Skip to content

Commit 1e67d21

Browse files
committed
Add more tests for structural types
1 parent 350864f commit 1e67d21

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/neg/structural.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,10 @@ object Test3 {
1010

1111
type A = { def foo(x: Int): Unit; def foo(x: String): Unit } // error: overloaded definition // error: overloaded definition
1212
type B = { val foo: Int; def foo: Int } // error: duplicate foo
13+
14+
type C = { var foo: Int } // error: refinements cannot have vars
15+
16+
trait Entry { type Key; val key: Key }
17+
type D = { def foo(e: Entry, k: e.Key): Unit }
18+
def i(x: D) = x.foo(???) // error: foo has dependent params
1319
}

0 commit comments

Comments
 (0)