Incorrect compiler error "Incompatible types" when using Default on array of pointers and elements (in some cases)
Original Reporter info from Mantis: martijnn
-
Reporter name:
Original Reporter info from Mantis: martijnn
- Reporter name:
Description:
When compiling a pascal program involving an array of typed pointers initialized with Default() and subsequently a dynamically allocated element initialized with Default() too, fpc >= 3.2 returns a compiler error: "Incompatible types" mentioning the wrong type.
Strange enough this only happens when the method prototype the code is contained in hits vague limits, i.e. the class name, name or parameter list exceeds a certain length.
Encountered in:
- i386/win32 (3.2.0+3.2.2rc1)
- x86_64/win64 (3.2.0+3.2.2rc1)
- Darwin (3.2.0)
Steps to reproduce:
- Compile the attached program that produces the error
- Follow any of the resolutions in the code to resolve the error
Mantis conversion info:
- Mantis ID: 38828
- OS: win32/win64/darwin
- Platform: i386/x86_64
- Version: 3.2.0
- Monitored by: » martijnn (martijnn)