aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-01-17 16:38:17 +0100
committerMartin Odersky <odersky@gmail.com>2014-01-17 16:38:17 +0100
commit422a33af1af13e3d389504e53a1be9a93b942be3 (patch)
tree377ea1a153776ade71cd1f9fdfd6eb49f4a1b116 /src/dotty/tools/dotc
parent2efd4f58a422ca7e308122e6fe9af0a530e10d67 (diff)
downloaddotty-422a33af1af13e3d389504e53a1be9a93b942be3.tar.gz
dotty-422a33af1af13e3d389504e53a1be9a93b942be3.tar.bz2
dotty-422a33af1af13e3d389504e53a1be9a93b942be3.zip
Make typedAhead adapt to prototype.
Not sure why it was different before. We need it at least to add implicit parameters in typedAheadExpr.
Diffstat (limited to 'src/dotty/tools/dotc')
-rw-r--r--src/dotty/tools/dotc/Main.scala1
-rw-r--r--src/dotty/tools/dotc/core/SymbolLoaders.scala1
-rw-r--r--src/dotty/tools/dotc/typer/Namer.scala4
3 files changed, 4 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/Main.scala b/src/dotty/tools/dotc/Main.scala
index 746a9cb13..f4da16a6a 100644
--- a/src/dotty/tools/dotc/Main.scala
+++ b/src/dotty/tools/dotc/Main.scala
@@ -15,6 +15,7 @@ import reporting.Reporter
* - have a second look at normalization (leave at method types if pt is method type?)
* - fix problem with duplicate companion objects for classes with default parameters in constructors
* - Check usages of isAliasType and replace where possible by looking at the info.
+ * - Don't open package objects from class files if they are present in source
*/
object Main extends Driver {
diff --git a/src/dotty/tools/dotc/core/SymbolLoaders.scala b/src/dotty/tools/dotc/core/SymbolLoaders.scala
index 34376437b..c66fcb656 100644
--- a/src/dotty/tools/dotc/core/SymbolLoaders.scala
+++ b/src/dotty/tools/dotc/core/SymbolLoaders.scala
@@ -182,6 +182,7 @@ class SymbolLoaders {
openPackageModule(pkgModule, pkgClass)
}
+ // todo: revise to really include the members?
def openPackageModule(container: Symbol, dest: ClassSymbol)(implicit ctx: Context): Unit = {
def isImportable(sym: Symbol) = !(sym is Private) && !sym.isConstructor
// unlink existing symbols in the package
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala
index 5db557a93..2433c49b5 100644
--- a/src/dotty/tools/dotc/typer/Namer.scala
+++ b/src/dotty/tools/dotc/typer/Namer.scala
@@ -407,7 +407,7 @@ class Namer { typer: Typer =>
/** Typecheck tree during completion, and remember result in typedtree map */
private def typedAheadImpl(tree: Tree, pt: Type)(implicit ctx: Context): tpd.Tree =
- typedTree.getOrElseUpdate(expanded(tree), typer.typedUnadapted(tree, pt))
+ typedTree.getOrElseUpdate(expanded(tree), typer.typed(tree, pt))
def typedAheadType(tree: Tree, pt: Type = WildcardType)(implicit ctx: Context): tpd.Tree =
typedAheadImpl(tree, pt)(ctx retractMode Mode.PatternOrType addMode Mode.Type)
@@ -517,7 +517,7 @@ class Namer { typer: Typer =>
// println(s"final inherited for $sym: ${inherited.toString}") !!!
// println(s"owner = ${sym.owner}, decls = ${sym.owner.info.decls.show}")
val rhsCtx = ctx.fresh addMode Mode.InferringReturnType
- def rhsType = adapt(typedAheadExpr(mdef.rhs, rhsProto)(rhsCtx), rhsProto).tpe.widen
+ def rhsType = typedAheadExpr(mdef.rhs, rhsProto)(rhsCtx).tpe.widen
def lhsType = fullyDefinedType(rhsType, "right-hand side", mdef.pos)
inherited orElse lhsType
}