Skip to content

Commit 220b753

Browse files
authored
Merge pull request #14889 from dotty-staging/more-regression-tests-2
Even more regression tests
2 parents ebe3d54 + ec658f2 commit 220b753

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

tests/neg/i12487.check

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- [E008] Not Found Error: tests/neg/i12487.scala:19:10 ----------------------------------------------------------------
2+
19 | example notCombine example // error
3+
| ^^^^^^^^^^^^^^^^^^
4+
| value notCombine is not a member of A

tests/neg/i12487.scala

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
trait A {
2+
def combine(another: A): A = ???
3+
}
4+
5+
trait Dsl {
6+
def example: A
7+
}
8+
9+
object Dsl {
10+
def execute(program: (dsl: Dsl) ?=> Int): String = ???
11+
}
12+
13+
def example(using a: Dsl): A = ???
14+
15+
import Dsl._
16+
17+
def demo = Dsl.execute {
18+
// change to `combine` and it compiles
19+
example notCombine example // error
20+
42
21+
}

tests/run/i12160.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package internal:
2+
object Foo:
3+
inline def foo: Unit = P.s
4+
5+
private object P { def s = "b" }
6+
end internal
7+
8+
@main def Test = internal.Foo.foo

0 commit comments

Comments
 (0)