Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Regression in ichoran/kse3 for opaque types #21239

Closed
WojciechMazur opened this issue Jul 22, 2024 · 0 comments · Fixed by #21260
Closed

Regression in ichoran/kse3 for opaque types #21239

WojciechMazur opened this issue Jul 22, 2024 · 0 comments · Fixed by #21260
Assignees
Labels
area:opaque-types itype:bug regression This worked in a previous version but doesn't anymore

Comments

@WojciechMazur
Copy link
Contributor

Based on Open CB failure found in ichoran/kse3 - build logs

Compiler version

Last good release: 3.5.1-RC1-bin-20240611-e2dfea3-NIGHTLY
First bad release: 3.5.1-RC1-bin-20240612-5cfcfa8-NIGHTLY
Affects 3.5.1-RC1
Bisect points to 4443395

Minimized code

import java.util.concurrent.atomic.AtomicReference

opaque type Worm[V] = AtomicReference[AnyRef]
object Worm:
  extension [V](worm: Worm[V])
    def wormAsAtomic: AtomicReference[AnyRef] = worm
    def get: V = worm.wormAsAtomic.get().asInstanceOf[V]
    def get2: V = get

Output

[error] ./bisect/test.scala:10:19
[error] Found:    AnyRef
[error] Required: V
[error]     def get2: V = get
[error]                   ^^^

Expectation

Should compile, get result should be V instead of AnyRef

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:opaque-types itype:bug regression This worked in a previous version but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants