diff options
author | Martin Odersky <odersky@gmail.com> | 2017-03-19 12:44:27 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-04-06 13:15:29 +0200 |
commit | 8d33ca7460493427055daaecca53c66127772831 (patch) | |
tree | 2c8f539d138a1374dde36c58ffb2f1d4c0841dfa /compiler/src/dotty/tools/dotc/typer/Typer.scala | |
parent | 15317555c94f613f266d7b0fb0a75b0b6ed2da6d (diff) | |
download | dotty-8d33ca7460493427055daaecca53c66127772831.tar.gz dotty-8d33ca7460493427055daaecca53c66127772831.tar.bz2 dotty-8d33ca7460493427055daaecca53c66127772831.zip |
Merge MethodType and PolyType functionality where possible
Two benefits: (1) less code. (2) finding subtle bugs about
parameter dependent method types. By merging with PolyTypes
we are forced to take parameter dependencies into account.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/typer/Typer.scala | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index 9a9e45941..723e7007f 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -748,7 +748,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit case _ => } val ofFun = - if (nme.syntheticParamNames(args.length + 1) contains param.name) + if (MethodType.syntheticParamNames(args.length + 1) contains param.name) i" of expanded function $tree" else "" @@ -1285,9 +1285,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit * @param psym Its type symbol * @param cinfo The info of its constructor */ - def maybeCall(ref: Tree, psym: Symbol, cinfo: Type): Tree = cinfo match { - case cinfo: PolyType => - maybeCall(ref, psym, cinfo.resultType) + def maybeCall(ref: Tree, psym: Symbol, cinfo: Type): Tree = cinfo.stripPoly match { case cinfo @ MethodType(Nil) if cinfo.resultType.isInstanceOf[ImplicitMethodType] => val icall = New(ref).select(nme.CONSTRUCTOR).appliedToNone typedExpr(untpd.TypedSplice(icall))(superCtx) |