Skip to content

Regression in ichoran/kse3 for opaque types #21239

Closed
@WojciechMazur

Description

@WojciechMazur

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions