diff options
author | Seth Tisue <seth@tisue.net> | 2017-02-16 16:49:49 -0800 |
---|---|---|
committer | Seth Tisue <seth@tisue.net> | 2017-02-17 12:41:27 -0800 |
commit | 2b3d017d5f6a196c612af1e4eb677b6d970b0a25 (patch) | |
tree | 948c4681464401832637ec62ff721097ba779dcd /src/reflect | |
parent | c8b80053bd41b5a6cf4c03b2a709099ae1b668d7 (diff) | |
download | scala-2b3d017d5f6a196c612af1e4eb677b6d970b0a25.tar.gz scala-2b3d017d5f6a196c612af1e4eb677b6d970b0a25.tar.bz2 scala-2b3d017d5f6a196c612af1e4eb677b6d970b0a25.zip |
fix recent regression: macro paradise + Java sources = MatchError
fixes https://github.com/scala/scala-dev/issues/303 ;
the regression was in https://github.com/scala/scala/pull/5585
Diffstat (limited to 'src/reflect')
-rw-r--r-- | src/reflect/scala/reflect/internal/ReificationSupport.scala | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/reflect/scala/reflect/internal/ReificationSupport.scala b/src/reflect/scala/reflect/internal/ReificationSupport.scala index 1b2be64654..21320149a3 100644 --- a/src/reflect/scala/reflect/internal/ReificationSupport.scala +++ b/src/reflect/scala/reflect/internal/ReificationSupport.scala @@ -351,9 +351,13 @@ trait ReificationSupport { self: SymbolTable => List[Tree], List[Tree], ValDef, List[Tree])] = tree match { case ClassDef(mods, name, tparams, impl) => val X = if (mods.isCase) UnMkTemplate.asCase else UnMkTemplate - val X(parents, selfType, ctorMods, vparamss, earlyDefs, body) = impl - if (ctorMods.isTrait || ctorMods.hasFlag(JAVA)) None - else Some((mods, name, tparams, ctorMods, vparamss, earlyDefs, parents, selfType, body)) + impl match { + case X(parents, selfType, ctorMods, vparamss, earlyDefs, body) + if (!ctorMods.isTrait && !ctorMods.hasFlag(JAVA)) => + Some((mods, name, tparams, ctorMods, vparamss, earlyDefs, parents, selfType, body)) + case _ => + None + } case _ => None } |