typecast of a class type to a descendant class type leads to problems
Original Reporter info from Mantis: Pierre @PierreMuller
-
Reporter name: Pierre Muller
Original Reporter info from Mantis: Pierre @PierreMuller
- Reporter name: Pierre Muller
Description:
using tstringdef(tdef).var
where var is a regular field of the tstringdef should lead to a compile time error
because var is not a class variable.
This compile time error is correctly generated when using tstringdef.var
but the tstringdef(tdef).var assumes that the VMT address is a 'normal' class instance
and thus does not emit a compile time error.
Steps to reproduce:
test_class_var.pp
contains a working code when compiled without -dERRORX
adding -dERROR1, -dERROR2, -dERROR3 or -dERROR4
should always generate a compile time error,
but with the current trunk compiler, only -dERROR2
correctly generates a compile time error.
-dERROR1 generates wrong results because it gets the value of the stringtype field
at some offset in the VMT of tdef.
-dERROR3 and -dERROR4 show similar problem.
Mantis conversion info:
- Mantis ID: 38349
- Version: 3.2.1