From 1f3319c83721401e31642c1515bd9be7c567abc1 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Wed, 6 Aug 2014 10:02:00 +1000 Subject: SI-8781 Avoid double-expansion under -Ymacro-expand:discard This mode of macro expansion is used by the presentation compiler to leave the original macro applications ("expandees") in the type checked trees, annotated with the types of the expansions. However, under some circumstances involving implicits, we would re-expand the macro. If the macro wasn't stable, this could lead to a type mismatch. The originally reported problem was with the shapeless `mkSingletonOps` macro. Its expansion had the type of a freshly-named class local to the expansion. Upon the re-expansion, a new class was generated, which lead to errors like: client/Client.scala:4: error: type mismatch; found : fresh$macro$2 required: fresh$macro$1 This commit suppressed re-expansion of the expandee by use of the existing, tree attachment driven mechanism. --- test/files/pos/t8781/Test_2.flags | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/files/pos/t8781/Test_2.flags (limited to 'test/files/pos/t8781/Test_2.flags') diff --git a/test/files/pos/t8781/Test_2.flags b/test/files/pos/t8781/Test_2.flags new file mode 100644 index 0000000000..24e2109690 --- /dev/null +++ b/test/files/pos/t8781/Test_2.flags @@ -0,0 +1 @@ +-Ymacro-expand:discard -Ystop-after:typer -- cgit v1.2.3