Skip to content

Commit 7151d0f

Browse files
committed
Adapt fun prototype when looking for second chance implicits (aka BigInt)
If we look for aprototype of the form select(name, FunProto(args, ...)) it's important that the result type of the FunProto type is a wildcard type, because implicit views are disabled for that match. --- this commit achieves the first bootstrap of dotty! ---
1 parent 4d3d2d3 commit 7151d0f

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,9 @@ trait Applications extends Compatibility { self: Typer =>
448448
// try with prototype `[].name(args)`, this might succeed by inserting an
449449
// implicit conversion around []. (an example is Int + BigInt).
450450
tryEither { implicit ctx =>
451-
val qual1 = adaptInterpolated(qual, new SelectionProto(name, proto, NoViewsAllowed))
451+
val simpleFunProto = new FunProto(tree.args, WildcardType, this) // drop result type, because views are disabled
452+
val selProto = new SelectionProto(name, simpleFunProto, NoViewsAllowed)
453+
val qual1 = adaptInterpolated(qual, selProto)
452454
if (qual eq qual1) ctx.error("no progress")
453455
if (ctx.reporter.hasErrors) qual1
454456
else

src/dotty/tools/io/ClassPath.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ extends ClassPath {
389389
}
390390
new MergedClassPath(newEntries, context)
391391
}
392-
def show() {
392+
def show(): Unit = {
393393
println("ClassPath %s has %d entries and results in:\n".format(name, entries.size))
394394
asClasspathString split ':' foreach (x => println(" " + x))
395395
}

test/dotc/tests.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ class tests extends CompilerTest {
5454
@Test def dotc_reporting = compileDir(dotcDir + "tools/dotc/reporting")
5555
@Test def dotc_typer = compileDir(dotcDir + "tools/dotc/typer")
5656
@Test def dotc_util = compileDir(dotcDir + "tools/dotc/util")
57+
@Test def tools_io = compileDir(dotcDir + "tools/io")
58+
@Test def tools = compileDir(dotcDir + "tools")
5759

58-
// @Test def dotc_compilercommand = compileFile(dotcDir + "tools/dotc/config/", "CompilerCommand")
60+
@Test def dotc_compilercommand = compileFile(dotcDir + "tools/dotc/config/", "CompilerCommand")
5961

6062
}

0 commit comments

Comments
 (0)