Skip to content

Avoid the TypeVar.inst trap#20160

Merged
odersky merged 1 commit intoscala:mainfrom
dotty-staging:fix-20154
Apr 11, 2024
Merged

Avoid the TypeVar.inst trap#20160
odersky merged 1 commit intoscala:mainfrom
dotty-staging:fix-20154

Conversation

@odersky
Copy link
Copy Markdown
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
Copy Markdown
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
@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]
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.

Regression in getkyo/kyo for type comparer

3 participants