diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/core/SymbolLoaders.scala | 16 | ||||
-rw-r--r-- | src/dotty/tools/dotc/typer/Applications.scala | 10 |
2 files changed, 16 insertions, 10 deletions
diff --git a/src/dotty/tools/dotc/core/SymbolLoaders.scala b/src/dotty/tools/dotc/core/SymbolLoaders.scala index a02af441f..34376437b 100644 --- a/src/dotty/tools/dotc/core/SymbolLoaders.scala +++ b/src/dotty/tools/dotc/core/SymbolLoaders.scala @@ -90,7 +90,7 @@ class SymbolLoaders { */ def enterClassAndModule( owner: Symbol, name: PreName, completer: SymbolLoader, - flags: FlagSet = EmptyFlags, scope: Scope = EmptyScope)(implicit ctx: CondensedContext) { + flags: FlagSet = EmptyFlags, scope: Scope = EmptyScope)(implicit ctx: CondensedContext): Unit = { val clazz = enterClass(owner, name, completer, flags, scope) val module = enterModule( owner, name, completer, @@ -107,7 +107,7 @@ class SymbolLoaders { */ def enterToplevelsFromSource( owner: Symbol, name: PreName, src: AbstractFile, - scope: Scope = EmptyScope)(implicit ctx: CondensedContext) { + scope: Scope = EmptyScope)(implicit ctx: CondensedContext): Unit = { enterClassAndModule(owner, name, new SourcefileLoader(src)(ctx.condensed), scope = scope) } @@ -124,7 +124,7 @@ class SymbolLoaders { /** Initialize toplevel class and module symbols in `owner` from class path representation `classRep` */ - def initializeFromClassPath(owner: Symbol, classRep: ClassPath#ClassRep)(implicit ctx: CondensedContext) { + def initializeFromClassPath(owner: Symbol, classRep: ClassPath#ClassRep)(implicit ctx: CondensedContext): Unit = { ((classRep.binary, classRep.source): @unchecked) match { case (Some(bin), Some(src)) if needCompile(bin, src) && !binaryOnly(owner, classRep.name) => if (ctx.settings.verbose.value) ctx.inform("[symloader] picked up newer source file for " + src.path) @@ -148,7 +148,7 @@ class SymbolLoaders { private[core] val preDecls: MutableScope = newScope - def doComplete(root: SymDenotation) { + def doComplete(root: SymDenotation): Unit = { assert(root is PackageClass, root) def maybeModuleClass(classRep: ClassPath#ClassRep) = classRep.name.last == '$' val pre = root.owner.thisType @@ -173,7 +173,7 @@ class SymbolLoaders { } /** if there's a `package` member object in `pkgClass`, enter its members into it. */ - def openPackageModule(pkgClass: ClassSymbol)(implicit ctx: Context) { + def openPackageModule(pkgClass: ClassSymbol)(implicit ctx: Context): Unit = { val pkgModule = pkgClass.info.decl(nme.PACKAGEkw).symbol if ((pkgModule is Module) && (pkgModule.isCompleted || @@ -182,7 +182,7 @@ class SymbolLoaders { openPackageModule(pkgModule, pkgClass) } - def openPackageModule(container: Symbol, dest: ClassSymbol)(implicit ctx: Context) { + 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 for (member <- container.info.decls.iterator) { @@ -226,7 +226,7 @@ abstract class SymbolLoader extends LazyType { def description: String override def complete(root: SymDenotation): Unit = { - def signalError(ex: Exception) { + def signalError(ex: Exception): Unit = { if (cctx.debug) ex.printStackTrace() val msg = ex.getMessage() cctx.error( @@ -289,7 +289,7 @@ class ClassfileLoader(val classfile: AbstractFile)(implicit val cctx: CondensedC else (rootDenot, linkedDenot) } - def doComplete(root: SymDenotation) { + def doComplete(root: SymDenotation): Unit = { val (classRoot, moduleRoot) = rootDenots(root.asClass) new ClassfileParser(classfile, classRoot, moduleRoot)(cctx).run() } diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala index d70c19f96..9ed05ff97 100644 --- a/src/dotty/tools/dotc/typer/Applications.scala +++ b/src/dotty/tools/dotc/typer/Applications.scala @@ -763,10 +763,16 @@ trait Applications extends Compatibility { self: Typer => } }} + /** Drop any implicit parameter section */ + def stripImplicit(tp: Type) = tp match { + case mt: ImplicitMethodType if !mt.isDependent => mt.resultType // todo: make sure implicit method types are not dependent + case _ => tp + } + val owner1 = alt1.symbol.owner val owner2 = alt2.symbol.owner - val tp1 = alt1.widen - val tp2 = alt2.widen + val tp1 = stripImplicit(alt1.widen) + val tp2 = stripImplicit(alt2.widen) def winsOwner1 = isDerived(owner1, owner2) def winsType1 = isAsSpecific(alt1, tp1, alt2, tp2) |