Skip to content

Imports from unstable prefixes should not be allowed #10295

Closed
@smarter

Description

@smarter

I don't think this is intentionally allowed, it only works when the def returns a singleton type:

scala> def get: 1 = { println("hi"); 1 }
def get: 1

scala> import get._

scala> toLong
hi
val res0: Long = 1

scala> toLong
hi
val res1: Long = 1

(if one really wants to pretend a prefix is stable, there's an @uncheckedStable annotation, though it's implemented by Scala 2 but not Dotty)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions