Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Avoid the TypeVar.inst trap #20160

Merged
merged 1 commit into from
Apr 11, 2024
Merged

Avoid the TypeVar.inst trap #20160

merged 1 commit into from
Apr 11, 2024

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Apr 11, 2024

tvar.inst gives the permanent instance of a type variable tvar. Even if tvar.isInstantiated is true its inst can still be NoType. This is a trap that caused a regression in the code of glb. This commit fixes the regression and introduces different names that will hopefully avoid the trap in the future.

Fixes #20154

`tvar.inst` gives the _permanent_ instance of a type variable `tvar`. Even if `tvar.isInstantiated` is true
its `inst` can still be NoType. This is a trap that caused a regression in the code of glb. This commit fixes
the regression and introduces different names that will hopefully avoid the trap in the future.

Fixes scala#20154
Copy link
Member

@noti0na1 noti0na1 left a comment

Choose a reason for hiding this comment

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

The renamed names are more clear! LGTM

@odersky odersky merged commit 1fa158b into scala:main Apr 11, 2024
19 checks passed
@odersky odersky deleted the fix-20154 branch April 11, 2024 14:57
@Kordyjan Kordyjan added this to the 3.5.0 milestone May 10, 2024
WojciechMazur added a commit that referenced this pull request Jul 10, 2024
Backports #20160 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression in getkyo/kyo for type comparer
3 participants