aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/ProtoTypes.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-09-17 22:32:10 +0200
committerMartin Odersky <odersky@gmail.com>2016-09-17 22:33:14 +0200
commit528f6b0524c465a3e795aa5bb538c680956bf6d2 (patch)
tree2a0f48e7f1ea2c9a52c15d0c9038712173804d41 /src/dotty/tools/dotc/typer/ProtoTypes.scala
parentc420b4cc0573e88bf301d4e020e2ad91b26806d0 (diff)
downloaddotty-528f6b0524c465a3e795aa5bb538c680956bf6d2.tar.gz
dotty-528f6b0524c465a3e795aa5bb538c680956bf6d2.tar.bz2
dotty-528f6b0524c465a3e795aa5bb538c680956bf6d2.zip
Fix #1503 - be careful where to insert an apply.
`apply` nodes should not be inserted in the result parts of a block, if-then-else, match, or try. Instead they should be added to the surrounding statement.
Diffstat (limited to 'src/dotty/tools/dotc/typer/ProtoTypes.scala')
-rw-r--r--src/dotty/tools/dotc/typer/ProtoTypes.scala4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/typer/ProtoTypes.scala b/src/dotty/tools/dotc/typer/ProtoTypes.scala
index f209c99be..41628f0dc 100644
--- a/src/dotty/tools/dotc/typer/ProtoTypes.scala
+++ b/src/dotty/tools/dotc/typer/ProtoTypes.scala
@@ -182,6 +182,8 @@ object ProtoTypes {
if ((args eq this.args) && (resultType eq this.resultType) && (typer eq this.typer)) this
else new FunProto(args, resultType, typer)
+ override def notApplied = WildcardType
+
/** Forget the types of any arguments that have been typed producing a constraint in a
* typer state that is not yet committed into the one of the current context `ctx`.
* This is necessary to avoid "orphan" PolyParams that are referred to from
@@ -319,6 +321,8 @@ object ProtoTypes {
if ((targs eq this.targs) && (resType eq this.resType)) this
else PolyProto(targs, resType)
+ override def notApplied = WildcardType
+
def map(tm: TypeMap)(implicit ctx: Context): PolyProto =
derivedPolyProto(targs mapConserve tm, tm(resultType))