diff options
author | odersky <odersky@gmail.com> | 2017-04-11 17:32:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-11 17:32:27 +0200 |
commit | f13e3a43d227933ce644f2503f658ea436ea11b4 (patch) | |
tree | cfbb32705c038aab021d5f95267135a8a031490f /tests | |
parent | 9917029becab32d56e786ac9309ee195737f6da0 (diff) | |
parent | 48c37927bd95f5e6bb9f71d02def7e2fef125202 (diff) | |
download | dotty-f13e3a43d227933ce644f2503f658ea436ea11b4.tar.gz dotty-f13e3a43d227933ce644f2503f658ea436ea11b4.tar.bz2 dotty-f13e3a43d227933ce644f2503f658ea436ea11b4.zip |
Merge pull request #2216 from dotty-staging/fix-2163
fix #2163: don't narrow liftedOwner if symbol is InSuperCall
Diffstat (limited to 'tests')
-rw-r--r-- | tests/run/i2163.scala | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/run/i2163.scala b/tests/run/i2163.scala new file mode 100644 index 000000000..952f651e3 --- /dev/null +++ b/tests/run/i2163.scala @@ -0,0 +1,21 @@ +class Base(f: Int => Int) { + def result = f(3) +} + +class Child(x: Int) extends Base(y => x + y) + +class Outer(z: Int) { + class Base(f: Int => Int) { + def result = f(3) + } + + class Child(x: Int) extends Base(y => x + y + z) +} + +object Test { + def main(args: Array[String]): Unit = { + assert(new Child(4).result == 7) + val o = new Outer(2) + assert(new o.Child(2).result == 7) + } +} |