diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2013-05-31 23:03:25 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2013-05-31 23:03:25 +0200 |
commit | 4dc3a3319705ba9cdf63978bbed9a2fc8051b34f (patch) | |
tree | c7b36ccf679cc8496a1af9ac1c8a7a35458b5f17 /src | |
parent | 9b310bc906257724fb0772cee116e4a7ebdb0acb (diff) | |
download | scala-4dc3a3319705ba9cdf63978bbed9a2fc8051b34f.tar.gz scala-4dc3a3319705ba9cdf63978bbed9a2fc8051b34f.tar.bz2 scala-4dc3a3319705ba9cdf63978bbed9a2fc8051b34f.zip |
SI-7375 ClassTag for value class aliases
reifyRuntimeClass now always dealiases its argument prior to processing.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/reflect/reify/package.scala | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/scala/reflect/reify/package.scala b/src/compiler/scala/reflect/reify/package.scala index 55f8684df2..6777bb0a50 100644 --- a/src/compiler/scala/reflect/reify/package.scala +++ b/src/compiler/scala/reflect/reify/package.scala @@ -45,18 +45,21 @@ package object reify { def reifyType(global: Global)(typer: global.analyzer.Typer,universe: global.Tree, mirror: global.Tree, tpe: global.Type, concrete: Boolean = false): global.Tree = mkReifier(global)(typer, universe, mirror, tpe, concrete = concrete).reification.asInstanceOf[global.Tree] - def reifyRuntimeClass(global: Global)(typer0: global.analyzer.Typer, tpe: global.Type, concrete: Boolean = true): global.Tree = { + def reifyRuntimeClass(global: Global)(typer0: global.analyzer.Typer, tpe0: global.Type, concrete: Boolean = true): global.Tree = { import global._ import definitions._ import analyzer.enclosingMacroPosition + // SI-7375 + val tpe = tpe0.dealiasWiden + if (tpe.isSpliceable) { val classTagInScope = typer0.resolveClassTag(enclosingMacroPosition, tpe, allowMaterialization = false) if (!classTagInScope.isEmpty) return Select(classTagInScope, nme.runtimeClass) if (concrete) throw new ReificationException(enclosingMacroPosition, "tpe %s is an unresolved spliceable type".format(tpe)) } - tpe.normalize match { + tpe match { case TypeRef(_, ArrayClass, componentTpe :: Nil) => val componentErasure = reifyRuntimeClass(global)(typer0, componentTpe, concrete) gen.mkMethodCall(arrayClassMethod, List(componentErasure)) |