aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Definitions.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-11-06 18:39:00 +0100
committerMartin Odersky <odersky@gmail.com>2013-11-06 18:39:00 +0100
commite401bac707d6d56d551db5556a7f58861ea3ae16 (patch)
treebdb6f5f25a9f339914858ff87143064a694eb9fc /src/dotty/tools/dotc/core/Definitions.scala
parentc1abb572fa3adaeef3f66c79ac8946d15c7aeca7 (diff)
downloaddotty-e401bac707d6d56d551db5556a7f58861ea3ae16.tar.gz
dotty-e401bac707d6d56d551db5556a7f58861ea3ae16.tar.bz2
dotty-e401bac707d6d56d551db5556a7f58861ea3ae16.zip
Fixing several type checking problems.
1. Being more precise what gets forced when. 2. stopping repeated evaluation when inserting an implicit methods to make arguments match. Previously the argument got re-evaluated which could lead to misleading errors (e..g missing parameter type if argument was a closure), and could also lead to exponential checking blowup. We now re-use the old argument but in its unadapted form. We do this with a tight coupling between an Application node and a FunProto node - typedArg in the application node forwards to new caching functionality in the FunProto node. It would probably be better overall to merge the two abstractions. FunProto = Application? 3. Various fixes to pattern matching.
Diffstat (limited to 'src/dotty/tools/dotc/core/Definitions.scala')
-rw-r--r--src/dotty/tools/dotc/core/Definitions.scala5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Definitions.scala b/src/dotty/tools/dotc/core/Definitions.scala
index 96fe172b3..9d03d001f 100644
--- a/src/dotty/tools/dotc/core/Definitions.scala
+++ b/src/dotty/tools/dotc/core/Definitions.scala
@@ -315,6 +315,11 @@ class Definitions(implicit ctx: Context) {
lazy val RootImports = Set[Symbol](PredefModule, ScalaPackageVal, JavaLangPackageVal)
+ def isTupleType(tp: Type) = {
+ val arity = tp.typeArgs.length
+ arity <= MaxTupleArity && (tp isRef TupleClass(arity))
+ }
+
// ----- Higher kinds machinery ------------------------------------------
private var _hkTraits: Set[Symbol] = Set()