File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
src/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ object ExplicitOuter {
213
213
case id : Ident =>
214
214
id.tpe match {
215
215
case ref @ TermRef (NoPrefix , _) =>
216
- ref.symbol.is(Method ) && isOuter(id.symbol.owner.enclosingClass)
216
+ ref.symbol.is(Hoistable ) && isOuter(id.symbol.owner.enclosingClass)
217
217
// methods will be placed in enclosing class scope by LambdaLift, so they will get
218
218
// an outer path then.
219
219
case _ => false
@@ -225,6 +225,8 @@ object ExplicitOuter {
225
225
}
226
226
}
227
227
228
+ private final val Hoistable = Method | Lazy | Module
229
+
228
230
/** The outer prefix implied by type `tpe` */
229
231
private def outerPrefix (tpe : Type )(implicit ctx : Context ): Type = tpe match {
230
232
case tpe : TypeRef =>
Original file line number Diff line number Diff line change
1
+ class HelloWorld {
2
+ def main (args : Array [String ]): Unit = {
3
+ object TypeBool ;
4
+
5
+ class Fct {
6
+ def g (x : Int ) = TypeBool // breaks.
7
+ }
8
+ }
9
+ }
You can’t perform that action at this time.
0 commit comments