Skip to content

Commit d036800

Browse files
oderskymichelou
authored andcommitted
Even more regression tests
Closes scala#12448 Closes scala#12487 Closes scala#12160
1 parent 229982f commit d036800

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

tests/neg/i12448.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class A
2+
object Main {
3+
def mkArray[T <: A]: T#AType // error // error
4+
mkArray[Array]
5+
}

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)