aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Applications.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/typer/Applications.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Applications.scala8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala
index b506e7e33..0991bf4a8 100644
--- a/src/dotty/tools/dotc/typer/Applications.scala
+++ b/src/dotty/tools/dotc/typer/Applications.scala
@@ -433,8 +433,12 @@ trait Applications extends Compatibility { self: Typer =>
/** Subclass of Application for type checking an Apply node with typed arguments. */
class ApplyToTyped(app: untpd.Apply, fun: Tree, methRef: TermRef, args: List[Tree], resultType: Type)(implicit ctx: Context)
- extends TypedApply(app, fun, methRef, args, resultType) {
- def typedArg(arg: Tree, formal: Type): TypedArg = arg
+ extends TypedApply[Type](app, fun, methRef, args, resultType) {
+ // Dotty deviation: Dotc infers Untyped for the supercall. This seems to be according to the rules
+ // (of both Scala and Dotty). Untyped is legal, and a subtype of Typed, whereas TypeApply
+ // is invariant in the type parameter, so the minimal type should be inferred. But then typedArg does
+ // not match the abstract method in Application and an abstract class error results.
+ def typedArg(arg: tpd.Tree, formal: Type): TypedArg = arg
def treeToArg(arg: Tree): Tree = arg
}