Skip to content

Compiling from tasty omits enabling CC #24519

@hamzaremmal

Description

@hamzaremmal

Compiler version

d5fec8f

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 found

Expectation

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.

Metadata

Metadata

Assignees

Labels

itype:bugstat:needs triageEvery issue needs to have an "area" and "itype" label

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions