aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Namer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-08-25 12:42:29 +0200
committerMartin Odersky <odersky@gmail.com>2013-08-25 12:42:29 +0200
commit22eb3ca60dcc124f331f5dad1e3b4c77bf72d427 (patch)
treeb8f43ebe04f35224b89a58c1d80fb0d5670f6758 /src/dotty/tools/dotc/typer/Namer.scala
parentd1e00f1a6a20d3649129793e6a108f10ed1db410 (diff)
downloaddotty-22eb3ca60dcc124f331f5dad1e3b4c77bf72d427.tar.gz
dotty-22eb3ca60dcc124f331f5dad1e3b4c77bf72d427.tar.bz2
dotty-22eb3ca60dcc124f331f5dad1e3b4c77bf72d427.zip
Inferred type of a valdef or defdef is always widened
Diffstat (limited to 'src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Namer.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala
index 5f6a6528f..6fe6182b4 100644
--- a/src/dotty/tools/dotc/typer/Namer.scala
+++ b/src/dotty/tools/dotc/typer/Namer.scala
@@ -283,7 +283,7 @@ class Namer { typer: Typer =>
/** The type signature of a ClassDef with given symbol */
def classDefSig(cdef: TypeDef, cls: ClassSymbol)(implicit ctx: Context): Type = {
-
+ //todo: normalize parents, so that all mixins extend superclass
def parentType(constr: untpd.Tree): Type = {
val Trees.Select(Trees.New(tpt), _) = methPart(constr)
val ptype = typedAheadType(tpt).tpe
@@ -366,7 +366,7 @@ class Namer { typer: Typer =>
tp & itpe
}
}
- inherited orElse typedAheadExpr(mdef.rhs).tpe
+ inherited orElse typedAheadExpr(mdef.rhs).tpe.widen
}
paramFn(typedAheadType(mdef.tpt, pt).tpe)
}