aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorodersky <odersky@gmail.com>2014-03-14 10:36:09 +0100
committerodersky <odersky@gmail.com>2014-03-14 10:36:09 +0100
commit8be53e728408f6d546a7fe990af9cd5e99db6250 (patch)
treec4f697db440f432a062c743e7b6848c48fa439d8 /src
parentf28d7a9423948626f6314b8c6d928b3048433efd (diff)
parent722661c0bada3a8e64512bda2ac7501b1c02ec10 (diff)
downloaddotty-8be53e728408f6d546a7fe990af9cd5e99db6250.tar.gz
dotty-8be53e728408f6d546a7fe990af9cd5e99db6250.tar.bz2
dotty-8be53e728408f6d546a7fe990af9cd5e99db6250.zip
Merge pull request #70 from odersky/fix/annotations-in-patterns
Fixed two problems with annotated types in patterns
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/parsing/Parsers.scala2
-rw-r--r--src/dotty/tools/dotc/printing/PlainPrinter.scala3
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala2
3 files changed, 3 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/parsing/Parsers.scala b/src/dotty/tools/dotc/parsing/Parsers.scala
index 37a0a3ce1..7e0910e1b 100644
--- a/src/dotty/tools/dotc/parsing/Parsers.scala
+++ b/src/dotty/tools/dotc/parsing/Parsers.scala
@@ -810,7 +810,7 @@ object Parsers {
def typeDependingOn(location: Location.Value): Tree =
if (location == Location.InParens) typ()
- else if (location == Location.InPattern) withType()
+ else if (location == Location.InPattern) refinedType()
else infixType()
/* ----------- EXPRESSIONS ------------------------------------------------ */
diff --git a/src/dotty/tools/dotc/printing/PlainPrinter.scala b/src/dotty/tools/dotc/printing/PlainPrinter.scala
index e5f85d11b..332b7bd21 100644
--- a/src/dotty/tools/dotc/printing/PlainPrinter.scala
+++ b/src/dotty/tools/dotc/printing/PlainPrinter.scala
@@ -103,8 +103,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
case tp: TypeRef =>
toTextPrefix(tp.prefix) ~ selectionString(tp)
case tp: RefinedType =>
- // return tp.toString // !!! DEBUG
- val parent :: (refined: List[RefinedType]) =
+ val parent :: (refined: List[RefinedType @unchecked]) =
refinementChain(tp).reverse
toTextLocal(parent) ~ "{" ~ Text(refined map toTextRefinement, "; ").close ~ "}"
case AndType(tp1, tp2) =>
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index c17c9d6d7..17c77be89 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -826,7 +826,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
}
def typedAnnotated(tree: untpd.Annotated, pt: Type)(implicit ctx: Context): Tree = track("typedAnnotated") {
- val annot1 = typed(tree.annot, defn.AnnotationClass.typeRef)
+ val annot1 = typedExpr(tree.annot, defn.AnnotationClass.typeRef)
val arg1 = typed(tree.arg, pt)
if (ctx.mode is Mode.Type)
assignType(cpy.Annotated(tree, annot1, arg1), annot1, arg1)