@arnedesmedt I had to change your PHP 7.4 implementation a bit, due to ReflectionType::__toString() being deprecated. See #6
I also added the exception back. Now it's thrown when the property has no type hint. However, we could also use the old logic (method return type) as a fallback in case no property type hint is given.
This would ease the migration path from 1.x to 2.x because you don't have to change all your ImmutableRecords at once. What do you think? Can you provide a PR for it and maybe also add some test cases?