diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2015-10-24 21:51:27 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-10-25 15:10:10 +0100 |
commit | ae0e1263c22e6b94b112a2b4b00a49853f0e3d58 (patch) | |
tree | 5048a614b5ca583e142236b3e3efe6d3eab49003 /src/dotty/tools/dotc/typer/Typer.scala | |
parent | ecf62cf18b43b5a39e973bdc8087675a24337ce0 (diff) | |
download | dotty-ae0e1263c22e6b94b112a2b4b00a49853f0e3d58.tar.gz dotty-ae0e1263c22e6b94b112a2b4b00a49853f0e3d58.tar.bz2 dotty-ae0e1263c22e6b94b112a2b4b00a49853f0e3d58.zip |
Less eager tvar interpolation: wait until method calls are fully applied
Fix #738
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 6510ba35b..47cd1cd18 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -563,7 +563,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit val pos = params indexWhere (_.name == param.name) if (pos < mtpe.paramTypes.length) { val ptype = mtpe.paramTypes(pos) - if (isFullyDefined(ptype, ForceDegree.none)) return ptype + if (isFullyDefined(ptype, ForceDegree.noBottom)) return ptype } case _ => } @@ -1265,7 +1265,16 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit def adapt(tree: Tree, pt: Type, original: untpd.Tree = untpd.EmptyTree)(implicit ctx: Context) = /*>|>*/ track("adapt") /*<|<*/ { /*>|>*/ ctx.traceIndented(i"adapting $tree of type ${tree.tpe} to $pt", typr, show = true) /*<|<*/ { - interpolateUndetVars(tree, if (tree.isDef) tree.symbol else NoSymbol) + val isMethodCall = + tree.tpe.widen match { + case (_: MethodType) | (_: PolyType) if !tree.isDef => + true + case _ => + false + } + if (!isMethodCall) // Delay tvar interpolation in method calls until they're fully applied + interpolateUndetVars(tree, if (tree.isDef) tree.symbol else NoSymbol) + tree.overwriteType(tree.tpe.simplified) adaptInterpolated(tree, pt, original) } |