File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -346,6 +346,8 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
346346 if (prevInfo == null ) tp.refinedInfo else prevInfo & tp.refinedInfo)
347347 formals = formals.updated(name, tp1.typeParamNamed(name))
348348 normalizeToRef(tp1)
349+ case tp @ RefinedType (tp1, _ : TermName , _) =>
350+ normalizeToRef(tp1)
349351 case _ : ErrorType =>
350352 defn.AnyType
351353 case AnnotatedType (tpe, _) =>
Original file line number Diff line number Diff line change 1+ object Foo {
2+ val f : Function0 [Int ]{ def apply (): Int } = () => 42
3+ }
Original file line number Diff line number Diff line change 1+ class Base
2+
3+ object Test {
4+ // OK
5+ val widen = {
6+ class Inner extends Base
7+ val f : () => Inner = { () => new Inner }
8+ f()
9+ }
10+
11+ // Crash
12+ val leak = {
13+ class Inner extends Base
14+ val f : (() => Inner ){ def apply (): Inner } = { () => new Inner }
15+ f()
16+ }
17+
18+ }
You can’t perform that action at this time.
0 commit comments