Closed
Description
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)