Closed metagn closed 4 days ago
Thanks for your hard work on this PR! The lines below are statistics of the Nim compiler built from a2031ec6cfe9475fb38ebc204ebcf8c2b6d02dce
Hint: mm: orc; opt: speed; options: -d:release 177825 lines; 8.643s; 653.555MiB peakmem
follows up #24425, fixes #18861, fixes #22445
Since #24425 generic object and distinct types now accurately link back to their generic instantiations. To work around this issue previously, type matching checked if generic objects/distinct types were structurally equal, which caused false positives with types that didn't use generic parameters in their structures. This structural check is now removed, in cases where generic objects/distinct types require a nontrivial equality check, the generic parameters of the
typeInst
fields are checked for equality instead.The check is copied from
tyGenericInst
, but the check intyGenericInst
is not always sufficient as this type can be skipped or unreachable in the case ofref object
s.