summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-03-11 22:53:09 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-03-11 22:53:09 -0700
commitbc5c177c6b910080f76fba85ffd9441a4a93173f (patch)
treecda9cfe031146e7ce9e6e02dfaf702f2f09ac420 /src
parent221f52757aa64d47fffe0a8e2204943423041316 (diff)
parent3ae265395c43711cabc5193fd3c8f95a9f86c843 (diff)
downloadscala-bc5c177c6b910080f76fba85ffd9441a4a93173f.tar.gz
scala-bc5c177c6b910080f76fba85ffd9441a4a93173f.tar.bz2
scala-bc5c177c6b910080f76fba85ffd9441a4a93173f.zip
Merge pull request #2223 from scalamacros/ticket/7235
reifier is now aware of SI-7235
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/reflect/reify/Errors.scala5
-rw-r--r--src/compiler/scala/reflect/reify/phases/Reshape.scala1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/compiler/scala/reflect/reify/Errors.scala b/src/compiler/scala/reflect/reify/Errors.scala
index 7c66d5b9eb..2e57bc59a8 100644
--- a/src/compiler/scala/reflect/reify/Errors.scala
+++ b/src/compiler/scala/reflect/reify/Errors.scala
@@ -27,6 +27,11 @@ trait Errors {
throw new ReificationException(defaultErrorPosition, msg)
}
+ def CannotReifyCompoundTypeTreeWithNonEmptyBody(ctt: CompoundTypeTree) = {
+ val msg = "implementation restriction: cannot reify refinement type trees with non-empty bodies"
+ throw new ReificationException(ctt.pos, msg)
+ }
+
def CannotReifyWeakType(details: Any) = {
val msg = "cannot create a TypeTag" + details + ": use WeakTypeTag instead"
throw new ReificationException(defaultErrorPosition, msg)
diff --git a/src/compiler/scala/reflect/reify/phases/Reshape.scala b/src/compiler/scala/reflect/reify/phases/Reshape.scala
index 7406f5d02d..a320718084 100644
--- a/src/compiler/scala/reflect/reify/phases/Reshape.scala
+++ b/src/compiler/scala/reflect/reify/phases/Reshape.scala
@@ -181,6 +181,7 @@ trait Reshape {
private def toPreTyperCompoundTypeTree(ctt: CompoundTypeTree): Tree = {
val CompoundTypeTree(tmpl @ Template(parents, self, stats)) = ctt
+ if (stats.nonEmpty) CannotReifyCompoundTypeTreeWithNonEmptyBody(ctt)
assert(self eq emptyValDef, self)
val att = tmpl.attachments.get[CompoundTypeTreeOriginalAttachment]
val CompoundTypeTreeOriginalAttachment(parents1, stats1) = att.getOrElse(CompoundTypeTreeOriginalAttachment(parents, stats))