aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/typer
diff options
context:
space:
mode:
authorodersky <odersky@gmail.com>2017-02-08 22:17:09 +1100
committerGitHub <noreply@github.com>2017-02-08 22:17:09 +1100
commit99679cffc0a5d20e7e7f3c090eb310a6134eeee7 (patch)
treea62c232c33a23e525687743f31a31a295014dd7d /compiler/src/dotty/tools/dotc/typer
parentde2c4477d2b9dfc0393b4acba5525fa9714835b9 (diff)
parentb0576e977c26a86a400755ab9810b90af73b3b8d (diff)
downloaddotty-99679cffc0a5d20e7e7f3c090eb310a6134eeee7.tar.gz
dotty-99679cffc0a5d20e7e7f3c090eb310a6134eeee7.tar.bz2
dotty-99679cffc0a5d20e7e7f3c090eb310a6134eeee7.zip
Merge pull request #1941 from dotty-staging/fix/infix-pos
Better positions for infix operations
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer')
-rw-r--r--compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/typer/Typer.scala4
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala b/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala
index c390ae808..e7e7ece78 100644
--- a/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala
+++ b/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala
@@ -144,7 +144,7 @@ object EtaExpansion {
ids = ids.init :+ repeated(ids.last)
var body: Tree = Apply(lifted, ids)
mt.resultType match {
- case rt: MethodType if !rt.isImplicit => body = PostfixOp(body, nme.WILDCARD)
+ case rt: MethodType if !rt.isImplicit => body = PostfixOp(body, Ident(nme.WILDCARD))
case _ =>
}
val fn = untpd.Function(params, body)
diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala
index 18ae790b7..652c89094 100644
--- a/compiler/src/dotty/tools/dotc/typer/Typer.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -1440,7 +1440,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
def typedAsFunction(tree: untpd.PostfixOp, pt: Type)(implicit ctx: Context): Tree = {
- val untpd.PostfixOp(qual, nme.WILDCARD) = tree
+ val untpd.PostfixOp(qual, Ident(nme.WILDCARD)) = tree
val pt1 = if (defn.isFunctionType(pt)) pt else AnyFunctionProto
var res = typed(qual, pt1)
if (pt1.eq(AnyFunctionProto) && !defn.isFunctionClass(res.tpe.classSymbol)) {
@@ -1541,7 +1541,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
case tree: untpd.Annotated => typedAnnotated(tree, pt)
case tree: untpd.TypedSplice => typedTypedSplice(tree)
case tree: untpd.UnApply => typedUnApply(tree, pt)
- case tree @ untpd.PostfixOp(qual, nme.WILDCARD) => typedAsFunction(tree, pt)
+ case tree @ untpd.PostfixOp(qual, Ident(nme.WILDCARD)) => typedAsFunction(tree, pt)
case untpd.EmptyTree => tpd.EmptyTree
case _ => typedUnadapted(desugar(tree), pt)
}