diff options
author | Martin Odersky <odersky@gmail.com> | 2013-10-15 14:55:00 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-10-15 14:55:09 +0200 |
commit | 4f05aa9bf0d3c29eae720115433ffe29b239d70f (patch) | |
tree | dbc9c8a430351c0a5b372adc9442c1b74ff92d54 /src/dotty/tools/dotc/typer/Namer.scala | |
parent | cdafc3058566d5eede8995f0812fe57a3a1ad6ee (diff) | |
download | dotty-4f05aa9bf0d3c29eae720115433ffe29b239d70f.tar.gz dotty-4f05aa9bf0d3c29eae720115433ffe29b239d70f.tar.bz2 dotty-4f05aa9bf0d3c29eae720115433ffe29b239d70f.zip |
Changes to adaptation and local type inference.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Namer.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala index 72ed20454..7582b0d0d 100644 --- a/src/dotty/tools/dotc/typer/Namer.scala +++ b/src/dotty/tools/dotc/typer/Namer.scala @@ -7,7 +7,7 @@ import ast._ import Trees._, Constants._, StdNames._, Scopes._, Denotations._ import Contexts._, Symbols._, Types._, SymDenotations._, Names._, NameOps._, Flags._, Decorators._ import ast.desugar, ast.desugar._ -import Inferencing.AnySelectionProto +import Inferencing.{fullyDefinedType, AnySelectionProto} import util.Positions._ import util.SourcePosition import collection.mutable @@ -385,7 +385,9 @@ class Namer { typer: Typer => tp & itpe } } - inherited orElse typedAheadExpr(mdef.rhs).tpe.widen + def rhsType = interpolateAndAdapt(typedAheadExpr(mdef.rhs), WildcardType).tpe.widen + def lhsType = fullyDefinedType(rhsType, "right-hand side", mdef.pos) + inherited orElse lhsType } paramFn(typedAheadType(mdef.tpt, pt).tpe) } |