diff options
author | Martin Odersky <odersky@gmail.com> | 2014-08-12 16:48:29 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-08-12 16:48:29 +0200 |
commit | 81745e2779fe13076e73538e66e3352cb9cd9cf3 (patch) | |
tree | 8e69125f8b9b0a674638bbfea4085c7e121e7200 /src/dotty/tools/dotc/typer/Applications.scala | |
parent | a3cc9388dc6fcfe92c1a34b079131a26f55e8179 (diff) | |
download | dotty-81745e2779fe13076e73538e66e3352cb9cd9cf3.tar.gz dotty-81745e2779fe13076e73538e66e3352cb9cd9cf3.tar.bz2 dotty-81745e2779fe13076e73538e66e3352cb9cd9cf3.zip |
Fix a problem due to different type inference
Diffstat (limited to 'src/dotty/tools/dotc/typer/Applications.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Applications.scala | 8 |
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 } |