diff options
author | Martin Odersky <odersky@gmail.com> | 2017-02-18 12:54:36 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-02-18 12:55:08 +0100 |
commit | e9fecd393a3c355a68207da4bb1fa9fcf47eafc9 (patch) | |
tree | 15d01361ddacc0cfafd05a7b780677c331c762c3 /tests | |
parent | 6df672c7e7be65d7be1cd6524c610aed4f35178c (diff) | |
download | dotty-e9fecd393a3c355a68207da4bb1fa9fcf47eafc9.tar.gz dotty-e9fecd393a3c355a68207da4bb1fa9fcf47eafc9.tar.bz2 dotty-e9fecd393a3c355a68207da4bb1fa9fcf47eafc9.zip |
Fix #1990: Handle case where inlining changes class of outer
The new situation in the test was that outer of the inlined method
was `A` but it's as seen from type is a subtype `B`.
We need two fixes:
- Ignore outerSelects in TreeChecker. These are treated as having fixed symbols.
- Adapt the outer-path logic to deal with code that's moved to another context.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pos/i1990.scala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/pos/i1990.scala b/tests/pos/i1990.scala new file mode 100644 index 000000000..77cea0af7 --- /dev/null +++ b/tests/pos/i1990.scala @@ -0,0 +1,12 @@ +class A { + class Foo { + inline def inlineMeth: Unit = { + new Bar + } + } + class Bar +} + +class B extends A { + (new Foo).inlineMeth +} |