aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOndrej Lhotak <olhotak@uwaterloo.ca>2015-01-21 17:21:25 +0100
committerOndrej Lhotak <olhotak@uwaterloo.ca>2015-01-21 17:21:25 +0100
commit914b0ec0279069f901519b51f8c1e0fc31a29a0a (patch)
tree5f67dad07799cac52a1245aa4526c9d078304f66 /src
parentcce8cf1491f282368893b81348ec3171486b52e3 (diff)
downloaddotty-914b0ec0279069f901519b51f8c1e0fc31a29a0a.tar.gz
dotty-914b0ec0279069f901519b51f8c1e0fc31a29a0a.tar.bz2
dotty-914b0ec0279069f901519b51f8c1e0fc31a29a0a.zip
fix widenForMatchSelector to transparently handle annotated types
The commit fixing #182 uncovered test failures due to this missing case in widenForMatchSelector.
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/typer/Inferencing.scala1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/typer/Inferencing.scala b/src/dotty/tools/dotc/typer/Inferencing.scala
index 05be46f29..8f08c19f9 100644
--- a/src/dotty/tools/dotc/typer/Inferencing.scala
+++ b/src/dotty/tools/dotc/typer/Inferencing.scala
@@ -99,6 +99,7 @@ trait Inferencing { this: Checking =>
/** Recursively widen and also follow type declarations and type aliases. */
def widenForMatchSelector(tp: Type)(implicit ctx: Context): Type = tp.widen match {
case tp: TypeRef if !tp.symbol.isClass => widenForMatchSelector(tp.info.bounds.hi)
+ case tp: AnnotatedType => tp.derivedAnnotatedType(tp.annot, widenForMatchSelector(tp.tpe))
case tp => tp
}