Skip to content

Over-eager Cyclic References when compiling Opaque Types #16642

Closed
@odersky

Description

@odersky

Compiler version

All 3.x versions

Minimized example

object Syms:
  import SymDs.*
  opaque type Symbol <: AnyRef  // compiles OK if <: AnyRef is missing
    = SymDenotation

object SymDs:
  import Syms.*
  class SymDenotation(sym: Symbol)

Output

3 |  opaque type Symbol <: AnyRef
  |              ^
  |              Cyclic reference involving type Symbol
  |
  | longer explanation available when compiling with `-explain`

Expectation

Should compile in the same way as when <: AnyRef is missing.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions