aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Namer.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Namer.scala19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala
index 8293b0239..947d46ee0 100644
--- a/src/dotty/tools/dotc/typer/Namer.scala
+++ b/src/dotty/tools/dotc/typer/Namer.scala
@@ -653,13 +653,20 @@ class Namer { typer: Typer =>
lhsType orElse WildcardType
}
}
-
- val pt = mdef.tpt match {
- case _: untpd.DerivedTypeTree => WildcardType
- case TypeTree(untpd.EmptyTree) => inferredType
- case _ => WildcardType
+
+ val tptProto = mdef.tpt match {
+ case _: untpd.DerivedTypeTree =>
+ WildcardType
+ case TypeTree(untpd.EmptyTree) =>
+ inferredType
+ case TypedSplice(tpt: TypeTree) if !isFullyDefined(tpt.tpe, ForceDegree.none) =>
+ typedAheadExpr(mdef.rhs, tpt.tpe)
+ typr.println(i"determine closure result type to be ${tpt.tpe}")
+ WildcardType
+ case _ =>
+ WildcardType
}
- paramFn(typedAheadType(mdef.tpt, pt).tpe)
+ paramFn(typedAheadType(mdef.tpt, tptProto).tpe)
}
/** The type signature of a DefDef with given symbol */