File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,8 @@ object Inliner {
120120
121121 // The types that are local to the inlined method, and that therefore have
122122 // to be abstracted out in the accessor, which is external to the inlined method
123- val localRefs = qualType.namedPartsWith(_.symbol.isContainedIn(inlineMethod)).toList
123+ val localRefs = qualType.namedPartsWith(ref =>
124+ ref.isType && ref.symbol.isContainedIn(inlineMethod)).toList
124125
125126 // Abstract accessed type over local refs
126127 def abstractQualType (mtpe : Type ): Type =
Original file line number Diff line number Diff line change 1+ object companions2 {
2+ inline def foo () = {
3+ class C {
4+ println(C .p)
5+ }
6+
7+ object C {
8+ private val p = 1
9+ }
10+ }
11+ }
12+
13+ class A {
14+ val b = new B
15+
16+ class B {
17+ private def getAncestor2 (p : A ): A = p
18+ private inline def getAncestor (p : A ): A = {
19+ p.b.getAncestor(p)
20+ }
21+ }
22+ }
You can’t perform that action at this time.
0 commit comments