diff options
author | Martin Odersky <odersky@gmail.com> | 2013-11-06 18:39:00 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-11-06 18:39:00 +0100 |
commit | e401bac707d6d56d551db5556a7f58861ea3ae16 (patch) | |
tree | bdb6f5f25a9f339914858ff87143064a694eb9fc /src/dotty/tools/dotc/core/Definitions.scala | |
parent | c1abb572fa3adaeef3f66c79ac8946d15c7aeca7 (diff) | |
download | dotty-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.scala | 5 |
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() |