diff options
author | odersky <odersky@gmail.com> | 2017-03-09 13:18:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-09 13:18:00 +0100 |
commit | 7f6e01d0019dd9bea5535ca17c6283e64e84fecb (patch) | |
tree | f05361ede8c31236da7640358b84c11d9060692f /tests/pos | |
parent | 8e5c9c4a1a4555883307b7e81fea064134f350f2 (diff) | |
parent | 57e449ed18bc4643871e5e84ddf2c9d334d12acb (diff) | |
download | dotty-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.scala | 15 |
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 +} + +} |