diff options
author | Martin Odersky <odersky@gmail.com> | 2015-09-18 17:37:56 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-09-18 17:37:56 +0200 |
commit | 493fbbdd6cd0ca7fecd7e34f963563fe58e1f877 (patch) | |
tree | 83c2e69cf63d3d08919862a2f608361259264444 /src/dotty/tools/dotc/typer/Typer.scala | |
parent | 7a97e86c71090600397fd9b14a5a4111c52d8498 (diff) | |
download | dotty-493fbbdd6cd0ca7fecd7e34f963563fe58e1f877.tar.gz dotty-493fbbdd6cd0ca7fecd7e34f963563fe58e1f877.tar.bz2 dotty-493fbbdd6cd0ca7fecd7e34f963563fe58e1f877.zip |
Fixes #739
by adding the following rule:
Before typing an implicit parameter list of a method m, instantiate all type parameters of m that occur in the type of some preceding value parameter of m.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index a2c49cdd9..4dfd69203 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -1312,6 +1312,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit case wtp: ExprType => adaptInterpolated(tree.withType(wtp.resultType), pt, original) case wtp: ImplicitMethodType if constrainResult(wtp, followAlias(pt)) => + val tvarsToInstantiate = tvarsInParams(tree) + wtp.paramTypes.foreach(instantiateSelected(_, tvarsToInstantiate)) val constr = ctx.typerState.constraint def addImplicitArgs = { def implicitArgError(msg: => String): Tree = { |