aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Definitions.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-01-19 22:26:23 +0100
committerMartin Odersky <odersky@gmail.com>2014-01-19 22:26:23 +0100
commit38b36268d5d29d25cb430c1e275c06ebb1c8f7dd (patch)
tree166d8147aa0a82a698b72716904befc154459462 /src/dotty/tools/dotc/core/Definitions.scala
parent6eece756db81a62d6114ff8ce8674cc0c69febaa (diff)
downloaddotty-38b36268d5d29d25cb430c1e275c06ebb1c8f7dd.tar.gz
dotty-38b36268d5d29d25cb430c1e275c06ebb1c8f7dd.tar.bz2
dotty-38b36268d5d29d25cb430c1e275c06ebb1c8f7dd.zip
Normalize parent types so that first one always refers to a class, not a trait.
Also: forward type parameter references of newly added to class scope. This is necessary, or the pattern match in test.scala would fail. Need to find out why.
Diffstat (limited to 'src/dotty/tools/dotc/core/Definitions.scala')
-rw-r--r--src/dotty/tools/dotc/core/Definitions.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Definitions.scala b/src/dotty/tools/dotc/core/Definitions.scala
index 1cf875280..7f5145ba3 100644
--- a/src/dotty/tools/dotc/core/Definitions.scala
+++ b/src/dotty/tools/dotc/core/Definitions.scala
@@ -284,7 +284,8 @@ class Definitions(implicit ctx: Context) {
object FunctionType {
def apply(args: List[Type], resultType: Type) =
FunctionClass(args.length).typeRef.appliedTo(args :+ resultType)
- def unapply(ft: Type) = {
+ def unapply(ft: Type): Option[(List[Type], Type)] = { // Dotty deviation: Type annotation needed because inferred type
+ // is Some[(List[Type], Type)] | None, which is not a legal unapply type.
val tsym = ft.typeSymbol
lazy val targs = ft.typeArgs
if ((FunctionClasses contains tsym) &&