Skip to content

Given leaked in outer scope #20071

Closed
@nicolasstucki

Description

@nicolasstucki

Compiler version

3.5.0-RC1-bin-SNAPSHOT

Minimized code

trait Decoder
object Decoder:
  given foo: Int = ???

type DecoderToInt[Why] >: Int <: Int

def bar[T](using d: DecoderToInt[T]): Any = ???
def test: Unit = bar[Decoder]

Output

Compiles (but should not)

Expectation

Should not compile. foo should not be available in test witouth an import.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions