From 8f18250f4fe494e0b6314fc2cb8e501753e79064 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 18 Sep 2014 17:38:43 +0200 Subject: Allow relaxed typing of applications Some transformations encounter applications where new arguments ahve to be supplied. The method type already accounts for these argument but the Application node passed into TreeTransform#transformApply is constructed with a cpy.Apply operation which does a type assignment. That type assignment fails with a parameter mismatch unless relaxedTyping is on. --- src/dotty/tools/dotc/core/Phases.scala | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/dotty/tools/dotc/core/Phases.scala') diff --git a/src/dotty/tools/dotc/core/Phases.scala b/src/dotty/tools/dotc/core/Phases.scala index 5eb8cd920..53c193994 100644 --- a/src/dotty/tools/dotc/core/Phases.scala +++ b/src/dotty/tools/dotc/core/Phases.scala @@ -200,6 +200,11 @@ object Phases { */ def checkPostCondition(tree: tpd.Tree)(implicit ctx: Context): Unit = () + /** If set, allow missing or superfluous arguments in applications + * and type applications. + */ + def relaxedTyping: Boolean = false + def exists: Boolean = true private var myPeriod: Period = Periods.InvalidPeriod -- cgit v1.2.3