diff options
author | Martin Odersky <odersky@gmail.com> | 2017-03-10 19:38:39 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-03-14 12:05:29 +0100 |
commit | 9d0aa36c879f4bde68e01e0ba9decab21d8fce49 (patch) | |
tree | b8f4e99a9d32f3ba657c9e707d45b91923fdeed9 /compiler/src/dotty/tools/dotc/typer/Typer.scala | |
parent | 3a93b3ee128bae804044b25aa7354ce32e074678 (diff) | |
download | dotty-9d0aa36c879f4bde68e01e0ba9decab21d8fce49.tar.gz dotty-9d0aa36c879f4bde68e01e0ba9decab21d8fce49.tar.bz2 dotty-9d0aa36c879f4bde68e01e0ba9decab21d8fce49.zip |
Construct MethodTypes from parameter closure
To allow for dependencies between method type parameters, construct MethodTypes
from a closure that maps the currently constructed MethodType to its parameter types.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/typer/Typer.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index fd0c7c73d..4bf87dd81 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -672,8 +672,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit // this can type the greatest set of admissible closures. (pt.dealias.argTypesLo.init, pt.dealias.argTypesHi.last) case SAMType(meth) => - val mt @ MethodType(_, paramTypes) = meth.info - (paramTypes, mt.resultType) + val MethodTpe(_, formals, restpe) = meth.info + (formals, restpe) case _ => (List.range(0, defaultArity) map alwaysWildcardType, WildcardType) } @@ -1287,10 +1287,10 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit def maybeCall(ref: Tree, psym: Symbol, cinfo: Type): Tree = cinfo match { case cinfo: PolyType => maybeCall(ref, psym, cinfo.resultType) - case cinfo @ MethodType(Nil, _) if cinfo.resultType.isInstanceOf[ImplicitMethodType] => + case cinfo @ MethodType(Nil) if cinfo.resultType.isInstanceOf[ImplicitMethodType] => val icall = New(ref).select(nme.CONSTRUCTOR).appliedToNone typedExpr(untpd.TypedSplice(icall))(superCtx) - case cinfo @ MethodType(Nil, _) if !cinfo.resultType.isInstanceOf[MethodType] => + case cinfo @ MethodType(Nil) if !cinfo.resultType.isInstanceOf[MethodType] => ref case cinfo: MethodType => if (!ctx.erasedTypes) { // after constructors arguments are passed in super call. |