Fix inherited type member refinement subtype checks - #596
Conversation
|
Note: I saw #579 also addresses #481 with a similar synthetic refined-parent approach. This PR adds coverage for bounded inherited type-member refinements as well, specifically:
It also narrows the synthesized refinement generation to abstract/deferred type members declared by base types to avoid broad tag-size growth. |
|
CLA is now signed. I also checked the failed build jobs. They appear to fail before running the Scala build because GitHub blocks
I attempted to rerun failed jobs after the CLA passed, but GitHub reports the workflow cannot be rerun, likely because of that workflow/action policy issue. Local validation passed for:
|
Fixes #481.
This updates full inheritance DB generation so concrete subclasses that resolve inherited abstract type members are also represented as children of the corresponding refined parent type.
For example:
Issue481AInt <: Issue481A { type T = Int }Issue481AString <: Issue481A { type T = String }Issue481AInt <: Issue481A { type T <: AnyVal }Issue481AString !<:< Issue481A { type T <: AnyVal }The implementation covers both Scala 2 and Scala 3 tag generation. It only synthesizes refined parent edges for abstract/deferred type members declared by base types, keeping the added inheritance DB entries scoped to the relevant case.
Tested:
izumi-reflectJVM / Test / testOnly izumi.reflect.test.LightTypeTagTest++2.13.14; izumi-reflectJVM / Test / testOnly izumi.reflect.test.LightTypeTagTest++2.12.20; izumi-reflectJVM / Test / testOnly izumi.reflect.test.LightTypeTagTest++2.11.12; izumi-reflectJVM / Test / testOnly izumi.reflect.test.LightTypeTagTestAlso verified with
git diff --check.