diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-06-18 14:11:00 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-06-18 17:33:21 +0200 |
commit | bec459a554d978f19dc0b40289d9179dbc28de78 (patch) | |
tree | 2cbdb165d33907a40a70a6529f87007b39c3831e /src | |
parent | 9a28ee1ffc085bc680c48b12ad632b9133adf020 (diff) | |
download | scala-bec459a554d978f19dc0b40289d9179dbc28de78.tar.gz scala-bec459a554d978f19dc0b40289d9179dbc28de78.tar.bz2 scala-bec459a554d978f19dc0b40289d9179dbc28de78.zip |
enables reification of anonymous classes
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/reflect/reify/Errors.scala | 5 | ||||
-rw-r--r-- | src/compiler/scala/reflect/reify/Reifier.scala | 14 |
2 files changed, 0 insertions, 19 deletions
diff --git a/src/compiler/scala/reflect/reify/Errors.scala b/src/compiler/scala/reflect/reify/Errors.scala index 714795503b..1b72b3075b 100644 --- a/src/compiler/scala/reflect/reify/Errors.scala +++ b/src/compiler/scala/reflect/reify/Errors.scala @@ -17,11 +17,6 @@ trait Errors { // expected errors: these can happen if the user casually writes whatever.reify(...) // hence we don't crash here, but nicely report a typechecking error and bail out asap - def CannotReifyReifeeThatHasTypeLocalToReifee(tree: Tree) = { - val msg = "implementation restriction: cannot reify block of type %s that involves a type declared inside the block being reified. consider casting the return value to a suitable type".format(tree.tpe) - throw new ReificationError(tree.pos, msg) - } - def CannotReifyType(tpe: Type) = { val msg = "implementation restriction: cannot reify type %s (%s)".format(tpe, tpe.kind) throw new ReificationError(defaultErrorPosition, msg) diff --git a/src/compiler/scala/reflect/reify/Reifier.scala b/src/compiler/scala/reflect/reify/Reifier.scala index 00f25f0d8b..8fba7274be 100644 --- a/src/compiler/scala/reflect/reify/Reifier.scala +++ b/src/compiler/scala/reflect/reify/Reifier.scala @@ -68,20 +68,6 @@ abstract class Reifier extends States val pipeline = mkReificationPipeline val rtree = pipeline(tree) - // consider the following code snippet - // - // val x = reify { class C; new C } - // - // inferred type for x will be C - // but C ceases to exist after reification so this type is clearly incorrect - // however, reify is "just" a library function, so it cannot affect type inference - // - // hence we crash here even though the reification itself goes well - // fortunately, all that it takes to fix the error is to cast "new C" to Object - // so I'm not very much worried about introducing this restriction - if (tree.tpe exists (sub => sub.typeSymbol.isLocalToReifee)) - CannotReifyReifeeThatHasTypeLocalToReifee(tree) - val tpe = typer.packedType(tree, NoSymbol) val ReifiedType(_, _, tpeSymtab, _, rtpe, tpeReificationIsConcrete) = `package`.reifyType(global)(typer, universe, mirror, tpe, concrete = false) state.reificationIsConcrete &= tpeReificationIsConcrete |