diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2017-03-12 17:29:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-12 17:29:50 +0100 |
commit | 4f15021847313c6d264e1bfad404f86f67912870 (patch) | |
tree | b78a38781eb8ab6b35466fb80cf19904beb62fea /tests | |
parent | a886727f0fc4dae7f7db67ae7577d85cca567ba9 (diff) | |
parent | e8c27da5855f59574ba00cb1a95be8fb36b1fb48 (diff) | |
download | dotty-4f15021847313c6d264e1bfad404f86f67912870.tar.gz dotty-4f15021847313c6d264e1bfad404f86f67912870.tar.bz2 dotty-4f15021847313c6d264e1bfad404f86f67912870.zip |
Merge pull request #2078 from dotty-staging/fix-#1569-v2
Fix #360: Improve avoidance algorithm
Diffstat (limited to 'tests')
-rw-r--r-- | tests/neg/t1569-failedAvoid.scala | 9 | ||||
-rw-r--r-- | tests/pos/t1569.scala | 12 |
2 files changed, 12 insertions, 9 deletions
diff --git a/tests/neg/t1569-failedAvoid.scala b/tests/neg/t1569-failedAvoid.scala deleted file mode 100644 index 45bb96f36..000000000 --- a/tests/neg/t1569-failedAvoid.scala +++ /dev/null @@ -1,9 +0,0 @@ -// This was t1569.scala. -// It fails in dotty because the expected type of the anonymous function in the last line -// is fully determined (C). So that type is taken as the type of the anonymous function. -// See pos/t1569a.scala for related examples that work. -object Bug { - class C { type T } - def foo(x: Int)(y: C)(z: y.T): Unit = {} - foo(3)(new C { type T = String })("hello") // error -} diff --git a/tests/pos/t1569.scala b/tests/pos/t1569.scala new file mode 100644 index 000000000..a2fbcf11f --- /dev/null +++ b/tests/pos/t1569.scala @@ -0,0 +1,12 @@ +// See pos/t1569a.scala for related examples that work. +object Bug { + class C { type T } + def foo(x: Int)(y: C)(z: y.T): Unit = {} + foo(3)(new C { type T = String })("hello") +} +object Bug2 { + class C { type T } + class D extends C { type T = String } + def foo(x: Int)(y: C)(z: y.T): Unit = {} + foo(3)(new D {})("hello") +} |