diff options
Diffstat (limited to 'src/dotty/tools/dotc/typer')
-rw-r--r-- | src/dotty/tools/dotc/typer/Applications.scala | 13 | ||||
-rw-r--r-- | src/dotty/tools/dotc/typer/ImportInfo.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/typer/Namer.scala | 5 |
3 files changed, 13 insertions, 7 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala index 64f44ee5e..dba95c689 100644 --- a/src/dotty/tools/dotc/typer/Applications.scala +++ b/src/dotty/tools/dotc/typer/Applications.scala @@ -621,10 +621,13 @@ trait Applications extends Compatibility { self: Typer => } println(i"case 2 $unapplyArgType ${ctx.typerState.constraint}") unapplyArgType - } else errorType( - i"Pattern type $unapplyArgType is neither a subtype nor a supertype of selector type $wpt", - tree.pos) - + } else { + // println("Neither sub nor super") + // println(TypeComparer.explained(implicit ctx => unapplyArgType <:< wpt)) + errorType( + i"Pattern type $unapplyArgType is neither a subtype nor a supertype of selector type $wpt", + tree.pos) + } var argTypes = unapplyArgs(mt.resultType) val bunchedArgs = argTypes match { case argType :: Nil if argType.isRepeatedParam => untpd.SeqLiteral(args) :: Nil @@ -666,7 +669,7 @@ trait Applications extends Compatibility { self: Typer => isApplicable(methRef, args, resultType) case _ => val app = tp.member(nme.apply) - app.exists && app.hasAltWith(d => isApplicable(TermRef(tp, nme.apply).withDenot(d), args, resultType)) + app.exists && app.hasAltWith(d => isApplicable(TermRef(tp, nme.apply, d), args, resultType)) } /** In a set of overloaded applicable alternatives, is `alt1` at least as good as diff --git a/src/dotty/tools/dotc/typer/ImportInfo.scala b/src/dotty/tools/dotc/typer/ImportInfo.scala index 9942e1915..d72e12baa 100644 --- a/src/dotty/tools/dotc/typer/ImportInfo.scala +++ b/src/dotty/tools/dotc/typer/ImportInfo.scala @@ -86,7 +86,7 @@ class ImportInfo(val sym: Symbol, val selectors: List[untpd.Tree], val isRootImp for { renamed <- reverseMapping.keys denot <- pre.member(reverseMapping(renamed)).altsWith(_ is Implicit) - } yield TermRef.withSig(pre, renamed, denot.signature).withDenot(denot) + } yield TermRef.withSig(pre, renamed, denot.signature, denot) } override def toString = { 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 |