diff options
author | Evgeny Kotelnikov <evgeny.kotelnikov@gmail.com> | 2013-01-19 17:42:12 +0400 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2013-02-07 18:56:20 +0100 |
commit | 96b0eff51e18a1abd9761451e08e63c9a3eb9ea6 (patch) | |
tree | c7706349969b570274dbb9259e29e9c4c3473471 /src/reflect | |
parent | 3d318be51f8e8cdec314565920327486212f5020 (diff) | |
download | scala-96b0eff51e18a1abd9761451e08e63c9a3eb9ea6.tar.gz scala-96b0eff51e18a1abd9761451e08e63c9a3eb9ea6.tar.bz2 scala-96b0eff51e18a1abd9761451e08e63c9a3eb9ea6.zip |
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.
Diffstat (limited to 'src/reflect')
-rw-r--r-- | src/reflect/scala/reflect/internal/TreeInfo.scala | 7 |
1 files changed, 7 insertions, 0 deletions
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) |