Skip to content

Commit 6982c67

Browse files
committed
Force expected result type of default getters.
We should find out why the type is expected in the first place.
1 parent 00638e9 commit 6982c67

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/dotty/tools/dotc/Driver.scala

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,15 @@ abstract class Driver extends DotClass {
5555
* @return The `Reporter` used. Use `Reporter#hasErrors` to check
5656
* if compilation succeeded.
5757
*/
58-
final def process(args: Array[String], reporter: Reporter = null,
59-
callback: CompilerCallback = null): Reporter = {
58+
final def process(
59+
args: Array[String],
60+
reporter: Reporter = null: Reporter,
61+
// Dotty deviation: without the final `: Reporter`, Dotty generates a
62+
// default getter of type `Null`, but scalac somehow expects to
63+
// see a default getter of type `Reporter` when compiling partest.
64+
// I don't know why partest expects to see this type, but
65+
// to make the build bootstrap, we force it by adding the type.
66+
callback: CompilerCallback = null: CompilerCallback): Reporter = {
6067
val ctx = initCtx.fresh
6168
if (reporter != null)
6269
ctx.setReporter(reporter)

0 commit comments

Comments
 (0)