Skip to content

Conversation

@yglukhov
Copy link
Member

@yglukhov yglukhov commented Dec 25, 2025

The fix is mostly AI generated (sans tests), please review carefully.

@yglukhov yglukhov force-pushed the fix-25340 branch 4 times, most recently from ac20804 to eece156 Compare December 29, 2025 22:13
@yglukhov yglukhov marked this pull request as ready for review December 29, 2025 23:57
# Check if the aliased types (last elements) have inheritance relationship
let aLast = roota.last
let fLast = rootf.last
if aLast.kind == tyObject and fLast.kind == tyObject and trIsOutParam notin flags:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no subtype relation between G[T] and G[S] just because there is one between T and S. This is not sound!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand it aLast and fLast are not T and S, but the implementations of G[T] and G[S], so the behavior seems to be correct? Also I tried to come up with an example that demonstrates the unsound behavior, but could not. Again, I'm not 100% sure, but I don't see the problem here.

@yglukhov
Copy link
Member Author

yglukhov commented Jan 5, 2026

Fixed isa relation for refs and ptrs too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants