Community
Participate
Working Groups
Hi, I found this strange bug. The following generates correct code: @Data class A { val double a } @Data class B extends A { val double b } The following generates code with error (a is not considered in B): @Data class B extends A { val double b } @Data class A { val double a }
The technical reason is that model inference is done at once per file from top to bottom. So at the point where for the first class the super type is asked for all members the members haven't been created. We could specially hadle this case in @Data, i.e. check whereher the super type is in the current class and process it first. Or we could think about a more holistic improvement in which we do the inference on a per type basis and will lazily trigger inference when a type is referenced from somewhere. This is the way it already works cross file but not with multiple types in the same resource.