-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
Compiler version
Minimized code
Compile this file normally, it will succeed.
import scala.language.experimental.captureChecking
trait File extends caps.SharedCapability
class Foo:
def f(file: File^): Iterator[File]^{file} =
Iterator.from(List(file))Then compile it with -from-tastyand it will fail.
Output
-- Error: test.scala:5:29 ------------------------------------------------------
class retainsCap is marked @experimental
Experimental definition may only be used under experimental mode:
1. in a definition marked as @experimental, or
2. an experimental feature is imported at the package level, or
3. compiling with the -experimental compiler flag.
-- Error: test.scala:6:4 -------------------------------------------------------
class retains is marked @experimental
Experimental definition may only be used under experimental mode:
1. in a definition marked as @experimental, or
2. an experimental feature is imported at the package level, or
3. compiling with the -experimental compiler flag.
2 errors foundExpectation
It should not fail the ref check and ask to be in an experimental mode. We already have the scala.language.experimental.captureChecking in scope.