aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-01-08 20:38:45 +0100
committerMartin Odersky <odersky@gmail.com>2014-01-08 20:38:53 +0100
commit8b9c14dcf8c74fbb9af2ecf842b8ba7776571f4c (patch)
tree5db677bcb8891f94cd859a0122bfb9d4d4bfa154 /src
parentaf9c414703db969d14ac66898fd2fe8d98bda3aa (diff)
downloaddotty-8b9c14dcf8c74fbb9af2ecf842b8ba7776571f4c.tar.gz
dotty-8b9c14dcf8c74fbb9af2ecf842b8ba7776571f4c.tar.bz2
dotty-8b9c14dcf8c74fbb9af2ecf842b8ba7776571f4c.zip
Mapping over a SelectionProto should give a SelectionProto, not a RefinedType.
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/core/Definitions.scala2
-rw-r--r--src/dotty/tools/dotc/typer/Inferencing.scala8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Definitions.scala b/src/dotty/tools/dotc/core/Definitions.scala
index 6f6442208..64441486d 100644
--- a/src/dotty/tools/dotc/core/Definitions.scala
+++ b/src/dotty/tools/dotc/core/Definitions.scala
@@ -284,7 +284,7 @@ class Definitions(implicit ctx: Context) {
lazy val targs = ft.typeArgs
if ((FunctionClasses contains tsym) &&
(targs.length - 1 <= MaxFunctionArity) &&
- (FunctionClass(targs.length - 1) == tsym)) Some(targs.init, targs.last)
+ (FunctionClass(targs.length - 1) == tsym)) Some((targs.init, targs.last)) // Dotty deviation: no auto-tupling
else None
}
}
diff --git a/src/dotty/tools/dotc/typer/Inferencing.scala b/src/dotty/tools/dotc/typer/Inferencing.scala
index fbc604db9..cbfe12abb 100644
--- a/src/dotty/tools/dotc/typer/Inferencing.scala
+++ b/src/dotty/tools/dotc/typer/Inferencing.scala
@@ -76,6 +76,14 @@ object Inferencing {
mbr.exists && mbr.hasAltWith(m => normalizedCompatible(m.info, proto))
}
override def toString = "Proto" + super.toString
+ override def derivedRefinedType(parent: Type, refinedName: Name, refinedInfo: Type)(implicit ctx: Context): RefinedType = {
+ val tp1 @ RefinedType(parent1, refinedName1) = super.derivedRefinedType(parent, refinedName, refinedInfo)
+ if (tp1 eq this) this
+ else {
+ assert(parent == WildcardType)
+ new SelectionProto(refinedName1, tp1.refinedInfo)
+ }
+ }
}
/** Create a selection proto-type, but only one level deep;