aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-03-08 22:23:24 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-03-20 13:02:40 +0100
commit3eab4101f516ececde15df74ca382a9fd7018fa8 (patch)
tree63798ba264407989f87e2043a248a8bfc48fbb47 /src/dotty/tools
parent4611bdf0972fc01dfdfa647a0e84e3bccf98ea05 (diff)
downloaddotty-3eab4101f516ececde15df74ca382a9fd7018fa8.tar.gz
dotty-3eab4101f516ececde15df74ca382a9fd7018fa8.tar.bz2
dotty-3eab4101f516ececde15df74ca382a9fd7018fa8.zip
Removed annotations forced by union types
Removed annotations from the dotty codebase that were necessary because the inferred union types caused inference errors later on.
Diffstat (limited to 'src/dotty/tools')
-rw-r--r--src/dotty/tools/dotc/ast/Desugar.scala5
-rw-r--r--src/dotty/tools/dotc/core/Definitions.scala5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/ast/Desugar.scala b/src/dotty/tools/dotc/ast/Desugar.scala
index 01aaf0b5f..0c741a652 100644
--- a/src/dotty/tools/dotc/ast/Desugar.scala
+++ b/src/dotty/tools/dotc/ast/Desugar.scala
@@ -180,8 +180,9 @@ object desugar {
constr1.mods, constr1.name, tparams, vparamss, constr1.tpt, constr1.rhs)
// a reference to the class type, with all parameters given.
- val classTypeRef: Tree = {
- // Dotty deviation: Without type annotation infers Ident | AppliedTypeTree, which
+ val classTypeRef/*: Tree*/ = {
+ // -language:keepUnions difference: classTypeRef needs type annotation, otherwise
+ // infers Ident | AppliedTypeTree, which
// renders the :\ in companions below untypable.
val tycon = Ident(cdef.name) withPos cdef.pos.startPos
val tparams = impl.constr.tparams
diff --git a/src/dotty/tools/dotc/core/Definitions.scala b/src/dotty/tools/dotc/core/Definitions.scala
index 22e308062..a58bfc058 100644
--- a/src/dotty/tools/dotc/core/Definitions.scala
+++ b/src/dotty/tools/dotc/core/Definitions.scala
@@ -286,8 +286,9 @@ class Definitions {
object FunctionType {
def apply(args: List[Type], resultType: Type) =
FunctionClass(args.length).typeRef.appliedTo(args ::: resultType :: Nil)
- 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.
+ def unapply(ft: Type)/*: Option[(List[Type], Type)]*/ = {
+ // -language:keepUnions difference: unapply needs result type because inferred type
+ // is Some[(List[Type], Type)] | None, which is not a legal unapply type.
val tsym = ft.typeSymbol
lazy val targs = ft.argInfos
if ((FunctionClasses contains tsym) &&