From 96b0eff51e18a1abd9761451e08e63c9a3eb9ea6 Mon Sep 17 00:00:00 2001 From: Evgeny Kotelnikov Date: Sat, 19 Jan 2013 17:42:12 +0400 Subject: SI-5824 Fix crashes in reify with _* Reification crashes if "foo: _*" construct is used. This happens besause type tree is represented either with TypeTree, or with Ident (present case), and `toPreTyperTypedOrAnnotated' only matches of the former. The fix is to cover the latter too. A test is included. --- src/reflect/scala/reflect/internal/TreeInfo.scala | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/reflect') diff --git a/src/reflect/scala/reflect/internal/TreeInfo.scala b/src/reflect/scala/reflect/internal/TreeInfo.scala index 98c1afb323..44dd92e62b 100644 --- a/src/reflect/scala/reflect/internal/TreeInfo.scala +++ b/src/reflect/scala/reflect/internal/TreeInfo.scala @@ -431,6 +431,13 @@ abstract class TreeInfo { case _ => false } + /** Is the argument a wildcard star type of the form `_*`? + */ + def isWildcardStarType(tree: Tree): Boolean = tree match { + case Ident(tpnme.WILDCARD_STAR) => true + case _ => false + } + /** Is this pattern node a catch-all (wildcard or variable) pattern? */ def isDefaultCase(cdef: CaseDef) = cdef match { case CaseDef(pat, EmptyTree, _) => isWildcardArg(pat) -- cgit v1.2.3