aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
diff options
context:
space:
mode:
authorodersky <odersky@gmail.com>2017-03-09 13:18:00 +0100
committerGitHub <noreply@github.com>2017-03-09 13:18:00 +0100
commit7f6e01d0019dd9bea5535ca17c6283e64e84fecb (patch)
treef05361ede8c31236da7640358b84c11d9060692f /tests/pos
parent8e5c9c4a1a4555883307b7e81fea064134f350f2 (diff)
parent57e449ed18bc4643871e5e84ddf2c9d334d12acb (diff)
downloaddotty-7f6e01d0019dd9bea5535ca17c6283e64e84fecb.tar.gz
dotty-7f6e01d0019dd9bea5535ca17c6283e64e84fecb.tar.bz2
dotty-7f6e01d0019dd9bea5535ca17c6283e64e84fecb.zip
Merge pull request #2068 from dotty-staging/fix-#2064
Fix #2064: Avoid illegal types in OrDominator
Diffstat (limited to 'tests/pos')
-rw-r--r--tests/pos/i2064.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/pos/i2064.scala b/tests/pos/i2064.scala
new file mode 100644
index 000000000..909923372
--- /dev/null
+++ b/tests/pos/i2064.scala
@@ -0,0 +1,15 @@
+object p {
+
+class Foo[T] {
+ // Crashes:
+ def f(): Foo[T] = (if (true) this else this).bar
+
+ // Works:
+ // def f(): Foo[T] = new Bar(if (true) this else this).bar
+}
+
+implicit class Bar[A](val self: A) {
+ def bar(): A = self
+}
+
+}