diff options
author | Martin Odersky <odersky@gmail.com> | 2013-12-14 17:32:16 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-12-14 17:32:16 +0100 |
commit | 01db9a68e5e68f08c8236c23c905009789d51587 (patch) | |
tree | 3e45103b0d36505d6f86f3024e56780e840c156b /src/dotty/tools/dotc/typer/Namer.scala | |
parent | d65587ae74cfe2dc7601f57e163b7e22bf89582a (diff) | |
download | dotty-01db9a68e5e68f08c8236c23c905009789d51587.tar.gz dotty-01db9a68e5e68f08c8236c23c905009789d51587.tar.bz2 dotty-01db9a68e5e68f08c8236c23c905009789d51587.zip |
Fixed several deep problems in handling of types and symbols.
1. We forgot to mark declaration symbols Deferred.
2. Types with NoPrefix and the same name got identified. Fixed by adding a new category WithNoPrefix to named types, and changing the way named types get generated.
3. Self types lacked parameters. (Question: Do we need to also track type members?)
4. Printers caused cyclic reference errors. Now some print operations are more careful with forcing.
5. Namedparts accumulator has to be more careful with ThisTypes. Because self types now contain parameters, which might lead back to this, we only add the class name (or the source module, if it's a module class).
6. toBounds in TypeApplications needs to use Co/Contra aliases for expanded name parameters, not just local ones.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Namer.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala index 99c036fe8..3ddd3980b 100644 --- a/src/dotty/tools/dotc/typer/Namer.scala +++ b/src/dotty/tools/dotc/typer/Namer.scala @@ -166,8 +166,9 @@ class Namer { typer: Typer => adjustIfModule(new Completer(tree) withDecls newScope, tree), privateWithinClass(tree.mods), tree.pos, ctx.source.file)) case tree: MemberDef => + val deferred = if (lacksDefinition(tree)) Deferred else EmptyFlags record(ctx.newSymbol( - ctx.owner, tree.name.encode, tree.mods.flags, + ctx.owner, tree.name.encode, tree.mods.flags | deferred, adjustIfModule(new Completer(tree), tree), privateWithinClass(tree.mods), tree.pos)) case tree: Import => @@ -408,6 +409,8 @@ class Namer { typer: Typer => tp & itpe } } + // println(s"final inherited for $sym: ${inherited.toString}") !!! + // println(s"owner = ${sym.owner}, decls = ${sym.owner.info.decls.show}") def rhsType = adapt(typedAheadExpr(mdef.rhs), WildcardType).tpe.widen def lhsType = fullyDefinedType(rhsType, "right-hand side", mdef.pos) inherited orElse lhsType |