diff --git a/tests/neg/i12487.check b/tests/neg/i12487.check new file mode 100644 index 000000000000..3985d9d468f6 --- /dev/null +++ b/tests/neg/i12487.check @@ -0,0 +1,4 @@ +-- [E008] Not Found Error: tests/neg/i12487.scala:19:10 ---------------------------------------------------------------- +19 | example notCombine example // error + | ^^^^^^^^^^^^^^^^^^ + | value notCombine is not a member of A diff --git a/tests/neg/i12487.scala b/tests/neg/i12487.scala new file mode 100644 index 000000000000..a2e35e76acdd --- /dev/null +++ b/tests/neg/i12487.scala @@ -0,0 +1,21 @@ +trait A { + def combine(another: A): A = ??? +} + +trait Dsl { + def example: A +} + +object Dsl { + def execute(program: (dsl: Dsl) ?=> Int): String = ??? +} + +def example(using a: Dsl): A = ??? + +import Dsl._ + +def demo = Dsl.execute { + // change to `combine` and it compiles + example notCombine example // error + 42 +} \ No newline at end of file diff --git a/tests/run/i12160.scala b/tests/run/i12160.scala new file mode 100644 index 000000000000..b15dd51413e0 --- /dev/null +++ b/tests/run/i12160.scala @@ -0,0 +1,8 @@ +package internal: + object Foo: + inline def foo: Unit = P.s + + private object P { def s = "b" } +end internal + +@main def Test = internal.Foo.foo \ No newline at end of file