public function fromProperty(string $propertyName)
    {
        $classType = $this->classType;
        /** @var FinalizedClassDefinition $definition */
        $definition = $classType::definition();
        if (!$definition->hasProperty($propertyName)) {
            throw InvalidArgumentException::format(
                    'Invalid call to %s: property %s::$%s does not exist',
                    __METHOD__, $this->classType, $propertyName
            );
        }

        $this->fromCallback(function (ITypedObject $object) use ($propertyName) {
            return $object->toArray()[$propertyName];
        });
    }