summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHeather Miller <heather.miller@epfl.ch>2012-04-15 14:51:18 +0200
committerHeather Miller <heather.miller@epfl.ch>2012-04-15 14:51:18 +0200
commite4bea920b42eaa526a9e07ad001f17443d6abeba (patch)
treec786202cc9d0fa5b1a26dfd8e1154cacca7fbaf4 /test
parent23aa1a8d7b08b767f90657baf9bc13a355682671 (diff)
parent364dd41c3e0e33afe6c3ec6e0c04f1d345c4b6ca (diff)
downloadscala-e4bea920b42eaa526a9e07ad001f17443d6abeba.tar.gz
scala-e4bea920b42eaa526a9e07ad001f17443d6abeba.tar.bz2
scala-e4bea920b42eaa526a9e07ad001f17443d6abeba.zip
Merge branch 'master' of https://github.com/scala/scala into wip-sip14-fixes
Diffstat (limited to 'test')
-rw-r--r--test/disabled/jvm/concurrent-future.check (renamed from test/files/jvm/concurrent-future.check)0
-rw-r--r--test/disabled/jvm/concurrent-future.scala (renamed from test/files/jvm/concurrent-future.scala)0
-rw-r--r--test/disabled/presentation/shutdown-deadlock.check (renamed from test/files/presentation/shutdown-deadlock.check)0
-rw-r--r--test/disabled/presentation/shutdown-deadlock/ShutdownDeadlockTest.scala (renamed from test/files/presentation/shutdown-deadlock/ShutdownDeadlockTest.scala)0
-rw-r--r--test/disabled/presentation/shutdown-deadlock/src/arrays.scala (renamed from test/files/presentation/shutdown-deadlock/src/arrays.scala)0
-rw-r--r--test/files/buildmanager/t2559/D.scala6
-rw-r--r--test/files/buildmanager/t2559/t2559.check5
-rw-r--r--test/files/buildmanager/t2650_1/t2650_1.check1
-rw-r--r--test/files/buildmanager/t2657/t2657.check1
-rw-r--r--test/files/codelib/code.jar.desired.sha12
-rw-r--r--test/files/continuations-run/match2.scala2
-rw-r--r--[-rwxr-xr-x]test/files/jvm/interpreter.check9
-rw-r--r--test/files/jvm/interpreter.scala9
-rw-r--r--test/files/jvm/manifests.check111
-rw-r--r--test/files/jvm/manifests.scala19
-rw-r--r--test/files/macros/Printf.scala39
-rw-r--r--test/files/macros/Test.scala8
-rw-r--r--test/files/macros/macros_v0001.bat40
-rw-r--r--test/files/macros/macros_v0001.sh30
-rw-r--r--test/files/neg/applydynamic_sip.check10
-rw-r--r--test/files/neg/applydynamic_sip.scala10
-rw-r--r--test/files/neg/array-not-seq.check12
-rw-r--r--test/files/neg/checksensible.check200
-rw-r--r--test/files/neg/classtags_contextbound_a.check4
-rw-r--r--test/files/neg/classtags_contextbound_a.scala4
-rw-r--r--test/files/neg/classtags_contextbound_b.check4
-rw-r--r--test/files/neg/classtags_contextbound_b.scala5
-rw-r--r--test/files/neg/classtags_contextbound_c.check4
-rw-r--r--test/files/neg/classtags_contextbound_c.scala5
-rw-r--r--test/files/neg/exhausting.flags2
-rw-r--r--test/files/neg/gadts1.check5
-rw-r--r--test/files/neg/macro-argtype-mismatch.flags2
-rw-r--r--test/files/neg/macro-argtype-mismatch/Macros_1.scala3
-rw-r--r--test/files/neg/macro-basic-mamdmi.check5
-rw-r--r--test/files/neg/macro-basic-mamdmi.flags1
-rw-r--r--test/files/neg/macro-basic-mamdmi/Impls_Macros_Test_1.scala37
-rw-r--r--test/files/neg/macro-cyclic.check4
-rw-r--r--test/files/neg/macro-cyclic.flags1
-rw-r--r--test/files/neg/macro-cyclic/Impls_Macros_1.scala25
-rw-r--r--test/files/neg/macro-deprecate-idents.check52
-rw-r--r--test/files/neg/macro-deprecate-idents.flags1
-rw-r--r--test/files/neg/macro-deprecate-idents.scala56
-rw-r--r--test/files/neg/macro-invalidimpl-a.check4
-rw-r--r--test/files/neg/macro-invalidimpl-a.flags1
-rw-r--r--test/files/neg/macro-invalidimpl-a/Impls_1.scala5
-rw-r--r--test/files/neg/macro-invalidimpl-a/Macros_Test_2.scala9
-rw-r--r--test/files/neg/macro-invalidimpl-b.check4
-rw-r--r--test/files/neg/macro-invalidimpl-b.flags1
-rw-r--r--test/files/neg/macro-invalidimpl-b/Impls_1.scala5
-rw-r--r--test/files/neg/macro-invalidimpl-b/Macros_Test_2.scala9
-rw-r--r--test/files/neg/macro-invalidimpl-c.check4
-rw-r--r--test/files/neg/macro-invalidimpl-c.flags1
-rw-r--r--test/files/neg/macro-invalidimpl-c/Impls_Macros_1.scala9
-rw-r--r--test/files/neg/macro-invalidimpl-c/Test_2.scala3
-rw-r--r--test/files/neg/macro-invalidimpl-d.check4
-rw-r--r--test/files/neg/macro-invalidimpl-d.flags1
-rw-r--r--test/files/neg/macro-invalidimpl-d/Impls_1.scala7
-rw-r--r--test/files/neg/macro-invalidimpl-d/Macros_Test_2.scala7
-rw-r--r--test/files/neg/macro-invalidimpl-e.check13
-rw-r--r--test/files/neg/macro-invalidimpl-e.flags1
-rw-r--r--test/files/neg/macro-invalidimpl-e/Impls_1.scala6
-rw-r--r--test/files/neg/macro-invalidimpl-e/Macros_Test_2.scala9
-rw-r--r--test/files/neg/macro-invalidimpl-f.check7
-rw-r--r--test/files/neg/macro-invalidimpl-f.flags1
-rw-r--r--test/files/neg/macro-invalidimpl-f/Impls_1.scala11
-rw-r--r--test/files/neg/macro-invalidimpl-f/Macros_Test_2.scala9
-rw-r--r--test/files/neg/macro-invalidimpl-g.check7
-rw-r--r--test/files/neg/macro-invalidimpl-g.flags1
-rw-r--r--test/files/neg/macro-invalidimpl-g/Impls_1.scala11
-rw-r--r--test/files/neg/macro-invalidimpl-g/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-invalidimpl-h.check4
-rw-r--r--test/files/neg/macro-invalidimpl-h.flags1
-rw-r--r--test/files/neg/macro-invalidimpl-h/Impls_1.scala5
-rw-r--r--test/files/neg/macro-invalidimpl-h/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-invalidret-nontree.check7
-rw-r--r--test/files/neg/macro-invalidret-nontree.flags1
-rw-r--r--test/files/neg/macro-invalidret-nontree/Impls_1.scala5
-rw-r--r--test/files/neg/macro-invalidret-nontree/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-invalidret-nonuniversetree.check7
-rw-r--r--test/files/neg/macro-invalidret-nonuniversetree.flags1
-rw-r--r--test/files/neg/macro-invalidret-nonuniversetree/Impls_1.scala5
-rw-r--r--test/files/neg/macro-invalidret-nonuniversetree/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-invalidshape-a.check6
-rw-r--r--test/files/neg/macro-invalidshape-a.flags1
-rw-r--r--test/files/neg/macro-invalidshape-a/Impls_1.scala5
-rw-r--r--test/files/neg/macro-invalidshape-a/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-invalidshape-b.check6
-rw-r--r--test/files/neg/macro-invalidshape-b.flags1
-rw-r--r--test/files/neg/macro-invalidshape-b/Impls_1.scala5
-rw-r--r--test/files/neg/macro-invalidshape-b/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-invalidshape-c.check6
-rw-r--r--test/files/neg/macro-invalidshape-c.flags1
-rw-r--r--test/files/neg/macro-invalidshape-c/Impls_1.scala5
-rw-r--r--test/files/neg/macro-invalidshape-c/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-invalidshape-d.check8
-rw-r--r--test/files/neg/macro-invalidshape-d.flags1
-rw-r--r--test/files/neg/macro-invalidshape-d/Impls_1.scala5
-rw-r--r--test/files/neg/macro-invalidshape-d/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-invalidsig-context-bounds.check4
-rw-r--r--test/files/neg/macro-invalidsig-context-bounds.flags1
-rw-r--r--test/files/neg/macro-invalidsig-context-bounds/Impls_1.scala8
-rw-r--r--test/files/neg/macro-invalidsig-context-bounds/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-invalidsig-ctx-badargc.check7
-rw-r--r--test/files/neg/macro-invalidsig-ctx-badargc.flags1
-rw-r--r--test/files/neg/macro-invalidsig-ctx-badargc/Impls_1.scala5
-rw-r--r--test/files/neg/macro-invalidsig-ctx-badargc/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-invalidsig-ctx-badtype.check7
-rw-r--r--test/files/neg/macro-invalidsig-ctx-badtype.flags1
-rw-r--r--test/files/neg/macro-invalidsig-ctx-badtype/Impls_1.scala5
-rw-r--r--test/files/neg/macro-invalidsig-ctx-badtype/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-invalidsig-ctx-badvarargs.check7
-rw-r--r--test/files/neg/macro-invalidsig-ctx-badvarargs.flags1
-rw-r--r--test/files/neg/macro-invalidsig-ctx-badvarargs/Impls_1.scala5
-rw-r--r--test/files/neg/macro-invalidsig-ctx-badvarargs/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-invalidsig-ctx-noctx.check7
-rw-r--r--test/files/neg/macro-invalidsig-ctx-noctx.flags1
-rw-r--r--test/files/neg/macro-invalidsig-ctx-noctx/Impls_1.scala5
-rw-r--r--test/files/neg/macro-invalidsig-ctx-noctx/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-invalidsig-implicit-params.check4
-rw-r--r--test/files/neg/macro-invalidsig-implicit-params.flags1
-rw-r--r--test/files/neg/macro-invalidsig-implicit-params/Impls_Macros_1.scala18
-rw-r--r--test/files/neg/macro-invalidsig-implicit-params/Test_2.scala4
-rw-r--r--test/files/neg/macro-invalidsig-params-badargc.check7
-rw-r--r--test/files/neg/macro-invalidsig-params-badargc.flags1
-rw-r--r--test/files/neg/macro-invalidsig-params-badargc/Impls_Macros_1.scala9
-rw-r--r--test/files/neg/macro-invalidsig-params-badargc/Test_2.scala (renamed from test/files/neg/macro-noexpand/Test_2.scala)2
-rw-r--r--test/files/neg/macro-invalidsig-params-badtype.check7
-rw-r--r--test/files/neg/macro-invalidsig-params-badtype.flags1
-rw-r--r--test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala9
-rw-r--r--test/files/neg/macro-invalidsig-params-badtype/Test_2.scala (renamed from test/files/neg/macro-argtype-mismatch/Test_2.scala)2
-rw-r--r--test/files/neg/macro-invalidsig-params-badvarargs.check7
-rw-r--r--test/files/neg/macro-invalidsig-params-badvarargs.flags1
-rw-r--r--test/files/neg/macro-invalidsig-params-badvarargs/Impls_Macros_1.scala9
-rw-r--r--test/files/neg/macro-invalidsig-params-badvarargs/Test_2.scala4
-rw-r--r--test/files/neg/macro-invalidsig-params-namemismatch.check7
-rw-r--r--test/files/neg/macro-invalidsig-params-namemismatch.flags1
-rw-r--r--test/files/neg/macro-invalidsig-params-namemismatch/Impls_Macros_1.scala9
-rw-r--r--test/files/neg/macro-invalidsig-params-namemismatch/Test_2.scala4
-rw-r--r--test/files/neg/macro-invalidsig-tparams-badtype.check7
-rw-r--r--test/files/neg/macro-invalidsig-tparams-badtype.flags1
-rw-r--r--test/files/neg/macro-invalidsig-tparams-badtype/Impls_1.scala5
-rw-r--r--test/files/neg/macro-invalidsig-tparams-badtype/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-invalidsig-tparams-bounds-a.check4
-rw-r--r--test/files/neg/macro-invalidsig-tparams-bounds-a.flags1
-rw-r--r--test/files/neg/macro-invalidsig-tparams-bounds-a/Impls_1.scala5
-rw-r--r--test/files/neg/macro-invalidsig-tparams-bounds-a/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-invalidsig-tparams-bounds-b.check4
-rw-r--r--test/files/neg/macro-invalidsig-tparams-bounds-b.flags1
-rw-r--r--test/files/neg/macro-invalidsig-tparams-bounds-b/Impls_1.scala5
-rw-r--r--test/files/neg/macro-invalidsig-tparams-bounds-b/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-invalidsig-tparams-notparams-a.check4
-rw-r--r--test/files/neg/macro-invalidsig-tparams-notparams-a.flags1
-rw-r--r--test/files/neg/macro-invalidsig-tparams-notparams-a/Impls_1.scala5
-rw-r--r--test/files/neg/macro-invalidsig-tparams-notparams-a/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-invalidsig-tparams-notparams-b.check4
-rw-r--r--test/files/neg/macro-invalidsig-tparams-notparams-b.flags1
-rw-r--r--test/files/neg/macro-invalidsig-tparams-notparams-b/Impls_1.scala11
-rw-r--r--test/files/neg/macro-invalidsig-tparams-notparams-b/Macros_Test_2.scala11
-rw-r--r--test/files/neg/macro-invalidsig-tparams-notparams-c.check4
-rw-r--r--test/files/neg/macro-invalidsig-tparams-notparams-c.flags1
-rw-r--r--test/files/neg/macro-invalidsig-tparams-notparams-c/Impls_1.scala11
-rw-r--r--test/files/neg/macro-invalidsig-tparams-notparams-c/Macros_Test_2.scala11
-rw-r--r--test/files/neg/macro-invalidusage-badargs.check6
-rw-r--r--test/files/neg/macro-invalidusage-badargs.flags1
-rw-r--r--test/files/neg/macro-invalidusage-badargs/Impls_1.scala5
-rw-r--r--test/files/neg/macro-invalidusage-badargs/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-invalidusage-badbounds.check4
-rw-r--r--test/files/neg/macro-invalidusage-badbounds.flags1
-rw-r--r--test/files/neg/macro-invalidusage-badbounds/Impls_1.scala5
-rw-r--r--test/files/neg/macro-invalidusage-badbounds/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-invalidusage-badtargs.check4
-rw-r--r--test/files/neg/macro-invalidusage-badtargs.flags1
-rw-r--r--test/files/neg/macro-invalidusage-badtargs/Impls_1.scala5
-rw-r--r--test/files/neg/macro-invalidusage-badtargs/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-invalidusage-methodvaluesyntax.check4
-rw-r--r--test/files/neg/macro-invalidusage-methodvaluesyntax.flags1
-rw-r--r--test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala9
-rw-r--r--test/files/neg/macro-invalidusage-methodvaluesyntax/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-noexpand.check2
-rw-r--r--test/files/neg/macro-noexpand.flags2
-rw-r--r--test/files/neg/macro-noexpand/Impls_1.scala5
-rw-r--r--test/files/neg/macro-noexpand/Macros_1.scala3
-rw-r--r--test/files/neg/macro-noexpand/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-noncompilertree.flags2
-rw-r--r--test/files/neg/macro-noncompilertree/Macros_1.scala3
-rw-r--r--test/files/neg/macro-nontree.flags2
-rw-r--r--test/files/neg/macro-nontree/Macros_1.scala3
-rw-r--r--test/files/neg/macro-nontypeablebody.check4
-rw-r--r--test/files/neg/macro-nontypeablebody.flags1
-rw-r--r--test/files/neg/macro-nontypeablebody/Impls_1.scala5
-rw-r--r--test/files/neg/macro-nontypeablebody/Macros_Test_2.scala8
-rw-r--r--test/files/neg/macro-override-macro-overrides-abstract-method-a.check5
-rw-r--r--test/files/neg/macro-override-macro-overrides-abstract-method-a.flags1
-rw-r--r--test/files/neg/macro-override-macro-overrides-abstract-method-a/Impls_Macros_1.scala13
-rw-r--r--test/files/neg/macro-override-macro-overrides-abstract-method-a/Test_2.scala4
-rw-r--r--test/files/neg/macro-override-macro-overrides-abstract-method-b.check5
-rw-r--r--test/files/neg/macro-override-macro-overrides-abstract-method-b.flags1
-rw-r--r--test/files/neg/macro-override-macro-overrides-abstract-method-b/Impls_Macros_1.scala13
-rw-r--r--test/files/neg/macro-override-macro-overrides-abstract-method-b/Test_2.scala4
-rw-r--r--test/files/neg/macro-override-method-overrides-macro.check5
-rw-r--r--test/files/neg/macro-override-method-overrides-macro.flags1
-rw-r--r--test/files/neg/macro-override-method-overrides-macro/Impls_1.scala15
-rw-r--r--test/files/neg/macro-override-method-overrides-macro/Macros_Test_2.scala15
-rw-r--r--test/files/neg/macro-reify-groundtypetag-hktypeparams-notags.check7
-rw-r--r--test/files/neg/macro-reify-groundtypetag-hktypeparams-notags/Test.scala9
-rw-r--r--test/files/neg/macro-reify-groundtypetag-typeparams-notags.check7
-rw-r--r--test/files/neg/macro-reify-groundtypetag-typeparams-notags/Test.scala9
-rw-r--r--test/files/neg/macro-reify-groundtypetag-usetypetag.check7
-rw-r--r--test/files/neg/macro-reify-groundtypetag-usetypetag/Test.scala9
-rw-r--r--test/files/neg/macro-without-xmacros-a.check17
-rw-r--r--test/files/neg/macro-without-xmacros-a/Impls_1.scala18
-rw-r--r--test/files/neg/macro-without-xmacros-a/Macros_2.scala12
-rw-r--r--test/files/neg/macro-without-xmacros-a/Test_3.scala (renamed from test/files/run/macro-basic/Test_2.scala)0
-rw-r--r--test/files/neg/macro-without-xmacros-b.check17
-rw-r--r--test/files/neg/macro-without-xmacros-b/Impls_1.scala18
-rw-r--r--test/files/neg/macro-without-xmacros-b/Macros_2.scala10
-rw-r--r--test/files/neg/macro-without-xmacros-b/Test_3.scala4
-rw-r--r--test/files/neg/pat_unreachable.flags1
-rw-r--r--test/files/neg/patmat-type-check.check14
-rw-r--r--test/files/neg/patmatexhaust.flags2
-rw-r--r--test/files/neg/reify_ann2a.check4
-rw-r--r--test/files/neg/reify_ann2b.check11
-rw-r--r--test/files/neg/reify_ann2b.scala11
-rw-r--r--test/files/neg/sealed-java-enums.flags2
-rw-r--r--test/files/neg/switch.flags1
-rw-r--r--test/files/neg/t0418.check5
-rw-r--r--test/files/neg/t112706A.check5
-rw-r--r--test/files/neg/t1878.check5
-rw-r--r--test/files/neg/t2386.check8
-rw-r--r--test/files/neg/t2775.check8
-rw-r--r--test/files/neg/t3098.flags2
-rw-r--r--test/files/neg/t3392.check5
-rw-r--r--test/files/neg/t3507.check4
-rw-r--r--test/files/neg/t3683a.flags2
-rw-r--r--test/files/neg/t3692.check15
-rw-r--r--test/files/neg/t3692.flags1
-rw-r--r--test/files/neg/t418.check5
-rw-r--r--test/files/neg/t4425.check2
-rw-r--r--test/files/neg/t5334_1.check4
-rw-r--r--test/files/neg/t5334_1.scala8
-rw-r--r--test/files/neg/t5334_2.check4
-rw-r--r--test/files/neg/t5334_2.scala8
-rw-r--r--test/files/neg/t5510.check19
-rw-r--r--test/files/neg/t5510.scala7
-rw-r--r--test/files/neg/t5589neg.check5
-rw-r--r--test/files/neg/t5663-badwarneq.check22
-rw-r--r--test/files/neg/t5663-badwarneq.flags1
-rw-r--r--test/files/neg/t5663-badwarneq.scala76
-rw-r--r--test/files/neg/t5666.check10
-rw-r--r--test/files/neg/t5666.scala14
-rw-r--r--test/files/neg/tailrec.check6
-rw-r--r--test/files/neg/unreachablechar.flags1
-rw-r--r--test/files/pos/generic-sigs.scala4
-rw-r--r--test/files/pos/hkarray.flags2
-rw-r--r--test/files/pos/liftcode_polymorphic.scala4
-rw-r--r--test/files/pos/macro-deprecate-dont-touch-backquotedidents.flags1
-rw-r--r--test/files/pos/macro-deprecate-dont-touch-backquotedidents.scala56
-rw-r--r--test/files/pos/macros.scala8
-rw-r--r--test/files/pos/t1439.flags2
-rw-r--r--test/files/pos/t5223.scala6
-rw-r--r--test/files/pos/t531.scala5
-rw-r--r--test/files/pos/t532.scala5
-rw-r--r--test/files/pos/virtpatmat_alts_subst.flags2
-rw-r--r--test/files/pos/virtpatmat_anonfun_for.flags1
-rw-r--r--test/files/pos/virtpatmat_binding_opt.flags2
-rw-r--r--test/files/pos/virtpatmat_castbinder.flags2
-rw-r--r--test/files/pos/virtpatmat_exist1.flags2
-rw-r--r--test/files/pos/virtpatmat_exist2.flags2
-rw-r--r--test/files/pos/virtpatmat_exist3.flags2
-rw-r--r--test/files/pos/virtpatmat_exist_uncurry.scala6
-rw-r--r--test/files/pos/virtpatmat_gadt_array.flags2
-rw-r--r--test/files/pos/virtpatmat_infer_single_1.flags2
-rw-r--r--test/files/pos/virtpatmat_instof_valuetype.flags2
-rw-r--r--test/files/pos/virtpatmat_obj_in_case.flags2
-rw-r--r--test/files/presentation/callcc-interpreter/Runner.scala4
-rw-r--r--test/files/presentation/random.check3
-rw-r--r--test/files/run/applydynamic_sip.check22
-rw-r--r--test/files/run/applydynamic_sip.scala58
-rw-r--r--test/files/run/classtags_contextbound.check1
-rw-r--r--test/files/run/classtags_contextbound.scala5
-rw-r--r--test/files/run/classtags_core.check30
-rw-r--r--test/files/run/classtags_core.scala32
-rw-r--r--test/files/run/constrained-types.check7
-rw-r--r--test/files/run/dynamic-proxy.check20
-rw-r--r--test/files/run/dynamic-proxy.flags1
-rw-r--r--test/files/run/dynamic-proxy.scala72
-rw-r--r--test/files/run/existentials-in-compiler.check16
-rw-r--r--test/files/run/existentials3.check46
-rw-r--r--test/files/run/existentials3.scala20
-rw-r--r--test/files/run/groundtypetags_core.check30
-rw-r--r--test/files/run/groundtypetags_core.scala32
-rw-r--r--test/files/run/implicitclasses.scala10
-rw-r--r--test/files/run/inline-ex-handlers.check261
-rw-r--r--test/files/run/macro-abort-fresh.check6
-rw-r--r--test/files/run/macro-abort-fresh.flags1
-rw-r--r--test/files/run/macro-abort-fresh/Macros_1.scala15
-rw-r--r--test/files/run/macro-abort-fresh/Test_2.scala6
-rw-r--r--test/files/run/macro-basic-ma-md-mi.check1
-rw-r--r--test/files/run/macro-basic-ma-md-mi.flags1
-rw-r--r--test/files/run/macro-basic-ma-md-mi/Impls_1.scala21
-rw-r--r--test/files/run/macro-basic-ma-md-mi/Macros_2.scala10
-rw-r--r--test/files/run/macro-basic-ma-md-mi/Test_3.scala4
-rw-r--r--test/files/run/macro-basic-ma-mdmi.check1
-rw-r--r--test/files/run/macro-basic-ma-mdmi.flags1
-rw-r--r--test/files/run/macro-basic-ma-mdmi/Impls_Macros_1.scala32
-rw-r--r--test/files/run/macro-basic-ma-mdmi/Test_2.scala4
-rw-r--r--test/files/run/macro-basic-mamd-mi.check1
-rw-r--r--test/files/run/macro-basic-mamd-mi.flags1
-rw-r--r--test/files/run/macro-basic-mamd-mi/Impls_1.scala19
-rw-r--r--test/files/run/macro-basic-mamd-mi/Macros_Test_2.scala15
-rw-r--r--test/files/run/macro-basic.check1
-rw-r--r--test/files/run/macro-basic.flags1
-rw-r--r--test/files/run/macro-basic/Macros_1.scala10
-rw-r--r--test/files/run/macro-bodyexpandstoimpl.check1
-rw-r--r--test/files/run/macro-bodyexpandstoimpl.flags1
-rw-r--r--test/files/run/macro-bodyexpandstoimpl/Impls_1.scala12
-rw-r--r--test/files/run/macro-bodyexpandstoimpl/Macros_Test_2.scala10
-rw-r--r--test/files/run/macro-declared-in-annotation.check1
-rw-r--r--test/files/run/macro-declared-in-annotation.flags1
-rw-r--r--test/files/run/macro-declared-in-annotation/Impls_1.scala11
-rw-r--r--test/files/run/macro-declared-in-annotation/Macros_2.scala8
-rw-r--r--test/files/run/macro-declared-in-annotation/Test_3.scala3
-rw-r--r--test/files/run/macro-declared-in-anonymous.check2
-rw-r--r--test/files/run/macro-declared-in-anonymous.flags1
-rw-r--r--test/files/run/macro-declared-in-anonymous/Impls_1.scala11
-rw-r--r--test/files/run/macro-declared-in-anonymous/Macros_Test_2.scala4
-rw-r--r--test/files/run/macro-declared-in-block.check2
-rw-r--r--test/files/run/macro-declared-in-block.flags1
-rw-r--r--test/files/run/macro-declared-in-block/Impls_1.scala11
-rw-r--r--test/files/run/macro-declared-in-block/Macros_Test_2.scala6
-rw-r--r--test/files/run/macro-declared-in-class-class.check2
-rw-r--r--test/files/run/macro-declared-in-class-class.flags1
-rw-r--r--test/files/run/macro-declared-in-class-class/Impls_1.scala11
-rw-r--r--test/files/run/macro-declared-in-class-class/Macros_Test_2.scala10
-rw-r--r--test/files/run/macro-declared-in-class-object.check2
-rw-r--r--test/files/run/macro-declared-in-class-object.flags1
-rw-r--r--test/files/run/macro-declared-in-class-object/Impls_1.scala11
-rw-r--r--test/files/run/macro-declared-in-class-object/Macros_Test_2.scala10
-rw-r--r--test/files/run/macro-declared-in-class.check2
-rw-r--r--test/files/run/macro-declared-in-class.flags1
-rw-r--r--test/files/run/macro-declared-in-class/Impls_1.scala11
-rw-r--r--test/files/run/macro-declared-in-class/Macros_Test_2.scala7
-rw-r--r--test/files/run/macro-declared-in-default-param.check5
-rw-r--r--test/files/run/macro-declared-in-default-param.flags1
-rw-r--r--test/files/run/macro-declared-in-default-param/Impls_1.scala11
-rw-r--r--test/files/run/macro-declared-in-default-param/Macros_Test_2.scala7
-rw-r--r--test/files/run/macro-declared-in-implicit-class.check2
-rw-r--r--test/files/run/macro-declared-in-implicit-class.flags1
-rw-r--r--test/files/run/macro-declared-in-implicit-class/Impls_Macros_1.scala19
-rw-r--r--test/files/run/macro-declared-in-implicit-class/Test_2.scala4
-rw-r--r--test/files/run/macro-declared-in-method.check2
-rw-r--r--test/files/run/macro-declared-in-method.flags1
-rw-r--r--test/files/run/macro-declared-in-method/Impls_1.scala11
-rw-r--r--test/files/run/macro-declared-in-method/Macros_Test_2.scala8
-rw-r--r--test/files/run/macro-declared-in-object-class.check2
-rw-r--r--test/files/run/macro-declared-in-object-class.flags1
-rw-r--r--test/files/run/macro-declared-in-object-class/Impls_1.scala11
-rw-r--r--test/files/run/macro-declared-in-object-class/Macros_Test_2.scala10
-rw-r--r--test/files/run/macro-declared-in-object-object.check2
-rw-r--r--test/files/run/macro-declared-in-object-object.flags1
-rw-r--r--test/files/run/macro-declared-in-object-object/Impls_1.scala11
-rw-r--r--test/files/run/macro-declared-in-object-object/Macros_Test_2.scala10
-rw-r--r--test/files/run/macro-declared-in-object.check2
-rw-r--r--test/files/run/macro-declared-in-object.flags1
-rw-r--r--test/files/run/macro-declared-in-object/Impls_1.scala11
-rw-r--r--test/files/run/macro-declared-in-object/Macros_Test_2.scala7
-rw-r--r--test/files/run/macro-declared-in-package-object.check2
-rw-r--r--test/files/run/macro-declared-in-package-object.flags1
-rw-r--r--test/files/run/macro-declared-in-package-object/Impls_1.scala11
-rw-r--r--test/files/run/macro-declared-in-package-object/Macros_Test_2.scala8
-rw-r--r--test/files/run/macro-declared-in-refinement.check2
-rw-r--r--test/files/run/macro-declared-in-refinement.flags1
-rw-r--r--test/files/run/macro-declared-in-refinement/Impls_1.scala11
-rw-r--r--test/files/run/macro-declared-in-refinement/Macros_Test_2.scala6
-rw-r--r--test/files/run/macro-declared-in-trait.check15
-rw-r--r--test/files/run/macro-declared-in-trait.flags1
-rw-r--r--test/files/run/macro-declared-in-trait/Impls_1.scala11
-rw-r--r--test/files/run/macro-declared-in-trait/Macros_Test_2.scala13
-rw-r--r--test/files/run/macro-def-infer-return-type-a.check1
-rw-r--r--test/files/run/macro-def-infer-return-type-a.flags1
-rw-r--r--test/files/run/macro-def-infer-return-type-a/Impls_1.scala5
-rw-r--r--test/files/run/macro-def-infer-return-type-a/Macros_Test_2.scala4
-rw-r--r--test/files/run/macro-def-infer-return-type-b.check6
-rw-r--r--test/files/run/macro-def-infer-return-type-b.flags1
-rw-r--r--test/files/run/macro-def-infer-return-type-b/Impls_Macros_1.scala10
-rw-r--r--test/files/run/macro-def-infer-return-type-b/Test_2.scala6
-rw-r--r--test/files/run/macro-def-infer-return-type-c.check1
-rw-r--r--test/files/run/macro-def-infer-return-type-c.flags1
-rw-r--r--test/files/run/macro-def-infer-return-type-c/Impls_1.scala5
-rw-r--r--test/files/run/macro-def-infer-return-type-c/Macros_Test_2.scala4
-rw-r--r--test/files/run/macro-def-path-dependent-a.check1
-rw-r--r--test/files/run/macro-def-path-dependent-a.flags1
-rw-r--r--test/files/run/macro-def-path-dependent-a/Impls_Macros_1.scala21
-rw-r--r--test/files/run/macro-def-path-dependent-a/Test_2.scala3
-rw-r--r--test/files/run/macro-def-path-dependent-b.check1
-rw-r--r--test/files/run/macro-def-path-dependent-b.flags1
-rw-r--r--test/files/run/macro-def-path-dependent-b/Impls_Macros_1.scala20
-rw-r--r--test/files/run/macro-def-path-dependent-b/Test_2.scala3
-rw-r--r--test/files/run/macro-def-path-dependent-c.check1
-rw-r--r--test/files/run/macro-def-path-dependent-c.flags1
-rw-r--r--test/files/run/macro-def-path-dependent-c/Impls_Macros_1.scala20
-rw-r--r--test/files/run/macro-def-path-dependent-c/Test_2.scala3
-rw-r--r--test/files/run/macro-def-path-dependent-d.check1
-rw-r--r--test/files/run/macro-def-path-dependent-d.flags1
-rw-r--r--test/files/run/macro-def-path-dependent-d/Impls_Macros_1.scala8
-rw-r--r--test/files/run/macro-def-path-dependent-d/Test_2.scala3
-rw-r--r--test/files/run/macro-expand-implicit-macro-has-implicit.check1
-rw-r--r--test/files/run/macro-expand-implicit-macro-has-implicit.flags1
-rw-r--r--test/files/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala9
-rw-r--r--test/files/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala5
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-implicit.check2
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-implicit.flags1
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala9
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala10
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-val.check1
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-val.flags1
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-val/Impls_1.scala9
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-val/Macros_Test_2.scala5
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-view.check1
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-view.flags1
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-view/Impls_1.scala9
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala9
-rw-r--r--test/files/run/macro-expand-multiple-arglists.check1
-rw-r--r--test/files/run/macro-expand-multiple-arglists.flags1
-rw-r--r--test/files/run/macro-expand-multiple-arglists/Impls_1.scala10
-rw-r--r--test/files/run/macro-expand-multiple-arglists/Macros_Test_2.scala4
-rw-r--r--test/files/run/macro-expand-nullary-generic.check6
-rw-r--r--test/files/run/macro-expand-nullary-generic.flags1
-rw-r--r--test/files/run/macro-expand-nullary-generic/Impls_1.scala14
-rw-r--r--test/files/run/macro-expand-nullary-generic/Macros_Test_2.scala15
-rw-r--r--test/files/run/macro-expand-nullary-nongeneric.check6
-rw-r--r--test/files/run/macro-expand-nullary-nongeneric.flags1
-rw-r--r--test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala14
-rw-r--r--test/files/run/macro-expand-nullary-nongeneric/Macros_Test_2.scala15
-rw-r--r--test/files/run/macro-expand-overload.check6
-rw-r--r--test/files/run/macro-expand-overload.flags1
-rw-r--r--test/files/run/macro-expand-overload/Impls_1.scala15
-rw-r--r--test/files/run/macro-expand-overload/Macros_Test_2.scala20
-rw-r--r--test/files/run/macro-expand-override.check15
-rw-r--r--test/files/run/macro-expand-override.flags1
-rw-r--r--test/files/run/macro-expand-override/Impls_1.scala15
-rw-r--r--test/files/run/macro-expand-override/Macros_Test_2.scala43
-rw-r--r--test/files/run/macro-expand-recursive.check1
-rw-r--r--test/files/run/macro-expand-recursive.flags1
-rw-r--r--test/files/run/macro-expand-recursive/Impls_1.scala15
-rw-r--r--test/files/run/macro-expand-recursive/Macros_Test_2.scala8
-rw-r--r--test/files/run/macro-expand-tparams-bounds-a.check (renamed from test/pending/run/reify_classfileann_b.check)0
-rw-r--r--test/files/run/macro-expand-tparams-bounds-a.flags1
-rw-r--r--test/files/run/macro-expand-tparams-bounds-a/Impls_1.scala8
-rw-r--r--test/files/run/macro-expand-tparams-bounds-a/Macros_Test_2.scala8
-rw-r--r--test/files/run/macro-expand-tparams-bounds-b.check0
-rw-r--r--test/files/run/macro-expand-tparams-bounds-b.flags1
-rw-r--r--test/files/run/macro-expand-tparams-bounds-b/Impls_1.scala10
-rw-r--r--test/files/run/macro-expand-tparams-bounds-b/Macros_Test_2.scala10
-rw-r--r--test/files/run/macro-expand-tparams-explicit.check1
-rw-r--r--test/files/run/macro-expand-tparams-explicit.flags1
-rw-r--r--test/files/run/macro-expand-tparams-explicit/Impls_1.scala10
-rw-r--r--test/files/run/macro-expand-tparams-explicit/Macros_Test_2.scala4
-rw-r--r--test/files/run/macro-expand-tparams-implicit.check2
-rw-r--r--test/files/run/macro-expand-tparams-implicit.flags1
-rw-r--r--test/files/run/macro-expand-tparams-implicit/Impls_1.scala10
-rw-r--r--test/files/run/macro-expand-tparams-implicit/Macros_Test_2.scala5
-rw-r--r--test/files/run/macro-expand-tparams-only-in-impl.flags1
-rw-r--r--test/files/run/macro-expand-tparams-only-in-impl/Impls_1.scala8
-rw-r--r--test/files/run/macro-expand-tparams-only-in-impl/Macros_Test_2.scala8
-rw-r--r--test/files/run/macro-expand-tparams-optional.check1
-rw-r--r--test/files/run/macro-expand-tparams-optional.flags1
-rw-r--r--test/files/run/macro-expand-tparams-optional/Impls_1.scala9
-rw-r--r--test/files/run/macro-expand-tparams-optional/Macros_Test_2.scala4
-rw-r--r--test/files/run/macro-expand-tparams-prefix-a.check4
-rw-r--r--test/files/run/macro-expand-tparams-prefix-a.flags1
-rw-r--r--test/files/run/macro-expand-tparams-prefix-a/Impls_1.scala10
-rw-r--r--test/files/run/macro-expand-tparams-prefix-a/Macros_Test_2.scala10
-rw-r--r--test/files/run/macro-expand-tparams-prefix-b.check2
-rw-r--r--test/files/run/macro-expand-tparams-prefix-b.flags1
-rw-r--r--test/files/run/macro-expand-tparams-prefix-b/Impls_1.scala11
-rw-r--r--test/files/run/macro-expand-tparams-prefix-b/Macros_Test_2.scala10
-rw-r--r--test/files/run/macro-expand-tparams-prefix-c1.check3
-rw-r--r--test/files/run/macro-expand-tparams-prefix-c1.flags1
-rw-r--r--test/files/run/macro-expand-tparams-prefix-c1/Impls_1.scala12
-rw-r--r--test/files/run/macro-expand-tparams-prefix-c1/Macros_Test_2.scala11
-rw-r--r--test/files/run/macro-expand-tparams-prefix-c2.check3
-rw-r--r--test/files/run/macro-expand-tparams-prefix-c2.flags1
-rw-r--r--test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala18
-rw-r--r--test/files/run/macro-expand-tparams-prefix-c2/Test_2.scala5
-rw-r--r--test/files/run/macro-expand-tparams-prefix-d1.check3
-rw-r--r--test/files/run/macro-expand-tparams-prefix-d1.flags1
-rw-r--r--test/files/run/macro-expand-tparams-prefix-d1/Impls_1.scala12
-rw-r--r--test/files/run/macro-expand-tparams-prefix-d1/Macros_Test_2.scala11
-rw-r--r--test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad.check4
-rw-r--r--test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad.flags1
-rw-r--r--test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala9
-rw-r--r--test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala10
-rw-r--r--test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good.check1
-rw-r--r--test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good.flags1
-rw-r--r--test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala13
-rw-r--r--test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Macros_Test_2.scala8
-rw-r--r--test/files/run/macro-expand-varargs-explicit-over-varargs.check1
-rw-r--r--test/files/run/macro-expand-varargs-explicit-over-varargs.flags1
-rw-r--r--test/files/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala13
-rw-r--r--test/files/run/macro-expand-varargs-explicit-over-varargs/Macros_Test_2.scala8
-rw-r--r--test/files/run/macro-expand-varargs-implicit-over-nonvarargs.check1
-rw-r--r--test/files/run/macro-expand-varargs-implicit-over-nonvarargs.flags1
-rw-r--r--test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala9
-rw-r--r--test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Macros_Test_2.scala7
-rw-r--r--test/files/run/macro-expand-varargs-implicit-over-varargs.check1
-rw-r--r--test/files/run/macro-expand-varargs-implicit-over-varargs.flags1
-rw-r--r--test/files/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala13
-rw-r--r--test/files/run/macro-expand-varargs-implicit-over-varargs/Macros_Test_2.scala7
-rw-r--r--test/files/run/macro-impl-default-params.check5
-rw-r--r--test/files/run/macro-impl-default-params.flags1
-rw-r--r--test/files/run/macro-impl-default-params/Impls_Macros_1.scala20
-rw-r--r--test/files/run/macro-impl-default-params/Test_2.scala4
-rw-r--r--test/files/run/macro-impl-rename-context.check2
-rw-r--r--test/files/run/macro-impl-rename-context.flags1
-rw-r--r--test/files/run/macro-impl-rename-context/Impls_Macros_1.scala15
-rw-r--r--test/files/run/macro-impl-rename-context/Test_2.scala4
-rw-r--r--test/files/run/macro-invalidret-doesnt-conform-to-def-rettype.check5
-rw-r--r--test/files/run/macro-invalidret-doesnt-conform-to-def-rettype.flags1
-rw-r--r--test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala12
-rw-r--r--test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala6
-rw-r--r--test/files/run/macro-invalidret-doesnt-conform-to-impl-rettype.check0
-rw-r--r--test/files/run/macro-invalidret-doesnt-conform-to-impl-rettype.flags1
-rw-r--r--test/files/run/macro-invalidret-nontypeable.check3
-rw-r--r--test/files/run/macro-invalidret-nontypeable.flags1
-rw-r--r--test/files/run/macro-invalidret-nontypeable/Impls_Macros_1.scala13
-rw-r--r--test/files/run/macro-invalidret-nontypeable/Test_2.scala6
-rw-r--r--test/files/run/macro-invalidusage-badret.check5
-rw-r--r--test/files/run/macro-invalidusage-badret.flags1
-rw-r--r--test/files/run/macro-invalidusage-badret/Impls_Macros_1.scala9
-rw-r--r--test/files/run/macro-invalidusage-badret/Test_2.scala6
-rw-r--r--test/files/run/macro-invalidusage-partialapplication.check3
-rw-r--r--test/files/run/macro-invalidusage-partialapplication.flags1
-rw-r--r--test/files/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala14
-rw-r--r--test/files/run/macro-invalidusage-partialapplication/Test_2.scala6
-rw-r--r--test/files/run/macro-openmacros.check3
-rw-r--r--test/files/run/macro-openmacros.flags1
-rw-r--r--test/files/run/macro-openmacros/Impls_Macros_1.scala26
-rw-r--r--test/files/run/macro-openmacros/Test_2.scala3
-rw-r--r--test/files/run/macro-quasiinvalidbody-c.check1
-rw-r--r--test/files/run/macro-quasiinvalidbody-c.flags1
-rw-r--r--test/files/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala9
-rw-r--r--test/files/run/macro-quasiinvalidbody-c/Test_2.scala4
-rw-r--r--test/files/run/macro-range.flags2
-rw-r--r--test/files/run/macro-range/Common_1.scala48
-rw-r--r--test/files/run/macro-range/Expansion_Impossible_2.scala53
-rw-r--r--test/files/run/macro-range/Expansion_Possible_3.scala7
-rw-r--r--test/files/run/macro-range/macro_range_1.scala99
-rw-r--r--test/files/run/macro-range/macro_range_2.scala99
-rw-r--r--test/files/run/macro-reflective-ma-normal-mdmi.check1
-rw-r--r--test/files/run/macro-reflective-ma-normal-mdmi.flags1
-rw-r--r--test/files/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala13
-rw-r--r--test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala5
-rw-r--r--test/files/run/macro-reflective-mamd-normal-mi.check1
-rw-r--r--test/files/run/macro-reflective-mamd-normal-mi/Impls_1.scala9
-rw-r--r--test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala17
-rw-r--r--test/files/run/macro-reify-basic.check1
-rw-r--r--test/files/run/macro-reify-basic.flags1
-rw-r--r--test/files/run/macro-reify-basic/Macros_1.scala11
-rw-r--r--test/files/run/macro-reify-basic/Test_2.scala3
-rw-r--r--test/files/run/macro-reify-eval-eval.check1
-rw-r--r--test/files/run/macro-reify-eval-eval.flags1
-rw-r--r--test/files/run/macro-reify-eval-eval/Macros_1.scala12
-rw-r--r--test/files/run/macro-reify-eval-eval/Test_2.scala3
-rw-r--r--test/files/run/macro-reify-eval-outside-reify.check1
-rw-r--r--test/files/run/macro-reify-eval-outside-reify.flags1
-rw-r--r--test/files/run/macro-reify-eval-outside-reify/Impls_Macros_1.scala9
-rw-r--r--test/files/run/macro-reify-eval-outside-reify/Test_2.scala5
-rw-r--r--test/files/run/macro-reify-freevars.check3
-rw-r--r--test/files/run/macro-reify-freevars.flags1
-rw-r--r--test/files/run/macro-reify-freevars/Macros_1.scala19
-rw-r--r--test/files/run/macro-reify-freevars/Test_2.scala9
-rw-r--r--test/files/run/macro-reify-groundtypetag-notypeparams.check2
-rw-r--r--test/files/run/macro-reify-groundtypetag-notypeparams/Test.scala6
-rw-r--r--test/files/run/macro-reify-groundtypetag-typeparams-tags.check2
-rw-r--r--test/files/run/macro-reify-groundtypetag-typeparams-tags/Test.scala9
-rw-r--r--test/files/run/macro-reify-nested-a.check0
-rw-r--r--test/files/run/macro-reify-nested-a.flags1
-rw-r--r--test/files/run/macro-reify-nested-a/Impls_Macros_1.scala43
-rw-r--r--test/files/run/macro-reify-nested-a/Test_2.scala4
-rw-r--r--test/files/run/macro-reify-nested-b.check0
-rw-r--r--test/files/run/macro-reify-nested-b.flags1
-rw-r--r--test/files/run/macro-reify-nested-b/Impls_Macros_1.scala43
-rw-r--r--test/files/run/macro-reify-nested-b/Test_2.scala4
-rw-r--r--test/files/run/macro-reify-ref-to-packageless.check1
-rw-r--r--test/files/run/macro-reify-ref-to-packageless.flags1
-rw-r--r--test/files/run/macro-reify-ref-to-packageless/Impls_1.scala6
-rw-r--r--test/files/run/macro-reify-ref-to-packageless/Test_2.scala4
-rw-r--r--test/files/run/macro-reify-tagful-a.check1
-rw-r--r--test/files/run/macro-reify-tagful-a.flags1
-rw-r--r--test/files/run/macro-reify-tagful-a/Macros_1.scala11
-rw-r--r--test/files/run/macro-reify-tagful-a/Test_2.scala4
-rw-r--r--test/files/run/macro-reify-tagless-a.check3
-rw-r--r--test/files/run/macro-reify-tagless-a.flags1
-rw-r--r--test/files/run/macro-reify-tagless-a/Impls_Macros_1.scala11
-rw-r--r--test/files/run/macro-reify-tagless-a/Test_2.scala12
-rw-r--r--test/files/run/macro-reify-typetag-notypeparams.check2
-rw-r--r--test/files/run/macro-reify-typetag-notypeparams/Test.scala6
-rw-r--r--test/files/run/macro-reify-typetag-typeparams-notags.check2
-rw-r--r--test/files/run/macro-reify-typetag-typeparams-notags/Test.scala9
-rw-r--r--test/files/run/macro-reify-typetag-typeparams-tags.check2
-rw-r--r--test/files/run/macro-reify-typetag-typeparams-tags/Test.scala9
-rw-r--r--test/files/run/macro-reify-typetag-usegroundtypetag.check2
-rw-r--r--test/files/run/macro-reify-typetag-usegroundtypetag/Test.scala9
-rw-r--r--test/files/run/macro-reify-unreify.check1
-rw-r--r--test/files/run/macro-reify-unreify.flags1
-rw-r--r--test/files/run/macro-reify-unreify/Macros_1.scala19
-rw-r--r--test/files/run/macro-reify-unreify/Test_2.scala3
-rw-r--r--test/files/run/macro-reify-value-outside-reify.check1
-rw-r--r--test/files/run/macro-reify-value-outside-reify.flags1
-rw-r--r--test/files/run/macro-reify-value-outside-reify/Impls_Macros_1.scala9
-rw-r--r--test/files/run/macro-reify-value-outside-reify/Test_2.scala6
-rw-r--r--test/files/run/macro-repl-basic.check79
-rw-r--r--test/files/run/macro-repl-basic.scala31
-rw-r--r--test/files/run/macro-repl-dontexpand.check5
-rw-r--r--test/files/run/macro-repl-dontexpand.scala7
-rw-r--r--test/files/run/macro-rettype-mismatch.flags2
-rw-r--r--test/files/run/macro-rettype-mismatch/Macros_1.scala3
-rw-r--r--test/files/run/macro-rettype-mismatch/Test_2.scala16
-rw-r--r--test/files/run/macro-settings.check1
-rw-r--r--test/files/run/macro-settings.flags1
-rw-r--r--test/files/run/macro-settings/Impls_Macros_1.scala11
-rw-r--r--test/files/run/macro-settings/Test_2.scala3
-rw-r--r--test/files/run/macro-sip19-revised.check5
-rw-r--r--test/files/run/macro-sip19-revised.flags1
-rw-r--r--test/files/run/macro-sip19-revised/Impls_Macros_1.scala34
-rw-r--r--test/files/run/macro-sip19-revised/Test_2.scala12
-rw-r--r--test/files/run/macro-sip19.check5
-rw-r--r--test/files/run/macro-sip19.flags1
-rw-r--r--test/files/run/macro-sip19/Impls_Macros_1.scala25
-rw-r--r--test/files/run/macro-sip19/Test_2.scala16
-rw-r--r--test/files/run/macro-typecheck-implicitsdisabled.check2
-rw-r--r--test/files/run/macro-typecheck-implicitsdisabled.flags1
-rw-r--r--test/files/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala28
-rw-r--r--test/files/run/macro-typecheck-implicitsdisabled/Test_2.scala4
-rw-r--r--test/files/run/macro-typecheck-macrosdisabled.check5
-rw-r--r--test/files/run/macro-typecheck-macrosdisabled.flags1
-rw-r--r--test/files/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala36
-rw-r--r--test/files/run/macro-typecheck-macrosdisabled/Test_2.scala4
-rw-r--r--test/files/run/macro-undetparams-consfromsls.check5
-rw-r--r--test/files/run/macro-undetparams-consfromsls.flags1
-rw-r--r--test/files/run/macro-undetparams-consfromsls/Impls_Macros_1.scala17
-rw-r--r--test/files/run/macro-undetparams-consfromsls/Test_2.scala7
-rw-r--r--test/files/run/macro-undetparams-implicitval.check1
-rw-r--r--test/files/run/macro-undetparams-implicitval.flags1
-rw-r--r--test/files/run/macro-undetparams-implicitval/Test.scala4
-rw-r--r--test/files/run/macro-undetparams-macroitself.check2
-rw-r--r--test/files/run/macro-undetparams-macroitself.flags1
-rw-r--r--test/files/run/macro-undetparams-macroitself/Impls_Macros_1.scala7
-rw-r--r--test/files/run/macro-undetparams-macroitself/Test_2.scala4
-rw-r--r--test/files/run/manifests.scala71
-rw-r--r--test/files/run/patmat_unapp_abstype.check2
-rw-r--r--test/files/run/patmat_unapp_abstype.flags1
-rw-r--r--test/files/run/patmat_unapp_abstype.scala54
-rw-r--r--test/files/run/primitive-sigs-2.check14
-rw-r--r--test/files/run/reify_ann1a.check60
-rw-r--r--test/files/run/reify_ann1a.scala11
-rw-r--r--test/files/run/reify_ann1b.check60
-rw-r--r--test/files/run/reify_ann1b.scala11
-rw-r--r--test/files/run/reify_ann2a.check44
-rw-r--r--test/files/run/reify_ann2a.scala (renamed from test/files/neg/reify_ann2a.scala)11
-rw-r--r--test/files/run/reify_ann3.check21
-rw-r--r--test/files/run/reify_ann3.scala19
-rw-r--r--test/files/run/reify_ann4.check32
-rw-r--r--test/files/run/reify_ann4.scala23
-rw-r--r--test/files/run/reify_ann5.check22
-rw-r--r--test/files/run/reify_ann5.scala20
-rw-r--r--test/files/run/reify_anonymous.scala12
-rw-r--r--test/files/run/reify_classfileann_a.check36
-rw-r--r--test/files/run/reify_classfileann_a.scala11
-rw-r--r--test/files/run/reify_classfileann_b.check20
-rw-r--r--test/files/run/reify_classfileann_b.scala (renamed from test/pending/run/reify_classfileann_b.scala)17
-rw-r--r--test/files/run/reify_closure1.scala9
-rw-r--r--test/files/run/reify_closure2a.scala9
-rw-r--r--test/files/run/reify_closure3a.scala9
-rw-r--r--test/files/run/reify_closure4a.scala9
-rw-r--r--test/files/run/reify_closure5a.scala17
-rw-r--r--test/files/run/reify_closure6.scala17
-rw-r--r--test/files/run/reify_closure7.scala17
-rw-r--r--test/files/run/reify_closure8a.scala10
-rw-r--r--test/files/run/reify_closure8b.check3
-rw-r--r--test/files/run/reify_closure8b.scala18
-rw-r--r--test/files/run/reify_closures10.scala10
-rw-r--r--test/files/run/reify_complex.scala12
-rw-r--r--test/files/run/reify_extendbuiltins.scala12
-rw-r--r--test/files/run/reify_for1.scala12
-rw-r--r--test/files/run/reify_fors.flags1
-rw-r--r--test/files/run/reify_fors.scala12
-rw-r--r--test/files/run/reify_generic.scala12
-rw-r--r--test/files/run/reify_generic2.scala12
-rw-r--r--test/files/run/reify_getter.scala11
-rw-r--r--test/files/run/reify_implicits.scala12
-rw-r--r--test/files/run/reify_inheritance.scala12
-rw-r--r--test/files/run/reify_inner1.scala12
-rw-r--r--test/files/run/reify_inner2.scala12
-rw-r--r--test/files/run/reify_inner3.scala12
-rw-r--r--test/files/run/reify_inner4.scala12
-rw-r--r--test/files/run/reify_maps.flags1
-rw-r--r--test/files/run/reify_maps.scala12
-rw-r--r--test/files/run/reify_metalevel_breach_+0_refers_to_1.check1
-rw-r--r--test/files/run/reify_metalevel_breach_+0_refers_to_1.scala13
-rw-r--r--test/files/run/reify_metalevel_breach_-1_refers_to_0_a.check1
-rw-r--r--test/files/run/reify_metalevel_breach_-1_refers_to_0_a.scala11
-rw-r--r--test/files/run/reify_metalevel_breach_-1_refers_to_0_b.check1
-rw-r--r--test/files/run/reify_metalevel_breach_-1_refers_to_0_b.scala15
-rw-r--r--test/files/run/reify_metalevel_breach_-1_refers_to_1.check1
-rw-r--r--test/files/run/reify_metalevel_breach_-1_refers_to_1.scala13
-rw-r--r--test/files/run/reify_nested_inner_refers_to_global.check1
-rw-r--r--test/files/run/reify_nested_inner_refers_to_global.scala14
-rw-r--r--test/files/run/reify_nested_inner_refers_to_local.check1
-rw-r--r--test/files/run/reify_nested_inner_refers_to_local.scala12
-rw-r--r--test/files/run/reify_nested_outer_refers_to_global.check1
-rw-r--r--test/files/run/reify_nested_outer_refers_to_global.scala16
-rw-r--r--test/files/run/reify_nested_outer_refers_to_local.check1
-rw-r--r--test/files/run/reify_nested_outer_refers_to_local.scala16
-rw-r--r--test/files/run/reify_newimpl_01.check1
-rw-r--r--test/files/run/reify_newimpl_01.scala11
-rw-r--r--test/files/run/reify_newimpl_02.check1
-rw-r--r--test/files/run/reify_newimpl_02.scala11
-rw-r--r--test/files/run/reify_newimpl_03.check1
-rw-r--r--test/files/run/reify_newimpl_03.scala11
-rw-r--r--test/files/run/reify_newimpl_04.check1
-rw-r--r--test/files/run/reify_newimpl_04.scala11
-rw-r--r--test/files/run/reify_newimpl_05.check1
-rw-r--r--test/files/run/reify_newimpl_05.scala12
-rw-r--r--test/files/run/reify_newimpl_06.check1
-rw-r--r--test/files/run/reify_newimpl_06.scala11
-rw-r--r--test/files/run/reify_newimpl_09.check1
-rw-r--r--test/files/run/reify_newimpl_09.scala11
-rw-r--r--test/files/run/reify_newimpl_10.check1
-rw-r--r--test/files/run/reify_newimpl_10.scala12
-rw-r--r--test/files/run/reify_newimpl_11.check2
-rw-r--r--test/files/run/reify_newimpl_11.scala17
-rw-r--r--test/files/run/reify_newimpl_12.check1
-rw-r--r--test/files/run/reify_newimpl_12.scala12
-rw-r--r--test/files/run/reify_newimpl_13.check2
-rw-r--r--test/files/run/reify_newimpl_13.scala19
-rw-r--r--test/files/run/reify_newimpl_14.check1
-rw-r--r--test/files/run/reify_newimpl_14.scala14
-rw-r--r--test/files/run/reify_newimpl_15.check1
-rw-r--r--test/files/run/reify_newimpl_15.scala13
-rw-r--r--test/files/run/reify_newimpl_16.check1
-rw-r--r--test/files/run/reify_newimpl_16.scala15
-rw-r--r--test/files/run/reify_newimpl_17.check2
-rw-r--r--test/files/run/reify_newimpl_17.scala18
-rw-r--r--test/files/run/reify_newimpl_18.check1
-rw-r--r--test/files/run/reify_newimpl_18.scala13
-rw-r--r--test/files/run/reify_newimpl_19.check2
-rw-r--r--test/files/run/reify_newimpl_19.scala18
-rw-r--r--test/files/run/reify_newimpl_20.check1
-rw-r--r--test/files/run/reify_newimpl_20.scala14
-rw-r--r--test/files/run/reify_newimpl_21.check1
-rw-r--r--test/files/run/reify_newimpl_21.scala18
-rw-r--r--test/files/run/reify_newimpl_22.check23
-rw-r--r--test/files/run/reify_newimpl_22.scala15
-rw-r--r--test/files/run/reify_newimpl_23.check22
-rw-r--r--test/files/run/reify_newimpl_23.scala14
-rw-r--r--test/files/run/reify_newimpl_24.check24
-rw-r--r--test/files/run/reify_newimpl_24.scala16
-rw-r--r--test/files/run/reify_newimpl_25.check21
-rw-r--r--test/files/run/reify_newimpl_25.scala13
-rw-r--r--test/files/run/reify_newimpl_26.check23
-rw-r--r--test/files/run/reify_newimpl_26.scala13
-rw-r--r--test/files/run/reify_newimpl_27.check1
-rw-r--r--test/files/run/reify_newimpl_27.scala13
-rw-r--r--test/files/run/reify_newimpl_28.check1
-rw-r--r--test/files/run/reify_newimpl_28.scala15
-rw-r--r--test/files/run/reify_newimpl_29.check1
-rw-r--r--test/files/run/reify_newimpl_29.scala13
-rw-r--r--test/files/run/reify_newimpl_30.check1
-rw-r--r--test/files/run/reify_newimpl_30.scala15
-rw-r--r--test/files/run/reify_newimpl_31.check1
-rw-r--r--test/files/run/reify_newimpl_31.scala13
-rw-r--r--test/files/run/reify_newimpl_32.check1
-rw-r--r--test/files/run/reify_newimpl_32.scala15
-rw-r--r--test/files/run/reify_newimpl_33.check1
-rw-r--r--test/files/run/reify_newimpl_33.scala14
-rw-r--r--test/files/run/reify_newimpl_34.check1
-rw-r--r--test/files/run/reify_newimpl_34.scala16
-rw-r--r--test/files/run/reify_newimpl_36.check1
-rw-r--r--test/files/run/reify_newimpl_36.scala14
-rw-r--r--test/files/run/reify_newimpl_37.check1
-rw-r--r--test/files/run/reify_newimpl_37.scala15
-rw-r--r--test/files/run/reify_newimpl_38.check1
-rw-r--r--test/files/run/reify_newimpl_38.scala14
-rw-r--r--test/files/run/reify_newimpl_39.check1
-rw-r--r--test/files/run/reify_newimpl_39.scala15
-rw-r--r--test/files/run/reify_newimpl_40.check1
-rw-r--r--test/files/run/reify_newimpl_40.scala15
-rw-r--r--test/files/run/reify_newimpl_41.check3
-rw-r--r--test/files/run/reify_newimpl_41.scala17
-rw-r--r--test/files/run/reify_newimpl_42.check3
-rw-r--r--test/files/run/reify_newimpl_42.scala16
-rw-r--r--test/files/run/reify_newimpl_43.check2
-rw-r--r--test/files/run/reify_newimpl_43.scala15
-rw-r--r--test/files/run/reify_newimpl_44.check2
-rw-r--r--test/files/run/reify_newimpl_44.scala15
-rw-r--r--test/files/run/reify_newimpl_45.check2
-rw-r--r--test/files/run/reify_newimpl_45.scala12
-rw-r--r--test/files/run/reify_newimpl_47.check1
-rw-r--r--test/files/run/reify_newimpl_47.scala15
-rw-r--r--test/files/run/reify_newimpl_48.check1
-rw-r--r--test/files/run/reify_newimpl_48.scala20
-rw-r--r--test/files/run/reify_newimpl_49.check3
-rw-r--r--test/files/run/reify_newimpl_49.scala15
-rw-r--r--test/files/run/reify_newimpl_50.check3
-rw-r--r--test/files/run/reify_newimpl_50.scala14
-rw-r--r--test/files/run/reify_newimpl_51.check3
-rw-r--r--test/files/run/reify_newimpl_51.scala17
-rw-r--r--test/files/run/reify_newimpl_52.check3
-rw-r--r--test/files/run/reify_newimpl_52.scala17
-rw-r--r--test/files/run/reify_printf.scala11
-rw-r--r--test/files/run/reify_sort.scala12
-rw-r--r--test/files/run/reify_sort1.scala12
-rw-r--r--test/files/run/reify_this.scala25
-rw-r--r--test/files/run/reify_timeofday.scala12
-rw-r--r--test/files/run/reify_typerefs_1a.check1
-rw-r--r--test/files/run/reify_typerefs_1a.scala15
-rw-r--r--test/files/run/reify_typerefs_1b.check1
-rw-r--r--test/files/run/reify_typerefs_1b.scala15
-rw-r--r--test/files/run/reify_typerefs_2a.check1
-rw-r--r--test/files/run/reify_typerefs_2a.scala17
-rw-r--r--test/files/run/reify_typerefs_2b.check1
-rw-r--r--test/files/run/reify_typerefs_2b.scala17
-rw-r--r--test/files/run/reify_typerefs_3a.check1
-rw-r--r--test/files/run/reify_typerefs_3a.scala17
-rw-r--r--test/files/run/reify_typerefs_3b.check1
-rw-r--r--test/files/run/reify_typerefs_3b.scala17
-rw-r--r--test/files/run/reify_varargs.scala12
-rw-r--r--test/files/run/repl-parens.check2
-rw-r--r--test/files/run/repl-parens.scala4
-rw-r--r--test/files/run/repl-power.check1
-rw-r--r--test/files/run/repl-suppressed-warnings.scala1
-rw-r--r--test/files/run/t1195.check12
-rw-r--r--test/files/run/t1195.scala4
-rw-r--r--test/files/run/t2886.check10
-rw-r--r--test/files/run/t2886.scala9
-rw-r--r--test/files/run/t3507.check1
-rw-r--r--test/files/run/t3507.scala (renamed from test/files/neg/t3507.scala)6
-rw-r--r--test/files/run/t3758.check6
-rw-r--r--test/files/run/t3758.scala12
-rw-r--r--test/files/run/t3835.scala9
-rw-r--r--test/files/run/t4110.check4
-rw-r--r--test/files/run/t4172.check2
-rw-r--r--test/files/run/t4317/S_1.scala2
-rw-r--r--test/files/run/t4710.check1
-rw-r--r--test/files/run/t5224.check18
-rw-r--r--test/files/run/t5224.scala5
-rw-r--r--test/files/run/t5225_1.check8
-rw-r--r--test/files/run/t5225_1.scala5
-rw-r--r--test/files/run/t5225_2.check8
-rw-r--r--test/files/run/t5225_2.scala5
-rw-r--r--test/files/run/t5229_1.scala12
-rw-r--r--test/files/run/t5229_2.scala9
-rw-r--r--test/files/run/t5230.scala9
-rw-r--r--test/files/run/t5258a.scala13
-rw-r--r--test/files/run/t5266_1.scala9
-rw-r--r--test/files/run/t5266_2.scala9
-rw-r--r--test/files/run/t5269.scala12
-rw-r--r--test/files/run/t5270.scala12
-rw-r--r--test/files/run/t5271_1.check22
-rw-r--r--test/files/run/t5271_1.scala9
-rw-r--r--test/files/run/t5271_2.check24
-rw-r--r--test/files/run/t5271_2.scala9
-rw-r--r--test/files/run/t5271_3.check38
-rw-r--r--test/files/run/t5271_3.scala9
-rw-r--r--test/files/run/t5271_4.scala12
-rw-r--r--test/files/run/t5272_1.scala12
-rw-r--r--test/files/run/t5272_2.scala12
-rw-r--r--test/files/run/t5273_1.flags1
-rw-r--r--test/files/run/t5273_1.scala12
-rw-r--r--test/files/run/t5273_2a.flags1
-rw-r--r--test/files/run/t5273_2a.scala12
-rw-r--r--test/files/run/t5273_2b.flags1
-rw-r--r--test/files/run/t5273_2b.scala12
-rw-r--r--test/files/run/t5274_1.scala12
-rw-r--r--test/files/run/t5274_2.scala12
-rw-r--r--test/files/run/t5275.scala12
-rw-r--r--test/files/run/t5276_1a.scala12
-rw-r--r--test/files/run/t5276_1b.scala12
-rw-r--r--test/files/run/t5276_2a.scala12
-rw-r--r--test/files/run/t5276_2b.scala12
-rw-r--r--test/files/run/t5277_1.scala12
-rw-r--r--test/files/run/t5277_2.scala12
-rw-r--r--test/files/run/t5279.scala12
-rw-r--r--test/files/run/t5334_1.scala12
-rw-r--r--test/files/run/t5334_2.scala12
-rw-r--r--test/files/run/t5335.scala12
-rw-r--r--test/files/run/t5415.scala10
-rw-r--r--test/files/run/t5419.check2
-rw-r--r--test/files/run/t5419.scala5
-rw-r--r--test/files/run/t5423.scala3
-rw-r--r--test/files/run/t5535.check20
-rw-r--r--test/files/run/t5535.scala10
-rw-r--r--test/files/run/t5583.check20
-rw-r--r--test/files/run/t5583.scala11
-rw-r--r--test/files/run/toolbox_console_reporter.check0
-rw-r--r--test/files/run/toolbox_console_reporter.scala16
-rw-r--r--test/files/run/toolbox_default_reporter_is_silent.check1
-rw-r--r--test/files/run/toolbox_default_reporter_is_silent.scala13
-rw-r--r--test/files/run/toolbox_silent_reporter.check4
-rw-r--r--test/files/run/toolbox_silent_reporter.scala16
-rw-r--r--test/files/run/toolbox_typecheck_implicitsdisabled.check5
-rw-r--r--test/files/run/toolbox_typecheck_implicitsdisabled.scala24
-rw-r--r--test/files/run/toolbox_typecheck_macrosdisabled.check5
-rw-r--r--test/files/run/toolbox_typecheck_macrosdisabled.scala17
-rw-r--r--test/files/run/treePrint.scala11
-rw-r--r--test/files/run/typetags_core.check30
-rw-r--r--test/files/run/typetags_core.scala32
-rw-r--r--test/files/run/virtpatmat_alts.flags2
-rw-r--r--test/files/run/virtpatmat_apply.flags2
-rw-r--r--test/files/run/virtpatmat_casting.flags2
-rw-r--r--test/files/run/virtpatmat_extends_product.flags2
-rw-r--r--test/files/run/virtpatmat_literal.flags2
-rw-r--r--test/files/run/virtpatmat_nested_lists.flags2
-rw-r--r--test/files/run/virtpatmat_npe.flags2
-rw-r--r--test/files/run/virtpatmat_opt_sharing.flags2
-rw-r--r--test/files/run/virtpatmat_partial.flags2
-rw-r--r--test/files/run/virtpatmat_staging.flags2
-rw-r--r--test/files/run/virtpatmat_stringinterp.check1
-rw-r--r--test/files/run/virtpatmat_stringinterp.flags1
-rw-r--r--test/files/run/virtpatmat_stringinterp.scala13
-rw-r--r--test/files/run/virtpatmat_switch.flags2
-rw-r--r--test/files/run/virtpatmat_tailcalls_verifyerror.flags2
-rw-r--r--test/files/run/virtpatmat_try.flags2
-rw-r--r--test/files/run/virtpatmat_typed.flags2
-rw-r--r--test/files/run/virtpatmat_unapply.flags2
-rw-r--r--test/files/run/virtpatmat_unapplyprod.flags2
-rw-r--r--test/files/run/virtpatmat_unapplyseq.flags2
-rw-r--r--test/files/specialized/spec-patmatch.check2
-rw-r--r--test/pending/neg/reify_packed.check4
-rw-r--r--test/pending/neg/reify_packed.scala10
-rw-r--r--test/pending/run/macro-expand-default.flags (renamed from test/files/pos/macros.flags)0
-rw-r--r--test/pending/run/macro-expand-default/Impls_1.scala10
-rw-r--r--test/pending/run/macro-expand-default/Macros_Test_2.scala8
-rw-r--r--test/pending/run/macro-expand-implicit-macro-has-context-bound.check1
-rw-r--r--test/pending/run/macro-expand-implicit-macro-has-context-bound.flags (renamed from test/pending/run/macro-overload.flags)0
-rw-r--r--test/pending/run/macro-expand-implicit-macro-has-context-bound/Impls_1.scala10
-rw-r--r--test/pending/run/macro-expand-implicit-macro-has-context-bound/Macros_Test_2.scala4
-rw-r--r--test/pending/run/macro-expand-named.flags1
-rw-r--r--test/pending/run/macro-expand-named/Impls_1.scala10
-rw-r--r--test/pending/run/macro-expand-named/Macros_Test_2.scala5
-rw-r--r--test/pending/run/macro-expand-tparams-prefix-e1.check3
-rw-r--r--test/pending/run/macro-expand-tparams-prefix-e1.flags1
-rw-r--r--test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala12
-rw-r--r--test/pending/run/macro-expand-tparams-prefix-e1/Macros_Test_2.scala13
-rw-r--r--test/pending/run/macro-expand-tparams-prefix-f1.check3
-rw-r--r--test/pending/run/macro-expand-tparams-prefix-f1.flags1
-rw-r--r--test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala12
-rw-r--r--test/pending/run/macro-expand-tparams-prefix-f1/Macros_Test_2.scala13
-rw-r--r--test/pending/run/macro-overload.check4
-rw-r--r--test/pending/run/macro-overload/Macros_1.scala9
-rw-r--r--test/pending/run/macro-overload/Test_2.scala6
-rw-r--r--test/pending/run/macro-quasiinvalidbody-a.check1
-rw-r--r--test/pending/run/macro-quasiinvalidbody-a.flags1
-rw-r--r--test/pending/run/macro-quasiinvalidbody-a/Impls_1.scala5
-rw-r--r--test/pending/run/macro-quasiinvalidbody-a/Macros_Test_2.scala10
-rw-r--r--test/pending/run/macro-quasiinvalidbody-b.check1
-rw-r--r--test/pending/run/macro-quasiinvalidbody-b.flags1
-rw-r--r--test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala7
-rw-r--r--test/pending/run/macro-quasiinvalidbody-b/Macros_Test_2.scala10
-rw-r--r--test/pending/run/macro-reify-array.flags1
-rw-r--r--test/pending/run/macro-reify-array/Macros_1.scala11
-rw-r--r--test/pending/run/macro-reify-array/Test_2.scala4
-rw-r--r--test/pending/run/macro-reify-eval-vs-value.flags1
-rw-r--r--test/pending/run/macro-reify-eval-vs-value/Macros_1.scala25
-rw-r--r--test/pending/run/macro-reify-eval-vs-value/Test_2.scala5
-rw-r--r--test/pending/run/macro-reify-groundtypetag-hktypeparams-tags.check2
-rw-r--r--test/pending/run/macro-reify-groundtypetag-hktypeparams-tags/Test.scala9
-rw-r--r--test/pending/run/macro-reify-tagful-b.check1
-rw-r--r--test/pending/run/macro-reify-tagful-b.flags1
-rw-r--r--test/pending/run/macro-reify-tagful-b/Macros_1.scala11
-rw-r--r--test/pending/run/macro-reify-tagful-b/Test_2.scala4
-rw-r--r--test/pending/run/macro-reify-tagless-b.check3
-rw-r--r--test/pending/run/macro-reify-tagless-b.flags1
-rw-r--r--test/pending/run/macro-reify-tagless-b/Impls_Macros_1.scala11
-rw-r--r--test/pending/run/macro-reify-tagless-b/Test_2.scala11
-rw-r--r--test/pending/run/macro-reify-typetag-hktypeparams-notags.check2
-rw-r--r--test/pending/run/macro-reify-typetag-hktypeparams-notags/Test.scala9
-rw-r--r--test/pending/run/macro-reify-typetag-hktypeparams-tags.check2
-rw-r--r--test/pending/run/macro-reify-typetag-hktypeparams-tags/Test.scala9
-rw-r--r--test/pending/run/reify_addressbook.scala12
-rw-r--r--test/pending/run/reify_brainf_ck.scala12
-rw-r--r--test/pending/run/reify_callccinterpreter.scala12
-rw-r--r--test/pending/run/reify_closure2b.scala9
-rw-r--r--test/pending/run/reify_closure3b.scala9
-rw-r--r--test/pending/run/reify_closure4b.scala9
-rw-r--r--test/pending/run/reify_closure5b.scala9
-rw-r--r--test/pending/run/reify_closure8b.check1
-rw-r--r--test/pending/run/reify_closure8b.scala16
-rw-r--r--test/pending/run/reify_closure9a.scala11
-rw-r--r--test/pending/run/reify_closure9b.scala11
-rw-r--r--test/pending/run/reify_closures11.scala11
-rw-r--r--test/pending/run/reify_csv.scala12
-rw-r--r--test/pending/run/reify_gadts.scala12
-rw-r--r--test/pending/run/reify_lazyevaluation.scala12
-rw-r--r--test/pending/run/reify_newimpl_07.scala13
-rw-r--r--test/pending/run/reify_newimpl_08.scala15
-rw-r--r--test/pending/run/reify_newimpl_35.scala10
-rw-r--r--test/pending/run/reify_newimpl_46.scala12
-rw-r--r--test/pending/run/reify_newimpl_53.scala15
-rw-r--r--test/pending/run/reify_properties.scala12
-rw-r--r--test/pending/run/reify_simpleinterpreter.scala12
-rw-r--r--test/pending/run/t5258a.check (renamed from test/files/run/t5258a.check)0
-rw-r--r--test/pending/run/t5258a.scala5
-rw-r--r--test/pending/run/t5258b.scala12
-rw-r--r--test/pending/run/t5258c.scala12
-rw-r--r--test/pending/run/t5271_1.scala12
-rw-r--r--test/pending/run/t5271_2.scala12
-rw-r--r--test/pending/run/t5271_3.scala12
-rw-r--r--test/pending/run/t5418.scala12
-rw-r--r--test/scaladoc/resources/implicits-base-res.scala147
-rw-r--r--test/scaladoc/resources/implicits-chaining-res.scala50
-rw-r--r--test/scaladoc/resources/implicits-elimination-res.scala14
-rw-r--r--test/scaladoc/resources/implicits-scopes-res.scala52
-rw-r--r--test/scaladoc/resources/implicits-shadowing-res.scala64
-rw-r--r--test/scaladoc/run/SI-5373.check2
-rw-r--r--test/scaladoc/run/SI-5373.scala6
-rw-r--r--test/scaladoc/run/implicits-base.check1
-rw-r--r--test/scaladoc/run/implicits-base.scala180
-rw-r--r--test/scaladoc/run/implicits-chaining.check1
-rw-r--r--test/scaladoc/run/implicits-chaining.scala65
-rw-r--r--test/scaladoc/run/implicits-elimination.check1
-rw-r--r--test/scaladoc/run/implicits-elimination.scala23
-rw-r--r--test/scaladoc/run/implicits-scopes.check1
-rw-r--r--test/scaladoc/run/implicits-scopes.scala77
-rw-r--r--test/scaladoc/run/implicits-shadowing.check1
-rw-r--r--test/scaladoc/run/implicits-shadowing.scala70
-rw-r--r--test/scaladoc/scalacheck/CommentFactoryTest.scala5
1029 files changed, 7816 insertions, 1873 deletions
diff --git a/test/files/jvm/concurrent-future.check b/test/disabled/jvm/concurrent-future.check
index 715ac90ce7..715ac90ce7 100644
--- a/test/files/jvm/concurrent-future.check
+++ b/test/disabled/jvm/concurrent-future.check
diff --git a/test/files/jvm/concurrent-future.scala b/test/disabled/jvm/concurrent-future.scala
index eda05428c8..eda05428c8 100644
--- a/test/files/jvm/concurrent-future.scala
+++ b/test/disabled/jvm/concurrent-future.scala
diff --git a/test/files/presentation/shutdown-deadlock.check b/test/disabled/presentation/shutdown-deadlock.check
index ddcb4ff59b..ddcb4ff59b 100644
--- a/test/files/presentation/shutdown-deadlock.check
+++ b/test/disabled/presentation/shutdown-deadlock.check
diff --git a/test/files/presentation/shutdown-deadlock/ShutdownDeadlockTest.scala b/test/disabled/presentation/shutdown-deadlock/ShutdownDeadlockTest.scala
index cef9d2a5ed..cef9d2a5ed 100644
--- a/test/files/presentation/shutdown-deadlock/ShutdownDeadlockTest.scala
+++ b/test/disabled/presentation/shutdown-deadlock/ShutdownDeadlockTest.scala
diff --git a/test/files/presentation/shutdown-deadlock/src/arrays.scala b/test/disabled/presentation/shutdown-deadlock/src/arrays.scala
index ecebc78a6f..ecebc78a6f 100644
--- a/test/files/presentation/shutdown-deadlock/src/arrays.scala
+++ b/test/disabled/presentation/shutdown-deadlock/src/arrays.scala
diff --git a/test/files/buildmanager/t2559/D.scala b/test/files/buildmanager/t2559/D.scala
index 906b69a3e7..62dc5427f9 100644
--- a/test/files/buildmanager/t2559/D.scala
+++ b/test/files/buildmanager/t2559/D.scala
@@ -1,8 +1,4 @@
object D {
- def x(a: A) =
- a match {
- case _: B => ()
- case _: C => ()
- }
+ def x(a: A) = if (a.isInstanceOf[B] || a.isInstanceOf[C]) ()
}
diff --git a/test/files/buildmanager/t2559/t2559.check b/test/files/buildmanager/t2559/t2559.check
index 752278fbe8..4d43838cf5 100644
--- a/test/files/buildmanager/t2559/t2559.check
+++ b/test/files/buildmanager/t2559/t2559.check
@@ -6,9 +6,4 @@ compiling Set(A.scala)
Changes: Map(class B -> List(), class C -> List(), class E -> List(Changed(Class(A))[class E extends a sealed trait A]), trait A -> List())
invalidate D.scala because it references changed class [Changed(Class(A))[class E extends a sealed trait A]]
compiling Set(D.scala)
-D.scala:3: warning: match is not exhaustive!
-missing combination E
-
- a match {
- ^
Changes: Map(object D -> List())
diff --git a/test/files/buildmanager/t2650_1/t2650_1.check b/test/files/buildmanager/t2650_1/t2650_1.check
index ecddb33620..f1e4b1b8bc 100644
--- a/test/files/buildmanager/t2650_1/t2650_1.check
+++ b/test/files/buildmanager/t2650_1/t2650_1.check
@@ -1,5 +1,6 @@
builder > A.scala B.scala
compiling Set(A.scala, B.scala)
+warning: there were 1 feature warnings; re-run with -feature for details
Changes: Map()
builder > A.scala
compiling Set(A.scala)
diff --git a/test/files/buildmanager/t2657/t2657.check b/test/files/buildmanager/t2657/t2657.check
index 74ba87a21d..cd0357599c 100644
--- a/test/files/buildmanager/t2657/t2657.check
+++ b/test/files/buildmanager/t2657/t2657.check
@@ -1,5 +1,6 @@
builder > A.scala B.scala
compiling Set(A.scala, B.scala)
+warning: there were 1 feature warnings; re-run with -feature for details
Changes: Map()
builder > A.scala
compiling Set(A.scala)
diff --git a/test/files/codelib/code.jar.desired.sha1 b/test/files/codelib/code.jar.desired.sha1
index 8dabf404b9..21c4dccb30 100644
--- a/test/files/codelib/code.jar.desired.sha1
+++ b/test/files/codelib/code.jar.desired.sha1
@@ -1 +1 @@
-e76a8883d275ca4870f745b505fb0a1cb9cbe446 ?code.jar
+3ddb9fded6e19ca591a78b8a294284c9e945da30 ?code.jar
diff --git a/test/files/continuations-run/match2.scala b/test/files/continuations-run/match2.scala
index 8b0fb946df..5092ce3abe 100644
--- a/test/files/continuations-run/match2.scala
+++ b/test/files/continuations-run/match2.scala
@@ -18,7 +18,7 @@ object Test {
}
- def main(args: Array[String]): Any = {
+ def main(args: Array[String]): Unit = {
println(reset(test1()))
println(reset(test2()))
}
diff --git a/test/files/jvm/interpreter.check b/test/files/jvm/interpreter.check
index 243c9aa3be..b9ff6afa2b 100755..100644
--- a/test/files/jvm/interpreter.check
+++ b/test/files/jvm/interpreter.check
@@ -73,7 +73,7 @@ fish: S = fish
scala> // Test that arrays pretty print nicely.
-scala> val arr = Array("What's", "up", "doc?")
+scala> val arr = Array("What's", "up", "doc?")
arr: Array[String] = Array(What's, up, doc?)
scala> // Test that arrays pretty print nicely, even when we give them type Any
@@ -97,6 +97,7 @@ scala> case class Bar(n: Int)
defined class Bar
scala> implicit def foo2bar(foo: Foo) = Bar(foo.n)
+warning: there were 1 feature warnings; re-run with -feature for details
foo2bar: (foo: Foo)Bar
scala> val bar: Bar = Foo(3)
@@ -270,6 +271,8 @@ scala> xs map (x => x)
res6: scala.collection.mutable.ArraySeq[_] = ArraySeq(1, 2)
scala> xs map (x => (x, x))
+warning: there were 1 feature warnings; re-run with -feature for details
+warning: there were 1 feature warnings; re-run with -feature for details
res7: Array[(_$1, _$1)] forSome { type _$1 } = Array((1,1), (2,2))
scala>
@@ -338,10 +341,10 @@ You typed two blank lines. Starting a new command.
scala> // defining and using quoted names should work (ticket #323)
-scala> def `match` = 1
+scala> def `match` = 1
match: Int
-scala> val x = `match`
+scala> val x = `match`
x: Int = 1
scala>
diff --git a/test/files/jvm/interpreter.scala b/test/files/jvm/interpreter.scala
index f0bc8b5818..755b2ac9ae 100644
--- a/test/files/jvm/interpreter.scala
+++ b/test/files/jvm/interpreter.scala
@@ -2,6 +2,7 @@ import scala.tools.nsc._
import scala.tools.partest.ReplTest
object Test extends ReplTest {
+ override def extraSettings = "-deprecation -Xoldpatmat"
def code = <code>
// basics
3+4
@@ -29,7 +30,7 @@ val atom = new scala.xml.Atom()
class S(override val toString : String)
val fish = new S("fish")
// Test that arrays pretty print nicely.
-val arr = Array("What's", "up", "doc?")
+val arr = Array("What's", "up", "doc?")
// Test that arrays pretty print nicely, even when we give them type Any
val arrInt : Any = Array(1,2,3)
// Test that nested arrays are pretty-printed correctly
@@ -132,8 +133,8 @@ there
// defining and using quoted names should work (ticket #323)
-def `match` = 1
-val x = `match`
+def `match` = 1
+val x = `match`
// multiple classes defined on one line
sealed class Exp; class Fact extends Exp; class Term extends Exp
@@ -153,6 +154,6 @@ def f(e: Exp) = e match {{ // non-exhaustive warning here
interp.interpret("\"after reset\"")
interp.interpret("plusOne(5) // should be undefined now")
}
-
+
appendix()
}
diff --git a/test/files/jvm/manifests.check b/test/files/jvm/manifests.check
index 54f504b929..be8ec2bb5b 100644
--- a/test/files/jvm/manifests.check
+++ b/test/files/jvm/manifests.check
@@ -1,55 +1,56 @@
-x=(), m=Unit
-x=true, m=Boolean
-x=a, m=Char
-x=1, m=Int
-x=abc, m=java.lang.String
-x='abc, m=scala.Symbol
-
-x=List(()), m=scala.collection.immutable.List[Unit]
-x=List(true), m=scala.collection.immutable.List[Boolean]
-x=List(1), m=scala.collection.immutable.List[Int]
-x=List(abc), m=scala.collection.immutable.List[java.lang.String]
-x=List('abc), m=scala.collection.immutable.List[scala.Symbol]
-
-x=[Z, m=Array[Boolean]
-x=[C, m=Array[Char]
-x=[I, m=Array[Int]
-x=[Ljava.lang.String;, m=Array[java.lang.String]
-x=[Lscala.Symbol;, m=Array[scala.Symbol]
-
-x=((),()), m=scala.Tuple2[Unit, Unit]
-x=(true,false), m=scala.Tuple2[Boolean, Boolean]
-x=(1,2), m=scala.Tuple2[Int, Int]
-x=(abc,xyz), m=scala.Tuple2[java.lang.String, java.lang.String]
-x=('abc,'xyz), m=scala.Tuple2[scala.Symbol, scala.Symbol]
-
-
-x=Foo, m=Foo[Int]
-x=Foo, m=Foo[scala.collection.immutable.List[Int]]
-x=Foo, m=Foo[Foo[Int]]
-x=Foo, m=Foo[scala.collection.immutable.List[Foo[Int]]]
-
-x=Test1$$anon$1, m=Object with Bar[java.lang.String]
-
-()=()
-true=true
-a=a
-1=1
-'abc='abc
-
-List(())=List(())
-List(true)=List(true)
-List('abc)=List('abc)
-
-Array()=Array()
-Array(true)=Array(true)
-Array(a)=Array(a)
-Array(1)=Array(1)
-
-((),())=((),())
-(true,false)=(true,false)
-
-List(List(1), List(2))=List(List(1), List(2))
-
-Array(Array(1), Array(2))=Array(Array(1), Array(2))
-
+x=(), m=ConcreteTypeTag[Unit], k=TypeRef, s=class Unit
+x=true, m=ConcreteTypeTag[Boolean], k=TypeRef, s=class Boolean
+x=a, m=ConcreteTypeTag[Char], k=TypeRef, s=class Char
+x=1, m=ConcreteTypeTag[Int], k=TypeRef, s=class Int
+x=abc, m=ConcreteTypeTag[String], k=TypeRef, s=class String
+x='abc, m=ConcreteTypeTag[Symbol], k=TypeRef, s=class Symbol
+
+x=List(()), m=ConcreteTypeTag[List[Unit]], k=TypeRef, s=class List
+x=List(true), m=ConcreteTypeTag[List[Boolean]], k=TypeRef, s=class List
+x=List(1), m=ConcreteTypeTag[List[Int]], k=TypeRef, s=class List
+x=List(abc), m=ConcreteTypeTag[List[String]], k=TypeRef, s=class List
+x=List('abc), m=ConcreteTypeTag[List[Symbol]], k=TypeRef, s=class List
+
+x=[Z, m=ConcreteTypeTag[Array[Boolean]], k=TypeRef, s=class Array
+x=[C, m=ConcreteTypeTag[Array[Char]], k=TypeRef, s=class Array
+x=[I, m=ConcreteTypeTag[Array[Int]], k=TypeRef, s=class Array
+x=[Ljava.lang.String;, m=ConcreteTypeTag[Array[String]], k=TypeRef, s=class Array
+x=[Lscala.Symbol;, m=ConcreteTypeTag[Array[Symbol]], k=TypeRef, s=class Array
+
+x=((),()), m=ConcreteTypeTag[(Unit, Unit)], k=TypeRef, s=class Tuple2
+x=(true,false), m=ConcreteTypeTag[(Boolean, Boolean)], k=TypeRef, s=class Tuple2
+x=(1,2), m=ConcreteTypeTag[(Int, Int)], k=TypeRef, s=class Tuple2
+x=(abc,xyz), m=ConcreteTypeTag[(String, String)], k=TypeRef, s=class Tuple2
+x=('abc,'xyz), m=ConcreteTypeTag[(Symbol, Symbol)], k=TypeRef, s=class Tuple2
+
+
+x=Foo, m=ConcreteTypeTag[Foo[Int]], k=TypeRef, s=class Foo
+x=Foo, m=ConcreteTypeTag[Foo[List[Int]]], k=TypeRef, s=class Foo
+x=Foo, m=ConcreteTypeTag[Foo[Foo[Int]]], k=TypeRef, s=class Foo
+x=Foo, m=ConcreteTypeTag[Foo[List[Foo[Int]]]], k=TypeRef, s=class Foo
+
+x=Test1$$anon$1, m=ConcreteTypeTag[Bar[String]], k=RefinedType, s=<local Test1>
+x=Test1$$anon$2, m=ConcreteTypeTag[Bar[String]], k=RefinedType, s=<local Test1>
+
+()=()
+true=true
+a=a
+1=1
+'abc='abc
+
+List(())=List(())
+List(true)=List(true)
+List('abc)=List('abc)
+
+Array()=Array()
+Array(true)=Array(true)
+Array(a)=Array(a)
+Array(1)=Array(1)
+
+((),())=((),())
+(true,false)=(true,false)
+
+List(List(1), List(2))=List(List(1), List(2))
+
+Array(Array(1), Array(2))=Array(Array(1), Array(2))
+
diff --git a/test/files/jvm/manifests.scala b/test/files/jvm/manifests.scala
index 6bbea4d052..935427f5d4 100644
--- a/test/files/jvm/manifests.scala
+++ b/test/files/jvm/manifests.scala
@@ -1,7 +1,6 @@
object Test extends App {
Test1
Test2
- //Test3 // Java 1.5+ only
}
class Foo[T](x: T)
@@ -51,7 +50,8 @@ object Test1 extends TestUtil {
print(new Foo(List(new Foo(2))))
println()
- print(new Bar[String] { def f = "abc" })
+ print(new Bar[String] { def f = "abc" });
+ {print(new Bar[String] { def f = "abc" })}
println()
}
@@ -88,15 +88,6 @@ object Test2 {
println()
}
-object Test3 extends TestUtil {
- import scala.reflect.Manifest._
- val ct1 = classType(classOf[Char])
- val ct2 = classType(classOf[List[_]], ct1)
- print(ct1)
- //print(ct2) // ??? x=scala.List[char], m=scala.reflect.Manifest[scala.runtime.Nothing$]
- println()
-}
-
trait TestUtil {
import java.io._
def write[A](o: A): Array[Byte] = {
@@ -112,8 +103,10 @@ trait TestUtil {
}
import scala.reflect._
def print[T](x: T)(implicit m: Manifest[T]) {
- val m1: Manifest[T] = read(write(m))
+ // manifests are no longer serializable
+// val m1: Manifest[T] = read(write(m))
+ val m1: Manifest[T] = m
val x1 = x.toString.replaceAll("@[0-9a-z]+$", "")
- println("x="+x1+", m="+m1)
+ println("x="+x1+", m="+m1+", k="+m1.tpe.kind+", s="+m1.sym.toString)
}
}
diff --git a/test/files/macros/Printf.scala b/test/files/macros/Printf.scala
deleted file mode 100644
index 4a88e5b069..0000000000
--- a/test/files/macros/Printf.scala
+++ /dev/null
@@ -1,39 +0,0 @@
-// macros should be built separately from their clients, so simple "scalac Printf.scala Test.scala" won't work
-// 1) first build this file with "scalac -Xmacros Printf.scala"
-// 2) the build the test with "scalac -cp <output directory of compiling Printf.scala> Test.scala"
-
-object Printf extends App {
- def macro printf(format: String, params: Any*) : String = {
- var i = 0
- def gensym(name: String) = { i += 1; newTermName(name + i) }
-
- def createTempValDef(value: Tree, clazz: Class[_]): (Option[Tree], Tree) = {
- val local = gensym("temp")
- val tpe = if (clazz == classOf[Int]) Ident(newTypeName("Int"))
- else if (clazz == classOf[String]) Select(Select(Ident(newTermName("java")), newTermName("lang")), newTypeName("String"))
- else throw new Exception("unknown class " + clazz.toString)
- (Some(ValDef(Modifiers(), local, tpe, value)), Ident(local))
- }
-
- def tree_printf(format: Tree, params: Tree*) = {
- val Literal(Constant(s_format: String)) = format
- val paramsStack = scala.collection.mutable.Stack(params: _*)
- val parsed = s_format.split("(?<=%[\\w%])|(?=%[\\w%])") map {
- case "%d" => createTempValDef(paramsStack.pop, classOf[Int])
- case "%s" => createTempValDef(paramsStack.pop, classOf[String])
- case "%%" => (None, Literal(Constant("%")))
- case part => (None, Literal(Constant(part)))
- }
-
- val evals = for ((Some(eval), _) <- parsed if eval != None) yield eval
- val prints = for ((_, ref) <- parsed) yield {
- val print = Select(Select(Ident(newTermName("scala")), newTermName("Predef")), newTermName("print"))
- Apply(print, List(ref))
- }
-
- Block((evals ++ prints).toList, Literal(Constant(())))
- }
-
- tree_printf(format, params: _*)
- }
-}
diff --git a/test/files/macros/Test.scala b/test/files/macros/Test.scala
deleted file mode 100644
index d8cdcf6756..0000000000
--- a/test/files/macros/Test.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-// macros should be built separately from their clients, so simple "scalac Printf.scala Test.scala" won't work
-// 1) first build the printf macro with "scalac -Xmacros Printf.scala"
-// 2) the build this file with "scalac -cp <output directory of compiling Printf.scala> Test.scala"
-
-object Test extends App {
- import Printf._
- printf("hello %s", "world")
-} \ No newline at end of file
diff --git a/test/files/macros/macros_v0001.bat b/test/files/macros/macros_v0001.bat
deleted file mode 100644
index 3395d2e3c1..0000000000
--- a/test/files/macros/macros_v0001.bat
+++ /dev/null
@@ -1,40 +0,0 @@
-@echo off
-
-set scalahome=%~dp0\..\..\..
-set scaladeps=%scalahome%\lib\jline.jar;%scalahome%\lib\fjbg.jar
-set scalalib=%scalahome%\build\pack\lib\scala-library.jar
-if not exist "%scalalib%" set scalalib=%scalahome%\build\locker\classes\library
-set scalacomp="%scalahome%\build\pack\lib\scala-compiler.jar"
-if not exist "%scalacomp%" set scalacomp=%scalahome%\build\locker\classes\compiler
-set stdcp=%scaladeps%;%scalalib%;%scalacomp%
-
-echo Compiling macros...
-set cp=%stdcp%
-call :scalac -Xmacros "%~dp0\Printf.scala"
-
-echo Compiling the program...
-set cp=%stdcp%;%~dp0.
-call :scalac "%~dp0\Test.scala"
-
-echo.
-echo NOW LOOK!!!
-echo ===============================================
-set cp=%stdcp%;%~dp0.
-call :scala Test
-echo.
-echo ===============================================
-goto :eof
-
-:scalac
-setlocal
-call set args=%*
-rem echo java -cp "%cp%" -Dscala.usejavacp=true scala.tools.nsc.Main %args%
-java -cp "%cp%" -Dscala.usejavacp=true scala.tools.nsc.Main %args%
-endlocal&goto :eof
-
-:scala
-setlocal
-call set args=%*
-rem echo java -cp "%cp%" -Dscala.usejavacp=true scala.tools.nsc.MainGenericRunner %args%
-java -cp "%cp%" -Dscala.usejavacp=true scala.tools.nsc.MainGenericRunner %args%
-endlocal&goto :eof
diff --git a/test/files/macros/macros_v0001.sh b/test/files/macros/macros_v0001.sh
deleted file mode 100644
index abe09836bb..0000000000
--- a/test/files/macros/macros_v0001.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-if [[ $(uname -s) == CYGWIN* ]]; then cpsep=";"; else cpsep=":"; fi
-scripthome="$(dirname "$0")"
-scalahome="$scripthome/../../.."
-scaladeps="$scalahome/lib/jline.jar;$scalahome/lib/fjbg.jar"
-scalalib="$scalahome/build/pack/lib/scala-library.jar"
-if [ ! -f "$scalalib" ]; then scalalib="$scalahome/build/locker/classes/library"; fi
-scalacomp="$scalahome/build/pack/lib/scala-compiler.jar"
-if [ ! -f "$scalacomp" ]; then scalacomp="$scalahome/build/locker/classes/compiler"; fi
-stdcp="$scaladeps$cpsep$scalalib$cpsep$scalacomp"
-function scalac { java -cp "$cp" -Dscala.usejavacp=true scala.tools.nsc.Main $*; }
-function scala { java -cp "$cp" -Dscala.usejavacp=true scala.tools.nsc.MainGenericRunner $*; }
-
-echo "Compiling macros..."
-cp="$stdcp"
-scalac -Xmacros "$scripthome/Printf.scala"
-
-echo "Compiling the program..."
-cp="$stdcp$cpsep$scripthome"
-scalac "$scripthome/Test.scala"
-
-echo ""
-echo "NOW LOOK"
-echo "==============================================="
-cp="$stdcp$cpsep$scripthome"
-scala Test
-echo ""
-echo "==============================================="
diff --git a/test/files/neg/applydynamic_sip.check b/test/files/neg/applydynamic_sip.check
new file mode 100644
index 0000000000..8845f68a52
--- /dev/null
+++ b/test/files/neg/applydynamic_sip.check
@@ -0,0 +1,10 @@
+applydynamic_sip.scala:7: error: applyDynamic does not support passing a vararg parameter
+ qual.sel(a, a2: _*)
+ ^
+applydynamic_sip.scala:8: error: applyDynamicNamed does not support passing a vararg parameter
+ qual.sel(arg = a, a2: _*)
+ ^
+applydynamic_sip.scala:9: error: applyDynamicNamed does not support passing a vararg parameter
+ qual.sel(arg, arg2 = "a2", a2: _*)
+ ^
+three errors found
diff --git a/test/files/neg/applydynamic_sip.scala b/test/files/neg/applydynamic_sip.scala
new file mode 100644
index 0000000000..362461577b
--- /dev/null
+++ b/test/files/neg/applydynamic_sip.scala
@@ -0,0 +1,10 @@
+object Test extends App {
+ val qual: Dynamic = ???
+ val expr = "expr"
+ val a = "a"
+ val a2 = "a2"
+
+ qual.sel(a, a2: _*)
+ qual.sel(arg = a, a2: _*)
+ qual.sel(arg, arg2 = "a2", a2: _*)
+} \ No newline at end of file
diff --git a/test/files/neg/array-not-seq.check b/test/files/neg/array-not-seq.check
index c16ecdad72..a3a639e772 100644
--- a/test/files/neg/array-not-seq.check
+++ b/test/files/neg/array-not-seq.check
@@ -1,7 +1,13 @@
array-not-seq.scala:2: error: An Array will no longer match as Seq[_].
def f1(x: Any) = x.isInstanceOf[Seq[_]]
^
-error: An Array will no longer match as Seq[_].
-error: An Array will no longer match as Seq[_].
-error: An Array will no longer match as Seq[_].
+array-not-seq.scala:4: error: An Array will no longer match as Seq[_].
+ case _: Seq[_] => true
+ ^
+array-not-seq.scala:16: error: An Array will no longer match as Seq[_].
+ case (Some(_: Seq[_]), Nil, _) => 1
+ ^
+array-not-seq.scala:17: error: An Array will no longer match as Seq[_].
+ case (None, List(_: List[_], _), _) => 2
+ ^
four errors found
diff --git a/test/files/neg/checksensible.check b/test/files/neg/checksensible.check
index d785179a56..23af94180a 100644
--- a/test/files/neg/checksensible.check
+++ b/test/files/neg/checksensible.check
@@ -1,100 +1,100 @@
-checksensible.scala:13: error: comparing a fresh object using `eq' will always yield false
- (new AnyRef) eq (new AnyRef)
- ^
-checksensible.scala:14: error: comparing a fresh object using `ne' will always yield true
- (new AnyRef) ne (new AnyRef)
- ^
-checksensible.scala:15: error: comparing a fresh object using `eq' will always yield false
- Shmoopie eq (new AnyRef)
- ^
-checksensible.scala:16: error: comparing a fresh object using `eq' will always yield false
- (Shmoopie: AnyRef) eq (new AnyRef)
- ^
-checksensible.scala:17: error: comparing a fresh object using `eq' will always yield false
- (new AnyRef) eq Shmoopie
- ^
-checksensible.scala:18: error: comparing a fresh object using `eq' will always yield false
- (new AnyRef) eq null
- ^
-checksensible.scala:19: error: comparing a fresh object using `eq' will always yield false
- null eq new AnyRef
- ^
-checksensible.scala:26: error: comparing values of types Unit and Int using `==' will always yield false
- (c = 1) == 0
- ^
-checksensible.scala:27: error: comparing values of types Int and Unit using `==' will always yield false
- 0 == (c = 1)
- ^
-checksensible.scala:29: error: comparing values of types Int and String using `==' will always yield false
- 1 == "abc"
- ^
-checksensible.scala:33: error: comparing values of types Some[Int] and Int using `==' will always yield false
- Some(1) == 1 // as above
- ^
-checksensible.scala:38: error: comparing a fresh object using `==' will always yield false
- new AnyRef == 1
- ^
-checksensible.scala:41: error: comparing values of types Int and Boolean using `==' will always yield false
- 1 == (new java.lang.Boolean(true))
- ^
-checksensible.scala:43: error: comparing values of types Int and Boolean using `!=' will always yield true
- 1 != true
- ^
-checksensible.scala:44: error: comparing values of types Unit and Boolean using `==' will always yield false
- () == true
- ^
-checksensible.scala:45: error: comparing values of types Unit and Unit using `==' will always yield true
- () == ()
- ^
-checksensible.scala:46: error: comparing values of types Unit and Unit using `==' will always yield true
- () == println
- ^
-checksensible.scala:47: error: comparing values of types Unit and scala.runtime.BoxedUnit using `==' will always yield true
- () == scala.runtime.BoxedUnit.UNIT // these should warn for always being true/false
- ^
-checksensible.scala:48: error: comparing values of types scala.runtime.BoxedUnit and Unit using `!=' will always yield false
- scala.runtime.BoxedUnit.UNIT != ()
- ^
-checksensible.scala:51: error: comparing values of types Int and Unit using `!=' will always yield true
- (1 != println)
- ^
-checksensible.scala:52: error: comparing values of types Int and Symbol using `!=' will always yield true
- (1 != 'sym)
- ^
-checksensible.scala:58: error: comparing a fresh object using `==' will always yield false
- ((x: Int) => x + 1) == null
- ^
-checksensible.scala:59: error: comparing a fresh object using `==' will always yield false
- Bep == ((_: Int) + 1)
- ^
-checksensible.scala:61: error: comparing a fresh object using `==' will always yield false
- new Object == new Object
- ^
-checksensible.scala:62: error: comparing a fresh object using `==' will always yield false
- new Object == "abc"
- ^
-checksensible.scala:63: error: comparing a fresh object using `!=' will always yield true
- new Exception() != new Exception()
- ^
-checksensible.scala:66: error: comparing values of types Int and Null using `==' will always yield false
- if (foo.length == null) "plante" else "plante pas"
- ^
-checksensible.scala:71: error: comparing values of types Bip and Bop using `==' will always yield false
- (x1 == x2)
- ^
-checksensible.scala:81: error: comparing values of types EqEqRefTest.this.C3 and EqEqRefTest.this.Z1 using `==' will always yield false
- c3 == z1
- ^
-checksensible.scala:82: error: comparing values of types EqEqRefTest.this.Z1 and EqEqRefTest.this.C3 using `==' will always yield false
- z1 == c3
- ^
-checksensible.scala:83: error: comparing values of types EqEqRefTest.this.Z1 and EqEqRefTest.this.C3 using `!=' will always yield true
- z1 != c3
- ^
-checksensible.scala:84: error: comparing values of types EqEqRefTest.this.C3 and String using `!=' will always yield true
- c3 != "abc"
- ^
-checksensible.scala:95: error: comparing values of types Unit and Int using `!=' will always yield true
- while ((c = in.read) != -1)
- ^
-33 errors found
+checksensible.scala:13: error: comparing a fresh object using `eq' will always yield false
+ (new AnyRef) eq (new AnyRef)
+ ^
+checksensible.scala:14: error: comparing a fresh object using `ne' will always yield true
+ (new AnyRef) ne (new AnyRef)
+ ^
+checksensible.scala:15: error: comparing a fresh object using `eq' will always yield false
+ Shmoopie eq (new AnyRef)
+ ^
+checksensible.scala:16: error: comparing a fresh object using `eq' will always yield false
+ (Shmoopie: AnyRef) eq (new AnyRef)
+ ^
+checksensible.scala:17: error: comparing a fresh object using `eq' will always yield false
+ (new AnyRef) eq Shmoopie
+ ^
+checksensible.scala:18: error: comparing a fresh object using `eq' will always yield false
+ (new AnyRef) eq null
+ ^
+checksensible.scala:19: error: comparing a fresh object using `eq' will always yield false
+ null eq new AnyRef
+ ^
+checksensible.scala:26: error: comparing values of types Unit and Int using `==' will always yield false
+ (c = 1) == 0
+ ^
+checksensible.scala:27: error: comparing values of types Int and Unit using `==' will always yield false
+ 0 == (c = 1)
+ ^
+checksensible.scala:29: error: comparing values of types Int and String using `==' will always yield false
+ 1 == "abc"
+ ^
+checksensible.scala:33: error: comparing values of types Some[Int] and Int using `==' will always yield false
+ Some(1) == 1 // as above
+ ^
+checksensible.scala:38: error: comparing a fresh object using `==' will always yield false
+ new AnyRef == 1
+ ^
+checksensible.scala:41: error: comparing values of types Int and Boolean using `==' will always yield false
+ 1 == (new java.lang.Boolean(true))
+ ^
+checksensible.scala:43: error: comparing values of types Int and Boolean using `!=' will always yield true
+ 1 != true
+ ^
+checksensible.scala:44: error: comparing values of types Unit and Boolean using `==' will always yield false
+ () == true
+ ^
+checksensible.scala:45: error: comparing values of types Unit and Unit using `==' will always yield true
+ () == ()
+ ^
+checksensible.scala:46: error: comparing values of types Unit and Unit using `==' will always yield true
+ () == println
+ ^
+checksensible.scala:47: error: comparing values of types Unit and scala.runtime.BoxedUnit using `==' will always yield true
+ () == scala.runtime.BoxedUnit.UNIT // these should warn for always being true/false
+ ^
+checksensible.scala:48: error: comparing values of types scala.runtime.BoxedUnit and Unit using `!=' will always yield false
+ scala.runtime.BoxedUnit.UNIT != ()
+ ^
+checksensible.scala:51: error: comparing values of types Int and Unit using `!=' will always yield true
+ (1 != println)
+ ^
+checksensible.scala:52: error: comparing values of types Int and Symbol using `!=' will always yield true
+ (1 != 'sym)
+ ^
+checksensible.scala:58: error: comparing a fresh object using `==' will always yield false
+ ((x: Int) => x + 1) == null
+ ^
+checksensible.scala:59: error: comparing a fresh object using `==' will always yield false
+ Bep == ((_: Int) + 1)
+ ^
+checksensible.scala:61: error: comparing a fresh object using `==' will always yield false
+ new Object == new Object
+ ^
+checksensible.scala:62: error: comparing a fresh object using `==' will always yield false
+ new Object == "abc"
+ ^
+checksensible.scala:63: error: comparing a fresh object using `!=' will always yield true
+ new Exception() != new Exception()
+ ^
+checksensible.scala:66: error: comparing values of types Int and Null using `==' will always yield false
+ if (foo.length == null) "plante" else "plante pas"
+ ^
+checksensible.scala:71: error: comparing values of types Bip and Bop using `==' will always yield false
+ (x1 == x2)
+ ^
+checksensible.scala:81: error: comparing values of types EqEqRefTest.this.C3 and EqEqRefTest.this.Z1 using `==' will always yield false
+ c3 == z1
+ ^
+checksensible.scala:82: error: comparing values of types EqEqRefTest.this.Z1 and EqEqRefTest.this.C3 using `==' will always yield false
+ z1 == c3
+ ^
+checksensible.scala:83: error: comparing values of types EqEqRefTest.this.Z1 and EqEqRefTest.this.C3 using `!=' will always yield true
+ z1 != c3
+ ^
+checksensible.scala:84: error: comparing values of types EqEqRefTest.this.C3 and String using `!=' will always yield true
+ c3 != "abc"
+ ^
+checksensible.scala:95: error: comparing values of types Unit and Int using `!=' will always yield true
+ while ((c = in.read) != -1)
+ ^
+33 errors found
diff --git a/test/files/neg/classtags_contextbound_a.check b/test/files/neg/classtags_contextbound_a.check
new file mode 100644
index 0000000000..f4b6ff5af1
--- /dev/null
+++ b/test/files/neg/classtags_contextbound_a.check
@@ -0,0 +1,4 @@
+classtags_contextbound_a.scala:2: error: No ClassTag available for T
+ def foo[T] = Array[T]()
+ ^
+one error found
diff --git a/test/files/neg/classtags_contextbound_a.scala b/test/files/neg/classtags_contextbound_a.scala
new file mode 100644
index 0000000000..d18beda341
--- /dev/null
+++ b/test/files/neg/classtags_contextbound_a.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ def foo[T] = Array[T]()
+ println(foo[Int].getClass)
+} \ No newline at end of file
diff --git a/test/files/neg/classtags_contextbound_b.check b/test/files/neg/classtags_contextbound_b.check
new file mode 100644
index 0000000000..f1f48bed72
--- /dev/null
+++ b/test/files/neg/classtags_contextbound_b.check
@@ -0,0 +1,4 @@
+classtags_contextbound_b.scala:3: error: No ClassTag available for T
+ def foo[T] = mkArray[T]
+ ^
+one error found
diff --git a/test/files/neg/classtags_contextbound_b.scala b/test/files/neg/classtags_contextbound_b.scala
new file mode 100644
index 0000000000..3247a8ff29
--- /dev/null
+++ b/test/files/neg/classtags_contextbound_b.scala
@@ -0,0 +1,5 @@
+object Test extends App {
+ def mkArray[T: ClassTag] = Array[T]()
+ def foo[T] = mkArray[T]
+ println(foo[Int].getClass)
+} \ No newline at end of file
diff --git a/test/files/neg/classtags_contextbound_c.check b/test/files/neg/classtags_contextbound_c.check
new file mode 100644
index 0000000000..54f630862a
--- /dev/null
+++ b/test/files/neg/classtags_contextbound_c.check
@@ -0,0 +1,4 @@
+classtags_contextbound_c.scala:2: error: No ClassTag available for T
+ def mkArray[T] = Array[T]()
+ ^
+one error found
diff --git a/test/files/neg/classtags_contextbound_c.scala b/test/files/neg/classtags_contextbound_c.scala
new file mode 100644
index 0000000000..0b63f8407e
--- /dev/null
+++ b/test/files/neg/classtags_contextbound_c.scala
@@ -0,0 +1,5 @@
+object Test extends App {
+ def mkArray[T] = Array[T]()
+ def foo[T: ClassTag] = mkArray[T]
+ println(foo[Int].getClass)
+} \ No newline at end of file
diff --git a/test/files/neg/exhausting.flags b/test/files/neg/exhausting.flags
index e8fb65d50c..b7eb21d5f5 100644
--- a/test/files/neg/exhausting.flags
+++ b/test/files/neg/exhausting.flags
@@ -1 +1 @@
--Xfatal-warnings \ No newline at end of file
+-Xfatal-warnings -Xoldpatmat
diff --git a/test/files/neg/gadts1.check b/test/files/neg/gadts1.check
index 44d2b114d6..0441f604c9 100644
--- a/test/files/neg/gadts1.check
+++ b/test/files/neg/gadts1.check
@@ -11,4 +11,7 @@ gadts1.scala:20: error: type mismatch;
required: a
case Cell[a](x: Int) => c.x = 5
^
-three errors found
+gadts1.scala:20: error: Could not typecheck extractor call: case class <none> with arguments List((x @ (_: Int)))
+ case Cell[a](x: Int) => c.x = 5
+ ^
+four errors found
diff --git a/test/files/neg/macro-argtype-mismatch.flags b/test/files/neg/macro-argtype-mismatch.flags
index 7fea2ff901..cd66464f2f 100644
--- a/test/files/neg/macro-argtype-mismatch.flags
+++ b/test/files/neg/macro-argtype-mismatch.flags
@@ -1 +1 @@
--Xmacros \ No newline at end of file
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-argtype-mismatch/Macros_1.scala b/test/files/neg/macro-argtype-mismatch/Macros_1.scala
deleted file mode 100644
index 4b5f98ba37..0000000000
--- a/test/files/neg/macro-argtype-mismatch/Macros_1.scala
+++ /dev/null
@@ -1,3 +0,0 @@
-object Macros {
- def macro foo(x: Int) = x
-} \ No newline at end of file
diff --git a/test/files/neg/macro-basic-mamdmi.check b/test/files/neg/macro-basic-mamdmi.check
new file mode 100644
index 0000000000..eef444f7b3
--- /dev/null
+++ b/test/files/neg/macro-basic-mamdmi.check
@@ -0,0 +1,5 @@
+Impls_Macros_Test_1.scala:36: error: macro implementation not found: foo (the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them)
+if you do need to define macro implementations along with the rest of your program, consider two-phase compilation with -Xmacro-fallback-classpath in the second phase pointing to the output of the first phase
+ println(foo(2) + Macros.bar(2) * new Macros().quux(4))
+ ^
+one error found
diff --git a/test/files/neg/macro-basic-mamdmi.flags b/test/files/neg/macro-basic-mamdmi.flags
new file mode 100644
index 0000000000..5e5dd6ce79
--- /dev/null
+++ b/test/files/neg/macro-basic-mamdmi.flags
@@ -0,0 +1 @@
+-language:experimental.macros
diff --git a/test/files/neg/macro-basic-mamdmi/Impls_Macros_Test_1.scala b/test/files/neg/macro-basic-mamdmi/Impls_Macros_Test_1.scala
new file mode 100644
index 0000000000..e9876e32e9
--- /dev/null
+++ b/test/files/neg/macro-basic-mamdmi/Impls_Macros_Test_1.scala
@@ -0,0 +1,37 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ import c.mirror._
+ val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1))))
+ Expr[Int](body)
+ }
+
+ def bar(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ import c.mirror._
+ val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2))))
+ Expr[Int](body)
+ }
+
+ def quux(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ import c.mirror._
+ val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(3))))
+ Expr[Int](body)
+ }
+}
+
+object Macros {
+ object Shmacros {
+ def foo(x: Int): Int = macro Impls.foo
+ }
+ def bar(x: Int): Int = macro Impls.bar
+}
+
+class Macros {
+ def quux(x: Int): Int = macro Impls.quux
+}
+
+object Test extends App {
+ import Macros.Shmacros._
+ println(foo(2) + Macros.bar(2) * new Macros().quux(4))
+} \ No newline at end of file
diff --git a/test/files/neg/macro-cyclic.check b/test/files/neg/macro-cyclic.check
new file mode 100644
index 0000000000..608381e0e8
--- /dev/null
+++ b/test/files/neg/macro-cyclic.check
@@ -0,0 +1,4 @@
+Impls_Macros_1.scala:5: error: could not find implicit value for parameter e: SourceLocation
+ c.reify { implicitly[SourceLocation] }
+ ^
+one error found
diff --git a/test/files/neg/macro-cyclic.flags b/test/files/neg/macro-cyclic.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-cyclic.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-cyclic/Impls_Macros_1.scala b/test/files/neg/macro-cyclic/Impls_Macros_1.scala
new file mode 100644
index 0000000000..1ea06fc968
--- /dev/null
+++ b/test/files/neg/macro-cyclic/Impls_Macros_1.scala
@@ -0,0 +1,25 @@
+import scala.reflect.makro.Context
+
+object Macros {
+ def impl(c: Context) = {
+ c.reify { implicitly[SourceLocation] }
+ }
+
+ implicit def sourceLocation: SourceLocation1 = macro impl
+}
+
+trait SourceLocation {
+ /** Source location of the outermost call */
+ val outer: SourceLocation
+
+ /** The name of the source file */
+ val fileName: String
+
+ /** The line number */
+ val line: Int
+
+ /** The character offset */
+ val charOffset: Int
+}
+
+case class SourceLocation1(val outer: SourceLocation, val fileName: String, val line: Int, val charOffset: Int) extends SourceLocation
diff --git a/test/files/neg/macro-deprecate-idents.check b/test/files/neg/macro-deprecate-idents.check
new file mode 100644
index 0000000000..f8a7e519df
--- /dev/null
+++ b/test/files/neg/macro-deprecate-idents.check
@@ -0,0 +1,52 @@
+macro-deprecate-idents.scala:2: error: macro is now a reserved word; usage as an identifier is deprecated
+ val macro = ???
+ ^
+macro-deprecate-idents.scala:6: error: macro is now a reserved word; usage as an identifier is deprecated
+ var macro = ???
+ ^
+macro-deprecate-idents.scala:10: error: macro is now a reserved word; usage as an identifier is deprecated
+ type macro = Int
+ ^
+macro-deprecate-idents.scala:14: error: macro is now a reserved word; usage as an identifier is deprecated
+ class macro
+ ^
+macro-deprecate-idents.scala:18: error: macro is now a reserved word; usage as an identifier is deprecated
+ class macro
+ ^
+macro-deprecate-idents.scala:22: error: macro is now a reserved word; usage as an identifier is deprecated
+ object macro
+ ^
+macro-deprecate-idents.scala:26: error: macro is now a reserved word; usage as an identifier is deprecated
+ object macro
+ ^
+macro-deprecate-idents.scala:30: error: macro is now a reserved word; usage as an identifier is deprecated
+ trait macro
+ ^
+macro-deprecate-idents.scala:34: error: macro is now a reserved word; usage as an identifier is deprecated
+ trait macro
+ ^
+macro-deprecate-idents.scala:37: error: macro is now a reserved word; usage as an identifier is deprecated
+package macro {
+ ^
+macro-deprecate-idents.scala:38: error: macro is now a reserved word; usage as an identifier is deprecated
+ package macro.bar {
+ ^
+macro-deprecate-idents.scala:43: error: macro is now a reserved word; usage as an identifier is deprecated
+ package macro.foo {
+ ^
+macro-deprecate-idents.scala:48: error: macro is now a reserved word; usage as an identifier is deprecated
+ val Some(macro) = Some(42)
+ ^
+macro-deprecate-idents.scala:49: error: macro is now a reserved word; usage as an identifier is deprecated
+ macro match {
+ ^
+macro-deprecate-idents.scala:50: error: macro is now a reserved word; usage as an identifier is deprecated
+ case macro => println(macro)
+ ^
+macro-deprecate-idents.scala:50: error: macro is now a reserved word; usage as an identifier is deprecated
+ case macro => println(macro)
+ ^
+macro-deprecate-idents.scala:55: error: macro is now a reserved word; usage as an identifier is deprecated
+ def macro = 2
+ ^
+17 errors found
diff --git a/test/files/neg/macro-deprecate-idents.flags b/test/files/neg/macro-deprecate-idents.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/neg/macro-deprecate-idents.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/neg/macro-deprecate-idents.scala b/test/files/neg/macro-deprecate-idents.scala
new file mode 100644
index 0000000000..23c398e341
--- /dev/null
+++ b/test/files/neg/macro-deprecate-idents.scala
@@ -0,0 +1,56 @@
+object Test1 {
+ val macro = ???
+}
+
+object Test2 {
+ var macro = ???
+}
+
+object Test3 {
+ type macro = Int
+}
+
+package test4 {
+ class macro
+}
+
+object Test5 {
+ class macro
+}
+
+package test6 {
+ object macro
+}
+
+object Test7 {
+ object macro
+}
+
+package test8 {
+ trait macro
+}
+
+object Test9 {
+ trait macro
+}
+
+package macro {
+ package macro.bar {
+ }
+}
+
+package foo {
+ package macro.foo {
+ }
+}
+
+object Test12 {
+ val Some(macro) = Some(42)
+ macro match {
+ case macro => println(macro)
+ }
+}
+
+object Test13 {
+ def macro = 2
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidimpl-a.check b/test/files/neg/macro-invalidimpl-a.check
new file mode 100644
index 0000000000..855fe2d169
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-a.check
@@ -0,0 +1,4 @@
+Macros_Test_2.scala:3: error: macro implementation must be in statically accessible object
+ def foo(x: Any) = macro impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidimpl-a.flags b/test/files/neg/macro-invalidimpl-a.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-a.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidimpl-a/Impls_1.scala b/test/files/neg/macro-invalidimpl-a/Impls_1.scala
new file mode 100644
index 0000000000..c2f1843b8b
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-a/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+class Impls {
+ def foo(c: Ctx)(x: c.Expr[Any]) = ???
+}
diff --git a/test/files/neg/macro-invalidimpl-a/Macros_Test_2.scala b/test/files/neg/macro-invalidimpl-a/Macros_Test_2.scala
new file mode 100644
index 0000000000..2220ddae0c
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-a/Macros_Test_2.scala
@@ -0,0 +1,9 @@
+object Macros {
+ val impls = new Impls
+ def foo(x: Any) = macro impls.foo
+}
+
+object Test extends App {
+ import Macros._
+ foo(42)
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidimpl-b.check b/test/files/neg/macro-invalidimpl-b.check
new file mode 100644
index 0000000000..855fe2d169
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-b.check
@@ -0,0 +1,4 @@
+Macros_Test_2.scala:3: error: macro implementation must be in statically accessible object
+ def foo(x: Any) = macro impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidimpl-b.flags b/test/files/neg/macro-invalidimpl-b.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-b.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidimpl-b/Impls_1.scala b/test/files/neg/macro-invalidimpl-b/Impls_1.scala
new file mode 100644
index 0000000000..7b1620d117
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-b/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Any]) = ???
+}
diff --git a/test/files/neg/macro-invalidimpl-b/Macros_Test_2.scala b/test/files/neg/macro-invalidimpl-b/Macros_Test_2.scala
new file mode 100644
index 0000000000..81e40837d2
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-b/Macros_Test_2.scala
@@ -0,0 +1,9 @@
+object Macros {
+ val impls = Impls
+ def foo(x: Any) = macro impls.foo
+}
+
+object Test extends App {
+ import Macros._
+ foo(42)
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidimpl-c.check b/test/files/neg/macro-invalidimpl-c.check
new file mode 100644
index 0000000000..722ec3c7bd
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-c.check
@@ -0,0 +1,4 @@
+Impls_Macros_1.scala:8: error: macro implementation must be in statically accessible object
+ def foo(x: Any) = macro Impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidimpl-c.flags b/test/files/neg/macro-invalidimpl-c.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-c.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidimpl-c/Impls_Macros_1.scala b/test/files/neg/macro-invalidimpl-c/Impls_Macros_1.scala
new file mode 100644
index 0000000000..657e2d4260
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-c/Impls_Macros_1.scala
@@ -0,0 +1,9 @@
+import scala.reflect.makro.{Context => Ctx}
+
+class Macros {
+ object Impls {
+ def foo(c: Ctx)(x: c.Expr[Any]) = ???
+ }
+
+ def foo(x: Any) = macro Impls.foo
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidimpl-c/Test_2.scala b/test/files/neg/macro-invalidimpl-c/Test_2.scala
new file mode 100644
index 0000000000..e75a8ba101
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-c/Test_2.scala
@@ -0,0 +1,3 @@
+object Test extends App {
+ new Macros().foo(42)
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidimpl-d.check b/test/files/neg/macro-invalidimpl-d.check
new file mode 100644
index 0000000000..6fedfa74fc
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-d.check
@@ -0,0 +1,4 @@
+Macros_Test_2.scala:2: error: macro implementation must be in statically accessible object
+ def foo(x: Any) = macro Impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidimpl-d.flags b/test/files/neg/macro-invalidimpl-d.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-d.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidimpl-d/Impls_1.scala b/test/files/neg/macro-invalidimpl-d/Impls_1.scala
new file mode 100644
index 0000000000..f18e699a1e
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-d/Impls_1.scala
@@ -0,0 +1,7 @@
+import scala.reflect.makro.{Context => Ctx}
+
+trait MacroHelpers {
+ object Impls {
+ def foo(c: Ctx)(x: c.Expr[Any]) = x
+ }
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidimpl-d/Macros_Test_2.scala b/test/files/neg/macro-invalidimpl-d/Macros_Test_2.scala
new file mode 100644
index 0000000000..067ab1ddec
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-d/Macros_Test_2.scala
@@ -0,0 +1,7 @@
+class Macros extends MacroHelpers {
+ def foo(x: Any) = macro Impls.foo
+}
+
+object Test extends App {
+ println(new Macros().foo(42))
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidimpl-e.check b/test/files/neg/macro-invalidimpl-e.check
new file mode 100644
index 0000000000..61d1e05b87
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-e.check
@@ -0,0 +1,13 @@
+Macros_Test_2.scala:2: error: ambiguous reference to overloaded definition,
+both method foo in object Impls of type (c: scala.reflect.makro.Context)(x: c.Expr[Any], y: c.Expr[Any])Nothing
+and method foo in object Impls of type (c: scala.reflect.makro.Context)(x: c.Expr[Any])Nothing
+match expected type ?
+ def foo(x: Any) = macro Impls.foo
+ ^
+Macros_Test_2.scala:3: error: ambiguous reference to overloaded definition,
+both method foo in object Impls of type (c: scala.reflect.makro.Context)(x: c.Expr[Any], y: c.Expr[Any])Nothing
+and method foo in object Impls of type (c: scala.reflect.makro.Context)(x: c.Expr[Any])Nothing
+match expected type ?
+ def foo(x: Any, y: Any) = macro Impls.foo
+ ^
+two errors found
diff --git a/test/files/neg/macro-invalidimpl-e.flags b/test/files/neg/macro-invalidimpl-e.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-e.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidimpl-e/Impls_1.scala b/test/files/neg/macro-invalidimpl-e/Impls_1.scala
new file mode 100644
index 0000000000..ad3eed5cd5
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-e/Impls_1.scala
@@ -0,0 +1,6 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Any]) = ???
+ def foo(c: Ctx)(x: c.Expr[Any], y: c.Expr[Any]) = ???
+}
diff --git a/test/files/neg/macro-invalidimpl-e/Macros_Test_2.scala b/test/files/neg/macro-invalidimpl-e/Macros_Test_2.scala
new file mode 100644
index 0000000000..6edde08167
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-e/Macros_Test_2.scala
@@ -0,0 +1,9 @@
+object Macros {
+ def foo(x: Any) = macro Impls.foo
+ def foo(x: Any, y: Any) = macro Impls.foo
+}
+
+object Test extends App {
+ import Macros._
+ foo(42)
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidimpl-f.check b/test/files/neg/macro-invalidimpl-f.check
new file mode 100644
index 0000000000..ec82faa58c
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-f.check
@@ -0,0 +1,7 @@
+Macros_Test_2.scala:2: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.makro.Context)(): c.Expr[Unit]
+ found : (c: scala.reflect.makro.Context): c.Expr[Unit]
+number of parameter sections differ
+ def bar1() = macro Impls.fooNullary
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidimpl-f.flags b/test/files/neg/macro-invalidimpl-f.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-f.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidimpl-f/Impls_1.scala b/test/files/neg/macro-invalidimpl-f/Impls_1.scala
new file mode 100644
index 0000000000..06c6efbb1f
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-f/Impls_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def fooNullary(c: Ctx) = {
+ import c.mirror._
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))
+ Expr[Unit](body)
+ }
+
+ def fooEmpty(c: Ctx)() = fooNullary(c)
+}
diff --git a/test/files/neg/macro-invalidimpl-f/Macros_Test_2.scala b/test/files/neg/macro-invalidimpl-f/Macros_Test_2.scala
new file mode 100644
index 0000000000..493edf1df8
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-f/Macros_Test_2.scala
@@ -0,0 +1,9 @@
+object Macros {
+ def bar1() = macro Impls.fooNullary
+}
+
+object Test extends App {
+ Macros.bar1
+ Macros.bar1()
+ println("kkthxbai")
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidimpl-g.check b/test/files/neg/macro-invalidimpl-g.check
new file mode 100644
index 0000000000..9c01f01dc8
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-g.check
@@ -0,0 +1,7 @@
+Macros_Test_2.scala:2: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.makro.Context): c.Expr[Unit]
+ found : (c: scala.reflect.makro.Context)(): c.Expr[Unit]
+number of parameter sections differ
+ def foo1 = macro Impls.fooEmpty
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidimpl-g.flags b/test/files/neg/macro-invalidimpl-g.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-g.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidimpl-g/Impls_1.scala b/test/files/neg/macro-invalidimpl-g/Impls_1.scala
new file mode 100644
index 0000000000..06c6efbb1f
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-g/Impls_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def fooNullary(c: Ctx) = {
+ import c.mirror._
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))
+ Expr[Unit](body)
+ }
+
+ def fooEmpty(c: Ctx)() = fooNullary(c)
+}
diff --git a/test/files/neg/macro-invalidimpl-g/Macros_Test_2.scala b/test/files/neg/macro-invalidimpl-g/Macros_Test_2.scala
new file mode 100644
index 0000000000..5561db9f9a
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-g/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo1 = macro Impls.fooEmpty
+}
+
+object Test extends App {
+ Macros.foo1
+ println("kkthxbai")
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidimpl-h.check b/test/files/neg/macro-invalidimpl-h.check
new file mode 100644
index 0000000000..cc7fc794d3
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-h.check
@@ -0,0 +1,4 @@
+Macros_Test_2.scala:2: error: type arguments [String] do not conform to method foo's type parameter bounds [U <: Int]
+ def foo = macro Impls.foo[String]
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidimpl-h.flags b/test/files/neg/macro-invalidimpl-h.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-h.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidimpl-h/Impls_1.scala b/test/files/neg/macro-invalidimpl-h/Impls_1.scala
new file mode 100644
index 0000000000..7db8bcd324
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-h/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[U <: Int](c: Ctx) = ???
+}
diff --git a/test/files/neg/macro-invalidimpl-h/Macros_Test_2.scala b/test/files/neg/macro-invalidimpl-h/Macros_Test_2.scala
new file mode 100644
index 0000000000..218c7aec7f
--- /dev/null
+++ b/test/files/neg/macro-invalidimpl-h/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo = macro Impls.foo[String]
+}
+
+object Test extends App {
+ import Macros._
+ foo
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidret-nontree.check b/test/files/neg/macro-invalidret-nontree.check
new file mode 100644
index 0000000000..7fcc396463
--- /dev/null
+++ b/test/files/neg/macro-invalidret-nontree.check
@@ -0,0 +1,7 @@
+Macros_Test_2.scala:2: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.makro.Context): c.Expr[Any]
+ found : (c: scala.reflect.makro.Context): Int
+type mismatch for return type : c.Expr[Any] does not conform to Int
+ def foo = macro Impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidret-nontree.flags b/test/files/neg/macro-invalidret-nontree.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidret-nontree.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidret-nontree/Impls_1.scala b/test/files/neg/macro-invalidret-nontree/Impls_1.scala
new file mode 100644
index 0000000000..efc8d4bfec
--- /dev/null
+++ b/test/files/neg/macro-invalidret-nontree/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = 2
+}
diff --git a/test/files/neg/macro-invalidret-nontree/Macros_Test_2.scala b/test/files/neg/macro-invalidret-nontree/Macros_Test_2.scala
new file mode 100644
index 0000000000..96a8de2832
--- /dev/null
+++ b/test/files/neg/macro-invalidret-nontree/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo = macro Impls.foo
+}
+
+object Test extends App {
+ import Macros._
+ foo
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidret-nonuniversetree.check b/test/files/neg/macro-invalidret-nonuniversetree.check
new file mode 100644
index 0000000000..a97d6daaa9
--- /dev/null
+++ b/test/files/neg/macro-invalidret-nonuniversetree.check
@@ -0,0 +1,7 @@
+Macros_Test_2.scala:2: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.makro.Context): c.Expr[Any]
+ found : (c: scala.reflect.makro.Context): reflect.mirror.Literal
+type mismatch for return type : c.Expr[Any] does not conform to reflect.mirror.Literal
+ def foo = macro Impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidret-nonuniversetree.flags b/test/files/neg/macro-invalidret-nonuniversetree.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidret-nonuniversetree.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidret-nonuniversetree/Impls_1.scala b/test/files/neg/macro-invalidret-nonuniversetree/Impls_1.scala
new file mode 100644
index 0000000000..86b7c8d8d0
--- /dev/null
+++ b/test/files/neg/macro-invalidret-nonuniversetree/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = scala.reflect.mirror.Literal(scala.reflect.mirror.Constant(42))
+}
diff --git a/test/files/neg/macro-invalidret-nonuniversetree/Macros_Test_2.scala b/test/files/neg/macro-invalidret-nonuniversetree/Macros_Test_2.scala
new file mode 100644
index 0000000000..96a8de2832
--- /dev/null
+++ b/test/files/neg/macro-invalidret-nonuniversetree/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo = macro Impls.foo
+}
+
+object Test extends App {
+ import Macros._
+ foo
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidshape-a.check b/test/files/neg/macro-invalidshape-a.check
new file mode 100644
index 0000000000..246b5c3226
--- /dev/null
+++ b/test/files/neg/macro-invalidshape-a.check
@@ -0,0 +1,6 @@
+Macros_Test_2.scala:2: error: macro body has wrong shape:
+ required: macro <reference to implementation object>.<implementation method name>
+ or : macro <implementation method name>
+ def foo(x: Any) = macro 2
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidshape-a.flags b/test/files/neg/macro-invalidshape-a.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidshape-a.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidshape-a/Impls_1.scala b/test/files/neg/macro-invalidshape-a/Impls_1.scala
new file mode 100644
index 0000000000..7b1620d117
--- /dev/null
+++ b/test/files/neg/macro-invalidshape-a/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Any]) = ???
+}
diff --git a/test/files/neg/macro-invalidshape-a/Macros_Test_2.scala b/test/files/neg/macro-invalidshape-a/Macros_Test_2.scala
new file mode 100644
index 0000000000..ffff17d1e7
--- /dev/null
+++ b/test/files/neg/macro-invalidshape-a/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo(x: Any) = macro 2
+}
+
+object Test extends App {
+ import Macros._
+ foo(42)
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidshape-b.check b/test/files/neg/macro-invalidshape-b.check
new file mode 100644
index 0000000000..59701d023b
--- /dev/null
+++ b/test/files/neg/macro-invalidshape-b.check
@@ -0,0 +1,6 @@
+Macros_Test_2.scala:2: error: macro body has wrong shape:
+ required: macro <reference to implementation object>.<implementation method name>
+ or : macro <implementation method name>
+ def foo(x: Any) = macro Impls.foo(null)(null)
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidshape-b.flags b/test/files/neg/macro-invalidshape-b.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidshape-b.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidshape-b/Impls_1.scala b/test/files/neg/macro-invalidshape-b/Impls_1.scala
new file mode 100644
index 0000000000..7b1620d117
--- /dev/null
+++ b/test/files/neg/macro-invalidshape-b/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Any]) = ???
+}
diff --git a/test/files/neg/macro-invalidshape-b/Macros_Test_2.scala b/test/files/neg/macro-invalidshape-b/Macros_Test_2.scala
new file mode 100644
index 0000000000..b67cd32a6e
--- /dev/null
+++ b/test/files/neg/macro-invalidshape-b/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo(x: Any) = macro Impls.foo(null)(null)
+}
+
+object Test extends App {
+ import Macros._
+ foo(42)
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidshape-c.check b/test/files/neg/macro-invalidshape-c.check
new file mode 100644
index 0000000000..84d8c35222
--- /dev/null
+++ b/test/files/neg/macro-invalidshape-c.check
@@ -0,0 +1,6 @@
+Macros_Test_2.scala:2: error: macro body has wrong shape:
+ required: macro <reference to implementation object>.<implementation method name>
+ or : macro <implementation method name>
+ def foo(x: Any) = macro {2; Impls.foo}
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidshape-c.flags b/test/files/neg/macro-invalidshape-c.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidshape-c.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidshape-c/Impls_1.scala b/test/files/neg/macro-invalidshape-c/Impls_1.scala
new file mode 100644
index 0000000000..7b1620d117
--- /dev/null
+++ b/test/files/neg/macro-invalidshape-c/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Any]) = ???
+}
diff --git a/test/files/neg/macro-invalidshape-c/Macros_Test_2.scala b/test/files/neg/macro-invalidshape-c/Macros_Test_2.scala
new file mode 100644
index 0000000000..552c3710c7
--- /dev/null
+++ b/test/files/neg/macro-invalidshape-c/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo(x: Any) = macro {2; Impls.foo}
+}
+
+object Test extends App {
+ import Macros._
+ foo(42)
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidshape-d.check b/test/files/neg/macro-invalidshape-d.check
new file mode 100644
index 0000000000..f0d77e2f2d
--- /dev/null
+++ b/test/files/neg/macro-invalidshape-d.check
@@ -0,0 +1,8 @@
+Macros_Test_2.scala:2: warning: macro is now a reserved word; usage as an identifier is deprecated
+ def foo(x: Any) = {2; macro Impls.foo}
+ ^
+Macros_Test_2.scala:2: error: ';' expected but '.' found.
+ def foo(x: Any) = {2; macro Impls.foo}
+ ^
+one warning found
+one error found
diff --git a/test/files/neg/macro-invalidshape-d.flags b/test/files/neg/macro-invalidshape-d.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidshape-d.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidshape-d/Impls_1.scala b/test/files/neg/macro-invalidshape-d/Impls_1.scala
new file mode 100644
index 0000000000..7b1620d117
--- /dev/null
+++ b/test/files/neg/macro-invalidshape-d/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Any]) = ???
+}
diff --git a/test/files/neg/macro-invalidshape-d/Macros_Test_2.scala b/test/files/neg/macro-invalidshape-d/Macros_Test_2.scala
new file mode 100644
index 0000000000..bacd9a6e7c
--- /dev/null
+++ b/test/files/neg/macro-invalidshape-d/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo(x: Any) = {2; macro Impls.foo}
+}
+
+object Test extends App {
+ import Macros._
+ foo(42)
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-context-bounds.check b/test/files/neg/macro-invalidsig-context-bounds.check
new file mode 100644
index 0000000000..dd68e5db1b
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-context-bounds.check
@@ -0,0 +1,4 @@
+Impls_1.scala:4: error: macro implementations cannot have implicit parameters other than TypeTag evidences
+ def foo[U: c.TypeTag: Numeric](c: Ctx) = {
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-context-bounds.flags b/test/files/neg/macro-invalidsig-context-bounds.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-context-bounds.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-context-bounds/Impls_1.scala b/test/files/neg/macro-invalidsig-context-bounds/Impls_1.scala
new file mode 100644
index 0000000000..2eb2ab3947
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-context-bounds/Impls_1.scala
@@ -0,0 +1,8 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[U: c.TypeTag: Numeric](c: Ctx) = {
+ import c.mirror._
+ Literal(Constant(42))
+ }
+}
diff --git a/test/files/neg/macro-invalidsig-context-bounds/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-context-bounds/Macros_Test_2.scala
new file mode 100644
index 0000000000..5b4602f328
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-context-bounds/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo[U] = macro Impls.foo[U]
+}
+
+object Test extends App {
+ import Macros._
+ println(foo[String])
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-ctx-badargc.check b/test/files/neg/macro-invalidsig-ctx-badargc.check
new file mode 100644
index 0000000000..1e1621ab61
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-ctx-badargc.check
@@ -0,0 +1,7 @@
+Macros_Test_2.scala:2: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.makro.Context): c.Expr[Any]
+ found : : Nothing
+number of parameter sections differ
+ def foo = macro Impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-ctx-badargc.flags b/test/files/neg/macro-invalidsig-ctx-badargc.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-ctx-badargc.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-ctx-badargc/Impls_1.scala b/test/files/neg/macro-invalidsig-ctx-badargc/Impls_1.scala
new file mode 100644
index 0000000000..da28944d27
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-ctx-badargc/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.api.{Mirror => Ctx}
+
+object Impls {
+ def foo = ???
+}
diff --git a/test/files/neg/macro-invalidsig-ctx-badargc/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-ctx-badargc/Macros_Test_2.scala
new file mode 100644
index 0000000000..96a8de2832
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-ctx-badargc/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo = macro Impls.foo
+}
+
+object Test extends App {
+ import Macros._
+ foo
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-ctx-badtype.check b/test/files/neg/macro-invalidsig-ctx-badtype.check
new file mode 100644
index 0000000000..3913a8e3cb
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-ctx-badtype.check
@@ -0,0 +1,7 @@
+Macros_Test_2.scala:2: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.makro.Context): c.Expr[Any]
+ found : (c: scala.reflect.api.Mirror): Nothing
+type mismatch for parameter c: scala.reflect.makro.Context does not conform to scala.reflect.api.Mirror
+ def foo = macro Impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-ctx-badtype.flags b/test/files/neg/macro-invalidsig-ctx-badtype.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-ctx-badtype.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-ctx-badtype/Impls_1.scala b/test/files/neg/macro-invalidsig-ctx-badtype/Impls_1.scala
new file mode 100644
index 0000000000..747a2e9ca8
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-ctx-badtype/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.api.{Mirror => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = ???
+}
diff --git a/test/files/neg/macro-invalidsig-ctx-badtype/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-ctx-badtype/Macros_Test_2.scala
new file mode 100644
index 0000000000..96a8de2832
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-ctx-badtype/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo = macro Impls.foo
+}
+
+object Test extends App {
+ import Macros._
+ foo
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-ctx-badvarargs.check b/test/files/neg/macro-invalidsig-ctx-badvarargs.check
new file mode 100644
index 0000000000..18e3d6201f
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-ctx-badvarargs.check
@@ -0,0 +1,7 @@
+Macros_Test_2.scala:2: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.makro.Context): c.Expr[Any]
+ found : (cs: scala.reflect.makro.Context*): Nothing
+types incompatible for parameter cs: corresponding is not a vararg parameter
+ def foo = macro Impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-ctx-badvarargs.flags b/test/files/neg/macro-invalidsig-ctx-badvarargs.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-ctx-badvarargs.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-ctx-badvarargs/Impls_1.scala b/test/files/neg/macro-invalidsig-ctx-badvarargs/Impls_1.scala
new file mode 100644
index 0000000000..b2fb2539ec
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-ctx-badvarargs/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(cs: Ctx*) = ???
+}
diff --git a/test/files/neg/macro-invalidsig-ctx-badvarargs/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-ctx-badvarargs/Macros_Test_2.scala
new file mode 100644
index 0000000000..96a8de2832
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-ctx-badvarargs/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo = macro Impls.foo
+}
+
+object Test extends App {
+ import Macros._
+ foo
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-ctx-noctx.check b/test/files/neg/macro-invalidsig-ctx-noctx.check
new file mode 100644
index 0000000000..66fa7c3514
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-ctx-noctx.check
@@ -0,0 +1,7 @@
+Macros_Test_2.scala:2: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.makro.Context)(x: c.Expr[Any]): c.Expr[Any]
+ found : (c: scala.reflect.makro.Context): Nothing
+number of parameter sections differ
+ def foo(x: Any) = macro Impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-ctx-noctx.flags b/test/files/neg/macro-invalidsig-ctx-noctx.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-ctx-noctx.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-ctx-noctx/Impls_1.scala b/test/files/neg/macro-invalidsig-ctx-noctx/Impls_1.scala
new file mode 100644
index 0000000000..1e0ed755af
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-ctx-noctx/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = ???
+}
diff --git a/test/files/neg/macro-invalidsig-ctx-noctx/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-ctx-noctx/Macros_Test_2.scala
new file mode 100644
index 0000000000..e053cf99df
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-ctx-noctx/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo(x: Any) = macro Impls.foo
+}
+
+object Test extends App {
+ import Macros._
+ foo(42)
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-implicit-params.check b/test/files/neg/macro-invalidsig-implicit-params.check
new file mode 100644
index 0000000000..0dd1c27b50
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-implicit-params.check
@@ -0,0 +1,4 @@
+Impls_Macros_1.scala:4: error: macro implementations cannot have implicit parameters other than TypeTag evidences
+ def foo_targs[T, U: c.TypeTag](c: Ctx)(implicit x: c.Expr[Int]) = {
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-implicit-params.flags b/test/files/neg/macro-invalidsig-implicit-params.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-implicit-params.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-implicit-params/Impls_Macros_1.scala b/test/files/neg/macro-invalidsig-implicit-params/Impls_Macros_1.scala
new file mode 100644
index 0000000000..662ad2ab52
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-implicit-params/Impls_Macros_1.scala
@@ -0,0 +1,18 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo_targs[T, U: c.TypeTag](c: Ctx)(implicit x: c.Expr[Int]) = {
+ import c.{prefix => prefix}
+ import c.mirror._
+ val body = Block(
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("invoking foo_targs...")))),
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("type of prefix is: " + prefix.tpe)))),
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("U is: " + implicitly[c.TypeTag[U]].tpe)))),
+ Literal(Constant(())))
+ Expr[Unit](body)
+ }
+}
+
+class Macros[T] {
+ def foo_targs[U](x: Int) = macro Impls.foo_targs[T, U]
+}
diff --git a/test/files/neg/macro-invalidsig-implicit-params/Test_2.scala b/test/files/neg/macro-invalidsig-implicit-params/Test_2.scala
new file mode 100644
index 0000000000..90e850df21
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-implicit-params/Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ println("foo_targs:")
+ new Macros[Int]().foo_targs[String](42)
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-params-badargc.check b/test/files/neg/macro-invalidsig-params-badargc.check
new file mode 100644
index 0000000000..6de8c5e95a
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-params-badargc.check
@@ -0,0 +1,7 @@
+Impls_Macros_1.scala:8: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.makro.Context)(x: c.Expr[Int]): c.Expr[Any]
+ found : (c: scala.reflect.makro.Context)(x: c.Expr[Int], y: c.Expr[Int]): Nothing
+parameter lists have different length, found extra parameter y: c.Expr[Int]
+ def foo(x: Int) = macro Impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-params-badargc.flags b/test/files/neg/macro-invalidsig-params-badargc.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-params-badargc.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-params-badargc/Impls_Macros_1.scala b/test/files/neg/macro-invalidsig-params-badargc/Impls_Macros_1.scala
new file mode 100644
index 0000000000..4b449f35ed
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-params-badargc/Impls_Macros_1.scala
@@ -0,0 +1,9 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int], y: c.Expr[Int]) = ???
+}
+
+object Macros {
+ def foo(x: Int) = macro Impls.foo
+}
diff --git a/test/files/neg/macro-noexpand/Test_2.scala b/test/files/neg/macro-invalidsig-params-badargc/Test_2.scala
index 0bed592883..cbd6232073 100644
--- a/test/files/neg/macro-noexpand/Test_2.scala
+++ b/test/files/neg/macro-invalidsig-params-badargc/Test_2.scala
@@ -1,4 +1,4 @@
object Test extends App {
import Macros._
- foo(x)
+ foo(42)
} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-params-badtype.check b/test/files/neg/macro-invalidsig-params-badtype.check
new file mode 100644
index 0000000000..71a65aec84
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-params-badtype.check
@@ -0,0 +1,7 @@
+Impls_Macros_1.scala:8: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.makro.Context)(x: c.Expr[Int]): c.Expr[Any]
+ found : (c: scala.reflect.makro.Context)(x: c.mirror.Tree): Nothing
+type mismatch for parameter x: c.Expr[Int] does not conform to c.mirror.Tree
+ def foo(x: Int) = macro Impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-params-badtype.flags b/test/files/neg/macro-invalidsig-params-badtype.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-params-badtype.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala b/test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala
new file mode 100644
index 0000000000..29220c1c82
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala
@@ -0,0 +1,9 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.mirror.Tree) = ???
+}
+
+object Macros {
+ def foo(x: Int) = macro Impls.foo
+}
diff --git a/test/files/neg/macro-argtype-mismatch/Test_2.scala b/test/files/neg/macro-invalidsig-params-badtype/Test_2.scala
index 18feb69425..cbd6232073 100644
--- a/test/files/neg/macro-argtype-mismatch/Test_2.scala
+++ b/test/files/neg/macro-invalidsig-params-badtype/Test_2.scala
@@ -1,4 +1,4 @@
object Test extends App {
import Macros._
- foo("2")
+ foo(42)
} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-params-badvarargs.check b/test/files/neg/macro-invalidsig-params-badvarargs.check
new file mode 100644
index 0000000000..0827680299
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-params-badvarargs.check
@@ -0,0 +1,7 @@
+Impls_Macros_1.scala:8: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.makro.Context)(x: c.Expr[Int], y: c.Expr[Int]): c.Expr[Any]
+ found : (c: scala.reflect.makro.Context)(xs: c.Expr[Int]*): Nothing
+parameter lists have different length, required extra parameter y: c.Expr[Int]
+ def foo(x: Int, y: Int) = macro Impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-params-badvarargs.flags b/test/files/neg/macro-invalidsig-params-badvarargs.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-params-badvarargs.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-params-badvarargs/Impls_Macros_1.scala b/test/files/neg/macro-invalidsig-params-badvarargs/Impls_Macros_1.scala
new file mode 100644
index 0000000000..2ee1c2767c
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-params-badvarargs/Impls_Macros_1.scala
@@ -0,0 +1,9 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(xs: c.Expr[Int]*) = ???
+}
+
+object Macros {
+ def foo(x: Int, y: Int) = macro Impls.foo
+}
diff --git a/test/files/neg/macro-invalidsig-params-badvarargs/Test_2.scala b/test/files/neg/macro-invalidsig-params-badvarargs/Test_2.scala
new file mode 100644
index 0000000000..fa50ac4f73
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-params-badvarargs/Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ import Macros._
+ foo(42, 100)
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-params-namemismatch.check b/test/files/neg/macro-invalidsig-params-namemismatch.check
new file mode 100644
index 0000000000..ca7270cca8
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-params-namemismatch.check
@@ -0,0 +1,7 @@
+Impls_Macros_1.scala:8: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.makro.Context)(x: c.Expr[Int], y: c.Expr[Int]): c.Expr[Any]
+ found : (c: scala.reflect.makro.Context)(y: c.Expr[Int], x: c.Expr[Int]): Nothing
+parameter names differ: x != y
+ def foo(x: Int, y: Int) = macro Impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-params-namemismatch.flags b/test/files/neg/macro-invalidsig-params-namemismatch.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-params-namemismatch.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-params-namemismatch/Impls_Macros_1.scala b/test/files/neg/macro-invalidsig-params-namemismatch/Impls_Macros_1.scala
new file mode 100644
index 0000000000..89c5347647
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-params-namemismatch/Impls_Macros_1.scala
@@ -0,0 +1,9 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(y: c.Expr[Int], x: c.Expr[Int]) = ???
+}
+
+object Macros {
+ def foo(x: Int, y: Int) = macro Impls.foo
+}
diff --git a/test/files/neg/macro-invalidsig-params-namemismatch/Test_2.scala b/test/files/neg/macro-invalidsig-params-namemismatch/Test_2.scala
new file mode 100644
index 0000000000..fa50ac4f73
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-params-namemismatch/Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ import Macros._
+ foo(42, 100)
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-tparams-badtype.check b/test/files/neg/macro-invalidsig-tparams-badtype.check
new file mode 100644
index 0000000000..bd1acc4a0a
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-badtype.check
@@ -0,0 +1,7 @@
+Macros_Test_2.scala:2: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.makro.Context): c.Expr[Any]
+ found : (c: scala.reflect.makro.Context)(U: c.mirror.Type): Nothing
+number of parameter sections differ
+ def foo[U] = macro Impls.foo[U]
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-tparams-badtype.flags b/test/files/neg/macro-invalidsig-tparams-badtype.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-badtype.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-tparams-badtype/Impls_1.scala b/test/files/neg/macro-invalidsig-tparams-badtype/Impls_1.scala
new file mode 100644
index 0000000000..b43251df33
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-badtype/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[U](c: Ctx)(U: c.mirror.Type) = ???
+}
diff --git a/test/files/neg/macro-invalidsig-tparams-badtype/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-tparams-badtype/Macros_Test_2.scala
new file mode 100644
index 0000000000..a82e813221
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-badtype/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo[U] = macro Impls.foo[U]
+}
+
+object Test extends App {
+ import Macros._
+ foo[Int]
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-tparams-bounds-a.check b/test/files/neg/macro-invalidsig-tparams-bounds-a.check
new file mode 100644
index 0000000000..6ba80b45c0
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-bounds-a.check
@@ -0,0 +1,4 @@
+Macros_Test_2.scala:2: error: type arguments [U] do not conform to method foo's type parameter bounds [U <: String]
+ def foo[U] = macro Impls.foo[U]
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-tparams-bounds-a.flags b/test/files/neg/macro-invalidsig-tparams-bounds-a.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-bounds-a.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-tparams-bounds-a/Impls_1.scala b/test/files/neg/macro-invalidsig-tparams-bounds-a/Impls_1.scala
new file mode 100644
index 0000000000..88b85d48f4
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-bounds-a/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[U <: String](c: Ctx) = ???
+}
diff --git a/test/files/neg/macro-invalidsig-tparams-bounds-a/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-tparams-bounds-a/Macros_Test_2.scala
new file mode 100644
index 0000000000..a82e813221
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-bounds-a/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo[U] = macro Impls.foo[U]
+}
+
+object Test extends App {
+ import Macros._
+ foo[Int]
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-tparams-bounds-b.check b/test/files/neg/macro-invalidsig-tparams-bounds-b.check
new file mode 100644
index 0000000000..50f0944acc
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-bounds-b.check
@@ -0,0 +1,4 @@
+Macros_Test_2.scala:2: error: type arguments [U] do not conform to method foo's type parameter bounds [U <: String]
+ def foo[U <: Int] = macro Impls.foo[U]
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-tparams-bounds-b.flags b/test/files/neg/macro-invalidsig-tparams-bounds-b.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-bounds-b.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-tparams-bounds-b/Impls_1.scala b/test/files/neg/macro-invalidsig-tparams-bounds-b/Impls_1.scala
new file mode 100644
index 0000000000..88b85d48f4
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-bounds-b/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[U <: String](c: Ctx) = ???
+}
diff --git a/test/files/neg/macro-invalidsig-tparams-bounds-b/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-tparams-bounds-b/Macros_Test_2.scala
new file mode 100644
index 0000000000..eed6369a16
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-bounds-b/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo[U <: Int] = macro Impls.foo[U]
+}
+
+object Test extends App {
+ import Macros._
+ foo[Int]
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-a.check b/test/files/neg/macro-invalidsig-tparams-notparams-a.check
new file mode 100644
index 0000000000..5b4ef42ea5
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-notparams-a.check
@@ -0,0 +1,4 @@
+Macros_Test_2.scala:2: error: macro implementation reference needs type arguments
+ def foo = macro Impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-a.flags b/test/files/neg/macro-invalidsig-tparams-notparams-a.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-notparams-a.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-a/Impls_1.scala b/test/files/neg/macro-invalidsig-tparams-notparams-a/Impls_1.scala
new file mode 100644
index 0000000000..bbe5b4e519
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-notparams-a/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[U: c.TypeTag](c: Ctx) = ???
+}
diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-a/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-tparams-notparams-a/Macros_Test_2.scala
new file mode 100644
index 0000000000..96a8de2832
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-notparams-a/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo = macro Impls.foo
+}
+
+object Test extends App {
+ import Macros._
+ foo
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-b.check b/test/files/neg/macro-invalidsig-tparams-notparams-b.check
new file mode 100644
index 0000000000..261e3b8293
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-notparams-b.check
@@ -0,0 +1,4 @@
+Macros_Test_2.scala:3: error: macro implementation reference needs type arguments
+ def foo[V] = macro Impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-b.flags b/test/files/neg/macro-invalidsig-tparams-notparams-b.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-notparams-b.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-b/Impls_1.scala b/test/files/neg/macro-invalidsig-tparams-notparams-b/Impls_1.scala
new file mode 100644
index 0000000000..7bc46ff876
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-notparams-b/Impls_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[T: c.TypeTag, U: c.TypeTag, V](c: Ctx)(implicit V: c.TypeTag[V]): c.Expr[Unit] = {
+ import c.mirror._
+ println(implicitly[c.TypeTag[T]])
+ println(implicitly[c.TypeTag[U]])
+ println(V)
+ Literal(Constant(()))
+ }
+}
diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-b/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-tparams-notparams-b/Macros_Test_2.scala
new file mode 100644
index 0000000000..7d02bf613a
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-notparams-b/Macros_Test_2.scala
@@ -0,0 +1,11 @@
+class D[T] {
+ class C[U] {
+ def foo[V] = macro Impls.foo
+ }
+}
+
+object Test extends App {
+ val outer1 = new D[Int]
+ val outer2 = new outer1.C[String]
+ outer2.foo[Boolean]
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-c.check b/test/files/neg/macro-invalidsig-tparams-notparams-c.check
new file mode 100644
index 0000000000..b64a469cc3
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-notparams-c.check
@@ -0,0 +1,4 @@
+Macros_Test_2.scala:3: error: wrong number of type parameters for method foo: [T, U, V](c: scala.reflect.makro.Context)(implicit evidence$1: c.TypeTag[T], implicit evidence$2: c.TypeTag[U], implicit V: c.TypeTag[V])c.Expr[Unit]
+ def foo[V] = macro Impls.foo[V]
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-c.flags b/test/files/neg/macro-invalidsig-tparams-notparams-c.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-notparams-c.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-c/Impls_1.scala b/test/files/neg/macro-invalidsig-tparams-notparams-c/Impls_1.scala
new file mode 100644
index 0000000000..7bc46ff876
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-notparams-c/Impls_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[T: c.TypeTag, U: c.TypeTag, V](c: Ctx)(implicit V: c.TypeTag[V]): c.Expr[Unit] = {
+ import c.mirror._
+ println(implicitly[c.TypeTag[T]])
+ println(implicitly[c.TypeTag[U]])
+ println(V)
+ Literal(Constant(()))
+ }
+}
diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-c/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-tparams-notparams-c/Macros_Test_2.scala
new file mode 100644
index 0000000000..109e142e52
--- /dev/null
+++ b/test/files/neg/macro-invalidsig-tparams-notparams-c/Macros_Test_2.scala
@@ -0,0 +1,11 @@
+class D[T] {
+ class C[U] {
+ def foo[V] = macro Impls.foo[V]
+ }
+}
+
+object Test extends App {
+ val outer1 = new D[Int]
+ val outer2 = new outer1.C[String]
+ outer2.foo[Boolean]
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidusage-badargs.check b/test/files/neg/macro-invalidusage-badargs.check
new file mode 100644
index 0000000000..52beda5b61
--- /dev/null
+++ b/test/files/neg/macro-invalidusage-badargs.check
@@ -0,0 +1,6 @@
+Macros_Test_2.scala:7: error: type mismatch;
+ found : String("42")
+ required: Int
+ val s: String = foo("42")
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidusage-badargs.flags b/test/files/neg/macro-invalidusage-badargs.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidusage-badargs.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidusage-badargs/Impls_1.scala b/test/files/neg/macro-invalidusage-badargs/Impls_1.scala
new file mode 100644
index 0000000000..2346a6106d
--- /dev/null
+++ b/test/files/neg/macro-invalidusage-badargs/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int]) = x
+}
diff --git a/test/files/neg/macro-invalidusage-badargs/Macros_Test_2.scala b/test/files/neg/macro-invalidusage-badargs/Macros_Test_2.scala
new file mode 100644
index 0000000000..a6af1bb277
--- /dev/null
+++ b/test/files/neg/macro-invalidusage-badargs/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo(x: Int) = macro Impls.foo
+}
+
+object Test extends App {
+ import Macros._
+ val s: String = foo("42")
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidusage-badbounds.check b/test/files/neg/macro-invalidusage-badbounds.check
new file mode 100644
index 0000000000..fd0b64533e
--- /dev/null
+++ b/test/files/neg/macro-invalidusage-badbounds.check
@@ -0,0 +1,4 @@
+Macros_Test_2.scala:7: error: type arguments [Int] do not conform to macro method foo's type parameter bounds [U <: String]
+ foo[Int]
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidusage-badbounds.flags b/test/files/neg/macro-invalidusage-badbounds.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidusage-badbounds.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidusage-badbounds/Impls_1.scala b/test/files/neg/macro-invalidusage-badbounds/Impls_1.scala
new file mode 100644
index 0000000000..88b85d48f4
--- /dev/null
+++ b/test/files/neg/macro-invalidusage-badbounds/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[U <: String](c: Ctx) = ???
+}
diff --git a/test/files/neg/macro-invalidusage-badbounds/Macros_Test_2.scala b/test/files/neg/macro-invalidusage-badbounds/Macros_Test_2.scala
new file mode 100644
index 0000000000..3139599108
--- /dev/null
+++ b/test/files/neg/macro-invalidusage-badbounds/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo[U <: String] = macro Impls.foo[U]
+}
+
+object Test extends App {
+ import Macros._
+ foo[Int]
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidusage-badtargs.check b/test/files/neg/macro-invalidusage-badtargs.check
new file mode 100644
index 0000000000..61ef6f5af7
--- /dev/null
+++ b/test/files/neg/macro-invalidusage-badtargs.check
@@ -0,0 +1,4 @@
+Macros_Test_2.scala:7: error: macro method foo: (x: Int)Int does not take type parameters.
+ val s: String = foo[String](42)
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidusage-badtargs.flags b/test/files/neg/macro-invalidusage-badtargs.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidusage-badtargs.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidusage-badtargs/Impls_1.scala b/test/files/neg/macro-invalidusage-badtargs/Impls_1.scala
new file mode 100644
index 0000000000..2346a6106d
--- /dev/null
+++ b/test/files/neg/macro-invalidusage-badtargs/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int]) = x
+}
diff --git a/test/files/neg/macro-invalidusage-badtargs/Macros_Test_2.scala b/test/files/neg/macro-invalidusage-badtargs/Macros_Test_2.scala
new file mode 100644
index 0000000000..c54093b637
--- /dev/null
+++ b/test/files/neg/macro-invalidusage-badtargs/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo(x: Int) = macro Impls.foo
+}
+
+object Test extends App {
+ import Macros._
+ val s: String = foo[String](42)
+} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidusage-methodvaluesyntax.check b/test/files/neg/macro-invalidusage-methodvaluesyntax.check
new file mode 100644
index 0000000000..27b2023202
--- /dev/null
+++ b/test/files/neg/macro-invalidusage-methodvaluesyntax.check
@@ -0,0 +1,4 @@
+Macros_Test_2.scala:6: error: macros cannot be eta-expanded
+ val firstClassFoo = Macros.foo _
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidusage-methodvaluesyntax.flags b/test/files/neg/macro-invalidusage-methodvaluesyntax.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-invalidusage-methodvaluesyntax.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala b/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala
new file mode 100644
index 0000000000..8e52613b6d
--- /dev/null
+++ b/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala
@@ -0,0 +1,9 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = {
+ import c.mirror._
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/neg/macro-invalidusage-methodvaluesyntax/Macros_Test_2.scala b/test/files/neg/macro-invalidusage-methodvaluesyntax/Macros_Test_2.scala
new file mode 100644
index 0000000000..343cec99b5
--- /dev/null
+++ b/test/files/neg/macro-invalidusage-methodvaluesyntax/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo = macro Impls.foo
+}
+
+object Test extends App {
+ val firstClassFoo = Macros.foo _
+ firstClassFoo
+} \ No newline at end of file
diff --git a/test/files/neg/macro-noexpand.check b/test/files/neg/macro-noexpand.check
index c15d54bb32..c829bbab71 100644
--- a/test/files/neg/macro-noexpand.check
+++ b/test/files/neg/macro-noexpand.check
@@ -1,4 +1,4 @@
-Test_2.scala:3: error: not found: value x
+Macros_Test_2.scala:7: error: not found: value x
foo(x)
^
one error found
diff --git a/test/files/neg/macro-noexpand.flags b/test/files/neg/macro-noexpand.flags
index 7fea2ff901..cd66464f2f 100644
--- a/test/files/neg/macro-noexpand.flags
+++ b/test/files/neg/macro-noexpand.flags
@@ -1 +1 @@
--Xmacros \ No newline at end of file
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-noexpand/Impls_1.scala b/test/files/neg/macro-noexpand/Impls_1.scala
new file mode 100644
index 0000000000..7b1620d117
--- /dev/null
+++ b/test/files/neg/macro-noexpand/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Any]) = ???
+}
diff --git a/test/files/neg/macro-noexpand/Macros_1.scala b/test/files/neg/macro-noexpand/Macros_1.scala
deleted file mode 100644
index 7a6aadf6a1..0000000000
--- a/test/files/neg/macro-noexpand/Macros_1.scala
+++ /dev/null
@@ -1,3 +0,0 @@
-object Macros {
- def macro foo(x: Any) = ???
-} \ No newline at end of file
diff --git a/test/files/neg/macro-noexpand/Macros_Test_2.scala b/test/files/neg/macro-noexpand/Macros_Test_2.scala
new file mode 100644
index 0000000000..e783e2b53e
--- /dev/null
+++ b/test/files/neg/macro-noexpand/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo(x: Any) = macro Impls.foo
+}
+
+object Test extends App {
+ import Macros._
+ foo(x)
+} \ No newline at end of file
diff --git a/test/files/neg/macro-noncompilertree.flags b/test/files/neg/macro-noncompilertree.flags
index 7fea2ff901..cd66464f2f 100644
--- a/test/files/neg/macro-noncompilertree.flags
+++ b/test/files/neg/macro-noncompilertree.flags
@@ -1 +1 @@
--Xmacros \ No newline at end of file
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-noncompilertree/Macros_1.scala b/test/files/neg/macro-noncompilertree/Macros_1.scala
deleted file mode 100644
index eb1253e5e9..0000000000
--- a/test/files/neg/macro-noncompilertree/Macros_1.scala
+++ /dev/null
@@ -1,3 +0,0 @@
-object Macros {
- def macro foo = scala.reflect.mirror.Literal(scala.reflect.mirror.Constant(2))
-} \ No newline at end of file
diff --git a/test/files/neg/macro-nontree.flags b/test/files/neg/macro-nontree.flags
index 7fea2ff901..cd66464f2f 100644
--- a/test/files/neg/macro-nontree.flags
+++ b/test/files/neg/macro-nontree.flags
@@ -1 +1 @@
--Xmacros \ No newline at end of file
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-nontree/Macros_1.scala b/test/files/neg/macro-nontree/Macros_1.scala
deleted file mode 100644
index 2433974a85..0000000000
--- a/test/files/neg/macro-nontree/Macros_1.scala
+++ /dev/null
@@ -1,3 +0,0 @@
-object Macros {
- def macro foo = 2
-} \ No newline at end of file
diff --git a/test/files/neg/macro-nontypeablebody.check b/test/files/neg/macro-nontypeablebody.check
new file mode 100644
index 0000000000..0cfc864df8
--- /dev/null
+++ b/test/files/neg/macro-nontypeablebody.check
@@ -0,0 +1,4 @@
+Macros_Test_2.scala:2: error: value foo2 is not a member of object Impls
+ def foo(x: Any) = macro Impls.foo2
+ ^
+one error found
diff --git a/test/files/neg/macro-nontypeablebody.flags b/test/files/neg/macro-nontypeablebody.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-nontypeablebody.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-nontypeablebody/Impls_1.scala b/test/files/neg/macro-nontypeablebody/Impls_1.scala
new file mode 100644
index 0000000000..7b1620d117
--- /dev/null
+++ b/test/files/neg/macro-nontypeablebody/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Any]) = ???
+}
diff --git a/test/files/neg/macro-nontypeablebody/Macros_Test_2.scala b/test/files/neg/macro-nontypeablebody/Macros_Test_2.scala
new file mode 100644
index 0000000000..2031893970
--- /dev/null
+++ b/test/files/neg/macro-nontypeablebody/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo(x: Any) = macro Impls.foo2
+}
+
+object Test extends App {
+ import Macros._
+ foo(42)
+} \ No newline at end of file
diff --git a/test/files/neg/macro-override-macro-overrides-abstract-method-a.check b/test/files/neg/macro-override-macro-overrides-abstract-method-a.check
new file mode 100644
index 0000000000..4d95dfc45c
--- /dev/null
+++ b/test/files/neg/macro-override-macro-overrides-abstract-method-a.check
@@ -0,0 +1,5 @@
+Impls_Macros_1.scala:12: error: overriding method foo in trait Foo of type (x: Int)Int;
+ macro method foo cannot override an abstract method
+ def foo(x: Int) = macro Impls.impl
+ ^
+one error found
diff --git a/test/files/neg/macro-override-macro-overrides-abstract-method-a.flags b/test/files/neg/macro-override-macro-overrides-abstract-method-a.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-override-macro-overrides-abstract-method-a.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-override-macro-overrides-abstract-method-a/Impls_Macros_1.scala b/test/files/neg/macro-override-macro-overrides-abstract-method-a/Impls_Macros_1.scala
new file mode 100644
index 0000000000..cb0b152852
--- /dev/null
+++ b/test/files/neg/macro-override-macro-overrides-abstract-method-a/Impls_Macros_1.scala
@@ -0,0 +1,13 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def impl(c: Ctx)(x: c.Expr[Int]) = x
+}
+
+trait Foo {
+ def foo(x: Int): Int
+}
+
+object Macros extends Foo {
+ def foo(x: Int) = macro Impls.impl
+}
diff --git a/test/files/neg/macro-override-macro-overrides-abstract-method-a/Test_2.scala b/test/files/neg/macro-override-macro-overrides-abstract-method-a/Test_2.scala
new file mode 100644
index 0000000000..7e3357ec28
--- /dev/null
+++ b/test/files/neg/macro-override-macro-overrides-abstract-method-a/Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ val designator: Macros.type = Macros
+ designator.foo(42)
+} \ No newline at end of file
diff --git a/test/files/neg/macro-override-macro-overrides-abstract-method-b.check b/test/files/neg/macro-override-macro-overrides-abstract-method-b.check
new file mode 100644
index 0000000000..4d95dfc45c
--- /dev/null
+++ b/test/files/neg/macro-override-macro-overrides-abstract-method-b.check
@@ -0,0 +1,5 @@
+Impls_Macros_1.scala:12: error: overriding method foo in trait Foo of type (x: Int)Int;
+ macro method foo cannot override an abstract method
+ def foo(x: Int) = macro Impls.impl
+ ^
+one error found
diff --git a/test/files/neg/macro-override-macro-overrides-abstract-method-b.flags b/test/files/neg/macro-override-macro-overrides-abstract-method-b.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-override-macro-overrides-abstract-method-b.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-override-macro-overrides-abstract-method-b/Impls_Macros_1.scala b/test/files/neg/macro-override-macro-overrides-abstract-method-b/Impls_Macros_1.scala
new file mode 100644
index 0000000000..cb0b152852
--- /dev/null
+++ b/test/files/neg/macro-override-macro-overrides-abstract-method-b/Impls_Macros_1.scala
@@ -0,0 +1,13 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def impl(c: Ctx)(x: c.Expr[Int]) = x
+}
+
+trait Foo {
+ def foo(x: Int): Int
+}
+
+object Macros extends Foo {
+ def foo(x: Int) = macro Impls.impl
+}
diff --git a/test/files/neg/macro-override-macro-overrides-abstract-method-b/Test_2.scala b/test/files/neg/macro-override-macro-overrides-abstract-method-b/Test_2.scala
new file mode 100644
index 0000000000..08fff30baf
--- /dev/null
+++ b/test/files/neg/macro-override-macro-overrides-abstract-method-b/Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ val designator: Foo = Macros
+ designator.foo(42)
+} \ No newline at end of file
diff --git a/test/files/neg/macro-override-method-overrides-macro.check b/test/files/neg/macro-override-method-overrides-macro.check
new file mode 100644
index 0000000000..42edb0ff23
--- /dev/null
+++ b/test/files/neg/macro-override-method-overrides-macro.check
@@ -0,0 +1,5 @@
+Macros_Test_2.scala:8: error: overriding macro method foo in class B of type (x: String)Unit;
+ method foo cannot override a macro
+ override def foo(x: String) = println("fooDString")
+ ^
+one error found
diff --git a/test/files/neg/macro-override-method-overrides-macro.flags b/test/files/neg/macro-override-method-overrides-macro.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/macro-override-method-overrides-macro.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/macro-override-method-overrides-macro/Impls_1.scala b/test/files/neg/macro-override-method-overrides-macro/Impls_1.scala
new file mode 100644
index 0000000000..0b127f5a59
--- /dev/null
+++ b/test/files/neg/macro-override-method-overrides-macro/Impls_1.scala
@@ -0,0 +1,15 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def impl(c: Ctx)(tag: String, x: c.Expr[_]) = {
+ import c.{prefix => prefix}
+ import c.mirror._
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(tag)), Literal(Constant(prefix.toString)), x.tree))
+ Expr[Unit](body)
+ }
+
+ def fooBString(c: Ctx)(x: c.Expr[_]) = impl(c)("fooBString", x)
+ def fooBInt(c: Ctx)(x: c.Expr[_]) = impl(c)("fooBInt", x)
+ def fooDInt(c: Ctx)(x: c.Expr[_]) = impl(c)("fooDInt", x)
+ def fooZString(c: Ctx)(x: c.Expr[_]) = impl(c)("fooZString", x)
+}
diff --git a/test/files/neg/macro-override-method-overrides-macro/Macros_Test_2.scala b/test/files/neg/macro-override-method-overrides-macro/Macros_Test_2.scala
new file mode 100644
index 0000000000..36821b05d8
--- /dev/null
+++ b/test/files/neg/macro-override-method-overrides-macro/Macros_Test_2.scala
@@ -0,0 +1,15 @@
+class B {
+ def foo(x: String) = macro Impls.fooBString
+ def foo(x: Int) = macro Impls.fooBInt
+ def foo(x: Boolean) = println("fooBBoolean")
+}
+
+class D extends B {
+ override def foo(x: String) = println("fooDString")
+ override def foo(x: Int) = macro Impls.fooDInt
+}
+
+class Z extends D {
+ override def foo(x: String) = macro Impls.fooZString
+ override def foo(x: Boolean) = println("fooZBoolean")
+}
diff --git a/test/files/neg/macro-reify-groundtypetag-hktypeparams-notags.check b/test/files/neg/macro-reify-groundtypetag-hktypeparams-notags.check
new file mode 100644
index 0000000000..39e90f827e
--- /dev/null
+++ b/test/files/neg/macro-reify-groundtypetag-hktypeparams-notags.check
@@ -0,0 +1,7 @@
+Test.scala:5: error: No ConcreteTypeTag available for C[T]
+ println(implicitly[ConcreteTypeTag[C[T]]])
+ ^
+Test.scala:6: error: No ConcreteTypeTag available for List[C[T]]
+ println(implicitly[ConcreteTypeTag[List[C[T]]]])
+ ^
+two errors found
diff --git a/test/files/neg/macro-reify-groundtypetag-hktypeparams-notags/Test.scala b/test/files/neg/macro-reify-groundtypetag-hktypeparams-notags/Test.scala
new file mode 100644
index 0000000000..1302999da6
--- /dev/null
+++ b/test/files/neg/macro-reify-groundtypetag-hktypeparams-notags/Test.scala
@@ -0,0 +1,9 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ def fooNoTypeTagHK[C[_], T] = {
+ println(implicitly[ConcreteTypeTag[C[T]]])
+ println(implicitly[ConcreteTypeTag[List[C[T]]]])
+ }
+ fooNoTypeTagHK[List, Int]
+} \ No newline at end of file
diff --git a/test/files/neg/macro-reify-groundtypetag-typeparams-notags.check b/test/files/neg/macro-reify-groundtypetag-typeparams-notags.check
new file mode 100644
index 0000000000..164ca3543f
--- /dev/null
+++ b/test/files/neg/macro-reify-groundtypetag-typeparams-notags.check
@@ -0,0 +1,7 @@
+Test.scala:5: error: No ConcreteTypeTag available for T
+ println(implicitly[ConcreteTypeTag[T]])
+ ^
+Test.scala:6: error: No ConcreteTypeTag available for List[T]
+ println(implicitly[ConcreteTypeTag[List[T]]])
+ ^
+two errors found
diff --git a/test/files/neg/macro-reify-groundtypetag-typeparams-notags/Test.scala b/test/files/neg/macro-reify-groundtypetag-typeparams-notags/Test.scala
new file mode 100644
index 0000000000..d2276ce333
--- /dev/null
+++ b/test/files/neg/macro-reify-groundtypetag-typeparams-notags/Test.scala
@@ -0,0 +1,9 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ def fooNoTypeTag[T] = {
+ println(implicitly[ConcreteTypeTag[T]])
+ println(implicitly[ConcreteTypeTag[List[T]]])
+ }
+ fooNoTypeTag[Int]
+} \ No newline at end of file
diff --git a/test/files/neg/macro-reify-groundtypetag-usetypetag.check b/test/files/neg/macro-reify-groundtypetag-usetypetag.check
new file mode 100644
index 0000000000..164ca3543f
--- /dev/null
+++ b/test/files/neg/macro-reify-groundtypetag-usetypetag.check
@@ -0,0 +1,7 @@
+Test.scala:5: error: No ConcreteTypeTag available for T
+ println(implicitly[ConcreteTypeTag[T]])
+ ^
+Test.scala:6: error: No ConcreteTypeTag available for List[T]
+ println(implicitly[ConcreteTypeTag[List[T]]])
+ ^
+two errors found
diff --git a/test/files/neg/macro-reify-groundtypetag-usetypetag/Test.scala b/test/files/neg/macro-reify-groundtypetag-usetypetag/Test.scala
new file mode 100644
index 0000000000..d82cdc33e9
--- /dev/null
+++ b/test/files/neg/macro-reify-groundtypetag-usetypetag/Test.scala
@@ -0,0 +1,9 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ def fooTypeTag[T: TypeTag] = {
+ println(implicitly[ConcreteTypeTag[T]])
+ println(implicitly[ConcreteTypeTag[List[T]]])
+ }
+ fooTypeTag[Int]
+} \ No newline at end of file
diff --git a/test/files/neg/macro-without-xmacros-a.check b/test/files/neg/macro-without-xmacros-a.check
new file mode 100644
index 0000000000..fd2667dbb8
--- /dev/null
+++ b/test/files/neg/macro-without-xmacros-a.check
@@ -0,0 +1,17 @@
+Macros_2.scala:5: error: macro definition needs to be enabled
+by making the implicit value language.experimental.macros visible.
+This can be achieved by adding the import clause 'import language.experimental.macros'
+or by setting the compiler option -language:experimental.macros.
+See the Scala docs for value scala.language.experimental.macros for a discussion
+why the feature needs to be explicitly enabled.
+ def foo(x: Int): Int = macro foo_impl
+ ^
+Macros_2.scala:7: error: macro definition needs to be enabled
+by making the implicit value language.experimental.macros visible.
+ def bar(x: Int): Int = macro bar_impl
+ ^
+Macros_2.scala:11: error: macro definition needs to be enabled
+by making the implicit value language.experimental.macros visible.
+ def quux(x: Int): Int = macro quux_impl
+ ^
+three errors found
diff --git a/test/files/neg/macro-without-xmacros-a/Impls_1.scala b/test/files/neg/macro-without-xmacros-a/Impls_1.scala
new file mode 100644
index 0000000000..01daf12b1a
--- /dev/null
+++ b/test/files/neg/macro-without-xmacros-a/Impls_1.scala
@@ -0,0 +1,18 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo_impl(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ import c.mirror._
+ Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1))))
+ }
+
+ def bar_impl(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ import c.mirror._
+ Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2))))
+ }
+
+ def quux_impl(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ import c.mirror._
+ Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(3))))
+ }
+}
diff --git a/test/files/neg/macro-without-xmacros-a/Macros_2.scala b/test/files/neg/macro-without-xmacros-a/Macros_2.scala
new file mode 100644
index 0000000000..62f9dcf505
--- /dev/null
+++ b/test/files/neg/macro-without-xmacros-a/Macros_2.scala
@@ -0,0 +1,12 @@
+import Impls._
+
+object Macros {
+ object Shmacros {
+ def foo(x: Int): Int = macro foo_impl
+ }
+ def bar(x: Int): Int = macro bar_impl
+}
+
+class Macros {
+ def quux(x: Int): Int = macro quux_impl
+} \ No newline at end of file
diff --git a/test/files/run/macro-basic/Test_2.scala b/test/files/neg/macro-without-xmacros-a/Test_3.scala
index e9a10e20c9..e9a10e20c9 100644
--- a/test/files/run/macro-basic/Test_2.scala
+++ b/test/files/neg/macro-without-xmacros-a/Test_3.scala
diff --git a/test/files/neg/macro-without-xmacros-b.check b/test/files/neg/macro-without-xmacros-b.check
new file mode 100644
index 0000000000..2d675b8319
--- /dev/null
+++ b/test/files/neg/macro-without-xmacros-b.check
@@ -0,0 +1,17 @@
+Macros_2.scala:3: error: macro definition needs to be enabled
+by making the implicit value language.experimental.macros visible.
+This can be achieved by adding the import clause 'import language.experimental.macros'
+or by setting the compiler option -language:experimental.macros.
+See the Scala docs for value scala.language.experimental.macros for a discussion
+why the feature needs to be explicitly enabled.
+ def foo(x: Int): Int = macro Impls.foo_impl
+ ^
+Macros_2.scala:5: error: macro definition needs to be enabled
+by making the implicit value language.experimental.macros visible.
+ def bar(x: Int): Int = macro Impls.bar_impl
+ ^
+Macros_2.scala:9: error: macro definition needs to be enabled
+by making the implicit value language.experimental.macros visible.
+ def quux(x: Int): Int = macro Impls.quux_impl
+ ^
+three errors found
diff --git a/test/files/neg/macro-without-xmacros-b/Impls_1.scala b/test/files/neg/macro-without-xmacros-b/Impls_1.scala
new file mode 100644
index 0000000000..01daf12b1a
--- /dev/null
+++ b/test/files/neg/macro-without-xmacros-b/Impls_1.scala
@@ -0,0 +1,18 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo_impl(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ import c.mirror._
+ Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1))))
+ }
+
+ def bar_impl(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ import c.mirror._
+ Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2))))
+ }
+
+ def quux_impl(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ import c.mirror._
+ Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(3))))
+ }
+}
diff --git a/test/files/neg/macro-without-xmacros-b/Macros_2.scala b/test/files/neg/macro-without-xmacros-b/Macros_2.scala
new file mode 100644
index 0000000000..de7080c7e8
--- /dev/null
+++ b/test/files/neg/macro-without-xmacros-b/Macros_2.scala
@@ -0,0 +1,10 @@
+object Macros {
+ object Shmacros {
+ def foo(x: Int): Int = macro Impls.foo_impl
+ }
+ def bar(x: Int): Int = macro Impls.bar_impl
+}
+
+class Macros {
+ def quux(x: Int): Int = macro Impls.quux_impl
+} \ No newline at end of file
diff --git a/test/files/neg/macro-without-xmacros-b/Test_3.scala b/test/files/neg/macro-without-xmacros-b/Test_3.scala
new file mode 100644
index 0000000000..e9a10e20c9
--- /dev/null
+++ b/test/files/neg/macro-without-xmacros-b/Test_3.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ import Macros.Shmacros._
+ println(foo(2) + Macros.bar(2) * new Macros().quux(4))
+} \ No newline at end of file
diff --git a/test/files/neg/pat_unreachable.flags b/test/files/neg/pat_unreachable.flags
new file mode 100644
index 0000000000..ba80cad69b
--- /dev/null
+++ b/test/files/neg/pat_unreachable.flags
@@ -0,0 +1 @@
+-Xoldpatmat
diff --git a/test/files/neg/patmat-type-check.check b/test/files/neg/patmat-type-check.check
index e045841ce1..ab4451f089 100644
--- a/test/files/neg/patmat-type-check.check
+++ b/test/files/neg/patmat-type-check.check
@@ -3,19 +3,31 @@ patmat-type-check.scala:22: error: scrutinee is incompatible with pattern type;
required: String
def f1 = "bob".reverse match { case Seq('b', 'o', 'b') => true } // fail
^
+patmat-type-check.scala:22: error: value _1 is not a member of object Seq
+ def f1 = "bob".reverse match { case Seq('b', 'o', 'b') => true } // fail
+ ^
patmat-type-check.scala:23: error: scrutinee is incompatible with pattern type;
found : Seq[A]
required: Array[Char]
def f2 = "bob".toArray match { case Seq('b', 'o', 'b') => true } // fail
^
+patmat-type-check.scala:23: error: value _1 is not a member of object Seq
+ def f2 = "bob".toArray match { case Seq('b', 'o', 'b') => true } // fail
+ ^
patmat-type-check.scala:27: error: scrutinee is incompatible with pattern type;
found : Seq[A]
required: Test.Bop2
def f3(x: Bop2) = x match { case Seq('b', 'o', 'b') => true } // fail
^
+patmat-type-check.scala:27: error: value _1 is not a member of object Seq
+ def f3(x: Bop2) = x match { case Seq('b', 'o', 'b') => true } // fail
+ ^
patmat-type-check.scala:30: error: scrutinee is incompatible with pattern type;
found : Seq[A]
required: Test.Bop3[Char]
def f4[T](x: Bop3[Char]) = x match { case Seq('b', 'o', 'b') => true } // fail
^
-four errors found
+patmat-type-check.scala:30: error: value _1 is not a member of object Seq
+ def f4[T](x: Bop3[Char]) = x match { case Seq('b', 'o', 'b') => true } // fail
+ ^
+8 errors found
diff --git a/test/files/neg/patmatexhaust.flags b/test/files/neg/patmatexhaust.flags
index e8fb65d50c..b7eb21d5f5 100644
--- a/test/files/neg/patmatexhaust.flags
+++ b/test/files/neg/patmatexhaust.flags
@@ -1 +1 @@
--Xfatal-warnings \ No newline at end of file
+-Xfatal-warnings -Xoldpatmat
diff --git a/test/files/neg/reify_ann2a.check b/test/files/neg/reify_ann2a.check
deleted file mode 100644
index 2afe37e1d8..0000000000
--- a/test/files/neg/reify_ann2a.check
+++ /dev/null
@@ -1,4 +0,0 @@
-reify_ann2a.scala:9: error: exception during macro expansion: implementation restriction: cannot reify annotation @ann(immutable.this.List.apply[String]("1a")) which involves a symbol declared inside the block being reified
- val tree = scala.reflect.Code.lift{
- ^
-one error found
diff --git a/test/files/neg/reify_ann2b.check b/test/files/neg/reify_ann2b.check
index ceb70689f1..b9dd84c1ee 100644
--- a/test/files/neg/reify_ann2b.check
+++ b/test/files/neg/reify_ann2b.check
@@ -1,7 +1,4 @@
-reify_ann2b.scala:10: error: inner classes cannot be classfile annotations
- class ann(bar: String) extends ClassfileAnnotation
- ^
-reify_ann2b.scala:9: error: exception during macro expansion: implementation restriction: cannot reify annotation @ann(bar = "1a") which involves a symbol declared inside the block being reified
- val tree = scala.reflect.Code.lift{
- ^
-two errors found
+reify_ann2b.scala:6: error: inner classes cannot be classfile annotations
+ class ann(bar: String) extends ClassfileAnnotation
+ ^
+one error found
diff --git a/test/files/neg/reify_ann2b.scala b/test/files/neg/reify_ann2b.scala
index b43567c2a7..6b6da8f790 100644
--- a/test/files/neg/reify_ann2b.scala
+++ b/test/files/neg/reify_ann2b.scala
@@ -1,12 +1,8 @@
-import scala.reflect._
-import scala.reflect.api._
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
// test 1: reify
- val tree = scala.reflect.Code.lift{
+ val tree = reify{
class ann(bar: String) extends ClassfileAnnotation
@ann(bar="1a") @ann(bar="1b") class C[@ann(bar="2a") @ann(bar="2b") T](@ann(bar="3a") @ann(bar="3b") x: T @ann(bar="4a") @ann(bar="4b")) {
@@ -20,8 +16,7 @@ object Test extends App {
println(tree.toString)
// test 2: import and typecheck
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val ttree = toolbox.typeCheck(tree)
println(ttree.toString)
diff --git a/test/files/neg/sealed-java-enums.flags b/test/files/neg/sealed-java-enums.flags
index e709c65918..312f3a87ec 100644
--- a/test/files/neg/sealed-java-enums.flags
+++ b/test/files/neg/sealed-java-enums.flags
@@ -1 +1 @@
--Xexperimental -Xfatal-warnings
+-Xexperimental -Xfatal-warnings -Xoldpatmat
diff --git a/test/files/neg/switch.flags b/test/files/neg/switch.flags
new file mode 100644
index 0000000000..809e9ff2f2
--- /dev/null
+++ b/test/files/neg/switch.flags
@@ -0,0 +1 @@
+ -Xoldpatmat
diff --git a/test/files/neg/t0418.check b/test/files/neg/t0418.check
index 4e9ad2f9ae..50931a1bca 100644
--- a/test/files/neg/t0418.check
+++ b/test/files/neg/t0418.check
@@ -4,4 +4,7 @@ t0418.scala:2: error: not found: value Foo12340771
t0418.scala:2: error: not found: value x
null match { case Foo12340771.Bar(x) => x }
^
-two errors found
+t0418.scala:2: error: Could not typecheck extractor call: case class <none> with arguments List((x @ _))
+ null match { case Foo12340771.Bar(x) => x }
+ ^
+three errors found
diff --git a/test/files/neg/t112706A.check b/test/files/neg/t112706A.check
index 30d0c3ec91..fb18b31be1 100644
--- a/test/files/neg/t112706A.check
+++ b/test/files/neg/t112706A.check
@@ -3,4 +3,7 @@ t112706A.scala:5: error: constructor cannot be instantiated to expected type;
required: String
case Tuple2(node,_) =>
^
-one error found
+t112706A.scala:5: error: Could not typecheck extractor call: case class Tuple2 with arguments List((node @ _), _)
+ case Tuple2(node,_) =>
+ ^
+two errors found
diff --git a/test/files/neg/t1878.check b/test/files/neg/t1878.check
index 128741a022..b47367e12c 100644
--- a/test/files/neg/t1878.check
+++ b/test/files/neg/t1878.check
@@ -9,10 +9,13 @@ t1878.scala:3: error: scrutinee is incompatible with pattern type;
t1878.scala:3: error: not found: value f
val err1 = "" match { case Seq(f @ _*, ',') => f }
^
+t1878.scala:3: error: value _2 is not a member of object Seq
+ val err1 = "" match { case Seq(f @ _*, ',') => f }
+ ^
t1878.scala:9: error: _* may only come last
val List(List(_*, arg2), _) = List(List(1,2,3), List(4,5,6))
^
t1878.scala:13: error: _* may only come last
case <p> { _* } </p> =>
^
-5 errors found
+6 errors found
diff --git a/test/files/neg/t2386.check b/test/files/neg/t2386.check
index 1a01696a9a..f70f12535f 100644
--- a/test/files/neg/t2386.check
+++ b/test/files/neg/t2386.check
@@ -1,4 +1,4 @@
-t2386.scala:2: error: could not find implicit value for evidence parameter of type scala.reflect.ClassManifest[Array[_ >: String with Int]]
- val a = Array(Array(1, 2), Array("a","b"))
- ^
-one error found
+t2386.scala:2: error: No ClassTag available for Array[_ >: String with Int]
+ val a = Array(Array(1, 2), Array("a","b"))
+ ^
+one error found
diff --git a/test/files/neg/t2775.check b/test/files/neg/t2775.check
index a30d35fdd9..f357221cd9 100644
--- a/test/files/neg/t2775.check
+++ b/test/files/neg/t2775.check
@@ -1,4 +1,4 @@
-t2775.scala:1: error: cannot find class manifest for element type B.this.T
-trait B[S] { type T = S; val c = new Array[T](1) }
- ^
-one error found
+t2775.scala:1: error: cannot find class tag for element type B.this.T
+trait B[S] { type T = S; val c = new Array[T](1) }
+ ^
+one error found
diff --git a/test/files/neg/t3098.flags b/test/files/neg/t3098.flags
index e8fb65d50c..b7eb21d5f5 100644
--- a/test/files/neg/t3098.flags
+++ b/test/files/neg/t3098.flags
@@ -1 +1 @@
--Xfatal-warnings \ No newline at end of file
+-Xfatal-warnings -Xoldpatmat
diff --git a/test/files/neg/t3392.check b/test/files/neg/t3392.check
index 842d63eec9..3a39098c4e 100644
--- a/test/files/neg/t3392.check
+++ b/test/files/neg/t3392.check
@@ -1,4 +1,7 @@
t3392.scala:9: error: not found: value x
case x@A(x/*<-- refers to the pattern that includes this comment*/.Ex(42)) =>
^
-one error found
+t3392.scala:9: error: Could not typecheck extractor call: case class <none> with arguments List(42)
+ case x@A(x/*<-- refers to the pattern that includes this comment*/.Ex(42)) =>
+ ^
+two errors found
diff --git a/test/files/neg/t3507.check b/test/files/neg/t3507.check
deleted file mode 100644
index 8e538e4a8b..0000000000
--- a/test/files/neg/t3507.check
+++ /dev/null
@@ -1,4 +0,0 @@
-t3507.scala:13: error: No Manifest available for _1.b.c.type.
- mani/*[object _1.b.c]*/(c) // kaboom in manifestOfType / TreeGen.mkAttributedQualifier
- ^
-one error found
diff --git a/test/files/neg/t3683a.flags b/test/files/neg/t3683a.flags
index 85d8eb2ba2..b7eb21d5f5 100644
--- a/test/files/neg/t3683a.flags
+++ b/test/files/neg/t3683a.flags
@@ -1 +1 @@
--Xfatal-warnings
+-Xfatal-warnings -Xoldpatmat
diff --git a/test/files/neg/t3692.check b/test/files/neg/t3692.check
index 96ddd2a461..d83abd31e2 100644
--- a/test/files/neg/t3692.check
+++ b/test/files/neg/t3692.check
@@ -1,4 +1,11 @@
-t3692.scala:15: error: unreachable code
- case m2: Map[T, Int] => new java.util.HashMap[T, Integer]
- ^
-one error found
+t3692.scala:11: warning: type Manifest in object Predef is deprecated: Use `@scala.reflect.ConcreteTypeTag` instead
+ private final def toJavaMap[T, V](map: Map[T, V])(implicit m1: Manifest[T], m2: Manifest[V]): java.util.Map[_, _] = {
+ ^
+t3692.scala:11: warning: type Manifest in object Predef is deprecated: Use `@scala.reflect.ConcreteTypeTag` instead
+ private final def toJavaMap[T, V](map: Map[T, V])(implicit m1: Manifest[T], m2: Manifest[V]): java.util.Map[_, _] = {
+ ^
+t3692.scala:15: error: unreachable code
+ case m2: Map[T, Int] => new java.util.HashMap[T, Integer]
+ ^
+two warnings found
+one error found
diff --git a/test/files/neg/t3692.flags b/test/files/neg/t3692.flags
new file mode 100644
index 0000000000..82becdfbfd
--- /dev/null
+++ b/test/files/neg/t3692.flags
@@ -0,0 +1 @@
+ -Xoldpatmat \ No newline at end of file
diff --git a/test/files/neg/t418.check b/test/files/neg/t418.check
index 1489547823..c06088ba9d 100644
--- a/test/files/neg/t418.check
+++ b/test/files/neg/t418.check
@@ -4,4 +4,7 @@ t418.scala:2: error: not found: value Foo12340771
t418.scala:2: error: not found: value x
null match { case Foo12340771.Bar(x) => x }
^
-two errors found
+t418.scala:2: error: Could not typecheck extractor call: case class <none> with arguments List((x @ _))
+ null match { case Foo12340771.Bar(x) => x }
+ ^
+three errors found
diff --git a/test/files/neg/t4425.check b/test/files/neg/t4425.check
index 4ff4b1eec0..0f2fe6f2d1 100644
--- a/test/files/neg/t4425.check
+++ b/test/files/neg/t4425.check
@@ -1,4 +1,4 @@
-t4425.scala:3: error: erroneous or inaccessible type
+t4425.scala:3: error: isInstanceOf cannot test if value types are references.
42 match { case _ X _ => () }
^
one error found
diff --git a/test/files/neg/t5334_1.check b/test/files/neg/t5334_1.check
new file mode 100644
index 0000000000..1d5a7cbc01
--- /dev/null
+++ b/test/files/neg/t5334_1.check
@@ -0,0 +1,4 @@
+t5334_1.scala:4: error: implementation restriction: cannot reify block of type C that involves a type declared inside the block being reified. consider casting the return value to a suitable type
+ reify {
+ ^
+one error found
diff --git a/test/files/neg/t5334_1.scala b/test/files/neg/t5334_1.scala
new file mode 100644
index 0000000000..a7de5a0915
--- /dev/null
+++ b/test/files/neg/t5334_1.scala
@@ -0,0 +1,8 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ reify {
+ class C { override def toString = "C" }
+ new C
+ }.eval
+}
diff --git a/test/files/neg/t5334_2.check b/test/files/neg/t5334_2.check
new file mode 100644
index 0000000000..a62bfff7a5
--- /dev/null
+++ b/test/files/neg/t5334_2.check
@@ -0,0 +1,4 @@
+t5334_2.scala:4: error: implementation restriction: cannot reify block of type List[(C, C)] that involves a type declared inside the block being reified. consider casting the return value to a suitable type
+ reify {
+ ^
+one error found
diff --git a/test/files/neg/t5334_2.scala b/test/files/neg/t5334_2.scala
new file mode 100644
index 0000000000..fc6dfcd0c1
--- /dev/null
+++ b/test/files/neg/t5334_2.scala
@@ -0,0 +1,8 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ reify {
+ class C { override def toString() = "C" }
+ List((new C, new C))
+ }.eval
+}
diff --git a/test/files/neg/t5510.check b/test/files/neg/t5510.check
new file mode 100644
index 0000000000..60da3bed40
--- /dev/null
+++ b/test/files/neg/t5510.check
@@ -0,0 +1,19 @@
+t5510.scala:2: error: unclosed string literal
+ val s1 = s"xxx
+ ^
+t5510.scala:3: error: unclosed string literal
+ val s2 = s"xxx $x
+ ^
+t5510.scala:4: error: unclosed string literal
+ val s3 = s"xxx $$
+ ^
+t5510.scala:5: error: unclosed string literal
+ val s4 = ""s"
+ ^
+t5510.scala:6: error: unclosed multi-line string literal
+ val s5 = ""s""" $s1 $s2 s"
+ ^
+t5510.scala:7: error: '}' expected but eof found.
+}
+ ^
+6 errors found
diff --git a/test/files/neg/t5510.scala b/test/files/neg/t5510.scala
new file mode 100644
index 0000000000..12630eb2cd
--- /dev/null
+++ b/test/files/neg/t5510.scala
@@ -0,0 +1,7 @@
+object Test {
+ val s1 = s"xxx
+ val s2 = s"xxx $x
+ val s3 = s"xxx $$
+ val s4 = ""s"
+ val s5 = ""s""" $s1 $s2 s"
+}
diff --git a/test/files/neg/t5589neg.check b/test/files/neg/t5589neg.check
index b3ff16d7e4..fb6858a397 100644
--- a/test/files/neg/t5589neg.check
+++ b/test/files/neg/t5589neg.check
@@ -22,6 +22,9 @@ t5589neg.scala:4: error: constructor cannot be instantiated to expected type;
t5589neg.scala:4: error: not found: value y2
def f7(x: Either[Int, (String, Int)]) = for (y1 @ Tuple1(y2) <- x.right) yield ((y1, y2))
^
+t5589neg.scala:4: error: Could not typecheck extractor call: case class Tuple1 with arguments List((y2 @ _))
+ def f7(x: Either[Int, (String, Int)]) = for (y1 @ Tuple1(y2) <- x.right) yield ((y1, y2))
+ ^
t5589neg.scala:5: error: constructor cannot be instantiated to expected type;
found : (T1, T2, T3)
required: (String, Int)
@@ -34,4 +37,4 @@ t5589neg.scala:5: error: not found: value y2
def f8(x: Either[Int, (String, Int)]) = for ((y1, y2, y3) <- x.right) yield ((y1, y2))
^
two warnings found
-7 errors found
+8 errors found
diff --git a/test/files/neg/t5663-badwarneq.check b/test/files/neg/t5663-badwarneq.check
new file mode 100644
index 0000000000..00c2234e9d
--- /dev/null
+++ b/test/files/neg/t5663-badwarneq.check
@@ -0,0 +1,22 @@
+t5663-badwarneq.scala:42: error: comparing case class values of types Some[Int] and None.type using `==' will always yield false
+ println(new Some(1) == None) // Should complain on type, was: spuriously complains on fresh object
+ ^
+t5663-badwarneq.scala:43: error: comparing case class values of types Some[Int] and Thing using `==' will always yield false
+ println(Some(1) == new Thing(1)) // Should complain on type, was: spuriously complains on fresh object
+ ^
+t5663-badwarneq.scala:51: error: ThingOne and Thingy are unrelated: they will most likely never compare equal
+ println(t1 == t2) // true, but apparently unrelated, a compromise warning
+ ^
+t5663-badwarneq.scala:52: error: ThingThree and Thingy are unrelated: they will most likely never compare equal
+ println(t4 == t2) // true, complains because ThingThree is final and Thingy not a subclass, stronger claim than unrelated
+ ^
+t5663-badwarneq.scala:55: error: comparing case class values of types ThingTwo and Some[Int] using `==' will always yield false
+ println(t3 == Some(1)) // false, warn on different cases
+ ^
+t5663-badwarneq.scala:56: error: comparing values of types ThingOne and Cousin using `==' will always yield false
+ println(t1 == c) // should warn
+ ^
+t5663-badwarneq.scala:64: error: comparing case class values of types Simple and SimpleSibling.type using `==' will always yield false
+ println(new Simple() == SimpleSibling) // like Some(1) == None, but needn't be final case
+ ^
+7 errors found
diff --git a/test/files/neg/t5663-badwarneq.flags b/test/files/neg/t5663-badwarneq.flags
new file mode 100644
index 0000000000..85d8eb2ba2
--- /dev/null
+++ b/test/files/neg/t5663-badwarneq.flags
@@ -0,0 +1 @@
+-Xfatal-warnings
diff --git a/test/files/neg/t5663-badwarneq.scala b/test/files/neg/t5663-badwarneq.scala
new file mode 100644
index 0000000000..56ec389c03
--- /dev/null
+++ b/test/files/neg/t5663-badwarneq.scala
@@ -0,0 +1,76 @@
+
+// alias
+trait Thingy
+
+class Gramps
+
+// sibling classes that extend a case class
+case class Thing(i: Int) extends Gramps
+class ThingOne(x:Int) extends Thing(x)
+class ThingTwo(y:Int) extends Thing(y) with Thingy
+final class ThingThree(z:Int) extends Thing(z)
+
+// not case cousin
+class Cousin extends Gramps
+
+class SimpleParent
+case class Simple() extends SimpleParent
+case object SimpleSibling extends SimpleParent
+
+/* It's not possible to run partest without -deprecation.
+ * Since detecting the warnings requires a neg test with
+ * -Xfatal-warnings, and deprecation terminates the compile,
+ * we'll just comment out the nasty part. The point was
+ * just to show there's nothing special about a trait
+ * that extends a case class, which is only permitted
+ * (deprecatingly) by omitting the parens.
+ *
+// common ancestor is something else
+class AnyThing
+case class SomeThing extends AnyThing // deprecation
+class OtherThing extends AnyThing
+
+// how you inherit caseness doesn't matter
+trait InThing extends SomeThing
+class MyThing extends InThing
+*/
+
+object Test {
+ def main(a: Array[String]) {
+ // nothing to do with Gavin
+ println(new Some(1) == new Some(1)) // OK, true
+ println(new Some(1) == None) // Should complain on type, was: spuriously complains on fresh object
+ println(Some(1) == new Thing(1)) // Should complain on type, was: spuriously complains on fresh object
+
+ val t1 = new ThingOne(11)
+ val t2: Thingy = new ThingTwo(11)
+ val t3 = new ThingTwo(11)
+ val t4 = new ThingThree(11)
+ val c = new Cousin
+
+ println(t1 == t2) // true, but apparently unrelated, a compromise warning
+ println(t4 == t2) // true, complains because ThingThree is final and Thingy not a subclass, stronger claim than unrelated
+ println(t2 == t3) // OK, two Thingy
+ println(t3 == t2) // ditto with case receiver
+ println(t3 == Some(1)) // false, warn on different cases
+ println(t1 == c) // should warn
+
+ // don't warn on fresh cases
+ println(new ThingOne(11) == t1) // OK, was: two cases not warnable on trunk
+ println(new ThingTwo(11) == t2) // true, was: spuriously complains on fresh object
+ println(new ThingOne(11) == t3) // two cases not warnable on trunk
+ println(new ThingTwo(11) == t3) // ditto
+
+ println(new Simple() == SimpleSibling) // like Some(1) == None, but needn't be final case
+
+ /*
+ val mine = new MyThing
+ val some = new SomeThing
+ val other = new OtherThing
+ println(mine == some) // OK, two Something
+ println(some == mine)
+ println(mine == other) // OK, two Anything?
+ println(mine == t1) // false
+ */
+ }
+}
diff --git a/test/files/neg/t5666.check b/test/files/neg/t5666.check
new file mode 100644
index 0000000000..cc31390dc7
--- /dev/null
+++ b/test/files/neg/t5666.check
@@ -0,0 +1,10 @@
+t5666.scala:2: error: class Any is abstract; cannot be instantiated
+ new Any
+ ^
+t5666.scala:3: error: class AnyVal is abstract; cannot be instantiated
+ new AnyVal
+ ^
+t5666.scala:13: error: trait Nothing is abstract; cannot be instantiated
+ new Nothing
+ ^
+three errors found
diff --git a/test/files/neg/t5666.scala b/test/files/neg/t5666.scala
new file mode 100644
index 0000000000..ffaeaacdaf
--- /dev/null
+++ b/test/files/neg/t5666.scala
@@ -0,0 +1,14 @@
+object t5666 {
+ new Any
+ new AnyVal
+ new Double
+ new Float
+ new Long
+ new Int
+ new Char
+ new Short
+ new Byte
+ new Boolean
+ new Unit
+ new Nothing
+} \ No newline at end of file
diff --git a/test/files/neg/tailrec.check b/test/files/neg/tailrec.check
index ad92731b2c..946d3421e6 100644
--- a/test/files/neg/tailrec.check
+++ b/test/files/neg/tailrec.check
@@ -4,9 +4,9 @@ tailrec.scala:45: error: could not optimize @tailrec annotated method facfail: i
tailrec.scala:50: error: could not optimize @tailrec annotated method fail1: it is neither private nor final so can be overridden
@tailrec def fail1(x: Int): Int = fail1(x)
^
-tailrec.scala:55: error: could not optimize @tailrec annotated method fail2: it contains a recursive call not in tail position
- case x :: xs => x :: fail2[T](xs)
- ^
+tailrec.scala:53: error: could not optimize @tailrec annotated method fail2: it contains a recursive call not in tail position
+ @tailrec final def fail2[T](xs: List[T]): List[T] = xs match {
+ ^
tailrec.scala:59: error: could not optimize @tailrec annotated method fail3: it is called recursively with different type arguments
@tailrec final def fail3[T](x: Int): Int = fail3(x - 1)
^
diff --git a/test/files/neg/unreachablechar.flags b/test/files/neg/unreachablechar.flags
new file mode 100644
index 0000000000..809e9ff2f2
--- /dev/null
+++ b/test/files/neg/unreachablechar.flags
@@ -0,0 +1 @@
+ -Xoldpatmat
diff --git a/test/files/pos/generic-sigs.scala b/test/files/pos/generic-sigs.scala
index 40ec044656..b112766056 100644
--- a/test/files/pos/generic-sigs.scala
+++ b/test/files/pos/generic-sigs.scala
@@ -1,3 +1,5 @@
+import language.existentials
+
object A {
def f1 = List(classOf[Int], classOf[String])
def f2 = List(classOf[String], classOf[Int])
@@ -15,4 +17,4 @@ object A {
class Boppy[+T1,-T2]
def g1 = new Boppy[t forSome { type t <: Int }, u forSome { type u <: String }]
-} \ No newline at end of file
+}
diff --git a/test/files/pos/hkarray.flags b/test/files/pos/hkarray.flags
index e8fb65d50c..e745d8bbe3 100644
--- a/test/files/pos/hkarray.flags
+++ b/test/files/pos/hkarray.flags
@@ -1 +1 @@
--Xfatal-warnings \ No newline at end of file
+-Xfatal-warnings -language:higherKinds \ No newline at end of file
diff --git a/test/files/pos/liftcode_polymorphic.scala b/test/files/pos/liftcode_polymorphic.scala
index 3d4b159c83..9c59b34bee 100644
--- a/test/files/pos/liftcode_polymorphic.scala
+++ b/test/files/pos/liftcode_polymorphic.scala
@@ -1,3 +1,5 @@
+import scala.reflect.mirror._
+
object Append extends Application {
def append[A](l1: List[A], l2: List[A]):List[A] =
@@ -6,6 +8,6 @@ object Append extends Application {
case x::xs => x :: append(xs, l2)
}
- println(scala.reflect.Code.lift(append _).tree)
+ println(reify(append _).tree)
}
diff --git a/test/files/pos/macro-deprecate-dont-touch-backquotedidents.flags b/test/files/pos/macro-deprecate-dont-touch-backquotedidents.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/pos/macro-deprecate-dont-touch-backquotedidents.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/pos/macro-deprecate-dont-touch-backquotedidents.scala b/test/files/pos/macro-deprecate-dont-touch-backquotedidents.scala
new file mode 100644
index 0000000000..69a7333011
--- /dev/null
+++ b/test/files/pos/macro-deprecate-dont-touch-backquotedidents.scala
@@ -0,0 +1,56 @@
+object Test1 {
+ val `macro` = ???
+}
+
+object Test2 {
+ var `macro` = ???
+}
+
+object Test3 {
+ type `macro` = Int
+}
+
+package test4 {
+ class `macro`
+}
+
+object Test5 {
+ class `macro`
+}
+
+package test6 {
+ object `macro`
+}
+
+object Test7 {
+ object `macro`
+}
+
+package test8 {
+ trait `macro`
+}
+
+object Test9 {
+ trait `macro`
+}
+
+package `macro` {
+ package `macro`.bar {
+ }
+}
+
+package foo {
+ package `macro`.foo {
+ }
+}
+
+//object Test12 {
+// val Some(`macro`) = Some(42)
+// `macro` match {
+// case `macro` => println(`macro`)
+// }
+//}
+
+object Test13 {
+ def `macro` = 2
+} \ No newline at end of file
diff --git a/test/files/pos/macros.scala b/test/files/pos/macros.scala
deleted file mode 100644
index 303610d464..0000000000
--- a/test/files/pos/macros.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-object Test {
-
- class C {
- def macro foo[T](xs: List[T]): T = (T, xs) match {
- case (t1: Type, t2: Tree) => t2
- }
- }
-}
diff --git a/test/files/pos/t1439.flags b/test/files/pos/t1439.flags
index 779916d58f..1e70f5c5c7 100644
--- a/test/files/pos/t1439.flags
+++ b/test/files/pos/t1439.flags
@@ -1 +1 @@
--unchecked -Xfatal-warnings \ No newline at end of file
+-unchecked -Xfatal-warnings -Xoldpatmat -language:higherKinds
diff --git a/test/files/pos/t5223.scala b/test/files/pos/t5223.scala
index 51682e9254..398630dc61 100644
--- a/test/files/pos/t5223.scala
+++ b/test/files/pos/t5223.scala
@@ -1,6 +1,6 @@
-import scala.reflect._
+import scala.reflect.mirror._
object Foo extends App {
- Code.lift{def printf(format: String, args: Any*): String = null }
- Code.lift{def printf(format: String, args: Any*): String = ("abc": @cloneable)}
+ reify{def printf(format: String, args: Any*): String = null }
+ reify{def printf(format: String, args: Any*): String = ("abc": @cloneable)}
}
diff --git a/test/files/pos/t531.scala b/test/files/pos/t531.scala
index 856926de4f..5176912ef0 100644
--- a/test/files/pos/t531.scala
+++ b/test/files/pos/t531.scala
@@ -1,8 +1,9 @@
+import scala.reflect.mirror._
+
object Test extends App {
- import scala.reflect._;
def titi = {
var truc = 0
- val tata = Code.lift{() => {
+ val tata = reify{() => {
truc = 6
}}
()
diff --git a/test/files/pos/t532.scala b/test/files/pos/t532.scala
index f864bbf45e..a319fdfa27 100644
--- a/test/files/pos/t532.scala
+++ b/test/files/pos/t532.scala
@@ -1,8 +1,9 @@
+import scala.reflect.mirror._
+
object Test extends App {
- import scala.reflect._;
def titi: Unit = {
var truc = 0
- val tata = Code.lift{() => {
+ val tata = reify{() => {
truc = truc + 6
}}
()
diff --git a/test/files/pos/virtpatmat_alts_subst.flags b/test/files/pos/virtpatmat_alts_subst.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/pos/virtpatmat_alts_subst.flags
+++ b/test/files/pos/virtpatmat_alts_subst.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/pos/virtpatmat_anonfun_for.flags b/test/files/pos/virtpatmat_anonfun_for.flags
index 23e3dc7d26..e69de29bb2 100644
--- a/test/files/pos/virtpatmat_anonfun_for.flags
+++ b/test/files/pos/virtpatmat_anonfun_for.flags
@@ -1 +0,0 @@
--Yvirtpatmat \ No newline at end of file
diff --git a/test/files/pos/virtpatmat_binding_opt.flags b/test/files/pos/virtpatmat_binding_opt.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/pos/virtpatmat_binding_opt.flags
+++ b/test/files/pos/virtpatmat_binding_opt.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/pos/virtpatmat_castbinder.flags b/test/files/pos/virtpatmat_castbinder.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/pos/virtpatmat_castbinder.flags
+++ b/test/files/pos/virtpatmat_castbinder.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/pos/virtpatmat_exist1.flags b/test/files/pos/virtpatmat_exist1.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/pos/virtpatmat_exist1.flags
+++ b/test/files/pos/virtpatmat_exist1.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/pos/virtpatmat_exist2.flags b/test/files/pos/virtpatmat_exist2.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/pos/virtpatmat_exist2.flags
+++ b/test/files/pos/virtpatmat_exist2.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/pos/virtpatmat_exist3.flags b/test/files/pos/virtpatmat_exist3.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/pos/virtpatmat_exist3.flags
+++ b/test/files/pos/virtpatmat_exist3.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/pos/virtpatmat_exist_uncurry.scala b/test/files/pos/virtpatmat_exist_uncurry.scala
new file mode 100644
index 0000000000..e017da6343
--- /dev/null
+++ b/test/files/pos/virtpatmat_exist_uncurry.scala
@@ -0,0 +1,6 @@
+object Test {
+ trait Leaf[T] {
+ def collect[U](f: PartialFunction[Leaf[_], U]): List[U]
+ def leaves: List[Leaf[T]] = collect { case l: Leaf[T] => l }
+ }
+} \ No newline at end of file
diff --git a/test/files/pos/virtpatmat_gadt_array.flags b/test/files/pos/virtpatmat_gadt_array.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/pos/virtpatmat_gadt_array.flags
+++ b/test/files/pos/virtpatmat_gadt_array.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/pos/virtpatmat_infer_single_1.flags b/test/files/pos/virtpatmat_infer_single_1.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/pos/virtpatmat_infer_single_1.flags
+++ b/test/files/pos/virtpatmat_infer_single_1.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/pos/virtpatmat_instof_valuetype.flags b/test/files/pos/virtpatmat_instof_valuetype.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/pos/virtpatmat_instof_valuetype.flags
+++ b/test/files/pos/virtpatmat_instof_valuetype.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/pos/virtpatmat_obj_in_case.flags b/test/files/pos/virtpatmat_obj_in_case.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/pos/virtpatmat_obj_in_case.flags
+++ b/test/files/pos/virtpatmat_obj_in_case.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/presentation/callcc-interpreter/Runner.scala b/test/files/presentation/callcc-interpreter/Runner.scala
index 1ef3cf9025..61b6efd50d 100644
--- a/test/files/presentation/callcc-interpreter/Runner.scala
+++ b/test/files/presentation/callcc-interpreter/Runner.scala
@@ -1,3 +1,5 @@
import scala.tools.nsc.interactive.tests._
-object Test extends InteractiveTest \ No newline at end of file
+object Test extends InteractiveTest {
+ settings.XoldPatmat.value = true // TODO: could this be running into some kind of race condition? sometimes the match has been translated, sometimes it hasn't
+} \ No newline at end of file
diff --git a/test/files/presentation/random.check b/test/files/presentation/random.check
index fce4b69fb3..1b73720312 100644
--- a/test/files/presentation/random.check
+++ b/test/files/presentation/random.check
@@ -4,7 +4,8 @@ askType at Random.scala(18,14)
================================================================================
[response] askTypeAt at (18,14)
val filter: Int => Boolean = try {
- java.this.lang.Integer.parseInt(args.apply(0)) match {
+ case <synthetic> val x1: Int = java.this.lang.Integer.parseInt(args.apply(0));
+ x1 match {
case 1 => ((x: Int) => x.%(2).!=(0))
case 2 => ((x: Int) => x.%(2).==(0))
case _ => ((x: Int) => x.!=(0))
diff --git a/test/files/run/applydynamic_sip.check b/test/files/run/applydynamic_sip.check
new file mode 100644
index 0000000000..d94db4417e
--- /dev/null
+++ b/test/files/run/applydynamic_sip.check
@@ -0,0 +1,22 @@
+qual.applyDynamic(sel)()
+qual.applyDynamic(sel)(a)
+qual.applyDynamic(sel)(a)
+.apply(a2)
+qual.applyDynamic(sel)(a)
+qual.applyDynamic(sel)(a)
+.apply(a2)
+qual.applyDynamicNamed(sel)((arg,a))
+qual.applyDynamicNamed(sel)((arg,a))
+qual.applyDynamicNamed(sel)((,a), (arg2,a2))
+qual.updateDynamic(sel)(expr)
+qual.selectDynamic(sel)
+qual.selectDynamic(sel)
+qual.selectDynamic(sel)
+.update(1, expr)
+qual.selectDynamic(sel)
+.update(expr)
+qual.selectDynamic(sel)
+.apply(1)
+qual.selectDynamic(sel)
+.apply
+.update(1, 1)
diff --git a/test/files/run/applydynamic_sip.scala b/test/files/run/applydynamic_sip.scala
new file mode 100644
index 0000000000..57cb4349f7
--- /dev/null
+++ b/test/files/run/applydynamic_sip.scala
@@ -0,0 +1,58 @@
+object Test extends App {
+ object stubUpdate {
+ def update(as: Any*) = println(".update"+as.toList.mkString("(",", ", ")"))
+ }
+
+ object stub {
+ def apply = {println(".apply"); stubUpdate}
+ def apply(as: Any*) = println(".apply"+as.toList.mkString("(",", ", ")"))
+ def update(as: Any*) = println(".update"+as.toList.mkString("(",", ", ")"))
+ }
+ class MyDynamic extends Dynamic {
+ def applyDynamic[T](n: String)(as: Any*) = {println("qual.applyDynamic("+ n +")"+ as.toList.mkString("(",", ", ")")); stub}
+ def applyDynamicNamed[T](n: String)(as: (String, Any)*) = {println("qual.applyDynamicNamed("+ n +")"+ as.toList.mkString("(",", ", ")")); stub}
+ def selectDynamic[T](n: String) = {println("qual.selectDynamic("+ n +")"); stub}
+ def updateDynamic(n: String)(x: Any): Unit = {println("qual.updateDynamic("+ n +")("+ x +")")}
+ }
+ val qual = new MyDynamic
+ val expr = "expr"
+ val a = "a"
+ val a2 = "a2"
+ type T = String
+
+ // If qual.sel is followed by a potential type argument list [Ts] and an argument list (arg1, …, argn) where none of the arguments argi are named:
+ // qual.applyDynamic(“sel”)(arg1, …, argn)
+ qual.sel()
+ qual.sel(a)
+ // qual.sel(a, a2: _*) -- should not accept varargs?
+ qual.sel(a)(a2)
+ qual.sel[T](a)
+ qual.sel[T](a)(a2)
+
+ // If qual.sel is followed by a potential type argument list [Ts]
+ // and a non-empty named argument list (x1 = arg1, …, xn = argn) where some name prefixes xi = might be missing:
+ // qual.applyDynamicNamed(“sel”)(xs1 -> arg1, …, xsn -> argn)
+ qual.sel(arg = a)
+ qual.sel[T](arg = a)
+ qual.sel(a, arg2 = "a2")
+ // qual.sel(a)(a2, arg2 = "a2")
+ // qual.sel[T](a)(a2, arg2 = "a2")
+ // qual.sel(arg = a, a2: _*)
+ // qual.sel(arg, arg2 = "a2", a2: _*)
+
+ // If qual.sel appears immediately on the left-hand side of an assigment
+ // qual.updateDynamic(“sel”)(expr)
+ qual.sel = expr
+
+ // If qual.sel, possibly applied to type arguments, but is
+ // not applied to explicit value arguments,
+ // nor immediately followed by an assignment operator:
+ // qual.selectDynamic[Ts](“sel”)
+ qual.sel
+ qual.sel[T]
+
+ qual.sel(1) = expr // parser turns this into qual.sel.update(1, expr)
+ qual.sel() = expr // parser turns this into qual.sel.update(expr)
+ qual.sel.apply(1)
+ qual.sel.apply(1) = 1
+} \ No newline at end of file
diff --git a/test/files/run/classtags_contextbound.check b/test/files/run/classtags_contextbound.check
new file mode 100644
index 0000000000..4104d544ba
--- /dev/null
+++ b/test/files/run/classtags_contextbound.check
@@ -0,0 +1 @@
+class [I
diff --git a/test/files/run/classtags_contextbound.scala b/test/files/run/classtags_contextbound.scala
new file mode 100644
index 0000000000..5bb0ae8d80
--- /dev/null
+++ b/test/files/run/classtags_contextbound.scala
@@ -0,0 +1,5 @@
+object Test extends App {
+ def mkArray[T: ClassTag] = Array[T]()
+ def foo[T: ClassTag] = mkArray[T]
+ println(foo[Int].getClass)
+} \ No newline at end of file
diff --git a/test/files/run/classtags_core.check b/test/files/run/classtags_core.check
new file mode 100644
index 0000000000..ce5a893b08
--- /dev/null
+++ b/test/files/run/classtags_core.check
@@ -0,0 +1,30 @@
+true
+ClassTag(byte)
+true
+ClassTag(short)
+true
+ClassTag(char)
+true
+ClassTag(int)
+true
+ClassTag(long)
+true
+ClassTag(float)
+true
+ClassTag(double)
+true
+ClassTag(boolean)
+true
+ClassTag(void)
+true
+ClassTag(class java.lang.Object)
+true
+ClassTag(class java.lang.Object)
+true
+ClassTag(class java.lang.Object)
+true
+ClassTag(class java.lang.Object)
+true
+ClassTag(class java.lang.Object)
+true
+ClassTag(class java.lang.Object)
diff --git a/test/files/run/classtags_core.scala b/test/files/run/classtags_core.scala
new file mode 100644
index 0000000000..45c54b1fe0
--- /dev/null
+++ b/test/files/run/classtags_core.scala
@@ -0,0 +1,32 @@
+object Test extends App {
+ println(implicitly[ClassTag[Byte]] eq ClassTag.Byte)
+ println(implicitly[ClassTag[Byte]])
+ println(implicitly[ClassTag[Short]] eq ClassTag.Short)
+ println(implicitly[ClassTag[Short]])
+ println(implicitly[ClassTag[Char]] eq ClassTag.Char)
+ println(implicitly[ClassTag[Char]])
+ println(implicitly[ClassTag[Int]] eq ClassTag.Int)
+ println(implicitly[ClassTag[Int]])
+ println(implicitly[ClassTag[Long]] eq ClassTag.Long)
+ println(implicitly[ClassTag[Long]])
+ println(implicitly[ClassTag[Float]] eq ClassTag.Float)
+ println(implicitly[ClassTag[Float]])
+ println(implicitly[ClassTag[Double]] eq ClassTag.Double)
+ println(implicitly[ClassTag[Double]])
+ println(implicitly[ClassTag[Boolean]] eq ClassTag.Boolean)
+ println(implicitly[ClassTag[Boolean]])
+ println(implicitly[ClassTag[Unit]] eq ClassTag.Unit)
+ println(implicitly[ClassTag[Unit]])
+ println(implicitly[ClassTag[Any]] eq ClassTag.Any)
+ println(implicitly[ClassTag[Any]])
+ println(implicitly[ClassTag[Object]] eq ClassTag.Object)
+ println(implicitly[ClassTag[Object]])
+ println(implicitly[ClassTag[AnyVal]] eq ClassTag.AnyVal)
+ println(implicitly[ClassTag[AnyVal]])
+ println(implicitly[ClassTag[AnyRef]] eq ClassTag.AnyRef)
+ println(implicitly[ClassTag[AnyRef]])
+ println(implicitly[ClassTag[Null]] eq ClassTag.Null)
+ println(implicitly[ClassTag[Null]])
+ println(implicitly[ClassTag[Nothing]] eq ClassTag.Nothing)
+ println(implicitly[ClassTag[Nothing]])
+} \ No newline at end of file
diff --git a/test/files/run/constrained-types.check b/test/files/run/constrained-types.check
index ac8817cb08..37784a20ca 100644
--- a/test/files/run/constrained-types.check
+++ b/test/files/run/constrained-types.check
@@ -75,9 +75,13 @@ scala> var four = "four"
four: String = four
scala> val four2 = m(four) // should have an existential bound
+warning: there were 1 feature warnings; re-run with -feature for details
+warning: there were 1 feature warnings; re-run with -feature for details
four2: String @Annot(x) forSome { val x: String } = four
scala> val four3 = four2 // should have the same type as four2
+warning: there were 1 feature warnings; re-run with -feature for details
+warning: there were 1 feature warnings; re-run with -feature for details
four3: String @Annot(x) forSome { val x: String } = four
scala> val stuff = m("stuff") // should not crash
@@ -100,6 +104,8 @@ scala> def m = {
val y : String @Annot(x) = x
y
} // x should not escape the local scope with a narrow type
+warning: there were 1 feature warnings; re-run with -feature for details
+warning: there were 1 feature warnings; re-run with -feature for details
m: String @Annot(x) forSome { val x: String }
scala>
@@ -113,6 +119,7 @@ scala> def n(y: String) = {
}
m("stuff".stripMargin)
} // x should be existentially bound
+warning: there were 1 feature warnings; re-run with -feature for details
n: (y: String)String @Annot(x) forSome { val x: String }
scala>
diff --git a/test/files/run/dynamic-proxy.check b/test/files/run/dynamic-proxy.check
new file mode 100644
index 0000000000..d1b85daff4
--- /dev/null
+++ b/test/files/run/dynamic-proxy.check
@@ -0,0 +1,20 @@
+noargs
+noargs
+nullary
+value
+symbolic
+symbolic with args
+non-existent method
+before mutation
+mutation 1
+after mutation 1
+mutation 2
+after mutation 2
+overloaded with object
+overloaded with primitive
+overloaded with object in var
+overloaded with object in var 2
+typeArgs: I am a car
+default: 4
+default: 3
+named: 6
diff --git a/test/files/run/dynamic-proxy.flags b/test/files/run/dynamic-proxy.flags
new file mode 100644
index 0000000000..48fd867160
--- /dev/null
+++ b/test/files/run/dynamic-proxy.flags
@@ -0,0 +1 @@
+-Xexperimental
diff --git a/test/files/run/dynamic-proxy.scala b/test/files/run/dynamic-proxy.scala
new file mode 100644
index 0000000000..ab5a8b1d66
--- /dev/null
+++ b/test/files/run/dynamic-proxy.scala
@@ -0,0 +1,72 @@
+import scala.reflect._
+
+class Car{ override def toString = "I am a car" }
+object x{
+ def nullary = "nullary"
+ def noargs() = "noargs"
+ def - = "symbolic"
+ def $(s:String) = "symbolic with args"
+ val value = "value"
+ def overloaded(i:Int) = "overloaded with primitive"
+ def overloaded(s:String) = s
+ def default( a:Int, b:Int = 2 ) = "default: "+(a+b)
+ def named( a:Int, b:Int, c:Int ) = "named: "+(a+b+c)
+ def typeArgs[T]( v:T ) = "typeArgs: "+v
+ var mutable = "before mutation"
+ def multiArgLists( a:String )( b:String ) = "multiArgList " + a + b
+ def bar( s:String )(implicit car:Car) = s + car.toString
+}
+
+object Test extends App{
+ val d = new DynamicProxy{ val dynamicProxyTarget = x }
+
+ println( d.noargs )
+ println( d.noargs() )
+ println( d.nullary )
+ println( d.value )
+ println( d.- )
+ println( d.$("x") )
+
+ try{
+ println( d.test )
+ } catch {
+ case _ => println("non-existent method")
+ }
+
+ println( d.mutable )
+
+ println("mutation 1")
+ d.mutable_=("after mutation 1")
+ println( d.mutable )
+
+ println("mutation 2")
+ d.mutable = "after mutation 2"
+ println( d.mutable )
+
+ println( d.overloaded("overloaded with object") )
+ println( d.overloaded(1) )
+
+ // test some non-constant arguments
+ def s = "overloaded with object in var"
+ println( d.overloaded(s) )
+ println( d.overloaded(s + " 2") )
+
+ val car = new Car
+ println( d.typeArgs(car) ) // inferred
+ // println( d.typeArgs[Car](car) ) // explicit not working (yet)
+
+ println( d.default( 1,3 ) )
+ println( d.default( 1 ) )
+
+ println( d.named(1,c=3,b=2) ) // applyDynamicNamed seems to be broken
+
+ // println( d.multiArgLists("a")("b") ) // not working yet
+
+ /*
+ // may never work
+ // testing implicit parameters (first test works when moving x into TestDynamicReflect)
+ implicit val car2 = new Car
+ println( d.bar( "Yeah, ") ); // FAILS: could not find implicit value for parameter car
+ {println( d.bar( "Yeah, ") )} // FAILS: could not find implicit value for parameter car
+ */
+}
diff --git a/test/files/run/existentials-in-compiler.check b/test/files/run/existentials-in-compiler.check
index 83e3cdf435..4df4b0ca96 100644
--- a/test/files/run/existentials-in-compiler.check
+++ b/test/files/run/existentials-in-compiler.check
@@ -100,8 +100,8 @@ abstract trait Cov31[+A, +B, C <: (A, B)] extends Object
abstract trait Cov32[+A, B, C <: (A, B)] extends Object
extest.Cov32[A,B,C] forSome { +A; B; C <: (A, B) }
-abstract trait Cov33[+A, -B, C <: (A, _$10) forSome { type _$10 }] extends Object
- extest.Cov33[A,B,C] forSome { +A; -B; C <: (A, _$10) forSome { type _$10 } }
+abstract trait Cov33[+A, -B, C <: Tuple2[A, _]] extends Object
+ extest.Cov33[A,B,C] forSome { +A; -B; C <: Tuple2[A, _] }
abstract trait Cov34[A, +B, C <: (A, B)] extends Object
extest.Cov34[A,B,C] forSome { A; +B; C <: (A, B) }
@@ -109,14 +109,14 @@ abstract trait Cov34[A, +B, C <: (A, B)] extends Object
abstract trait Cov35[A, B, C <: (A, B)] extends Object
extest.Cov35[A,B,C] forSome { A; B; C <: (A, B) }
-abstract trait Cov36[A, -B, C <: (A, _$11) forSome { type _$11 }] extends Object
- extest.Cov36[A,B,C] forSome { A; -B; C <: (A, _$11) forSome { type _$11 } }
+abstract trait Cov36[A, -B, C <: Tuple2[A, _]] extends Object
+ extest.Cov36[A,B,C] forSome { A; -B; C <: Tuple2[A, _] }
-abstract trait Cov37[-A, +B, C <: (_$12, B) forSome { type _$12 }] extends Object
- extest.Cov37[A,B,C] forSome { -A; +B; C <: (_$12, B) forSome { type _$12 } }
+abstract trait Cov37[-A, +B, C <: Tuple2[_, B]] extends Object
+ extest.Cov37[A,B,C] forSome { -A; +B; C <: Tuple2[_, B] }
-abstract trait Cov38[-A, B, C <: (_$13, B) forSome { type _$13 }] extends Object
- extest.Cov38[A,B,C] forSome { -A; B; C <: (_$13, B) forSome { type _$13 } }
+abstract trait Cov38[-A, B, C <: Tuple2[_, B]] extends Object
+ extest.Cov38[A,B,C] forSome { -A; B; C <: Tuple2[_, B] }
abstract trait Cov39[-A, -B, C <: Tuple2[_, _]] extends Object
extest.Cov39[_, _, _ <: Tuple2[_, _]]
diff --git a/test/files/run/existentials3.check b/test/files/run/existentials3.check
index 36a458dacc..8227d77909 100644
--- a/test/files/run/existentials3.check
+++ b/test/files/run/existentials3.check
@@ -1,22 +1,24 @@
-_ <: scala.runtime.AbstractFunction0[_ <: Object with Test$ToS with scala.Product with scala.Serializable] with scala.Serializable with java.lang.Object
-_ <: Object with Test$ToS with scala.Product with scala.Serializable
-Object with Test$ToS
-Object with Test$ToS
-Object with Test$ToS
-scala.Function0[Object with Test$ToS]
-scala.Function0[Object with Test$ToS]
-_ <: Object with _ <: Object with Object with Test$ToS
-_ <: Object with _ <: Object with _ <: Object with Test$ToS
-scala.collection.immutable.List[Object with scala.collection.Seq[Int]]
-scala.collection.immutable.List[Object with scala.collection.Seq[_ <: Int]]
-_ <: scala.runtime.AbstractFunction0[_ <: Object with Test$ToS with scala.Product with scala.Serializable] with scala.Serializable with java.lang.Object
-_ <: Object with Test$ToS with scala.Product with scala.Serializable
-Object with Test$ToS
-Object with Test$ToS
-Object with Test$ToS
-scala.Function0[Object with Test$ToS]
-scala.Function0[Object with Test$ToS]
-_ <: Object with _ <: Object with Object with Test$ToS
-_ <: Object with _ <: Object with _ <: Object with Test$ToS
-scala.collection.immutable.List[Object with scala.collection.Seq[Int]]
-scala.collection.immutable.List[Object with scala.collection.Seq[_ <: Int]]
+ConcreteTypeTag[Bar.type], t=TypeRef, s= <: scala.runtime.AbstractFunction0[Bar] with Serializable{case def unapply(x$0: Bar): Boolean} with Singleton
+ConcreteTypeTag[Bar], t=TypeRef, s= <: Test.ToS with Product with Serializable{def copy(): Bar}
+ConcreteTypeTag[Test.ToS], t=RefinedType, s=f3
+ConcreteTypeTag[Test.ToS], t=RefinedType, s=f4
+ConcreteTypeTag[Test.ToS], t=RefinedType, s=f5
+ConcreteTypeTag[() => Test.ToS], t=TypeRef, s=class Function0
+ConcreteTypeTag[() => Test.ToS], t=TypeRef, s=class Function0
+ConcreteTypeTag[$anon], t=TypeRef, s= <: B with Test.ToS
+ConcreteTypeTag[$anon], t=TypeRef, s= <: B with A with Test.ToS
+ConcreteTypeTag[List[Object{type T1}#T1]], t=TypeRef, s=class List
+ConcreteTypeTag[List[Seq[Int]]], t=TypeRef, s=class List
+ConcreteTypeTag[List[Seq[U forSome { type U <: Int }]]], t=TypeRef, s=class List
+ConcreteTypeTag[Bar.type], t=TypeRef, s= <: scala.runtime.AbstractFunction0[Bar] with Serializable{case def unapply(x$0: Bar): Boolean} with Singleton
+ConcreteTypeTag[Bar], t=TypeRef, s= <: Test.ToS with Product with Serializable{def copy(): Bar}
+ConcreteTypeTag[Test.ToS], t=RefinedType, s=g3
+ConcreteTypeTag[Test.ToS], t=RefinedType, s=g4
+ConcreteTypeTag[Test.ToS], t=RefinedType, s=g5
+ConcreteTypeTag[() => Test.ToS], t=TypeRef, s=class Function0
+ConcreteTypeTag[() => Test.ToS], t=TypeRef, s=class Function0
+ConcreteTypeTag[$anon], t=TypeRef, s= <: B with Test.ToS
+ConcreteTypeTag[$anon], t=TypeRef, s= <: B with A with Test.ToS
+ConcreteTypeTag[List[Object{type T1}#T1]], t=TypeRef, s=class List
+ConcreteTypeTag[List[Seq[Int]]], t=TypeRef, s=class List
+ConcreteTypeTag[List[Seq[U forSome { type U <: Int }]]], t=TypeRef, s=class List
diff --git a/test/files/run/existentials3.scala b/test/files/run/existentials3.scala
index bb80d366cc..d6d5612687 100644
--- a/test/files/run/existentials3.scala
+++ b/test/files/run/existentials3.scala
@@ -11,11 +11,11 @@ object Test {
def f8 = { trait A ; trait B extends A ; class C extends B with ToS; new C { } }
def f9 = { trait A ; trait B ; class C extends B with A with ToS; new C { } }
-
+
def f10 = { class A { type T1 } ; List[A#T1]() }
def f11 = { abstract class A extends Seq[Int] ; List[A]() }
def f12 = { abstract class A extends Seq[U forSome { type U <: Int }] ; List[A]() }
-
+
val g1 = { case class Bar() extends ToS; Bar }
val g2 = { case class Bar() extends ToS; Bar() }
val g3 = { class Bar() extends ToS; object Bar extends ToS; Bar }
@@ -30,10 +30,16 @@ object Test {
val g10 = { class A { type T1 } ; List[A#T1]() }
val g11 = { abstract class A extends Seq[Int] ; List[A]() }
val g12 = { abstract class A extends Seq[U forSome { type U <: Int }] ; List[A]() }
-
- def m[T: Manifest](x: T) = println(manifest[T])
-
+
+ def printTag(t: TypeTag[_]) = {
+ val s = if (t.sym.isFreeType) t.sym.typeSignature.toString else t.sym.toString
+ println("%s, t=%s, s=%s".format(t, t.tpe.kind, s))
+ }
+ def m[T: ConcreteTypeTag](x: T) = printTag(concreteTypeTag[T])
+ def m2[T: TypeTag](x: T) = printTag(typeTag[T])
+
// manifests don't work for f10/g10
+ // oh, they do now :)
def main(args: Array[String]): Unit = {
m(f1)
m(f2)
@@ -44,7 +50,7 @@ object Test {
m(f7)
m(f8)
m(f9)
- // m(f10)
+ m2(f10)
m(f11)
m(f12)
m(g1)
@@ -56,7 +62,7 @@ object Test {
m(g7)
m(g8)
m(g9)
- // m(g10)
+ m2(g10)
m(g11)
m(g12)
}
diff --git a/test/files/run/groundtypetags_core.check b/test/files/run/groundtypetags_core.check
new file mode 100644
index 0000000000..62fcb481ae
--- /dev/null
+++ b/test/files/run/groundtypetags_core.check
@@ -0,0 +1,30 @@
+true
+ConcreteTypeTag[Byte]
+true
+ConcreteTypeTag[Short]
+true
+ConcreteTypeTag[Char]
+true
+ConcreteTypeTag[Int]
+true
+ConcreteTypeTag[Long]
+true
+ConcreteTypeTag[Float]
+true
+ConcreteTypeTag[Double]
+true
+ConcreteTypeTag[Boolean]
+true
+ConcreteTypeTag[Unit]
+true
+ConcreteTypeTag[Any]
+true
+ConcreteTypeTag[Object]
+true
+ConcreteTypeTag[AnyVal]
+true
+ConcreteTypeTag[AnyRef]
+true
+ConcreteTypeTag[Null]
+true
+ConcreteTypeTag[Nothing]
diff --git a/test/files/run/groundtypetags_core.scala b/test/files/run/groundtypetags_core.scala
new file mode 100644
index 0000000000..8b81a0c795
--- /dev/null
+++ b/test/files/run/groundtypetags_core.scala
@@ -0,0 +1,32 @@
+object Test extends App {
+ println(implicitly[ConcreteTypeTag[Byte]] eq ConcreteTypeTag.Byte)
+ println(implicitly[ConcreteTypeTag[Byte]])
+ println(implicitly[ConcreteTypeTag[Short]] eq ConcreteTypeTag.Short)
+ println(implicitly[ConcreteTypeTag[Short]])
+ println(implicitly[ConcreteTypeTag[Char]] eq ConcreteTypeTag.Char)
+ println(implicitly[ConcreteTypeTag[Char]])
+ println(implicitly[ConcreteTypeTag[Int]] eq ConcreteTypeTag.Int)
+ println(implicitly[ConcreteTypeTag[Int]])
+ println(implicitly[ConcreteTypeTag[Long]] eq ConcreteTypeTag.Long)
+ println(implicitly[ConcreteTypeTag[Long]])
+ println(implicitly[ConcreteTypeTag[Float]] eq ConcreteTypeTag.Float)
+ println(implicitly[ConcreteTypeTag[Float]])
+ println(implicitly[ConcreteTypeTag[Double]] eq ConcreteTypeTag.Double)
+ println(implicitly[ConcreteTypeTag[Double]])
+ println(implicitly[ConcreteTypeTag[Boolean]] eq ConcreteTypeTag.Boolean)
+ println(implicitly[ConcreteTypeTag[Boolean]])
+ println(implicitly[ConcreteTypeTag[Unit]] eq ConcreteTypeTag.Unit)
+ println(implicitly[ConcreteTypeTag[Unit]])
+ println(implicitly[ConcreteTypeTag[Any]] eq ConcreteTypeTag.Any)
+ println(implicitly[ConcreteTypeTag[Any]])
+ println(implicitly[ConcreteTypeTag[Object]] eq ConcreteTypeTag.Object)
+ println(implicitly[ConcreteTypeTag[Object]])
+ println(implicitly[ConcreteTypeTag[AnyVal]] eq ConcreteTypeTag.AnyVal)
+ println(implicitly[ConcreteTypeTag[AnyVal]])
+ println(implicitly[ConcreteTypeTag[AnyRef]] eq ConcreteTypeTag.AnyRef)
+ println(implicitly[ConcreteTypeTag[AnyRef]])
+ println(implicitly[ConcreteTypeTag[Null]] eq ConcreteTypeTag.Null)
+ println(implicitly[ConcreteTypeTag[Null]])
+ println(implicitly[ConcreteTypeTag[Nothing]] eq ConcreteTypeTag.Nothing)
+ println(implicitly[ConcreteTypeTag[Nothing]])
+} \ No newline at end of file
diff --git a/test/files/run/implicitclasses.scala b/test/files/run/implicitclasses.scala
new file mode 100644
index 0000000000..886d4dede0
--- /dev/null
+++ b/test/files/run/implicitclasses.scala
@@ -0,0 +1,10 @@
+object Test extends App {
+
+ implicit class C(s: String) {
+ def nElems = s.length
+ }
+
+ assert("abc".nElems == 3)
+
+}
+
diff --git a/test/files/run/inline-ex-handlers.check b/test/files/run/inline-ex-handlers.check
index 7a8a744bfa..708fcc6985 100644
--- a/test/files/run/inline-ex-handlers.check
+++ b/test/files/run/inline-ex-handlers.check
@@ -1,40 +1,44 @@
172c172
-< locals: value x$1, value temp1
+< locals: value x$1, value x1
---
-> locals: value x$1, value temp1, variable boxed1
+> locals: value x$1, value x1, variable boxed1
174c174
< blocks: [1,2,3,4]
---
-> blocks: [1,2,3]
-187,189d186
-< 92 JUMP 4
-<
-< 4:
-195a193,194
+> blocks: [1,3,4]
+186a187,188
> 92 STORE_LOCAL(variable boxed1)
> 92 LOAD_LOCAL(variable boxed1)
-386c385
-< blocks: [1,2,3,4,5,7,8,10]
+195,197d196
+< 92 JUMP 2
+<
+< 2:
+385c384
+< blocks: [1,2,3,4,5,8,11,13,14,16]
---
-> blocks: [1,2,3,4,5,7,8,10,11]
-410c409,418
+> blocks: [1,2,3,5,8,11,13,14,16,17]
+409c408,417
< 103 THROW(MyException)
---
-> ? STORE_LOCAL(value ex$1)
-> ? JUMP 11
+> ? STORE_LOCAL(value ex5)
+> ? JUMP 17
>
-> 11:
-> 101 LOAD_LOCAL(value ex$1)
-> 101 STORE_LOCAL(value temp2)
-> 101 SCOPE_ENTER value temp2
-> 101 LOAD_LOCAL(value temp2)
-> 101 IS_INSTANCE REF(class MyException)
-> 101 CZJUMP (BOOL)NE ? 4 : 5
-501c509
+> 17:
+> 101 LOAD_LOCAL(value ex5)
+> 101 STORE_LOCAL(value x3)
+> 101 SCOPE_ENTER value x3
+> 106 LOAD_LOCAL(value x3)
+> 106 IS_INSTANCE REF(class MyException)
+> 106 CZJUMP (BOOL)NE ? 5 : 11
+422,424d429
+< 101 JUMP 4
+<
+< 4:
+512c517
< blocks: [1,2,3,4,6,7,8,9,10]
---
> blocks: [1,2,3,4,6,7,8,9,10,11,12,13]
-530c538,543
+541c546,551
< 306 THROW(MyException)
---
> ? JUMP 11
@@ -43,7 +47,7 @@
> ? LOAD_LOCAL(variable monitor4)
> 305 MONITOR_EXIT
> ? JUMP 12
-536c549,555
+547c557,563
< ? THROW(Throwable)
---
> ? JUMP 12
@@ -53,7 +57,7 @@
> 304 MONITOR_EXIT
> ? STORE_LOCAL(value t)
> ? JUMP 13
-542c561,574
+553c569,582
< ? THROW(Throwable)
---
> ? STORE_LOCAL(value t)
@@ -70,19 +74,19 @@
> 310 CALL_PRIMITIVE(EndConcat)
> 310 CALL_METHOD scala.Predef.println (dynamic)
> 310 JUMP 2
-566c598
+577c606
< catch (Throwable) in ArrayBuffer(7, 8, 9, 10) starting at: 6
---
> catch (Throwable) in ArrayBuffer(7, 8, 9, 10, 11) starting at: 6
-569c601
+580c609
< catch (Throwable) in ArrayBuffer(4, 6, 7, 8, 9, 10) starting at: 3
---
> catch (Throwable) in ArrayBuffer(4, 6, 7, 8, 9, 10, 11, 12) starting at: 3
-601c633
+612c641
< blocks: [1,2,3,4,5,6,7,9,10]
---
> blocks: [1,2,3,4,5,6,7,9,10,11,12]
-625c657,663
+636c665,671
< 78 THROW(IllegalArgumentException)
---
> ? STORE_LOCAL(value e)
@@ -92,7 +96,7 @@
> 81 LOAD_LOCAL(value e)
> ? STORE_LOCAL(variable exc1)
> ? JUMP 12
-654c692,706
+665c700,714
< 81 THROW(Exception)
---
> ? STORE_LOCAL(variable exc1)
@@ -110,57 +114,53 @@
> 84 STORE_LOCAL(variable result)
> 84 LOAD_LOCAL(variable exc1)
> 84 THROW(Throwable)
-676c728
+687c736
< catch (<none>) in ArrayBuffer(4, 6, 7, 9) starting at: 3
---
> catch (<none>) in ArrayBuffer(4, 6, 7, 9, 11) starting at: 3
-702c754
-< blocks: [1,2,3,4,5,6,7,8,11,12,13,14,15,16,18,19]
+713c762
+< blocks: [1,2,3,4,5,6,9,12,14,17,18,19,22,25,27,28,30,31]
---
-> blocks: [1,2,3,4,5,6,7,8,11,12,13,14,15,16,18,19,20,21,22]
-726c778,787
+> blocks: [1,2,3,4,5,6,9,12,14,17,18,19,22,25,27,28,30,31,32,33,34]
+737c786,793
< 172 THROW(MyException)
---
-> ? STORE_LOCAL(value ex$4)
-> ? JUMP 20
+> ? STORE_LOCAL(value ex5)
+> ? JUMP 32
>
-> 20:
-> 170 LOAD_LOCAL(value ex$4)
-> 170 STORE_LOCAL(value temp11)
-> 170 SCOPE_ENTER value temp11
-> 170 LOAD_LOCAL(value temp11)
-> 170 IS_INSTANCE REF(class MyException)
-> 170 CZJUMP (BOOL)NE ? 12 : 13
-780c841,842
+> 32:
+> 170 LOAD_LOCAL(value ex5)
+> 170 STORE_LOCAL(value x3)
+> 170 SCOPE_ENTER value x3
+> 170 JUMP 18
+793c849,850
< 177 THROW(MyException)
---
-> ? STORE_LOCAL(value ex$5)
-> ? JUMP 21
-784c846,855
+> ? STORE_LOCAL(value ex5)
+> ? JUMP 33
+797c854,861
< 170 THROW(Throwable)
---
-> ? STORE_LOCAL(value ex$5)
-> ? JUMP 21
+> ? STORE_LOCAL(value ex5)
+> ? JUMP 33
>
-> 21:
-> 169 LOAD_LOCAL(value ex$5)
-> 169 STORE_LOCAL(value temp14)
-> 169 SCOPE_ENTER value temp14
-> 169 LOAD_LOCAL(value temp14)
-> 169 IS_INSTANCE REF(class MyException)
-> 169 CZJUMP (BOOL)NE ? 5 : 6
-815c886,887
+> 33:
+> 169 LOAD_LOCAL(value ex5)
+> 169 STORE_LOCAL(value x3)
+> 169 SCOPE_ENTER value x3
+> 169 JUMP 5
+830c894,895
< 182 THROW(MyException)
---
> ? STORE_LOCAL(variable exc2)
-> ? JUMP 22
-819c891,905
+> ? JUMP 34
+834c899,900
< 169 THROW(Throwable)
---
> ? STORE_LOCAL(variable exc2)
-> ? JUMP 22
->
-> 22:
+> ? JUMP 34
+835a902,914
+> 34:
> 184 LOAD_MODULE object Predef
> 184 CONSTANT("finally")
> 184 CALL_METHOD scala.Predef.println (dynamic)
@@ -172,57 +172,60 @@
> 185 STORE_LOCAL(variable result)
> 185 LOAD_LOCAL(variable exc2)
> 185 THROW(Throwable)
-841c927
-< catch (Throwable) in ArrayBuffer(11, 12, 13, 14, 15, 16, 18) starting at: 4
+>
+856c935
+< catch (Throwable) in ArrayBuffer(17, 18, 19, 22, 25, 27, 28, 30) starting at: 4
---
-> catch (Throwable) in ArrayBuffer(11, 12, 13, 14, 15, 16, 18, 20) starting at: 4
-844c930
-< catch (<none>) in ArrayBuffer(4, 5, 6, 7, 11, 12, 13, 14, 15, 16, 18) starting at: 3
+> catch (Throwable) in ArrayBuffer(17, 18, 19, 22, 25, 27, 28, 30, 32) starting at: 4
+859c938
+< catch (<none>) in ArrayBuffer(4, 5, 6, 9, 12, 17, 18, 19, 22, 25, 27, 28, 30) starting at: 3
---
-> catch (<none>) in ArrayBuffer(4, 5, 6, 7, 11, 12, 13, 14, 15, 16, 18, 20, 21) starting at: 3
-870c956
-< blocks: [1,2,3,6,7,8,10,11,13]
+> catch (<none>) in ArrayBuffer(4, 5, 6, 9, 12, 17, 18, 19, 22, 25, 27, 28, 30, 32, 33) starting at: 3
+885c964
+< blocks: [1,2,3,6,7,8,11,14,16,17,19]
---
-> blocks: [1,2,3,6,7,8,10,11,13,14]
-894c980,989
+> blocks: [1,2,3,6,7,8,11,14,16,17,19,20]
+909c988,995
< 124 THROW(MyException)
---
-> ? STORE_LOCAL(value ex$2)
-> ? JUMP 14
+> ? STORE_LOCAL(value ex5)
+> ? JUMP 20
>
-> 14:
-> 122 LOAD_LOCAL(value ex$2)
-> 122 STORE_LOCAL(value temp5)
-> 122 SCOPE_ENTER value temp5
-> 122 LOAD_LOCAL(value temp5)
-> 122 IS_INSTANCE REF(class MyException)
-> 122 CZJUMP (BOOL)NE ? 7 : 8
-942c1037
-< catch (IllegalArgumentException) in ArrayBuffer(6, 7, 8, 10, 11, 13) starting at: 3
----
-> catch (IllegalArgumentException) in ArrayBuffer(6, 7, 8, 10, 11, 13, 14) starting at: 3
-968c1063
-< blocks: [1,2,3,4,5,9,10,11,13]
----
-> blocks: [1,2,3,4,5,9,10,11,13,14]
-992c1087,1096
+> 20:
+> 122 LOAD_LOCAL(value ex5)
+> 122 STORE_LOCAL(value x3)
+> 122 SCOPE_ENTER value x3
+> 122 JUMP 7
+969c1055
+< catch (IllegalArgumentException) in ArrayBuffer(6, 7, 8, 11, 14, 16, 17, 19) starting at: 3
+---
+> catch (IllegalArgumentException) in ArrayBuffer(6, 7, 8, 11, 14, 16, 17, 19, 20) starting at: 3
+995c1081
+< blocks: [1,2,3,4,5,8,11,15,16,17,19]
+---
+> blocks: [1,2,3,5,8,11,15,16,17,19,20]
+1019c1105,1114
< 148 THROW(MyException)
---
-> ? STORE_LOCAL(value ex$3)
-> ? JUMP 14
+> ? STORE_LOCAL(value ex5)
+> ? JUMP 20
>
-> 14:
-> 145 LOAD_LOCAL(value ex$3)
-> 145 STORE_LOCAL(value temp8)
-> 145 SCOPE_ENTER value temp8
-> 145 LOAD_LOCAL(value temp8)
-> 145 IS_INSTANCE REF(class MyException)
-> 145 CZJUMP (BOOL)NE ? 4 : 5
-1236c1340
+> 20:
+> 145 LOAD_LOCAL(value ex5)
+> 145 STORE_LOCAL(value x3)
+> 145 SCOPE_ENTER value x3
+> 154 LOAD_LOCAL(value x3)
+> 154 IS_INSTANCE REF(class MyException)
+> 154 CZJUMP (BOOL)NE ? 5 : 11
+1040,1042d1134
+< 145 JUMP 4
+<
+< 4:
+1275c1367
< blocks: [1,2,3,4,5,7]
---
> blocks: [1,2,3,4,5,7,8]
-1260c1364,1371
+1299c1391,1398
< 38 THROW(IllegalArgumentException)
---
> ? STORE_LOCAL(value e)
@@ -233,33 +236,37 @@
> 42 CONSTANT("IllegalArgumentException")
> 42 CALL_METHOD scala.Predef.println (dynamic)
> 42 JUMP 2
-1309c1420
-< blocks: [1,2,3,4,5,7,8,10,11,13]
+1348c1447
+< blocks: [1,2,3,4,5,8,11,13,14,16,17,19]
---
-> blocks: [1,2,3,4,5,7,8,10,11,13,14]
-1333c1444,1445
+> blocks: [1,2,3,5,8,11,13,14,16,17,19,20]
+1372c1471,1472
< 203 THROW(MyException)
---
-> ? STORE_LOCAL(value ex$6)
-> ? JUMP 14
-1353c1465,1474
+> ? STORE_LOCAL(value ex5)
+> ? JUMP 20
+1392c1492,1501
< 209 THROW(MyException)
---
-> ? STORE_LOCAL(value ex$6)
-> ? JUMP 14
+> ? STORE_LOCAL(value ex5)
+> ? JUMP 20
>
-> 14:
-> 200 LOAD_LOCAL(value ex$6)
-> 200 STORE_LOCAL(value temp17)
-> 200 SCOPE_ENTER value temp17
-> 200 LOAD_LOCAL(value temp17)
-> 200 IS_INSTANCE REF(class MyException)
-> 200 CZJUMP (BOOL)NE ? 4 : 5
-1416c1537
+> 20:
+> 200 LOAD_LOCAL(value ex5)
+> 200 STORE_LOCAL(value x3)
+> 200 SCOPE_ENTER value x3
+> 212 LOAD_LOCAL(value x3)
+> 212 IS_INSTANCE REF(class MyException)
+> 212 CZJUMP (BOOL)NE ? 5 : 11
+1405,1407d1513
+< 200 JUMP 4
+<
+< 4:
+1467c1573
< blocks: [1,2,3,4,5,7]
---
> blocks: [1,2,3,4,5,7,8]
-1440c1561,1568
+1491c1597,1604
< 58 THROW(IllegalArgumentException)
---
> ? STORE_LOCAL(value e)
@@ -270,11 +277,11 @@
> 62 CONSTANT("RuntimeException")
> 62 CALL_METHOD scala.Predef.println (dynamic)
> 62 JUMP 2
-1489c1617
+1540c1653
< blocks: [1,2,3,4]
---
> blocks: [1,2,3,4,5]
-1509c1637,1642
+1560c1673,1678
< 229 THROW(MyException)
---
> ? JUMP 5
@@ -283,19 +290,19 @@
> ? LOAD_LOCAL(variable monitor1)
> 228 MONITOR_EXIT
> 228 THROW(Throwable)
-1515c1648
+1566c1684
< ? THROW(Throwable)
---
> 228 THROW(Throwable)
-1543c1676
+1594c1712
< locals: value args, variable result, variable monitor2, variable monitorResult1
---
> locals: value exception$1, value args, variable result, variable monitor2, variable monitorResult1
-1545c1678
+1596c1714
< blocks: [1,2,3,4]
---
> blocks: [1,2,3,4,5]
-1568c1701,1709
+1619c1737,1745
< 245 THROW(MyException)
---
> ? STORE_LOCAL(value exception$1)
@@ -307,7 +314,7 @@
> ? LOAD_LOCAL(variable monitor2)
> 244 MONITOR_EXIT
> 244 THROW(Throwable)
-1574c1715
+1625c1751
< ? THROW(Throwable)
---
> 244 THROW(Throwable)
diff --git a/test/files/run/macro-abort-fresh.check b/test/files/run/macro-abort-fresh.check
new file mode 100644
index 0000000000..28057c2883
--- /dev/null
+++ b/test/files/run/macro-abort-fresh.check
@@ -0,0 +1,6 @@
+$1$
+qwe1
+qwe2
+reflective compilation has failed:
+
+blargh
diff --git a/test/files/run/macro-abort-fresh.flags b/test/files/run/macro-abort-fresh.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-abort-fresh.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-abort-fresh/Macros_1.scala b/test/files/run/macro-abort-fresh/Macros_1.scala
new file mode 100644
index 0000000000..4186c4c4a6
--- /dev/null
+++ b/test/files/run/macro-abort-fresh/Macros_1.scala
@@ -0,0 +1,15 @@
+import scala.reflect.makro.Context
+
+object Impls {
+ def impl(c: Context) = {
+ import c.mirror._
+ println(c.fresh())
+ println(c.fresh("qwe"))
+ println(c.fresh(newTypeName("qwe")))
+ c.abort(NoPosition, "blargh")
+ }
+}
+
+object Macros {
+ def foo = macro Impls.impl
+} \ No newline at end of file
diff --git a/test/files/run/macro-abort-fresh/Test_2.scala b/test/files/run/macro-abort-fresh/Test_2.scala
new file mode 100644
index 0000000000..f389231ca6
--- /dev/null
+++ b/test/files/run/macro-abort-fresh/Test_2.scala
@@ -0,0 +1,6 @@
+object Test extends App {
+ import scala.reflect.mirror._
+ val tree = Select(Ident("Macros"), newTermName("foo"))
+ try tree.eval
+ catch { case ex: Throwable => println(ex.getMessage) }
+} \ No newline at end of file
diff --git a/test/files/run/macro-basic-ma-md-mi.check b/test/files/run/macro-basic-ma-md-mi.check
new file mode 100644
index 0000000000..b74e882ae3
--- /dev/null
+++ b/test/files/run/macro-basic-ma-md-mi.check
@@ -0,0 +1 @@
+31 \ No newline at end of file
diff --git a/test/files/run/macro-basic-ma-md-mi.flags b/test/files/run/macro-basic-ma-md-mi.flags
new file mode 100644
index 0000000000..5e5dd6ce79
--- /dev/null
+++ b/test/files/run/macro-basic-ma-md-mi.flags
@@ -0,0 +1 @@
+-language:experimental.macros
diff --git a/test/files/run/macro-basic-ma-md-mi/Impls_1.scala b/test/files/run/macro-basic-ma-md-mi/Impls_1.scala
new file mode 100644
index 0000000000..3f23e349d5
--- /dev/null
+++ b/test/files/run/macro-basic-ma-md-mi/Impls_1.scala
@@ -0,0 +1,21 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ import c.mirror._
+ val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1))))
+ Expr[Int](body)
+ }
+
+ def bar(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ import c.mirror._
+ val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2))))
+ Expr[Int](body)
+ }
+
+ def quux(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ import c.mirror._
+ val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(3))))
+ Expr[Int](body)
+ }
+}
diff --git a/test/files/run/macro-basic-ma-md-mi/Macros_2.scala b/test/files/run/macro-basic-ma-md-mi/Macros_2.scala
new file mode 100644
index 0000000000..5279043746
--- /dev/null
+++ b/test/files/run/macro-basic-ma-md-mi/Macros_2.scala
@@ -0,0 +1,10 @@
+object Macros {
+ object Shmacros {
+ def foo(x: Int): Int = macro Impls.foo
+ }
+ def bar(x: Int): Int = macro Impls.bar
+}
+
+class Macros {
+ def quux(x: Int): Int = macro Impls.quux
+} \ No newline at end of file
diff --git a/test/files/run/macro-basic-ma-md-mi/Test_3.scala b/test/files/run/macro-basic-ma-md-mi/Test_3.scala
new file mode 100644
index 0000000000..e9a10e20c9
--- /dev/null
+++ b/test/files/run/macro-basic-ma-md-mi/Test_3.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ import Macros.Shmacros._
+ println(foo(2) + Macros.bar(2) * new Macros().quux(4))
+} \ No newline at end of file
diff --git a/test/files/run/macro-basic-ma-mdmi.check b/test/files/run/macro-basic-ma-mdmi.check
new file mode 100644
index 0000000000..b74e882ae3
--- /dev/null
+++ b/test/files/run/macro-basic-ma-mdmi.check
@@ -0,0 +1 @@
+31 \ No newline at end of file
diff --git a/test/files/run/macro-basic-ma-mdmi.flags b/test/files/run/macro-basic-ma-mdmi.flags
new file mode 100644
index 0000000000..5e5dd6ce79
--- /dev/null
+++ b/test/files/run/macro-basic-ma-mdmi.flags
@@ -0,0 +1 @@
+-language:experimental.macros
diff --git a/test/files/run/macro-basic-ma-mdmi/Impls_Macros_1.scala b/test/files/run/macro-basic-ma-mdmi/Impls_Macros_1.scala
new file mode 100644
index 0000000000..44bfe861e3
--- /dev/null
+++ b/test/files/run/macro-basic-ma-mdmi/Impls_Macros_1.scala
@@ -0,0 +1,32 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ import c.mirror._
+ val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1))))
+ Expr[Int](body)
+ }
+
+ def bar(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ import c.mirror._
+ val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2))))
+ Expr[Int](body)
+ }
+
+ def quux(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ import c.mirror._
+ val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(3))))
+ Expr[Int](body)
+ }
+}
+
+object Macros {
+ object Shmacros {
+ def foo(x: Int): Int = macro Impls.foo
+ }
+ def bar(x: Int): Int = macro Impls.bar
+}
+
+class Macros {
+ def quux(x: Int): Int = macro Impls.quux
+} \ No newline at end of file
diff --git a/test/files/run/macro-basic-ma-mdmi/Test_2.scala b/test/files/run/macro-basic-ma-mdmi/Test_2.scala
new file mode 100644
index 0000000000..e9a10e20c9
--- /dev/null
+++ b/test/files/run/macro-basic-ma-mdmi/Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ import Macros.Shmacros._
+ println(foo(2) + Macros.bar(2) * new Macros().quux(4))
+} \ No newline at end of file
diff --git a/test/files/run/macro-basic-mamd-mi.check b/test/files/run/macro-basic-mamd-mi.check
new file mode 100644
index 0000000000..b74e882ae3
--- /dev/null
+++ b/test/files/run/macro-basic-mamd-mi.check
@@ -0,0 +1 @@
+31 \ No newline at end of file
diff --git a/test/files/run/macro-basic-mamd-mi.flags b/test/files/run/macro-basic-mamd-mi.flags
new file mode 100644
index 0000000000..5e5dd6ce79
--- /dev/null
+++ b/test/files/run/macro-basic-mamd-mi.flags
@@ -0,0 +1 @@
+-language:experimental.macros
diff --git a/test/files/run/macro-basic-mamd-mi/Impls_1.scala b/test/files/run/macro-basic-mamd-mi/Impls_1.scala
new file mode 100644
index 0000000000..eadb63fa8e
--- /dev/null
+++ b/test/files/run/macro-basic-mamd-mi/Impls_1.scala
@@ -0,0 +1,19 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ import c.mirror._
+ Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1))))
+ }
+
+ def bar(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ import c.mirror._
+ Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2))))
+ }
+
+ def quux(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ import c.mirror._
+ val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(3))))
+ Expr[Int](body)
+ }
+}
diff --git a/test/files/run/macro-basic-mamd-mi/Macros_Test_2.scala b/test/files/run/macro-basic-mamd-mi/Macros_Test_2.scala
new file mode 100644
index 0000000000..d3746894f0
--- /dev/null
+++ b/test/files/run/macro-basic-mamd-mi/Macros_Test_2.scala
@@ -0,0 +1,15 @@
+object Macros {
+ object Shmacros {
+ def foo(x: Int): Int = macro Impls.foo
+ }
+ def bar(x: Int): Int = macro Impls.bar
+}
+
+class Macros {
+ def quux(x: Int): Int = macro Impls.quux
+}
+
+object Test extends App {
+ import Macros.Shmacros._
+ println(foo(2) + Macros.bar(2) * new Macros().quux(4))
+} \ No newline at end of file
diff --git a/test/files/run/macro-basic.check b/test/files/run/macro-basic.check
deleted file mode 100644
index d434014897..0000000000
--- a/test/files/run/macro-basic.check
+++ /dev/null
@@ -1 +0,0 @@
-10
diff --git a/test/files/run/macro-basic.flags b/test/files/run/macro-basic.flags
deleted file mode 100644
index 06a7b31f11..0000000000
--- a/test/files/run/macro-basic.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xmacros
diff --git a/test/files/run/macro-basic/Macros_1.scala b/test/files/run/macro-basic/Macros_1.scala
deleted file mode 100644
index c2ea183abe..0000000000
--- a/test/files/run/macro-basic/Macros_1.scala
+++ /dev/null
@@ -1,10 +0,0 @@
-object Macros {
- object Shmacros {
- def macro foo(x: Int): Int = x
- }
- def macro bar(x: Int): Int = x
-}
-
-class Macros {
- def macro quux(x: Int): Int = x
-} \ No newline at end of file
diff --git a/test/files/run/macro-bodyexpandstoimpl.check b/test/files/run/macro-bodyexpandstoimpl.check
new file mode 100644
index 0000000000..f70d7bba4a
--- /dev/null
+++ b/test/files/run/macro-bodyexpandstoimpl.check
@@ -0,0 +1 @@
+42 \ No newline at end of file
diff --git a/test/files/run/macro-bodyexpandstoimpl.flags b/test/files/run/macro-bodyexpandstoimpl.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-bodyexpandstoimpl.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-bodyexpandstoimpl/Impls_1.scala b/test/files/run/macro-bodyexpandstoimpl/Impls_1.scala
new file mode 100644
index 0000000000..5c5ec2c999
--- /dev/null
+++ b/test/files/run/macro-bodyexpandstoimpl/Impls_1.scala
@@ -0,0 +1,12 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int]) = x
+
+ def refToFoo(dummy: Int) = macro refToFoo_impl
+ def refToFoo_impl(c: Ctx)(dummy: c.Expr[Int]) = {
+ import c.mirror._
+ val body = Select(Ident(newTermName("Impls")), newTermName("foo"))
+ Expr[Int](body)
+ }
+} \ No newline at end of file
diff --git a/test/files/run/macro-bodyexpandstoimpl/Macros_Test_2.scala b/test/files/run/macro-bodyexpandstoimpl/Macros_Test_2.scala
new file mode 100644
index 0000000000..2934201a16
--- /dev/null
+++ b/test/files/run/macro-bodyexpandstoimpl/Macros_Test_2.scala
@@ -0,0 +1,10 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Macros {
+ def foo(x: Int) = macro Impls.refToFoo(42)
+}
+
+object Test extends App {
+ import Macros._
+ println(foo(42))
+} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-annotation.check b/test/files/run/macro-declared-in-annotation.check
new file mode 100644
index 0000000000..1ea14b4e20
--- /dev/null
+++ b/test/files/run/macro-declared-in-annotation.check
@@ -0,0 +1 @@
+it works
diff --git a/test/files/run/macro-declared-in-annotation.flags b/test/files/run/macro-declared-in-annotation.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-declared-in-annotation.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-annotation/Impls_1.scala b/test/files/run/macro-declared-in-annotation/Impls_1.scala
new file mode 100644
index 0000000000..a1234a7374
--- /dev/null
+++ b/test/files/run/macro-declared-in-annotation/Impls_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = {
+ import c.{prefix => prefix}
+ import c.mirror._
+ val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
+ val body = Block(List(printPrefix), Literal(Constant("this is deprecated")))
+ Expr[String](body)
+ }
+}
diff --git a/test/files/run/macro-declared-in-annotation/Macros_2.scala b/test/files/run/macro-declared-in-annotation/Macros_2.scala
new file mode 100644
index 0000000000..a565849aa9
--- /dev/null
+++ b/test/files/run/macro-declared-in-annotation/Macros_2.scala
@@ -0,0 +1,8 @@
+class foo(val bar: String) extends StaticAnnotation
+
+object Api {
+ // foo in ann must have a different name
+ // otherwise, we get bitten by https://issues.scala-lang.org/browse/SI-5544
+ @foo({def fooInAnn = macro Impls.foo; fooInAnn})
+ def foo = println("it works")
+} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-annotation/Test_3.scala b/test/files/run/macro-declared-in-annotation/Test_3.scala
new file mode 100644
index 0000000000..866487f028
--- /dev/null
+++ b/test/files/run/macro-declared-in-annotation/Test_3.scala
@@ -0,0 +1,3 @@
+object Test extends App {
+ Api.foo
+} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-anonymous.check b/test/files/run/macro-declared-in-anonymous.check
new file mode 100644
index 0000000000..09b8d015a6
--- /dev/null
+++ b/test/files/run/macro-declared-in-anonymous.check
@@ -0,0 +1,2 @@
+prefix = Expr[Nothing](Test.this.macros)
+it works
diff --git a/test/files/run/macro-declared-in-anonymous.flags b/test/files/run/macro-declared-in-anonymous.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-declared-in-anonymous.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-anonymous/Impls_1.scala b/test/files/run/macro-declared-in-anonymous/Impls_1.scala
new file mode 100644
index 0000000000..c0827ace31
--- /dev/null
+++ b/test/files/run/macro-declared-in-anonymous/Impls_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = {
+ import c.{prefix => prefix}
+ import c.mirror._
+ val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
+ val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-declared-in-anonymous/Macros_Test_2.scala b/test/files/run/macro-declared-in-anonymous/Macros_Test_2.scala
new file mode 100644
index 0000000000..8bd8c172c9
--- /dev/null
+++ b/test/files/run/macro-declared-in-anonymous/Macros_Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ val macros = new { def foo = macro Impls.foo }
+ macros.foo
+} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-block.check b/test/files/run/macro-declared-in-block.check
new file mode 100644
index 0000000000..a61fd13087
--- /dev/null
+++ b/test/files/run/macro-declared-in-block.check
@@ -0,0 +1,2 @@
+prefix = Expr[Nothing](<empty>)
+it works
diff --git a/test/files/run/macro-declared-in-block.flags b/test/files/run/macro-declared-in-block.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-declared-in-block.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-block/Impls_1.scala b/test/files/run/macro-declared-in-block/Impls_1.scala
new file mode 100644
index 0000000000..c0827ace31
--- /dev/null
+++ b/test/files/run/macro-declared-in-block/Impls_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = {
+ import c.{prefix => prefix}
+ import c.mirror._
+ val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
+ val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-declared-in-block/Macros_Test_2.scala b/test/files/run/macro-declared-in-block/Macros_Test_2.scala
new file mode 100644
index 0000000000..69088e24bc
--- /dev/null
+++ b/test/files/run/macro-declared-in-block/Macros_Test_2.scala
@@ -0,0 +1,6 @@
+object Test extends App {
+ {
+ def foo = macro Impls.foo
+ foo
+ }
+} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-class-class.check b/test/files/run/macro-declared-in-class-class.check
new file mode 100644
index 0000000000..480c2f906f
--- /dev/null
+++ b/test/files/run/macro-declared-in-class-class.check
@@ -0,0 +1,2 @@
+prefix = Expr[Nothing](new Test.this.outer.Macros())
+it works
diff --git a/test/files/run/macro-declared-in-class-class.flags b/test/files/run/macro-declared-in-class-class.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-declared-in-class-class.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-class-class/Impls_1.scala b/test/files/run/macro-declared-in-class-class/Impls_1.scala
new file mode 100644
index 0000000000..c2e6933582
--- /dev/null
+++ b/test/files/run/macro-declared-in-class-class/Impls_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = {
+ import c.{prefix => prefix}
+ import c.mirror._
+ val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
+ val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-declared-in-class-class/Macros_Test_2.scala b/test/files/run/macro-declared-in-class-class/Macros_Test_2.scala
new file mode 100644
index 0000000000..871857a97f
--- /dev/null
+++ b/test/files/run/macro-declared-in-class-class/Macros_Test_2.scala
@@ -0,0 +1,10 @@
+class Macros {
+ class Macros {
+ def foo = macro Impls.foo
+ }
+}
+
+object Test extends App {
+ val outer = new Macros()
+ new outer.Macros().foo
+} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-class-object.check b/test/files/run/macro-declared-in-class-object.check
new file mode 100644
index 0000000000..f7ba5a53cb
--- /dev/null
+++ b/test/files/run/macro-declared-in-class-object.check
@@ -0,0 +1,2 @@
+prefix = Expr[Nothing](Test.this.outer.Macros)
+it works
diff --git a/test/files/run/macro-declared-in-class-object.flags b/test/files/run/macro-declared-in-class-object.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-declared-in-class-object.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-class-object/Impls_1.scala b/test/files/run/macro-declared-in-class-object/Impls_1.scala
new file mode 100644
index 0000000000..c2e6933582
--- /dev/null
+++ b/test/files/run/macro-declared-in-class-object/Impls_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = {
+ import c.{prefix => prefix}
+ import c.mirror._
+ val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
+ val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-declared-in-class-object/Macros_Test_2.scala b/test/files/run/macro-declared-in-class-object/Macros_Test_2.scala
new file mode 100644
index 0000000000..994f9fe935
--- /dev/null
+++ b/test/files/run/macro-declared-in-class-object/Macros_Test_2.scala
@@ -0,0 +1,10 @@
+class Macros {
+ object Macros {
+ def foo = macro Impls.foo
+ }
+}
+
+object Test extends App {
+ val outer = new Macros()
+ outer.Macros.foo
+} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-class.check b/test/files/run/macro-declared-in-class.check
new file mode 100644
index 0000000000..946851e4bb
--- /dev/null
+++ b/test/files/run/macro-declared-in-class.check
@@ -0,0 +1,2 @@
+prefix = Expr[Nothing](new Macros())
+it works
diff --git a/test/files/run/macro-declared-in-class.flags b/test/files/run/macro-declared-in-class.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-declared-in-class.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-class/Impls_1.scala b/test/files/run/macro-declared-in-class/Impls_1.scala
new file mode 100644
index 0000000000..c2e6933582
--- /dev/null
+++ b/test/files/run/macro-declared-in-class/Impls_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = {
+ import c.{prefix => prefix}
+ import c.mirror._
+ val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
+ val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-declared-in-class/Macros_Test_2.scala b/test/files/run/macro-declared-in-class/Macros_Test_2.scala
new file mode 100644
index 0000000000..1b9d13e775
--- /dev/null
+++ b/test/files/run/macro-declared-in-class/Macros_Test_2.scala
@@ -0,0 +1,7 @@
+class Macros {
+ def foo = macro Impls.foo
+}
+
+object Test extends App {
+ new Macros().foo
+} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-default-param.check b/test/files/run/macro-declared-in-default-param.check
new file mode 100644
index 0000000000..00052ad018
--- /dev/null
+++ b/test/files/run/macro-declared-in-default-param.check
@@ -0,0 +1,5 @@
+prefix = Expr[Nothing](<empty>)
+it works
+it works
+prefix = Expr[Nothing](<empty>)
+it works
diff --git a/test/files/run/macro-declared-in-default-param.flags b/test/files/run/macro-declared-in-default-param.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-declared-in-default-param.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-default-param/Impls_1.scala b/test/files/run/macro-declared-in-default-param/Impls_1.scala
new file mode 100644
index 0000000000..e45095812a
--- /dev/null
+++ b/test/files/run/macro-declared-in-default-param/Impls_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = {
+ import c.{prefix => prefix}
+ import c.mirror._
+ val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
+ val body = Block(List(printPrefix), Literal(Constant("it works")))
+ Expr[String](body)
+ }
+}
diff --git a/test/files/run/macro-declared-in-default-param/Macros_Test_2.scala b/test/files/run/macro-declared-in-default-param/Macros_Test_2.scala
new file mode 100644
index 0000000000..356029e63e
--- /dev/null
+++ b/test/files/run/macro-declared-in-default-param/Macros_Test_2.scala
@@ -0,0 +1,7 @@
+object Test extends App {
+ def foo(bar: String = { def foo = macro Impls.foo; foo }) = println(bar)
+
+ foo()
+ foo("it works")
+ foo()
+} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-implicit-class.check b/test/files/run/macro-declared-in-implicit-class.check
new file mode 100644
index 0000000000..b3640ceaa7
--- /dev/null
+++ b/test/files/run/macro-declared-in-implicit-class.check
@@ -0,0 +1,2 @@
+prefix = Expr[Nothing](Macros.foo("2"))
+Some(2)
diff --git a/test/files/run/macro-declared-in-implicit-class.flags b/test/files/run/macro-declared-in-implicit-class.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-declared-in-implicit-class.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-implicit-class/Impls_Macros_1.scala b/test/files/run/macro-declared-in-implicit-class/Impls_Macros_1.scala
new file mode 100644
index 0000000000..8605d4a8be
--- /dev/null
+++ b/test/files/run/macro-declared-in-implicit-class/Impls_Macros_1.scala
@@ -0,0 +1,19 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def toOptionOfInt(c: Ctx) = {
+ import c.{prefix => prefix}
+ import c.mirror._
+ val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
+ val body = Block(printPrefix, Apply(Ident(definitions.SomeModule), List(Select(Select(prefix.tree, newTermName("x")), newTermName("toInt")))))
+ Expr[Option[Int]](body)
+ }
+}
+
+object Macros {
+ implicit def foo(x: String): Foo = new Foo(x)
+
+ class Foo(val x: String) {
+ def toOptionOfInt = macro Impls.toOptionOfInt
+ }
+}
diff --git a/test/files/run/macro-declared-in-implicit-class/Test_2.scala b/test/files/run/macro-declared-in-implicit-class/Test_2.scala
new file mode 100644
index 0000000000..d0bc9cc38c
--- /dev/null
+++ b/test/files/run/macro-declared-in-implicit-class/Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ import Macros._
+ println("2".toOptionOfInt)
+} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-method.check b/test/files/run/macro-declared-in-method.check
new file mode 100644
index 0000000000..a61fd13087
--- /dev/null
+++ b/test/files/run/macro-declared-in-method.check
@@ -0,0 +1,2 @@
+prefix = Expr[Nothing](<empty>)
+it works
diff --git a/test/files/run/macro-declared-in-method.flags b/test/files/run/macro-declared-in-method.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-declared-in-method.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-method/Impls_1.scala b/test/files/run/macro-declared-in-method/Impls_1.scala
new file mode 100644
index 0000000000..c2e6933582
--- /dev/null
+++ b/test/files/run/macro-declared-in-method/Impls_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = {
+ import c.{prefix => prefix}
+ import c.mirror._
+ val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
+ val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-declared-in-method/Macros_Test_2.scala b/test/files/run/macro-declared-in-method/Macros_Test_2.scala
new file mode 100644
index 0000000000..ed5c8b7c43
--- /dev/null
+++ b/test/files/run/macro-declared-in-method/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Test extends App {
+ def bar() = {
+ def foo = macro Impls.foo
+ foo
+ }
+
+ bar()
+} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-object-class.check b/test/files/run/macro-declared-in-object-class.check
new file mode 100644
index 0000000000..480c2f906f
--- /dev/null
+++ b/test/files/run/macro-declared-in-object-class.check
@@ -0,0 +1,2 @@
+prefix = Expr[Nothing](new Test.this.outer.Macros())
+it works
diff --git a/test/files/run/macro-declared-in-object-class.flags b/test/files/run/macro-declared-in-object-class.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-declared-in-object-class.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-object-class/Impls_1.scala b/test/files/run/macro-declared-in-object-class/Impls_1.scala
new file mode 100644
index 0000000000..c2e6933582
--- /dev/null
+++ b/test/files/run/macro-declared-in-object-class/Impls_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = {
+ import c.{prefix => prefix}
+ import c.mirror._
+ val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
+ val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-declared-in-object-class/Macros_Test_2.scala b/test/files/run/macro-declared-in-object-class/Macros_Test_2.scala
new file mode 100644
index 0000000000..204deed61c
--- /dev/null
+++ b/test/files/run/macro-declared-in-object-class/Macros_Test_2.scala
@@ -0,0 +1,10 @@
+object Macros {
+ class Macros {
+ def foo = macro Impls.foo
+ }
+}
+
+object Test extends App {
+ val outer = Macros
+ new outer.Macros().foo
+} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-object-object.check b/test/files/run/macro-declared-in-object-object.check
new file mode 100644
index 0000000000..f7ba5a53cb
--- /dev/null
+++ b/test/files/run/macro-declared-in-object-object.check
@@ -0,0 +1,2 @@
+prefix = Expr[Nothing](Test.this.outer.Macros)
+it works
diff --git a/test/files/run/macro-declared-in-object-object.flags b/test/files/run/macro-declared-in-object-object.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-declared-in-object-object.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-object-object/Impls_1.scala b/test/files/run/macro-declared-in-object-object/Impls_1.scala
new file mode 100644
index 0000000000..c2e6933582
--- /dev/null
+++ b/test/files/run/macro-declared-in-object-object/Impls_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = {
+ import c.{prefix => prefix}
+ import c.mirror._
+ val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
+ val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-declared-in-object-object/Macros_Test_2.scala b/test/files/run/macro-declared-in-object-object/Macros_Test_2.scala
new file mode 100644
index 0000000000..e261a50f3d
--- /dev/null
+++ b/test/files/run/macro-declared-in-object-object/Macros_Test_2.scala
@@ -0,0 +1,10 @@
+object Macros {
+ object Macros {
+ def foo = macro Impls.foo
+ }
+}
+
+object Test extends App {
+ val outer = Macros
+ outer.Macros.foo
+} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-object.check b/test/files/run/macro-declared-in-object.check
new file mode 100644
index 0000000000..05a8cc48ea
--- /dev/null
+++ b/test/files/run/macro-declared-in-object.check
@@ -0,0 +1,2 @@
+prefix = Expr[Nothing](Macros)
+it works
diff --git a/test/files/run/macro-declared-in-object.flags b/test/files/run/macro-declared-in-object.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-declared-in-object.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-object/Impls_1.scala b/test/files/run/macro-declared-in-object/Impls_1.scala
new file mode 100644
index 0000000000..c2e6933582
--- /dev/null
+++ b/test/files/run/macro-declared-in-object/Impls_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = {
+ import c.{prefix => prefix}
+ import c.mirror._
+ val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
+ val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-declared-in-object/Macros_Test_2.scala b/test/files/run/macro-declared-in-object/Macros_Test_2.scala
new file mode 100644
index 0000000000..a5a4862ba0
--- /dev/null
+++ b/test/files/run/macro-declared-in-object/Macros_Test_2.scala
@@ -0,0 +1,7 @@
+object Macros {
+ def foo = macro Impls.foo
+}
+
+object Test extends App {
+ Macros.foo
+} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-package-object.check b/test/files/run/macro-declared-in-package-object.check
new file mode 100644
index 0000000000..6f797f3c68
--- /dev/null
+++ b/test/files/run/macro-declared-in-package-object.check
@@ -0,0 +1,2 @@
+prefix = Expr[Nothing](Macros.`package`)
+it works
diff --git a/test/files/run/macro-declared-in-package-object.flags b/test/files/run/macro-declared-in-package-object.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-declared-in-package-object.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-package-object/Impls_1.scala b/test/files/run/macro-declared-in-package-object/Impls_1.scala
new file mode 100644
index 0000000000..c2e6933582
--- /dev/null
+++ b/test/files/run/macro-declared-in-package-object/Impls_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = {
+ import c.{prefix => prefix}
+ import c.mirror._
+ val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
+ val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-declared-in-package-object/Macros_Test_2.scala b/test/files/run/macro-declared-in-package-object/Macros_Test_2.scala
new file mode 100644
index 0000000000..54a5962e80
--- /dev/null
+++ b/test/files/run/macro-declared-in-package-object/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+package object Macros {
+ def foo = macro Impls.foo
+}
+
+object Test extends App {
+ import Macros._
+ foo
+} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-refinement.check b/test/files/run/macro-declared-in-refinement.check
new file mode 100644
index 0000000000..861cd43b01
--- /dev/null
+++ b/test/files/run/macro-declared-in-refinement.check
@@ -0,0 +1,2 @@
+prefix = Expr[Nothing](Test.this.macros)
+it works
diff --git a/test/files/run/macro-declared-in-refinement.flags b/test/files/run/macro-declared-in-refinement.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-declared-in-refinement.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-refinement/Impls_1.scala b/test/files/run/macro-declared-in-refinement/Impls_1.scala
new file mode 100644
index 0000000000..c2e6933582
--- /dev/null
+++ b/test/files/run/macro-declared-in-refinement/Impls_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = {
+ import c.{prefix => prefix}
+ import c.mirror._
+ val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
+ val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-declared-in-refinement/Macros_Test_2.scala b/test/files/run/macro-declared-in-refinement/Macros_Test_2.scala
new file mode 100644
index 0000000000..f746c2da57
--- /dev/null
+++ b/test/files/run/macro-declared-in-refinement/Macros_Test_2.scala
@@ -0,0 +1,6 @@
+class Base
+
+object Test extends App {
+ val macros = new Base { def foo = macro Impls.foo }
+ macros.foo
+} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-trait.check b/test/files/run/macro-declared-in-trait.check
new file mode 100644
index 0000000000..d5d9e4e457
--- /dev/null
+++ b/test/files/run/macro-declared-in-trait.check
@@ -0,0 +1,15 @@
+prefix = Expr[Nothing]({
+ final class $anon extends Object with Base {
+ def <init>(): anonymous class $anon = {
+ $anon.super.<init>();
+ ()
+ };
+ <empty>
+ };
+ new $anon()
+})
+it works
+prefix = Expr[Nothing](Macros)
+it works
+prefix = Expr[Nothing](new Macros())
+it works
diff --git a/test/files/run/macro-declared-in-trait.flags b/test/files/run/macro-declared-in-trait.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-declared-in-trait.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-trait/Impls_1.scala b/test/files/run/macro-declared-in-trait/Impls_1.scala
new file mode 100644
index 0000000000..c2e6933582
--- /dev/null
+++ b/test/files/run/macro-declared-in-trait/Impls_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = {
+ import c.{prefix => prefix}
+ import c.mirror._
+ val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
+ val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-declared-in-trait/Macros_Test_2.scala b/test/files/run/macro-declared-in-trait/Macros_Test_2.scala
new file mode 100644
index 0000000000..f75906b636
--- /dev/null
+++ b/test/files/run/macro-declared-in-trait/Macros_Test_2.scala
@@ -0,0 +1,13 @@
+trait Base {
+ def foo = macro Impls.foo
+}
+
+object Macros extends Base
+
+class Macros extends Base
+
+object Test extends App {
+ (new Base {}).foo
+ Macros.foo
+ new Macros().foo
+} \ No newline at end of file
diff --git a/test/files/run/macro-def-infer-return-type-a.check b/test/files/run/macro-def-infer-return-type-a.check
new file mode 100644
index 0000000000..f70d7bba4a
--- /dev/null
+++ b/test/files/run/macro-def-infer-return-type-a.check
@@ -0,0 +1 @@
+42 \ No newline at end of file
diff --git a/test/files/run/macro-def-infer-return-type-a.flags b/test/files/run/macro-def-infer-return-type-a.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-def-infer-return-type-a.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-def-infer-return-type-a/Impls_1.scala b/test/files/run/macro-def-infer-return-type-a/Impls_1.scala
new file mode 100644
index 0000000000..2346a6106d
--- /dev/null
+++ b/test/files/run/macro-def-infer-return-type-a/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int]) = x
+}
diff --git a/test/files/run/macro-def-infer-return-type-a/Macros_Test_2.scala b/test/files/run/macro-def-infer-return-type-a/Macros_Test_2.scala
new file mode 100644
index 0000000000..60fe9dc1c2
--- /dev/null
+++ b/test/files/run/macro-def-infer-return-type-a/Macros_Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ def foo(x: Int) = macro Impls.foo
+ println(foo(42))
+} \ No newline at end of file
diff --git a/test/files/run/macro-def-infer-return-type-b.check b/test/files/run/macro-def-infer-return-type-b.check
new file mode 100644
index 0000000000..f34d257c82
--- /dev/null
+++ b/test/files/run/macro-def-infer-return-type-b.check
@@ -0,0 +1,6 @@
+reflective compilation has failed:
+
+exception during macro expansion:
+java.lang.Error: an implementation is missing
+ at Impls$.foo(Impls_Macros_1.scala:5)
+
diff --git a/test/files/run/macro-def-infer-return-type-b.flags b/test/files/run/macro-def-infer-return-type-b.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-def-infer-return-type-b.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-def-infer-return-type-b/Impls_Macros_1.scala b/test/files/run/macro-def-infer-return-type-b/Impls_Macros_1.scala
new file mode 100644
index 0000000000..8640713846
--- /dev/null
+++ b/test/files/run/macro-def-infer-return-type-b/Impls_Macros_1.scala
@@ -0,0 +1,10 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[T](c: Ctx)(x: c.Expr[T]) =
+ throw new Error("an implementation is missing")
+}
+
+object Macros {
+ def foo[T](x: T) = macro Impls.foo[T]
+} \ No newline at end of file
diff --git a/test/files/run/macro-def-infer-return-type-b/Test_2.scala b/test/files/run/macro-def-infer-return-type-b/Test_2.scala
new file mode 100644
index 0000000000..8ff4494750
--- /dev/null
+++ b/test/files/run/macro-def-infer-return-type-b/Test_2.scala
@@ -0,0 +1,6 @@
+object Test extends App {
+ import scala.reflect.mirror._
+ val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
+ try tree.eval
+ catch { case ex: Throwable => println(ex.getMessage) }
+} \ No newline at end of file
diff --git a/test/files/run/macro-def-infer-return-type-c.check b/test/files/run/macro-def-infer-return-type-c.check
new file mode 100644
index 0000000000..f70d7bba4a
--- /dev/null
+++ b/test/files/run/macro-def-infer-return-type-c.check
@@ -0,0 +1 @@
+42 \ No newline at end of file
diff --git a/test/files/run/macro-def-infer-return-type-c.flags b/test/files/run/macro-def-infer-return-type-c.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-def-infer-return-type-c.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-def-infer-return-type-c/Impls_1.scala b/test/files/run/macro-def-infer-return-type-c/Impls_1.scala
new file mode 100644
index 0000000000..f3e53bbea7
--- /dev/null
+++ b/test/files/run/macro-def-infer-return-type-c/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[T](c: Ctx)(x: c.Expr[T]): c.Expr[T] = x
+}
diff --git a/test/files/run/macro-def-infer-return-type-c/Macros_Test_2.scala b/test/files/run/macro-def-infer-return-type-c/Macros_Test_2.scala
new file mode 100644
index 0000000000..967d16f6de
--- /dev/null
+++ b/test/files/run/macro-def-infer-return-type-c/Macros_Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ def foo[T](x: T) = macro Impls.foo[T]
+ println(foo(42))
+} \ No newline at end of file
diff --git a/test/files/run/macro-def-path-dependent-a.check b/test/files/run/macro-def-path-dependent-a.check
new file mode 100644
index 0000000000..1ea14b4e20
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent-a.check
@@ -0,0 +1 @@
+it works
diff --git a/test/files/run/macro-def-path-dependent-a.flags b/test/files/run/macro-def-path-dependent-a.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent-a.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-def-path-dependent-a/Impls_Macros_1.scala b/test/files/run/macro-def-path-dependent-a/Impls_Macros_1.scala
new file mode 100644
index 0000000000..d7167e671c
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent-a/Impls_Macros_1.scala
@@ -0,0 +1,21 @@
+import scala.reflect.makro.{Context => Ctx}
+
+trait Exprs {
+ self: Universe =>
+
+ class Expr[T]
+}
+
+trait Reifiers {
+ self: Universe =>
+
+ type Expr[T]
+
+ def reify[T](expr: T) = macro Impls.reify[T]
+}
+
+trait Universe extends Exprs with Reifiers
+
+object Impls {
+ def reify[T](cc: Ctx{ type PrefixType = Reifiers })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ???
+}
diff --git a/test/files/run/macro-def-path-dependent-a/Test_2.scala b/test/files/run/macro-def-path-dependent-a/Test_2.scala
new file mode 100644
index 0000000000..7dffc5107d
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent-a/Test_2.scala
@@ -0,0 +1,3 @@
+object Test extends App {
+ println("it works")
+} \ No newline at end of file
diff --git a/test/files/run/macro-def-path-dependent-b.check b/test/files/run/macro-def-path-dependent-b.check
new file mode 100644
index 0000000000..1ea14b4e20
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent-b.check
@@ -0,0 +1 @@
+it works
diff --git a/test/files/run/macro-def-path-dependent-b.flags b/test/files/run/macro-def-path-dependent-b.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent-b.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-def-path-dependent-b/Impls_Macros_1.scala b/test/files/run/macro-def-path-dependent-b/Impls_Macros_1.scala
new file mode 100644
index 0000000000..44af6949a7
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent-b/Impls_Macros_1.scala
@@ -0,0 +1,20 @@
+import scala.reflect.makro.{Context => Ctx}
+
+trait Exprs {
+ self: Universe =>
+
+ class Expr[T]
+}
+
+trait Reifiers {
+ self: Universe =>
+
+}
+
+trait Universe extends Exprs with Reifiers {
+ def reify[T](expr: T) = macro Impls.reify[T]
+}
+
+object Impls {
+ def reify[T](cc: Ctx{ type PrefixType = Universe })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ???
+}
diff --git a/test/files/run/macro-def-path-dependent-b/Test_2.scala b/test/files/run/macro-def-path-dependent-b/Test_2.scala
new file mode 100644
index 0000000000..7dffc5107d
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent-b/Test_2.scala
@@ -0,0 +1,3 @@
+object Test extends App {
+ println("it works")
+} \ No newline at end of file
diff --git a/test/files/run/macro-def-path-dependent-c.check b/test/files/run/macro-def-path-dependent-c.check
new file mode 100644
index 0000000000..1ea14b4e20
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent-c.check
@@ -0,0 +1 @@
+it works
diff --git a/test/files/run/macro-def-path-dependent-c.flags b/test/files/run/macro-def-path-dependent-c.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent-c.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-def-path-dependent-c/Impls_Macros_1.scala b/test/files/run/macro-def-path-dependent-c/Impls_Macros_1.scala
new file mode 100644
index 0000000000..305146c48b
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent-c/Impls_Macros_1.scala
@@ -0,0 +1,20 @@
+import scala.reflect.makro.{Context => Ctx}
+
+trait Exprs {
+ self: Universe =>
+
+ class Expr[T]
+}
+
+trait Reifiers {
+ self: Universe =>
+
+}
+
+trait Universe extends Exprs with Reifiers {
+ def reify[T](expr: T): Expr[T] = macro Impls.reify[T]
+}
+
+object Impls {
+ def reify[T](cc: Ctx{ type PrefixType = Universe })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ???
+}
diff --git a/test/files/run/macro-def-path-dependent-c/Test_2.scala b/test/files/run/macro-def-path-dependent-c/Test_2.scala
new file mode 100644
index 0000000000..7dffc5107d
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent-c/Test_2.scala
@@ -0,0 +1,3 @@
+object Test extends App {
+ println("it works")
+} \ No newline at end of file
diff --git a/test/files/run/macro-def-path-dependent-d.check b/test/files/run/macro-def-path-dependent-d.check
new file mode 100644
index 0000000000..1ea14b4e20
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent-d.check
@@ -0,0 +1 @@
+it works
diff --git a/test/files/run/macro-def-path-dependent-d.flags b/test/files/run/macro-def-path-dependent-d.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent-d.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-def-path-dependent-d/Impls_Macros_1.scala b/test/files/run/macro-def-path-dependent-d/Impls_Macros_1.scala
new file mode 100644
index 0000000000..32f03e778e
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent-d/Impls_Macros_1.scala
@@ -0,0 +1,8 @@
+import scala.reflect.makro.Context
+import scala.reflect.api.Universe
+
+object Test {
+ def materializeTypeTag[T](u: Universe)(e: T) = macro materializeTypeTag_impl[T]
+
+ def materializeTypeTag_impl[T: c.TypeTag](c: Context)(u: c.Expr[Universe])(e: c.Expr[T]): c.Expr[u.value.TypeTag[T]] = ???
+}
diff --git a/test/files/run/macro-def-path-dependent-d/Test_2.scala b/test/files/run/macro-def-path-dependent-d/Test_2.scala
new file mode 100644
index 0000000000..7dffc5107d
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent-d/Test_2.scala
@@ -0,0 +1,3 @@
+object Test extends App {
+ println("it works")
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-implicit-macro-has-implicit.check b/test/files/run/macro-expand-implicit-macro-has-implicit.check
new file mode 100644
index 0000000000..2f562a182f
--- /dev/null
+++ b/test/files/run/macro-expand-implicit-macro-has-implicit.check
@@ -0,0 +1 @@
+42
diff --git a/test/files/run/macro-expand-implicit-macro-has-implicit.flags b/test/files/run/macro-expand-implicit-macro-has-implicit.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-implicit-macro-has-implicit.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala b/test/files/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala
new file mode 100644
index 0000000000..39db275e1c
--- /dev/null
+++ b/test/files/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala
@@ -0,0 +1,9 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int]) = {
+ import c.mirror._
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(x.tree))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala b/test/files/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala
new file mode 100644
index 0000000000..ffb04dc80b
--- /dev/null
+++ b/test/files/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala
@@ -0,0 +1,5 @@
+object Test extends App {
+ implicit val x = 42
+ def foo(implicit x: Int) = macro Impls.foo
+ foo
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-implicit-macro-is-implicit.check b/test/files/run/macro-expand-implicit-macro-is-implicit.check
new file mode 100644
index 0000000000..42abf4579b
--- /dev/null
+++ b/test/files/run/macro-expand-implicit-macro-is-implicit.check
@@ -0,0 +1,2 @@
+Some(2)
+2
diff --git a/test/files/run/macro-expand-implicit-macro-is-implicit.flags b/test/files/run/macro-expand-implicit-macro-is-implicit.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-implicit-macro-is-implicit.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala b/test/files/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala
new file mode 100644
index 0000000000..0262485994
--- /dev/null
+++ b/test/files/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala
@@ -0,0 +1,9 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[String]): c.Expr[Option[Int]] = {
+ import c.mirror._
+ val body = Apply(Ident(definitions.SomeModule), List(Select(x.tree, newTermName("toInt"))))
+ Expr[Option[Int]](body)
+ }
+}
diff --git a/test/files/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala b/test/files/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala
new file mode 100644
index 0000000000..81ebd63c5f
--- /dev/null
+++ b/test/files/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala
@@ -0,0 +1,10 @@
+object Macros {
+ implicit def foo(x: String): Option[Int] = macro Impls.foo
+}
+
+object Test extends App {
+ import Macros._
+ println("2": Option[Int])
+ val s: Int = "2" getOrElse 0
+ println(s)
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-implicit-macro-is-val.check b/test/files/run/macro-expand-implicit-macro-is-val.check
new file mode 100644
index 0000000000..78c6baefdd
--- /dev/null
+++ b/test/files/run/macro-expand-implicit-macro-is-val.check
@@ -0,0 +1 @@
+2
diff --git a/test/files/run/macro-expand-implicit-macro-is-val.flags b/test/files/run/macro-expand-implicit-macro-is-val.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-implicit-macro-is-val.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-implicit-macro-is-val/Impls_1.scala b/test/files/run/macro-expand-implicit-macro-is-val/Impls_1.scala
new file mode 100644
index 0000000000..510d8502f6
--- /dev/null
+++ b/test/files/run/macro-expand-implicit-macro-is-val/Impls_1.scala
@@ -0,0 +1,9 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = {
+ import c.mirror._
+ val body = Literal(Constant(2))
+ Expr[Int](body)
+ }
+}
diff --git a/test/files/run/macro-expand-implicit-macro-is-val/Macros_Test_2.scala b/test/files/run/macro-expand-implicit-macro-is-val/Macros_Test_2.scala
new file mode 100644
index 0000000000..b91b1016c9
--- /dev/null
+++ b/test/files/run/macro-expand-implicit-macro-is-val/Macros_Test_2.scala
@@ -0,0 +1,5 @@
+object Test extends App {
+ implicit def foo = macro Impls.foo
+ def bar(implicit x: Int) = println(x)
+ bar
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-implicit-macro-is-view.check b/test/files/run/macro-expand-implicit-macro-is-view.check
new file mode 100644
index 0000000000..78c6baefdd
--- /dev/null
+++ b/test/files/run/macro-expand-implicit-macro-is-view.check
@@ -0,0 +1 @@
+2
diff --git a/test/files/run/macro-expand-implicit-macro-is-view.flags b/test/files/run/macro-expand-implicit-macro-is-view.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-implicit-macro-is-view.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-implicit-macro-is-view/Impls_1.scala b/test/files/run/macro-expand-implicit-macro-is-view/Impls_1.scala
new file mode 100644
index 0000000000..0262485994
--- /dev/null
+++ b/test/files/run/macro-expand-implicit-macro-is-view/Impls_1.scala
@@ -0,0 +1,9 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[String]): c.Expr[Option[Int]] = {
+ import c.mirror._
+ val body = Apply(Ident(definitions.SomeModule), List(Select(x.tree, newTermName("toInt"))))
+ Expr[Option[Int]](body)
+ }
+}
diff --git a/test/files/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala b/test/files/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala
new file mode 100644
index 0000000000..0ff1fb80ca
--- /dev/null
+++ b/test/files/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala
@@ -0,0 +1,9 @@
+object Macros {
+ implicit def foo(x: String): Option[Int] = macro Impls.foo
+}
+
+object Test extends App {
+ import Macros._
+ def bar[T <% Option[Int]](x: T) = println(x)
+ println("2")
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-multiple-arglists.check b/test/files/run/macro-expand-multiple-arglists.check
new file mode 100644
index 0000000000..c24b6ae77d
--- /dev/null
+++ b/test/files/run/macro-expand-multiple-arglists.check
@@ -0,0 +1 @@
+38 \ No newline at end of file
diff --git a/test/files/run/macro-expand-multiple-arglists.flags b/test/files/run/macro-expand-multiple-arglists.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-multiple-arglists.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-multiple-arglists/Impls_1.scala b/test/files/run/macro-expand-multiple-arglists/Impls_1.scala
new file mode 100644
index 0000000000..ae1c50eace
--- /dev/null
+++ b/test/files/run/macro-expand-multiple-arglists/Impls_1.scala
@@ -0,0 +1,10 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int])(y: c.Expr[Int]) = {
+ import c.mirror._
+ val sum = Apply(Select(x.tree, newTermName("$minus")), List(y.tree))
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(sum))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-expand-multiple-arglists/Macros_Test_2.scala b/test/files/run/macro-expand-multiple-arglists/Macros_Test_2.scala
new file mode 100644
index 0000000000..fa4504b0ea
--- /dev/null
+++ b/test/files/run/macro-expand-multiple-arglists/Macros_Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ def foo(x: Int)(y: Int) = macro Impls.foo
+ foo(40)(2)
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-nullary-generic.check b/test/files/run/macro-expand-nullary-generic.check
new file mode 100644
index 0000000000..6dfe04af12
--- /dev/null
+++ b/test/files/run/macro-expand-nullary-generic.check
@@ -0,0 +1,6 @@
+it works ConcreteTypeTag[Int]
+it works ConcreteTypeTag[Int]
+it works ConcreteTypeTag[Int]
+it works ConcreteTypeTag[Int]
+it works ConcreteTypeTag[Int]
+kkthxbai
diff --git a/test/files/run/macro-expand-nullary-generic.flags b/test/files/run/macro-expand-nullary-generic.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-nullary-generic.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-nullary-generic/Impls_1.scala b/test/files/run/macro-expand-nullary-generic/Impls_1.scala
new file mode 100644
index 0000000000..10352594f5
--- /dev/null
+++ b/test/files/run/macro-expand-nullary-generic/Impls_1.scala
@@ -0,0 +1,14 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def impl[T: c.TypeTag](c: Ctx) = {
+ import c.mirror._
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works " + implicitly[c.TypeTag[T]]))))
+ Expr[Unit](body)
+ }
+
+ def fooNullary[T: c.TypeTag](c: Ctx) = impl[T](c)
+ def fooEmpty[T: c.TypeTag](c: Ctx)() = impl[T](c)
+ def barNullary[T: c.TypeTag](c: Ctx)(x: c.Expr[Int]) = impl[T](c)
+ def barEmpty[T: c.TypeTag](c: Ctx)(x: c.Expr[Int])() = impl[T](c)
+}
diff --git a/test/files/run/macro-expand-nullary-generic/Macros_Test_2.scala b/test/files/run/macro-expand-nullary-generic/Macros_Test_2.scala
new file mode 100644
index 0000000000..2d5cf53c3c
--- /dev/null
+++ b/test/files/run/macro-expand-nullary-generic/Macros_Test_2.scala
@@ -0,0 +1,15 @@
+object Macros {
+ def foo1[T] = macro Impls.fooNullary[T]
+ def foo2[T]() = macro Impls.fooEmpty[T]
+ def bar1[T](x: Int) = macro Impls.barNullary[T]
+ def bar2[T](x: Int)() = macro Impls.barEmpty[T]
+}
+
+object Test extends App {
+ Macros.foo1[Int]
+ Macros.foo2[Int]
+ Macros.foo2[Int]()
+ Macros.bar1[Int](42)
+ Macros.bar2[Int](42)()
+ println("kkthxbai")
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-nullary-nongeneric.check b/test/files/run/macro-expand-nullary-nongeneric.check
new file mode 100644
index 0000000000..9ab5f3a2bc
--- /dev/null
+++ b/test/files/run/macro-expand-nullary-nongeneric.check
@@ -0,0 +1,6 @@
+it works
+it works
+it works
+it works
+it works
+kkthxbai
diff --git a/test/files/run/macro-expand-nullary-nongeneric.flags b/test/files/run/macro-expand-nullary-nongeneric.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-nullary-nongeneric.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala b/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala
new file mode 100644
index 0000000000..7dc58abba8
--- /dev/null
+++ b/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala
@@ -0,0 +1,14 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def impl(c: Ctx) = {
+ import c.mirror._
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))
+ Expr[Unit](body)
+ }
+
+ def fooNullary(c: Ctx) = impl(c)
+ def fooEmpty(c: Ctx)() = impl(c)
+ def barNullary(c: Ctx)(x: c.Expr[Int]) = impl(c)
+ def barEmpty(c: Ctx)(x: c.Expr[Int])() = impl(c)
+}
diff --git a/test/files/run/macro-expand-nullary-nongeneric/Macros_Test_2.scala b/test/files/run/macro-expand-nullary-nongeneric/Macros_Test_2.scala
new file mode 100644
index 0000000000..1f6d717956
--- /dev/null
+++ b/test/files/run/macro-expand-nullary-nongeneric/Macros_Test_2.scala
@@ -0,0 +1,15 @@
+object Macros {
+ def foo1 = macro Impls.fooNullary
+ def foo2() = macro Impls.fooEmpty
+ def bar1(x: Int) = macro Impls.barNullary
+ def bar2(x: Int)() = macro Impls.barEmpty
+}
+
+object Test extends App {
+ Macros.foo1
+ Macros.foo2
+ Macros.foo2()
+ Macros.bar1(42)
+ Macros.bar2(42)()
+ println("kkthxbai")
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-overload.check b/test/files/run/macro-expand-overload.check
new file mode 100644
index 0000000000..9d9989d85f
--- /dev/null
+++ b/test/files/run/macro-expand-overload.check
@@ -0,0 +1,6 @@
+(fooObjectString,Expr[Nothing](Macros),42)
+(fooObjectInt,Expr[Nothing](Macros),42)
+fooObjectBoolean
+(fooClassString,Expr[Nothing](new Macros()),42)
+(fooClassInt,Expr[Nothing](new Macros()),42)
+fooClassBoolean
diff --git a/test/files/run/macro-expand-overload.flags b/test/files/run/macro-expand-overload.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-overload.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-overload/Impls_1.scala b/test/files/run/macro-expand-overload/Impls_1.scala
new file mode 100644
index 0000000000..1dc4adc20e
--- /dev/null
+++ b/test/files/run/macro-expand-overload/Impls_1.scala
@@ -0,0 +1,15 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def impl(c: Ctx)(tag: String, x: c.Expr[_]) = {
+ import c.{prefix => prefix}
+ import c.mirror._
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(tag)), Literal(Constant(prefix.toString)), x.tree))
+ Expr[Unit](body)
+ }
+
+ def fooObjectString(c: Ctx)(x: c.Expr[_]) = impl(c)("fooObjectString", x)
+ def fooObjectInt(c: Ctx)(x: c.Expr[_]) = impl(c)("fooObjectInt", x)
+ def fooClassString(c: Ctx)(x: c.Expr[_]) = impl(c)("fooClassString", x)
+ def fooClassInt(c: Ctx)(x: c.Expr[_]) = impl(c)("fooClassInt", x)
+}
diff --git a/test/files/run/macro-expand-overload/Macros_Test_2.scala b/test/files/run/macro-expand-overload/Macros_Test_2.scala
new file mode 100644
index 0000000000..7f61f85184
--- /dev/null
+++ b/test/files/run/macro-expand-overload/Macros_Test_2.scala
@@ -0,0 +1,20 @@
+object Macros {
+ def foo(x: String) = macro Impls.fooObjectString
+ def foo(x: Int) = macro Impls.fooObjectInt
+ def foo(x: Boolean) = println("fooObjectBoolean")
+}
+
+class Macros {
+ def foo(x: String) = macro Impls.fooClassString
+ def foo(x: Int) = macro Impls.fooClassInt
+ def foo(x: Boolean) = println("fooClassBoolean")
+}
+
+object Test extends App {
+ Macros.foo("42")
+ Macros.foo(42)
+ Macros.foo(true)
+ new Macros().foo("42")
+ new Macros().foo(42)
+ new Macros().foo(true)
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-override.check b/test/files/run/macro-expand-override.check
new file mode 100644
index 0000000000..486bec7098
--- /dev/null
+++ b/test/files/run/macro-expand-override.check
@@ -0,0 +1,15 @@
+(fooBString,Expr[Nothing](Test.this.dd),42)
+(fooDInt,Expr[Nothing](Test.this.dd),42)
+fooBBoolean
+(fooBString,Expr[Nothing](Test.this.db),42)
+(fooBInt,Expr[Nothing](Test.this.db),42)
+fooBBoolean
+(fooZString,Expr[Nothing](Test.this.zz),42)
+(fooDInt,Expr[Nothing](Test.this.zz),42)
+fooZBoolean
+(fooBString,Expr[Nothing](Test.this.zd),42)
+(fooDInt,Expr[Nothing](Test.this.zd),42)
+fooZBoolean
+(fooBString,Expr[Nothing](Test.this.zb),42)
+(fooBInt,Expr[Nothing](Test.this.zb),42)
+fooZBoolean
diff --git a/test/files/run/macro-expand-override.flags b/test/files/run/macro-expand-override.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-override.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-override/Impls_1.scala b/test/files/run/macro-expand-override/Impls_1.scala
new file mode 100644
index 0000000000..0b127f5a59
--- /dev/null
+++ b/test/files/run/macro-expand-override/Impls_1.scala
@@ -0,0 +1,15 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def impl(c: Ctx)(tag: String, x: c.Expr[_]) = {
+ import c.{prefix => prefix}
+ import c.mirror._
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(tag)), Literal(Constant(prefix.toString)), x.tree))
+ Expr[Unit](body)
+ }
+
+ def fooBString(c: Ctx)(x: c.Expr[_]) = impl(c)("fooBString", x)
+ def fooBInt(c: Ctx)(x: c.Expr[_]) = impl(c)("fooBInt", x)
+ def fooDInt(c: Ctx)(x: c.Expr[_]) = impl(c)("fooDInt", x)
+ def fooZString(c: Ctx)(x: c.Expr[_]) = impl(c)("fooZString", x)
+}
diff --git a/test/files/run/macro-expand-override/Macros_Test_2.scala b/test/files/run/macro-expand-override/Macros_Test_2.scala
new file mode 100644
index 0000000000..f162773c95
--- /dev/null
+++ b/test/files/run/macro-expand-override/Macros_Test_2.scala
@@ -0,0 +1,43 @@
+class B {
+ def foo(x: String) = macro Impls.fooBString
+ def foo(x: Int) = macro Impls.fooBInt
+ def foo(x: Boolean) = println("fooBBoolean")
+}
+
+class D extends B {
+ //override def foo(x: String) = println("fooDString") => method cannot override a macro
+ override def foo(x: Int) = macro Impls.fooDInt
+}
+
+class Z extends D {
+ override def foo(x: String) = macro Impls.fooZString
+ override def foo(x: Boolean) = println("fooZBoolean")
+}
+
+object Test extends App {
+
+ val dd: D = new D()
+ dd.foo("42")
+ dd.foo(42)
+ dd.foo(true)
+
+ val db: B = new D()
+ db.foo("42")
+ db.foo(42)
+ db.foo(true)
+
+ val zz: Z = new Z()
+ zz.foo("42")
+ zz.foo(42)
+ zz.foo(true)
+
+ val zd: D = new Z()
+ zd.foo("42")
+ zd.foo(42)
+ zd.foo(true)
+
+ val zb: B = new Z()
+ zb.foo("42")
+ zb.foo(42)
+ zb.foo(true)
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-recursive.check b/test/files/run/macro-expand-recursive.check
new file mode 100644
index 0000000000..1ea14b4e20
--- /dev/null
+++ b/test/files/run/macro-expand-recursive.check
@@ -0,0 +1 @@
+it works
diff --git a/test/files/run/macro-expand-recursive.flags b/test/files/run/macro-expand-recursive.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-recursive.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-recursive/Impls_1.scala b/test/files/run/macro-expand-recursive/Impls_1.scala
new file mode 100644
index 0000000000..6eff805989
--- /dev/null
+++ b/test/files/run/macro-expand-recursive/Impls_1.scala
@@ -0,0 +1,15 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = {
+ import c.mirror._
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))
+ Expr[Unit](body)
+ }
+
+ def fooFoo(c: Ctx) = {
+ import c.mirror._
+ val body = Select(Ident(newTermName("Macros")), newTermName("foo"))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-expand-recursive/Macros_Test_2.scala b/test/files/run/macro-expand-recursive/Macros_Test_2.scala
new file mode 100644
index 0000000000..6ff691bdb1
--- /dev/null
+++ b/test/files/run/macro-expand-recursive/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo = macro Impls.foo
+ def fooFoo = macro Impls.fooFoo
+}
+
+object Test extends App {
+ Macros.fooFoo
+} \ No newline at end of file
diff --git a/test/pending/run/reify_classfileann_b.check b/test/files/run/macro-expand-tparams-bounds-a.check
index e69de29bb2..e69de29bb2 100644
--- a/test/pending/run/reify_classfileann_b.check
+++ b/test/files/run/macro-expand-tparams-bounds-a.check
diff --git a/test/files/run/macro-expand-tparams-bounds-a.flags b/test/files/run/macro-expand-tparams-bounds-a.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-bounds-a.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-bounds-a/Impls_1.scala b/test/files/run/macro-expand-tparams-bounds-a/Impls_1.scala
new file mode 100644
index 0000000000..4cd98c5838
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-bounds-a/Impls_1.scala
@@ -0,0 +1,8 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[U <: String](c: Ctx): c.Expr[Unit] = {
+ import c.mirror._
+ Literal(Constant(()))
+ }
+}
diff --git a/test/files/run/macro-expand-tparams-bounds-a/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-bounds-a/Macros_Test_2.scala
new file mode 100644
index 0000000000..b498e6f65b
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-bounds-a/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo[U <: String] = macro Impls.foo[U]
+}
+
+object Test extends App {
+ import Macros._
+ foo[String]
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-bounds-b.check b/test/files/run/macro-expand-tparams-bounds-b.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-bounds-b.check
diff --git a/test/files/run/macro-expand-tparams-bounds-b.flags b/test/files/run/macro-expand-tparams-bounds-b.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-bounds-b.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-bounds-b/Impls_1.scala b/test/files/run/macro-expand-tparams-bounds-b/Impls_1.scala
new file mode 100644
index 0000000000..9103ddb08a
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-bounds-b/Impls_1.scala
@@ -0,0 +1,10 @@
+import scala.reflect.makro.{Context => Ctx}
+
+class C
+
+object Impls {
+ def foo[U <: C](c: Ctx): c.Expr[Unit] = {
+ import c.mirror._
+ Literal(Constant(()))
+ }
+}
diff --git a/test/files/run/macro-expand-tparams-bounds-b/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-bounds-b/Macros_Test_2.scala
new file mode 100644
index 0000000000..1a261e9f73
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-bounds-b/Macros_Test_2.scala
@@ -0,0 +1,10 @@
+class D extends C
+
+object Macros {
+ def foo[T <: D] = macro Impls.foo[T]
+}
+
+object Test extends App {
+ import Macros._
+ foo[D]
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-explicit.check b/test/files/run/macro-expand-tparams-explicit.check
new file mode 100644
index 0000000000..5670e27c4e
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-explicit.check
@@ -0,0 +1 @@
+ConcreteTypeTag[Int]
diff --git a/test/files/run/macro-expand-tparams-explicit.flags b/test/files/run/macro-expand-tparams-explicit.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-explicit.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-explicit/Impls_1.scala b/test/files/run/macro-expand-tparams-explicit/Impls_1.scala
new file mode 100644
index 0000000000..957d8331fc
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-explicit/Impls_1.scala
@@ -0,0 +1,10 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[U: c.TypeTag](c: Ctx) = {
+ import c.mirror._
+ val U = implicitly[c.TypeTag[U]]
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(U.toString))))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-expand-tparams-explicit/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-explicit/Macros_Test_2.scala
new file mode 100644
index 0000000000..e72c27881a
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-explicit/Macros_Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ def foo[U] = macro Impls.foo[U]
+ foo[Int]
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-implicit.check b/test/files/run/macro-expand-tparams-implicit.check
new file mode 100644
index 0000000000..e57fc1217b
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-implicit.check
@@ -0,0 +1,2 @@
+ConcreteTypeTag[Int]
+ConcreteTypeTag[String]
diff --git a/test/files/run/macro-expand-tparams-implicit.flags b/test/files/run/macro-expand-tparams-implicit.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-implicit.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-implicit/Impls_1.scala b/test/files/run/macro-expand-tparams-implicit/Impls_1.scala
new file mode 100644
index 0000000000..c25d12be60
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-implicit/Impls_1.scala
@@ -0,0 +1,10 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[U: c.TypeTag](c: Ctx)(x: c.Expr[U]) = {
+ import c.mirror._
+ val U = implicitly[c.TypeTag[U]]
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(U.toString))))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-expand-tparams-implicit/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-implicit/Macros_Test_2.scala
new file mode 100644
index 0000000000..f8c573f509
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-implicit/Macros_Test_2.scala
@@ -0,0 +1,5 @@
+object Test extends App {
+ def foo[U](x: U) = macro Impls.foo[U]
+ foo(42)
+ foo("42")
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-only-in-impl.flags b/test/files/run/macro-expand-tparams-only-in-impl.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-only-in-impl.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-only-in-impl/Impls_1.scala b/test/files/run/macro-expand-tparams-only-in-impl/Impls_1.scala
new file mode 100644
index 0000000000..4cd98c5838
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-only-in-impl/Impls_1.scala
@@ -0,0 +1,8 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[U <: String](c: Ctx): c.Expr[Unit] = {
+ import c.mirror._
+ Literal(Constant(()))
+ }
+}
diff --git a/test/files/run/macro-expand-tparams-only-in-impl/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-only-in-impl/Macros_Test_2.scala
new file mode 100644
index 0000000000..218c7aec7f
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-only-in-impl/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo = macro Impls.foo[String]
+}
+
+object Test extends App {
+ import Macros._
+ foo
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-optional.check b/test/files/run/macro-expand-tparams-optional.check
new file mode 100644
index 0000000000..3bacd7a4e0
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-optional.check
@@ -0,0 +1 @@
+don't know U
diff --git a/test/files/run/macro-expand-tparams-optional.flags b/test/files/run/macro-expand-tparams-optional.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-optional.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-optional/Impls_1.scala b/test/files/run/macro-expand-tparams-optional/Impls_1.scala
new file mode 100644
index 0000000000..37efb009c4
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-optional/Impls_1.scala
@@ -0,0 +1,9 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[U](c: Ctx) = {
+ import c.mirror._
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("don't know U"))))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-expand-tparams-optional/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-optional/Macros_Test_2.scala
new file mode 100644
index 0000000000..e72c27881a
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-optional/Macros_Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ def foo[U] = macro Impls.foo[U]
+ foo[Int]
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-prefix-a.check b/test/files/run/macro-expand-tparams-prefix-a.check
new file mode 100644
index 0000000000..922be1a6dd
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-prefix-a.check
@@ -0,0 +1,4 @@
+ConcreteTypeTag[Int]
+ConcreteTypeTag[Int]
+ConcreteTypeTag[String]
+ConcreteTypeTag[Boolean]
diff --git a/test/files/run/macro-expand-tparams-prefix-a.flags b/test/files/run/macro-expand-tparams-prefix-a.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-prefix-a.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-prefix-a/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix-a/Impls_1.scala
new file mode 100644
index 0000000000..c25d12be60
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-prefix-a/Impls_1.scala
@@ -0,0 +1,10 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[U: c.TypeTag](c: Ctx)(x: c.Expr[U]) = {
+ import c.mirror._
+ val U = implicitly[c.TypeTag[U]]
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(U.toString))))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-expand-tparams-prefix-a/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-prefix-a/Macros_Test_2.scala
new file mode 100644
index 0000000000..81ccb7ff42
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-prefix-a/Macros_Test_2.scala
@@ -0,0 +1,10 @@
+object Test extends App {
+ class C[T] {
+ def foo[U](x: U) = macro Impls.foo[U]
+ }
+
+ new C[Int]().foo(42)
+ new C[Boolean]().foo(42)
+ new C[Int]().foo("42")
+ new C[String]().foo(true)
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-prefix-b.check b/test/files/run/macro-expand-tparams-prefix-b.check
new file mode 100644
index 0000000000..a336bb51ec
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-prefix-b.check
@@ -0,0 +1,2 @@
+ConcreteTypeTag[Boolean] ConcreteTypeTag[Int]
+ConcreteTypeTag[Boolean] ConcreteTypeTag[String]
diff --git a/test/files/run/macro-expand-tparams-prefix-b.flags b/test/files/run/macro-expand-tparams-prefix-b.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-prefix-b.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-prefix-b/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix-b/Impls_1.scala
new file mode 100644
index 0000000000..8af3ecc9ae
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-prefix-b/Impls_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[T: c.TypeTag, U: c.TypeTag](c: Ctx)(x: c.Expr[U]) = {
+ import c.mirror._
+ val T = implicitly[c.TypeTag[T]]
+ val U = implicitly[c.TypeTag[U]]
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString + " " + U.toString))))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-expand-tparams-prefix-b/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-prefix-b/Macros_Test_2.scala
new file mode 100644
index 0000000000..a4a0acfe8b
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-prefix-b/Macros_Test_2.scala
@@ -0,0 +1,10 @@
+object Test extends App {
+ class C[T] {
+ def foo[U](x: U) = macro Impls.foo[T, U]
+ }
+
+ object D extends C[Boolean]
+
+ D.foo(42)
+ D.foo("42")
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-prefix-c1.check b/test/files/run/macro-expand-tparams-prefix-c1.check
new file mode 100644
index 0000000000..87f295aa49
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-prefix-c1.check
@@ -0,0 +1,3 @@
+ConcreteTypeTag[Int]
+ConcreteTypeTag[String]
+ConcreteTypeTag[Boolean]
diff --git a/test/files/run/macro-expand-tparams-prefix-c1.flags b/test/files/run/macro-expand-tparams-prefix-c1.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-prefix-c1.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-prefix-c1/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix-c1/Impls_1.scala
new file mode 100644
index 0000000000..bc880fdf77
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-prefix-c1/Impls_1.scala
@@ -0,0 +1,12 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[T, U: c.TypeTag, V](c: Ctx)(implicit T: c.TypeTag[T], V: c.TypeTag[V]): c.Expr[Unit] = {
+ import c.mirror._
+ Block(List(
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))),
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.TypeTag[U]].toString)))),
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))),
+ Literal(Constant(())))
+ }
+}
diff --git a/test/files/run/macro-expand-tparams-prefix-c1/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-prefix-c1/Macros_Test_2.scala
new file mode 100644
index 0000000000..4fa0c8cb33
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-prefix-c1/Macros_Test_2.scala
@@ -0,0 +1,11 @@
+class D[T] {
+ class C[U] {
+ def foo[V] = macro Impls.foo[T, U, V]
+ }
+}
+
+object Test extends App {
+ val outer1 = new D[Int]
+ val outer2 = new outer1.C[String]
+ outer2.foo[Boolean]
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-prefix-c2.check b/test/files/run/macro-expand-tparams-prefix-c2.check
new file mode 100644
index 0000000000..87f295aa49
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-prefix-c2.check
@@ -0,0 +1,3 @@
+ConcreteTypeTag[Int]
+ConcreteTypeTag[String]
+ConcreteTypeTag[Boolean]
diff --git a/test/files/run/macro-expand-tparams-prefix-c2.flags b/test/files/run/macro-expand-tparams-prefix-c2.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-prefix-c2.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala b/test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala
new file mode 100644
index 0000000000..c83e401afb
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala
@@ -0,0 +1,18 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[T, U: c.TypeTag, V](c: Ctx)(implicit T: c.TypeTag[T], V: c.TypeTag[V]): c.Expr[Unit] = {
+ import c.mirror._
+ Block(List(
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))),
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.TypeTag[U]].toString)))),
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))),
+ Literal(Constant(())))
+ }
+}
+
+class D[T] {
+ class C[U] {
+ def foo[V] = macro Impls.foo[T, U, V]
+ }
+}
diff --git a/test/files/run/macro-expand-tparams-prefix-c2/Test_2.scala b/test/files/run/macro-expand-tparams-prefix-c2/Test_2.scala
new file mode 100644
index 0000000000..e729d4a536
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-prefix-c2/Test_2.scala
@@ -0,0 +1,5 @@
+object Test extends App {
+ val outer1 = new D[Int]
+ val outer2 = new outer1.C[String]
+ outer2.foo[Boolean]
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-prefix-d1.check b/test/files/run/macro-expand-tparams-prefix-d1.check
new file mode 100644
index 0000000000..ca7a220475
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-prefix-d1.check
@@ -0,0 +1,3 @@
+TypeTag[T]
+TypeTag[U]
+ConcreteTypeTag[Boolean]
diff --git a/test/files/run/macro-expand-tparams-prefix-d1.flags b/test/files/run/macro-expand-tparams-prefix-d1.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-prefix-d1.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-prefix-d1/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix-d1/Impls_1.scala
new file mode 100644
index 0000000000..bc880fdf77
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-prefix-d1/Impls_1.scala
@@ -0,0 +1,12 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[T, U: c.TypeTag, V](c: Ctx)(implicit T: c.TypeTag[T], V: c.TypeTag[V]): c.Expr[Unit] = {
+ import c.mirror._
+ Block(List(
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))),
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.TypeTag[U]].toString)))),
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))),
+ Literal(Constant(())))
+ }
+}
diff --git a/test/files/run/macro-expand-tparams-prefix-d1/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-prefix-d1/Macros_Test_2.scala
new file mode 100644
index 0000000000..8222a6d1e8
--- /dev/null
+++ b/test/files/run/macro-expand-tparams-prefix-d1/Macros_Test_2.scala
@@ -0,0 +1,11 @@
+object Test extends App {
+ class D[T] {
+ class C[U] {
+ def foo[V] = macro Impls.foo[T, U, V]
+ foo[Boolean]
+ }
+ }
+
+ val outer1 = new D[Int]
+ new outer1.C[String]
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad.check b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad.check
new file mode 100644
index 0000000000..fd1d654cf8
--- /dev/null
+++ b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad.check
@@ -0,0 +1,4 @@
+reflective compilation has failed:
+
+no `: _*' annotation allowed here
+(such annotations are only allowed in arguments to *-parameters)
diff --git a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad.flags b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala
new file mode 100644
index 0000000000..d97f0af786
--- /dev/null
+++ b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala
@@ -0,0 +1,9 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(xs: c.Expr[Int]*) = {
+ import c.mirror._
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), xs.map(_.tree).toList)
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala
new file mode 100644
index 0000000000..523c6b0645
--- /dev/null
+++ b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala
@@ -0,0 +1,10 @@
+object Macros {
+ def foo(xs: Int*) = macro Impls.foo
+}
+
+object Test extends App {
+ import scala.reflect.mirror._
+ val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Typed(Apply(Ident(definitions.ListModule), List(Literal(Constant(1)), Literal(Constant(2)))), Ident(tpnme.WILDCARD_STAR))))
+ try tree.eval
+ catch { case ex: Throwable => println(ex.getMessage) }
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good.check b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good.check
new file mode 100644
index 0000000000..835137b4a2
--- /dev/null
+++ b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good.check
@@ -0,0 +1 @@
+List(1, 2, 3, 4, 5)
diff --git a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good.flags b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala
new file mode 100644
index 0000000000..f9667d78b8
--- /dev/null
+++ b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala
@@ -0,0 +1,13 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(xs: c.Expr[Int]*) = {
+ import c.mirror._
+ val stripped_xs = xs map (_.tree) toList match {
+ case List(Typed(stripped, Ident(wildstar))) if wildstar == tpnme.WILDCARD_STAR => List(stripped)
+ case _ => ???
+ }
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), stripped_xs)
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Macros_Test_2.scala b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Macros_Test_2.scala
new file mode 100644
index 0000000000..f127ebcde7
--- /dev/null
+++ b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo(xs: Int*) = macro Impls.foo
+}
+
+object Test extends App {
+ val numbers = List(1, 2, 3, 4, 5)
+ Macros.foo(numbers: _*)
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-varargs-explicit-over-varargs.check b/test/files/run/macro-expand-varargs-explicit-over-varargs.check
new file mode 100644
index 0000000000..835137b4a2
--- /dev/null
+++ b/test/files/run/macro-expand-varargs-explicit-over-varargs.check
@@ -0,0 +1 @@
+List(1, 2, 3, 4, 5)
diff --git a/test/files/run/macro-expand-varargs-explicit-over-varargs.flags b/test/files/run/macro-expand-varargs-explicit-over-varargs.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-varargs-explicit-over-varargs.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala b/test/files/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala
new file mode 100644
index 0000000000..8c609daa0e
--- /dev/null
+++ b/test/files/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala
@@ -0,0 +1,13 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def myprintln(xs: Int*) = {
+ println(xs)
+ }
+
+ def foo(c: Ctx)(xs: c.Expr[Int]*) = {
+ import c.mirror._
+ val body = Apply(Select(Ident(newTermName("Impls")), newTermName("myprintln")), xs.map(_.tree).toList)
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-expand-varargs-explicit-over-varargs/Macros_Test_2.scala b/test/files/run/macro-expand-varargs-explicit-over-varargs/Macros_Test_2.scala
new file mode 100644
index 0000000000..f127ebcde7
--- /dev/null
+++ b/test/files/run/macro-expand-varargs-explicit-over-varargs/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo(xs: Int*) = macro Impls.foo
+}
+
+object Test extends App {
+ val numbers = List(1, 2, 3, 4, 5)
+ Macros.foo(numbers: _*)
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-varargs-implicit-over-nonvarargs.check b/test/files/run/macro-expand-varargs-implicit-over-nonvarargs.check
new file mode 100644
index 0000000000..0a6596858c
--- /dev/null
+++ b/test/files/run/macro-expand-varargs-implicit-over-nonvarargs.check
@@ -0,0 +1 @@
+(1,2,3,4,5)
diff --git a/test/files/run/macro-expand-varargs-implicit-over-nonvarargs.flags b/test/files/run/macro-expand-varargs-implicit-over-nonvarargs.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-varargs-implicit-over-nonvarargs.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala b/test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala
new file mode 100644
index 0000000000..d97f0af786
--- /dev/null
+++ b/test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala
@@ -0,0 +1,9 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(xs: c.Expr[Int]*) = {
+ import c.mirror._
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), xs.map(_.tree).toList)
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Macros_Test_2.scala b/test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Macros_Test_2.scala
new file mode 100644
index 0000000000..2311ca0b95
--- /dev/null
+++ b/test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Macros_Test_2.scala
@@ -0,0 +1,7 @@
+object Macros {
+ def foo(xs: Int*) = macro Impls.foo
+}
+
+object Test extends App {
+ Macros.foo(1, 2, 3, 4, 5)
+} \ No newline at end of file
diff --git a/test/files/run/macro-expand-varargs-implicit-over-varargs.check b/test/files/run/macro-expand-varargs-implicit-over-varargs.check
new file mode 100644
index 0000000000..f25fa141d3
--- /dev/null
+++ b/test/files/run/macro-expand-varargs-implicit-over-varargs.check
@@ -0,0 +1 @@
+WrappedArray(1, 2, 3, 4, 5)
diff --git a/test/files/run/macro-expand-varargs-implicit-over-varargs.flags b/test/files/run/macro-expand-varargs-implicit-over-varargs.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-expand-varargs-implicit-over-varargs.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala b/test/files/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala
new file mode 100644
index 0000000000..8c609daa0e
--- /dev/null
+++ b/test/files/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala
@@ -0,0 +1,13 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def myprintln(xs: Int*) = {
+ println(xs)
+ }
+
+ def foo(c: Ctx)(xs: c.Expr[Int]*) = {
+ import c.mirror._
+ val body = Apply(Select(Ident(newTermName("Impls")), newTermName("myprintln")), xs.map(_.tree).toList)
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-expand-varargs-implicit-over-varargs/Macros_Test_2.scala b/test/files/run/macro-expand-varargs-implicit-over-varargs/Macros_Test_2.scala
new file mode 100644
index 0000000000..2311ca0b95
--- /dev/null
+++ b/test/files/run/macro-expand-varargs-implicit-over-varargs/Macros_Test_2.scala
@@ -0,0 +1,7 @@
+object Macros {
+ def foo(xs: Int*) = macro Impls.foo
+}
+
+object Test extends App {
+ Macros.foo(1, 2, 3, 4, 5)
+} \ No newline at end of file
diff --git a/test/files/run/macro-impl-default-params.check b/test/files/run/macro-impl-default-params.check
new file mode 100644
index 0000000000..eaf94458e6
--- /dev/null
+++ b/test/files/run/macro-impl-default-params.check
@@ -0,0 +1,5 @@
+foo_targs:
+invoking foo_targs...
+type of prefix is: Nothing
+type of prefix tree is: Macros[Int]
+U is: String
diff --git a/test/files/run/macro-impl-default-params.flags b/test/files/run/macro-impl-default-params.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-impl-default-params.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-impl-default-params/Impls_Macros_1.scala b/test/files/run/macro-impl-default-params/Impls_Macros_1.scala
new file mode 100644
index 0000000000..cece1c09e4
--- /dev/null
+++ b/test/files/run/macro-impl-default-params/Impls_Macros_1.scala
@@ -0,0 +1,20 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo_targs[T, U: c.TypeTag](c: Ctx = null)(x: c.Expr[Int] = null) = {
+ import c.{prefix => prefix}
+ import c.mirror._
+ val U = implicitly[c.TypeTag[U]]
+ val body = Block(
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("invoking foo_targs...")))),
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("type of prefix is: " + prefix.tpe)))),
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("type of prefix tree is: " + prefix.tree.tpe)))),
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("U is: " + U.tpe)))),
+ Literal(Constant(())))
+ Expr[Unit](body)
+ }
+}
+
+class Macros[T] {
+ def foo_targs[U](x: Int) = macro Impls.foo_targs[T, U]
+}
diff --git a/test/files/run/macro-impl-default-params/Test_2.scala b/test/files/run/macro-impl-default-params/Test_2.scala
new file mode 100644
index 0000000000..90e850df21
--- /dev/null
+++ b/test/files/run/macro-impl-default-params/Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ println("foo_targs:")
+ new Macros[Int]().foo_targs[String](42)
+} \ No newline at end of file
diff --git a/test/files/run/macro-impl-rename-context.check b/test/files/run/macro-impl-rename-context.check
new file mode 100644
index 0000000000..753edcd970
--- /dev/null
+++ b/test/files/run/macro-impl-rename-context.check
@@ -0,0 +1,2 @@
+foo
+invoking foo...
diff --git a/test/files/run/macro-impl-rename-context.flags b/test/files/run/macro-impl-rename-context.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-impl-rename-context.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-impl-rename-context/Impls_Macros_1.scala b/test/files/run/macro-impl-rename-context/Impls_Macros_1.scala
new file mode 100644
index 0000000000..000e351f4d
--- /dev/null
+++ b/test/files/run/macro-impl-rename-context/Impls_Macros_1.scala
@@ -0,0 +1,15 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(unconventionalName: Ctx)(x: unconventionalName.Expr[Int]) = {
+ import unconventionalName.mirror._
+ val body = Block(
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("invoking foo...")))),
+ Literal(Constant(())))
+ Expr[Unit](body)
+ }
+}
+
+object Macros {
+ def foo(x: Int) = macro Impls.foo
+}
diff --git a/test/files/run/macro-impl-rename-context/Test_2.scala b/test/files/run/macro-impl-rename-context/Test_2.scala
new file mode 100644
index 0000000000..bd9c493544
--- /dev/null
+++ b/test/files/run/macro-impl-rename-context/Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ println("foo")
+ Macros.foo(42)
+} \ No newline at end of file
diff --git a/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype.check b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype.check
new file mode 100644
index 0000000000..e21e05157a
--- /dev/null
+++ b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype.check
@@ -0,0 +1,5 @@
+reflective compilation has failed:
+
+type mismatch;
+ found : String("42")
+ required: Int
diff --git a/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype.flags b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala
new file mode 100644
index 0000000000..882867fcab
--- /dev/null
+++ b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala
@@ -0,0 +1,12 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx): c.Expr[Int] = {
+ import c.mirror._
+ Literal(Constant("42"))
+ }
+}
+
+object Macros {
+ def foo: Int = macro Impls.foo
+} \ No newline at end of file
diff --git a/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala
new file mode 100644
index 0000000000..f389231ca6
--- /dev/null
+++ b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala
@@ -0,0 +1,6 @@
+object Test extends App {
+ import scala.reflect.mirror._
+ val tree = Select(Ident("Macros"), newTermName("foo"))
+ try tree.eval
+ catch { case ex: Throwable => println(ex.getMessage) }
+} \ No newline at end of file
diff --git a/test/files/run/macro-invalidret-doesnt-conform-to-impl-rettype.check b/test/files/run/macro-invalidret-doesnt-conform-to-impl-rettype.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/files/run/macro-invalidret-doesnt-conform-to-impl-rettype.check
diff --git a/test/files/run/macro-invalidret-doesnt-conform-to-impl-rettype.flags b/test/files/run/macro-invalidret-doesnt-conform-to-impl-rettype.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-invalidret-doesnt-conform-to-impl-rettype.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-invalidret-nontypeable.check b/test/files/run/macro-invalidret-nontypeable.check
new file mode 100644
index 0000000000..eee08528e2
--- /dev/null
+++ b/test/files/run/macro-invalidret-nontypeable.check
@@ -0,0 +1,3 @@
+reflective compilation has failed:
+
+not found: value IDoNotExist
diff --git a/test/files/run/macro-invalidret-nontypeable.flags b/test/files/run/macro-invalidret-nontypeable.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-invalidret-nontypeable.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-invalidret-nontypeable/Impls_Macros_1.scala b/test/files/run/macro-invalidret-nontypeable/Impls_Macros_1.scala
new file mode 100644
index 0000000000..f3a0476a35
--- /dev/null
+++ b/test/files/run/macro-invalidret-nontypeable/Impls_Macros_1.scala
@@ -0,0 +1,13 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = {
+ import c.mirror._
+ val body = Ident("IDoNotExist")
+ Expr[Int](body)
+ }
+}
+
+object Macros {
+ def foo = macro Impls.foo
+}
diff --git a/test/files/run/macro-invalidret-nontypeable/Test_2.scala b/test/files/run/macro-invalidret-nontypeable/Test_2.scala
new file mode 100644
index 0000000000..f389231ca6
--- /dev/null
+++ b/test/files/run/macro-invalidret-nontypeable/Test_2.scala
@@ -0,0 +1,6 @@
+object Test extends App {
+ import scala.reflect.mirror._
+ val tree = Select(Ident("Macros"), newTermName("foo"))
+ try tree.eval
+ catch { case ex: Throwable => println(ex.getMessage) }
+} \ No newline at end of file
diff --git a/test/files/run/macro-invalidusage-badret.check b/test/files/run/macro-invalidusage-badret.check
new file mode 100644
index 0000000000..5bdc484644
--- /dev/null
+++ b/test/files/run/macro-invalidusage-badret.check
@@ -0,0 +1,5 @@
+reflective compilation has failed:
+
+type mismatch;
+ found : Int(42)
+ required: String
diff --git a/test/files/run/macro-invalidusage-badret.flags b/test/files/run/macro-invalidusage-badret.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-invalidusage-badret.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-invalidusage-badret/Impls_Macros_1.scala b/test/files/run/macro-invalidusage-badret/Impls_Macros_1.scala
new file mode 100644
index 0000000000..c63ad01677
--- /dev/null
+++ b/test/files/run/macro-invalidusage-badret/Impls_Macros_1.scala
@@ -0,0 +1,9 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int]) = x
+}
+
+object Macros {
+ def foo(x: Int) = macro Impls.foo
+}
diff --git a/test/files/run/macro-invalidusage-badret/Test_2.scala b/test/files/run/macro-invalidusage-badret/Test_2.scala
new file mode 100644
index 0000000000..e171c9d05a
--- /dev/null
+++ b/test/files/run/macro-invalidusage-badret/Test_2.scala
@@ -0,0 +1,6 @@
+object Test extends App {
+ import scala.reflect.mirror._
+ val tree = Typed(Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42)))), Ident(newTypeName("String")))
+ try tree.eval
+ catch { case ex: Throwable => println(ex.getMessage) }
+} \ No newline at end of file
diff --git a/test/files/run/macro-invalidusage-partialapplication.check b/test/files/run/macro-invalidusage-partialapplication.check
new file mode 100644
index 0000000000..73f57b0b81
--- /dev/null
+++ b/test/files/run/macro-invalidusage-partialapplication.check
@@ -0,0 +1,3 @@
+reflective compilation has failed:
+
+macros cannot be partially applied
diff --git a/test/files/run/macro-invalidusage-partialapplication.flags b/test/files/run/macro-invalidusage-partialapplication.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-invalidusage-partialapplication.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala b/test/files/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala
new file mode 100644
index 0000000000..449b91d074
--- /dev/null
+++ b/test/files/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala
@@ -0,0 +1,14 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int])(y: c.Expr[Int]) = {
+ import c.mirror._
+ val sum = Apply(Select(x.tree, newTermName("$plus")), List(y.tree))
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(sum))
+ Expr[Unit](body)
+ }
+}
+
+object Macros {
+ def foo(x: Int)(y: Int) = macro Impls.foo
+} \ No newline at end of file
diff --git a/test/files/run/macro-invalidusage-partialapplication/Test_2.scala b/test/files/run/macro-invalidusage-partialapplication/Test_2.scala
new file mode 100644
index 0000000000..63371a4a82
--- /dev/null
+++ b/test/files/run/macro-invalidusage-partialapplication/Test_2.scala
@@ -0,0 +1,6 @@
+object Test extends App {
+ import scala.reflect.mirror._
+ val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(40))))
+ try tree.eval
+ catch { case ex: Throwable => println(ex.getMessage) }
+}
diff --git a/test/files/run/macro-openmacros.check b/test/files/run/macro-openmacros.check
new file mode 100644
index 0000000000..a4b06a1e1a
--- /dev/null
+++ b/test/files/run/macro-openmacros.check
@@ -0,0 +1,3 @@
+List(MacroContext(foo@source-Test_2.scala,line-2,offset=35 +0))
+List(MacroContext(foo@source-Test_2.scala,line-2,offset=35 +1), MacroContext(foo@source-Test_2.scala,line-2,offset=35 +0))
+List(MacroContext(foo@source-Test_2.scala,line-2,offset=35 +2), MacroContext(foo@source-Test_2.scala,line-2,offset=35 +1), MacroContext(foo@source-Test_2.scala,line-2,offset=35 +0))
diff --git a/test/files/run/macro-openmacros.flags b/test/files/run/macro-openmacros.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-openmacros.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-openmacros/Impls_Macros_1.scala b/test/files/run/macro-openmacros/Impls_Macros_1.scala
new file mode 100644
index 0000000000..9fd658656e
--- /dev/null
+++ b/test/files/run/macro-openmacros/Impls_Macros_1.scala
@@ -0,0 +1,26 @@
+import scala.reflect.makro.Context
+
+object Macros {
+ def impl(c: Context): c.Expr[Unit] = {
+ // we're macros, so we can reflect against our source path
+ // so we don't need any partests to clean up after us!
+ val c.CompilationUnit(file, _, _) = c.enclosingUnit
+ val dir = file.getParentFile
+ def normalizePaths(s: String) = {
+ val base = (dir.getCanonicalPath + java.io.File.separator).replace('\\', '/')
+ var regex = """\Q%s\E""" format base
+ val isWin = System.getProperty("os.name", "") startsWith "Windows"
+ if (isWin) regex = "(?i)" + regex
+ s.replace('\\', '/').replaceAll(regex, "")
+ }
+
+ import c.mirror._
+ val next = if (c.enclosingMacros.length < 3) Expr[Unit](Select(Ident(staticModule("Macros")), newTermName("foo"))) else c.literalUnit
+ c.reify {
+ println(c.literal(normalizePaths(c.enclosingMacros.toString)).eval)
+ next.eval
+ }
+ }
+
+ def foo = macro impl
+} \ No newline at end of file
diff --git a/test/files/run/macro-openmacros/Test_2.scala b/test/files/run/macro-openmacros/Test_2.scala
new file mode 100644
index 0000000000..5d19639cdd
--- /dev/null
+++ b/test/files/run/macro-openmacros/Test_2.scala
@@ -0,0 +1,3 @@
+object Test extends App {
+ Macros.foo
+}
diff --git a/test/files/run/macro-quasiinvalidbody-c.check b/test/files/run/macro-quasiinvalidbody-c.check
new file mode 100644
index 0000000000..f70d7bba4a
--- /dev/null
+++ b/test/files/run/macro-quasiinvalidbody-c.check
@@ -0,0 +1 @@
+42 \ No newline at end of file
diff --git a/test/files/run/macro-quasiinvalidbody-c.flags b/test/files/run/macro-quasiinvalidbody-c.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-quasiinvalidbody-c.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala b/test/files/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala
new file mode 100644
index 0000000000..7cb810c86b
--- /dev/null
+++ b/test/files/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala
@@ -0,0 +1,9 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Macros {
+ object Impls {
+ def foo(c: Ctx)(x: c.Expr[Any]) = x
+ }
+
+ def foo(x: Any) = macro Impls.foo
+} \ No newline at end of file
diff --git a/test/files/run/macro-quasiinvalidbody-c/Test_2.scala b/test/files/run/macro-quasiinvalidbody-c/Test_2.scala
new file mode 100644
index 0000000000..dec29aa857
--- /dev/null
+++ b/test/files/run/macro-quasiinvalidbody-c/Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ import Macros._
+ println(foo(42))
+} \ No newline at end of file
diff --git a/test/files/run/macro-range.flags b/test/files/run/macro-range.flags
index 06a7b31f11..5e5dd6ce79 100644
--- a/test/files/run/macro-range.flags
+++ b/test/files/run/macro-range.flags
@@ -1 +1 @@
--Xmacros
+-language:experimental.macros
diff --git a/test/files/run/macro-range/Common_1.scala b/test/files/run/macro-range/Common_1.scala
new file mode 100644
index 0000000000..bd46e1f529
--- /dev/null
+++ b/test/files/run/macro-range/Common_1.scala
@@ -0,0 +1,48 @@
+import reflect.api.Modifier
+import reflect.makro.Context
+
+abstract class RangeDefault {
+ val from, to: Int
+ def foreach(f: Int => Unit) = {
+ var i = from
+ while (i < to) { f(i); i += 1 }
+ }
+}
+
+/** This class should go into reflect.macro once it is a bit more stable. */
+abstract class Utils {
+ val context: Context
+ import context.mirror._
+
+ class TreeSubstituter(from: List[Symbol], to: List[Tree]) extends Transformer {
+ override def transform(tree: Tree): Tree = tree match {
+ case Ident(_) =>
+ def subst(from: List[Symbol], to: List[Tree]): Tree =
+ if (from.isEmpty) tree
+ else if (tree.symbol == from.head) to.head.duplicate // TODO: does it ever make sense *not* to perform a shallowDuplicate on `to.head`?
+ else subst(from.tail, to.tail);
+ subst(from, to)
+ case _ =>
+ val tree1 = super.transform(tree)
+ if (tree1 ne tree) tree1.tpe = null
+ tree1
+ }
+ }
+ def makeApply(fn: Tree, args: List[Tree]): Tree = fn match {
+ case Function(vparams, body) =>
+ new TreeSubstituter(vparams map (_.symbol), args) transform body
+ case Block(stats, expr) =>
+ Block(stats, makeApply(expr, args))
+ case _ =>
+ // todo. read the compiler config and print if -Ydebug is set
+ //println("no beta on "+fn+" "+fn.getClass)
+ Apply(fn, args)
+ }
+ def makeWhile(lname: TermName, cond: Tree, body: Tree): Tree = {
+ val continu = Apply(Ident(lname), Nil)
+ val rhs = If(cond, Block(List(body), continu), Literal(Constant()))
+ LabelDef(lname, Nil, rhs)
+ }
+ def makeBinop(left: Tree, op: String, right: Tree): Tree =
+ Apply(Select(left, newTermName(op)), List(right))
+}
diff --git a/test/files/run/macro-range/Expansion_Impossible_2.scala b/test/files/run/macro-range/Expansion_Impossible_2.scala
new file mode 100644
index 0000000000..7a093b74ee
--- /dev/null
+++ b/test/files/run/macro-range/Expansion_Impossible_2.scala
@@ -0,0 +1,53 @@
+import reflect.api.Modifier
+import reflect.makro.Context
+
+object Impls {
+ def foreach(c: Context)(f: c.Expr[Int => Unit]): c.Expr[Unit] = {
+ // todo. read the compiler config and print if -Ydebug is set
+ //println("macro-expand, _this = "+ _this)
+ object utils extends Utils { val context: c.type = c }
+ import utils._
+ import c.mirror._
+
+ val initName = newTermName("<init>")
+ // Either:
+ // scala"{ var i = $low; val h = $hi; while (i < h) { $f(i); i = i + 1 } }
+ // or:
+ // scala"($_this: RangeDefault).foreach($f)"
+ c.prefix.tree match {
+ case Apply(Select(New(tpt), initName), List(lo, hi)) if tpt.symbol.fullName == "Range" =>
+ val iname = newTermName("$i")
+ val hname = newTermName("$h")
+ def iref = Ident(iname)
+ def href = Ident(hname)
+ val labelname = newTermName("$while")
+ val cond = makeBinop(iref, "$less", href)
+ val body = Block(
+ List(makeApply(f, List(iref))),
+ Assign(iref, makeBinop(iref, "$plus", Literal(Constant(1)))))
+ val generated =
+ Block(
+ List(
+ ValDef(Modifiers(Set(Modifier.mutable)), iname, TypeTree(), lo),
+ ValDef(Modifiers(), hname, TypeTree(), hi)),
+ makeWhile(labelname, cond, body))
+ // todo. read the compiler config and print if -Ydebug is set
+ //tools.nsc.util.trace("generated: ")(generated)
+ generated
+ case _ =>
+ Apply(
+ Select(
+ Typed(c.prefix, Ident(newTypeName("RangeDefault"))),
+ newTermName("foreach")),
+ List(f))
+ }
+ }
+}
+
+class Range(val from: Int, val to: Int) extends RangeDefault {
+ override def foreach(f: Int => Unit): Unit = macro Impls.foreach
+}
+
+object Test extends App {
+ new Range(1, 10) foreach println
+} \ No newline at end of file
diff --git a/test/files/run/macro-range/Expansion_Possible_3.scala b/test/files/run/macro-range/Expansion_Possible_3.scala
new file mode 100644
index 0000000000..e7ecbcc362
--- /dev/null
+++ b/test/files/run/macro-range/Expansion_Possible_3.scala
@@ -0,0 +1,7 @@
+class Range(val from: Int, val to: Int) extends RangeDefault {
+ override def foreach(f: Int => Unit): Unit = macro Impls.foreach
+}
+
+object Test extends App {
+ new Range(1, 10) foreach println
+} \ No newline at end of file
diff --git a/test/files/run/macro-range/macro_range_1.scala b/test/files/run/macro-range/macro_range_1.scala
deleted file mode 100644
index fdfe7169ad..0000000000
--- a/test/files/run/macro-range/macro_range_1.scala
+++ /dev/null
@@ -1,99 +0,0 @@
-import reflect.api.Modifier
-import reflect.macro.Context
-
-abstract class RangeDefault {
- val from, to: Int
- def foreach(f: Int => Unit) = {
- var i = from
- while (i < to) { f(i); i += 1 }
- }
-}
-
-/** This class should go into reflect.macro once it is a bit more stable. */
-abstract class Utils {
- val context: Context
- import context._
-
- class TreeSubstituter(from: List[Symbol], to: List[Tree]) extends Transformer {
- override def transform(tree: Tree): Tree = tree match {
- case Ident(_) =>
- def subst(from: List[Symbol], to: List[Tree]): Tree =
- if (from.isEmpty) tree
- else if (tree.symbol == from.head) to.head.duplicate // TODO: does it ever make sense *not* to perform a shallowDuplicate on `to.head`?
- else subst(from.tail, to.tail);
- subst(from, to)
- case _ =>
- val tree1 = super.transform(tree)
- if (tree1 ne tree) tree1.tpe = null
- tree1
- }
- }
- def makeApply(fn: Tree, args: List[Tree]): Tree = fn match {
- case Function(vparams, body) =>
- new TreeSubstituter(vparams map (_.symbol), args) transform body
- case Block(stats, expr) =>
- Block(stats, makeApply(expr, args))
- case _ =>
- // todo. read the compiler config and print if -Ydebug is set
- //println("no beta on "+fn+" "+fn.getClass)
- Apply(fn, args)
- }
- def makeWhile(lname: TermName, cond: Tree, body: Tree): Tree = {
- val continu = Apply(Ident(lname), Nil)
- val rhs = If(cond, Block(List(body), continu), Literal(Constant()))
- LabelDef(lname, Nil, rhs)
- }
- def makeBinop(left: Tree, op: String, right: Tree): Tree =
- Apply(Select(left, newTermName(op)), List(right))
-}
-
-class Range(val from: Int, val to: Int) extends RangeDefault {
- override def macro foreach(f: Int => Unit): Unit = {
- // todo. read the compiler config and print if -Ydebug is set
- //println("macro-expand, _this = "+ _this)
- import _context._
- object utils extends Utils {
- val context: _context.type = _context
- }
- import utils._
-
- val initName = newTermName("<init>")
- // Either:
- // scala"{ var i = $low; val h = $hi; while (i < h) { $f(i); i = i + 1 } }
- // or:
- // scala"($_this: RangeDefault).foreach($f)"
- _this match {
- case Apply(Select(New(tpt), initName), List(lo, hi)) if tpt.symbol.fullName == "Range" =>
- val iname = newTermName("$i")
- val hname = newTermName("$h")
- def iref = Ident(iname)
- def href = Ident(hname)
- val labelname = newTermName("$while")
- val cond = makeBinop(iref, "$less", href)
- val body = Block(
- List(makeApply(f, List(iref))),
- Assign(iref, makeBinop(iref, "$plus", Literal(Constant(1)))))
- val generated =
- Block(
- List(
- ValDef(Modifiers(Set(Modifier.mutable)), iname, TypeTree(), lo),
- ValDef(Modifiers(), hname, TypeTree(), hi)),
- makeWhile(labelname, cond, body))
- // todo. read the compiler config and print if -Ydebug is set
- //tools.nsc.util.trace("generated: ")(generated)
- generated
- case _ =>
- Apply(
- Select(
- Typed(_this, Ident(newTypeName("RangeDefault"))),
- newTermName("foreach")),
- List(f))
- }
- }
-}
-
-object Test extends App {
-
- new Range(1, 10) foreach println
-
-}
diff --git a/test/files/run/macro-range/macro_range_2.scala b/test/files/run/macro-range/macro_range_2.scala
deleted file mode 100644
index fdfe7169ad..0000000000
--- a/test/files/run/macro-range/macro_range_2.scala
+++ /dev/null
@@ -1,99 +0,0 @@
-import reflect.api.Modifier
-import reflect.macro.Context
-
-abstract class RangeDefault {
- val from, to: Int
- def foreach(f: Int => Unit) = {
- var i = from
- while (i < to) { f(i); i += 1 }
- }
-}
-
-/** This class should go into reflect.macro once it is a bit more stable. */
-abstract class Utils {
- val context: Context
- import context._
-
- class TreeSubstituter(from: List[Symbol], to: List[Tree]) extends Transformer {
- override def transform(tree: Tree): Tree = tree match {
- case Ident(_) =>
- def subst(from: List[Symbol], to: List[Tree]): Tree =
- if (from.isEmpty) tree
- else if (tree.symbol == from.head) to.head.duplicate // TODO: does it ever make sense *not* to perform a shallowDuplicate on `to.head`?
- else subst(from.tail, to.tail);
- subst(from, to)
- case _ =>
- val tree1 = super.transform(tree)
- if (tree1 ne tree) tree1.tpe = null
- tree1
- }
- }
- def makeApply(fn: Tree, args: List[Tree]): Tree = fn match {
- case Function(vparams, body) =>
- new TreeSubstituter(vparams map (_.symbol), args) transform body
- case Block(stats, expr) =>
- Block(stats, makeApply(expr, args))
- case _ =>
- // todo. read the compiler config and print if -Ydebug is set
- //println("no beta on "+fn+" "+fn.getClass)
- Apply(fn, args)
- }
- def makeWhile(lname: TermName, cond: Tree, body: Tree): Tree = {
- val continu = Apply(Ident(lname), Nil)
- val rhs = If(cond, Block(List(body), continu), Literal(Constant()))
- LabelDef(lname, Nil, rhs)
- }
- def makeBinop(left: Tree, op: String, right: Tree): Tree =
- Apply(Select(left, newTermName(op)), List(right))
-}
-
-class Range(val from: Int, val to: Int) extends RangeDefault {
- override def macro foreach(f: Int => Unit): Unit = {
- // todo. read the compiler config and print if -Ydebug is set
- //println("macro-expand, _this = "+ _this)
- import _context._
- object utils extends Utils {
- val context: _context.type = _context
- }
- import utils._
-
- val initName = newTermName("<init>")
- // Either:
- // scala"{ var i = $low; val h = $hi; while (i < h) { $f(i); i = i + 1 } }
- // or:
- // scala"($_this: RangeDefault).foreach($f)"
- _this match {
- case Apply(Select(New(tpt), initName), List(lo, hi)) if tpt.symbol.fullName == "Range" =>
- val iname = newTermName("$i")
- val hname = newTermName("$h")
- def iref = Ident(iname)
- def href = Ident(hname)
- val labelname = newTermName("$while")
- val cond = makeBinop(iref, "$less", href)
- val body = Block(
- List(makeApply(f, List(iref))),
- Assign(iref, makeBinop(iref, "$plus", Literal(Constant(1)))))
- val generated =
- Block(
- List(
- ValDef(Modifiers(Set(Modifier.mutable)), iname, TypeTree(), lo),
- ValDef(Modifiers(), hname, TypeTree(), hi)),
- makeWhile(labelname, cond, body))
- // todo. read the compiler config and print if -Ydebug is set
- //tools.nsc.util.trace("generated: ")(generated)
- generated
- case _ =>
- Apply(
- Select(
- Typed(_this, Ident(newTypeName("RangeDefault"))),
- newTermName("foreach")),
- List(f))
- }
- }
-}
-
-object Test extends App {
-
- new Range(1, 10) foreach println
-
-}
diff --git a/test/files/run/macro-reflective-ma-normal-mdmi.check b/test/files/run/macro-reflective-ma-normal-mdmi.check
new file mode 100644
index 0000000000..ac4213d6e9
--- /dev/null
+++ b/test/files/run/macro-reflective-ma-normal-mdmi.check
@@ -0,0 +1 @@
+43 \ No newline at end of file
diff --git a/test/files/run/macro-reflective-ma-normal-mdmi.flags b/test/files/run/macro-reflective-ma-normal-mdmi.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-reflective-ma-normal-mdmi.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala b/test/files/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala
new file mode 100644
index 0000000000..f6caf89dca
--- /dev/null
+++ b/test/files/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala
@@ -0,0 +1,13 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int]) = {
+ import c.mirror._
+ val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1))))
+ Expr[Int](body)
+ }
+}
+
+object Macros {
+ def foo(x: Int) = macro Impls.foo
+} \ No newline at end of file
diff --git a/test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala b/test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala
new file mode 100644
index 0000000000..3c594aed75
--- /dev/null
+++ b/test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala
@@ -0,0 +1,5 @@
+object Test extends App {
+ import scala.reflect.mirror._
+ val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
+ println(tree.eval)
+}
diff --git a/test/files/run/macro-reflective-mamd-normal-mi.check b/test/files/run/macro-reflective-mamd-normal-mi.check
new file mode 100644
index 0000000000..ac4213d6e9
--- /dev/null
+++ b/test/files/run/macro-reflective-mamd-normal-mi.check
@@ -0,0 +1 @@
+43 \ No newline at end of file
diff --git a/test/files/run/macro-reflective-mamd-normal-mi/Impls_1.scala b/test/files/run/macro-reflective-mamd-normal-mi/Impls_1.scala
new file mode 100644
index 0000000000..dc7d42d23e
--- /dev/null
+++ b/test/files/run/macro-reflective-mamd-normal-mi/Impls_1.scala
@@ -0,0 +1,9 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int]) = {
+ import c.mirror._
+ val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1))))
+ Expr[Int](body)
+ }
+}
diff --git a/test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala b/test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala
new file mode 100644
index 0000000000..cf34f1685d
--- /dev/null
+++ b/test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala
@@ -0,0 +1,17 @@
+//object Macros {
+// def foo(x: Int) = macro Impls.foo
+//}
+
+object Test extends App {
+ import scala.reflect.mirror._
+
+ val macrobody = Select(Ident(newTermName("Impls")), newTermName("foo"))
+ val macroparam = ValDef(NoMods, newTermName("x"), TypeTree(definitions.IntClass.asType), EmptyTree)
+ val macrodef = DefDef(Modifiers(Set(scala.reflect.api.Modifier.`macro`)), newTermName("foo"), Nil, List(List(macroparam)), TypeTree(), macrobody)
+ val modulector = DefDef(NoMods, nme.CONSTRUCTOR, Nil, List(List()), TypeTree(), Block(Apply(Select(Super(This(EmptyTypeName), EmptyTypeName), nme.CONSTRUCTOR), List())))
+ val module = ModuleDef(NoMods, newTermName("Macros"), Template(Nil, emptyValDef, List(modulector, macrodef)))
+ val macroapp = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
+ val tree = Block(macrodef, module, macroapp)
+ val toolbox = mkToolBox(options = "-language:experimental.macros")
+ println(toolbox.runExpr(tree))
+}
diff --git a/test/files/run/macro-reify-basic.check b/test/files/run/macro-reify-basic.check
new file mode 100644
index 0000000000..f35d3e67b4
--- /dev/null
+++ b/test/files/run/macro-reify-basic.check
@@ -0,0 +1 @@
+hello world
diff --git a/test/files/run/macro-reify-basic.flags b/test/files/run/macro-reify-basic.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-reify-basic.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-reify-basic/Macros_1.scala b/test/files/run/macro-reify-basic/Macros_1.scala
new file mode 100644
index 0000000000..b2243d131c
--- /dev/null
+++ b/test/files/run/macro-reify-basic/Macros_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Macros {
+ def foo(s: String) = macro Impls.foo
+
+ object Impls {
+ def foo(c: Ctx)(s: c.Expr[String]) = c.reify {
+ println("hello " + s.eval)
+ }
+ }
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-basic/Test_2.scala b/test/files/run/macro-reify-basic/Test_2.scala
new file mode 100644
index 0000000000..0a762f7ad7
--- /dev/null
+++ b/test/files/run/macro-reify-basic/Test_2.scala
@@ -0,0 +1,3 @@
+object Test extends App {
+ Macros.foo("world")
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-eval-eval.check b/test/files/run/macro-reify-eval-eval.check
new file mode 100644
index 0000000000..f35d3e67b4
--- /dev/null
+++ b/test/files/run/macro-reify-eval-eval.check
@@ -0,0 +1 @@
+hello world
diff --git a/test/files/run/macro-reify-eval-eval.flags b/test/files/run/macro-reify-eval-eval.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-reify-eval-eval.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-reify-eval-eval/Macros_1.scala b/test/files/run/macro-reify-eval-eval/Macros_1.scala
new file mode 100644
index 0000000000..6b8ac94f0e
--- /dev/null
+++ b/test/files/run/macro-reify-eval-eval/Macros_1.scala
@@ -0,0 +1,12 @@
+import scala.reflect.makro.{Context => Ctx}
+import scala.reflect.{mirror => mr}
+
+object Macros {
+ def foo = macro Impls.foo
+
+ object Impls {
+ def foo(c: Ctx) = c.reify {
+ { c.reify(c.reify("hello world")) }.eval.eval
+ }
+ }
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-eval-eval/Test_2.scala b/test/files/run/macro-reify-eval-eval/Test_2.scala
new file mode 100644
index 0000000000..f697da6020
--- /dev/null
+++ b/test/files/run/macro-reify-eval-eval/Test_2.scala
@@ -0,0 +1,3 @@
+object Test extends App {
+ println(Macros.foo)
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-eval-outside-reify.check b/test/files/run/macro-reify-eval-outside-reify.check
new file mode 100644
index 0000000000..2f562a182f
--- /dev/null
+++ b/test/files/run/macro-reify-eval-outside-reify.check
@@ -0,0 +1 @@
+42
diff --git a/test/files/run/macro-reify-eval-outside-reify.flags b/test/files/run/macro-reify-eval-outside-reify.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-reify-eval-outside-reify.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-reify-eval-outside-reify/Impls_Macros_1.scala b/test/files/run/macro-reify-eval-outside-reify/Impls_Macros_1.scala
new file mode 100644
index 0000000000..13b603d610
--- /dev/null
+++ b/test/files/run/macro-reify-eval-outside-reify/Impls_Macros_1.scala
@@ -0,0 +1,9 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int]) = c.literal(x.eval)
+}
+
+object Macros {
+ def foo(x: Int) = macro Impls.foo
+}
diff --git a/test/files/run/macro-reify-eval-outside-reify/Test_2.scala b/test/files/run/macro-reify-eval-outside-reify/Test_2.scala
new file mode 100644
index 0000000000..3c594aed75
--- /dev/null
+++ b/test/files/run/macro-reify-eval-outside-reify/Test_2.scala
@@ -0,0 +1,5 @@
+object Test extends App {
+ import scala.reflect.mirror._
+ val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
+ println(tree.eval)
+}
diff --git a/test/files/run/macro-reify-freevars.check b/test/files/run/macro-reify-freevars.check
new file mode 100644
index 0000000000..02a6a7436b
--- /dev/null
+++ b/test/files/run/macro-reify-freevars.check
@@ -0,0 +1,3 @@
+reflective compilation has failed:
+
+macro expansion contains free term variable code defined by map in Macros_1.scala:8:9. have you forgot to use eval when splicing this variable into a reifee? if you have troubles tracking free term variables, consider using -Xlog-free-terms
diff --git a/test/files/run/macro-reify-freevars.flags b/test/files/run/macro-reify-freevars.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-reify-freevars.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-reify-freevars/Macros_1.scala b/test/files/run/macro-reify-freevars/Macros_1.scala
new file mode 100644
index 0000000000..3cc559a0af
--- /dev/null
+++ b/test/files/run/macro-reify-freevars/Macros_1.scala
@@ -0,0 +1,19 @@
+package scala.collection.slick
+object QueryableMacros{
+ def map[T:c.TypeTag, S:c.TypeTag]
+ (c: scala.reflect.makro.Context)
+ (projection: c.mirror.Expr[T => S])
+ : c.mirror.Expr[scala.collection.slick.Queryable[S]] = {
+ import c.mirror._
+ val code = EmptyTree
+ c.reify{
+ Queryable.factory[S]( code.asInstanceOf[reflect.mirror.Tree] )
+ }
+ }
+}
+class Queryable[T]{
+ def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S]
+}
+object Queryable{
+ def factory[S]( projection:scala.reflect.mirror.Tree ) : Queryable[S] = null
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-freevars/Test_2.scala b/test/files/run/macro-reify-freevars/Test_2.scala
new file mode 100644
index 0000000000..55c677155a
--- /dev/null
+++ b/test/files/run/macro-reify-freevars/Test_2.scala
@@ -0,0 +1,9 @@
+object Test extends App {
+ import scala.reflect.mirror._
+ val q = New(AppliedTypeTree(Select(Select(Select(Ident("scala"), newTermName("collection")), newTermName("slick")), newTypeName("Queryable")), List(Ident("Int"))))
+ val x = ValDef(NoMods, newTermName("x"), Ident("Int"), EmptyTree)
+ val fn = Function(List(x), Apply(Select(Ident(newTermName("x")), newTermName("$plus")), List(Literal(Constant("5")))))
+ val tree = Apply(Select(q, newTermName("map")), List(fn))
+ try tree.eval
+ catch { case ex: Throwable => println(ex.getMessage) }
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-groundtypetag-notypeparams.check b/test/files/run/macro-reify-groundtypetag-notypeparams.check
new file mode 100644
index 0000000000..d75b3c72b2
--- /dev/null
+++ b/test/files/run/macro-reify-groundtypetag-notypeparams.check
@@ -0,0 +1,2 @@
+ConcreteTypeTag[Int]
+ConcreteTypeTag[List[Int]]
diff --git a/test/files/run/macro-reify-groundtypetag-notypeparams/Test.scala b/test/files/run/macro-reify-groundtypetag-notypeparams/Test.scala
new file mode 100644
index 0000000000..d2f8fab5ec
--- /dev/null
+++ b/test/files/run/macro-reify-groundtypetag-notypeparams/Test.scala
@@ -0,0 +1,6 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ println(implicitly[ConcreteTypeTag[Int]])
+ println(implicitly[ConcreteTypeTag[List[Int]]])
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-groundtypetag-typeparams-tags.check b/test/files/run/macro-reify-groundtypetag-typeparams-tags.check
new file mode 100644
index 0000000000..d75b3c72b2
--- /dev/null
+++ b/test/files/run/macro-reify-groundtypetag-typeparams-tags.check
@@ -0,0 +1,2 @@
+ConcreteTypeTag[Int]
+ConcreteTypeTag[List[Int]]
diff --git a/test/files/run/macro-reify-groundtypetag-typeparams-tags/Test.scala b/test/files/run/macro-reify-groundtypetag-typeparams-tags/Test.scala
new file mode 100644
index 0000000000..6d7eab5f9a
--- /dev/null
+++ b/test/files/run/macro-reify-groundtypetag-typeparams-tags/Test.scala
@@ -0,0 +1,9 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ def fooTypeTag[T: ConcreteTypeTag] = {
+ println(implicitly[ConcreteTypeTag[T]])
+ println(implicitly[ConcreteTypeTag[List[T]]])
+ }
+ fooTypeTag[Int]
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-nested-a.check b/test/files/run/macro-reify-nested-a.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/files/run/macro-reify-nested-a.check
diff --git a/test/files/run/macro-reify-nested-a.flags b/test/files/run/macro-reify-nested-a.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-reify-nested-a.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-reify-nested-a/Impls_Macros_1.scala b/test/files/run/macro-reify-nested-a/Impls_Macros_1.scala
new file mode 100644
index 0000000000..1ce8f44671
--- /dev/null
+++ b/test/files/run/macro-reify-nested-a/Impls_Macros_1.scala
@@ -0,0 +1,43 @@
+import scala.reflect.makro.Context
+
+case class Utils[C <: Context]( c:C ) {
+ import c.mirror._
+ import c.{Tree=>_}
+ object removeDoubleReify extends c.mirror.Transformer {
+ def apply( tree:Tree ) = transform(tree)
+ override def transform(tree: Tree): Tree = {
+ super.transform {
+ tree match {
+ case Apply(TypeApply(Select(_this, termname), _), reified::Nil )
+ if termname.toString == "factory" => c.unreifyTree(reified)
+ case Apply(Select(_this, termname), reified::Nil )
+ if termname.toString == "factory" => c.unreifyTree(reified)
+ case _ => tree
+ }
+ }
+ }
+ }
+}
+object QueryableMacros{
+ def _helper[C <: Context,S:c.TypeTag]( c:C )( name:String, projection:c.mirror.Expr[_] ) = {
+ import c.mirror._
+ val element_type = implicitly[c.TypeTag[S]].tpe
+ val foo = Expr[reflect.mirror.Expr[Queryable[S]]](
+ c.reifyTree( c.reflectMirrorPrefix, c.typeCheck(
+ Utils[c.type](c).removeDoubleReify(
+ Apply(Select(c.prefix.tree, newTermName( name )), List( projection.tree ))
+ ).asInstanceOf[Tree]
+ )))
+ c.reify{ Queryable.factory[S]( foo.eval )}
+ }
+ def map[T:c.TypeTag, S:c.TypeTag]
+ (c: scala.reflect.makro.Context)
+ (projection: c.mirror.Expr[T => S]): c.mirror.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection )
+}
+class Queryable[T]{
+ def _map[S]( projection: T => S ) : Queryable[S] = ???
+ def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S]
+}
+object Queryable{
+ def factory[S]( projection:scala.reflect.mirror.Expr[Queryable[S]] ) : Queryable[S] = null
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-nested-a/Test_2.scala b/test/files/run/macro-reify-nested-a/Test_2.scala
new file mode 100644
index 0000000000..fa0eb378af
--- /dev/null
+++ b/test/files/run/macro-reify-nested-a/Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App{
+ val q : Queryable[Any] = new Queryable[Any]
+ q.map(e1 => q.map(e2=>e1))
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-nested-b.check b/test/files/run/macro-reify-nested-b.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/files/run/macro-reify-nested-b.check
diff --git a/test/files/run/macro-reify-nested-b.flags b/test/files/run/macro-reify-nested-b.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-reify-nested-b.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-reify-nested-b/Impls_Macros_1.scala b/test/files/run/macro-reify-nested-b/Impls_Macros_1.scala
new file mode 100644
index 0000000000..1ce8f44671
--- /dev/null
+++ b/test/files/run/macro-reify-nested-b/Impls_Macros_1.scala
@@ -0,0 +1,43 @@
+import scala.reflect.makro.Context
+
+case class Utils[C <: Context]( c:C ) {
+ import c.mirror._
+ import c.{Tree=>_}
+ object removeDoubleReify extends c.mirror.Transformer {
+ def apply( tree:Tree ) = transform(tree)
+ override def transform(tree: Tree): Tree = {
+ super.transform {
+ tree match {
+ case Apply(TypeApply(Select(_this, termname), _), reified::Nil )
+ if termname.toString == "factory" => c.unreifyTree(reified)
+ case Apply(Select(_this, termname), reified::Nil )
+ if termname.toString == "factory" => c.unreifyTree(reified)
+ case _ => tree
+ }
+ }
+ }
+ }
+}
+object QueryableMacros{
+ def _helper[C <: Context,S:c.TypeTag]( c:C )( name:String, projection:c.mirror.Expr[_] ) = {
+ import c.mirror._
+ val element_type = implicitly[c.TypeTag[S]].tpe
+ val foo = Expr[reflect.mirror.Expr[Queryable[S]]](
+ c.reifyTree( c.reflectMirrorPrefix, c.typeCheck(
+ Utils[c.type](c).removeDoubleReify(
+ Apply(Select(c.prefix.tree, newTermName( name )), List( projection.tree ))
+ ).asInstanceOf[Tree]
+ )))
+ c.reify{ Queryable.factory[S]( foo.eval )}
+ }
+ def map[T:c.TypeTag, S:c.TypeTag]
+ (c: scala.reflect.makro.Context)
+ (projection: c.mirror.Expr[T => S]): c.mirror.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection )
+}
+class Queryable[T]{
+ def _map[S]( projection: T => S ) : Queryable[S] = ???
+ def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S]
+}
+object Queryable{
+ def factory[S]( projection:scala.reflect.mirror.Expr[Queryable[S]] ) : Queryable[S] = null
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-nested-b/Test_2.scala b/test/files/run/macro-reify-nested-b/Test_2.scala
new file mode 100644
index 0000000000..fa13f57ffb
--- /dev/null
+++ b/test/files/run/macro-reify-nested-b/Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App{
+ val q : Queryable[Any] = new Queryable[Any]
+ q.map(e1 => q.map(e2=>e1).map(e2=>e1))
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-ref-to-packageless.check b/test/files/run/macro-reify-ref-to-packageless.check
new file mode 100644
index 0000000000..2f562a182f
--- /dev/null
+++ b/test/files/run/macro-reify-ref-to-packageless.check
@@ -0,0 +1 @@
+42
diff --git a/test/files/run/macro-reify-ref-to-packageless.flags b/test/files/run/macro-reify-ref-to-packageless.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-reify-ref-to-packageless.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-reify-ref-to-packageless/Impls_1.scala b/test/files/run/macro-reify-ref-to-packageless/Impls_1.scala
new file mode 100644
index 0000000000..2f2d05678d
--- /dev/null
+++ b/test/files/run/macro-reify-ref-to-packageless/Impls_1.scala
@@ -0,0 +1,6 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ val `Answer to the Ultimate Question of Life, the Universe, and Everything` = 42
+ def foo(c: Ctx) = c.reify { `Answer to the Ultimate Question of Life, the Universe, and Everything` }
+}
diff --git a/test/files/run/macro-reify-ref-to-packageless/Test_2.scala b/test/files/run/macro-reify-ref-to-packageless/Test_2.scala
new file mode 100644
index 0000000000..9d475f756d
--- /dev/null
+++ b/test/files/run/macro-reify-ref-to-packageless/Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ def foo = macro Impls.foo
+ println(foo)
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-tagful-a.check b/test/files/run/macro-reify-tagful-a.check
new file mode 100644
index 0000000000..8a701df6a5
--- /dev/null
+++ b/test/files/run/macro-reify-tagful-a.check
@@ -0,0 +1 @@
+List(hello world)
diff --git a/test/files/run/macro-reify-tagful-a.flags b/test/files/run/macro-reify-tagful-a.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-reify-tagful-a.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-reify-tagful-a/Macros_1.scala b/test/files/run/macro-reify-tagful-a/Macros_1.scala
new file mode 100644
index 0000000000..2ff12091a1
--- /dev/null
+++ b/test/files/run/macro-reify-tagful-a/Macros_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Macros {
+ def foo[T](s: T) = macro Impls.foo[T]
+
+ object Impls {
+ def foo[T: c.TypeTag](c: Ctx)(s: c.Expr[T]) = c.reify {
+ List(s.eval)
+ }
+ }
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-tagful-a/Test_2.scala b/test/files/run/macro-reify-tagful-a/Test_2.scala
new file mode 100644
index 0000000000..4d27166341
--- /dev/null
+++ b/test/files/run/macro-reify-tagful-a/Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ val list: List[String] = Macros.foo("hello world")
+ println(list)
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-tagless-a.check b/test/files/run/macro-reify-tagless-a.check
new file mode 100644
index 0000000000..b58cff19bc
--- /dev/null
+++ b/test/files/run/macro-reify-tagless-a.check
@@ -0,0 +1,3 @@
+reflective compilation has failed:
+
+macro expansion contains free type variable T defined by foo in Impls_Macros_1.scala:7:13. have you forgot to use c.TypeTag annotation for this type parameter? if you have troubles tracking free type variables, consider using -Xlog-free-types
diff --git a/test/files/run/macro-reify-tagless-a.flags b/test/files/run/macro-reify-tagless-a.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-reify-tagless-a.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-reify-tagless-a/Impls_Macros_1.scala b/test/files/run/macro-reify-tagless-a/Impls_Macros_1.scala
new file mode 100644
index 0000000000..45e39d7d1c
--- /dev/null
+++ b/test/files/run/macro-reify-tagless-a/Impls_Macros_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Macros {
+ def foo[T](s: T) = macro Impls.foo[T]
+
+ object Impls {
+ def foo[T](c: Ctx)(s: c.Expr[T]) = c.reify {
+ List[T](s.eval)
+ }
+ }
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-tagless-a/Test_2.scala b/test/files/run/macro-reify-tagless-a/Test_2.scala
new file mode 100644
index 0000000000..d996da1570
--- /dev/null
+++ b/test/files/run/macro-reify-tagless-a/Test_2.scala
@@ -0,0 +1,12 @@
+object Test extends App {
+ //val list: List[String] = Macros.foo("hello world")
+ //println(list)
+
+ import scala.reflect.mirror._
+ val tpt = AppliedTypeTree(Ident(definitions.ListClass), List(Ident(definitions.StringClass)))
+ val rhs = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant("hello world"))))
+ val list = ValDef(NoMods, newTermName("list"), tpt, rhs)
+ val tree = Block(list, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Ident(list.name))))
+ try tree.eval
+ catch { case ex: Throwable => println(ex.getMessage) }
+}
diff --git a/test/files/run/macro-reify-typetag-notypeparams.check b/test/files/run/macro-reify-typetag-notypeparams.check
new file mode 100644
index 0000000000..d75b3c72b2
--- /dev/null
+++ b/test/files/run/macro-reify-typetag-notypeparams.check
@@ -0,0 +1,2 @@
+ConcreteTypeTag[Int]
+ConcreteTypeTag[List[Int]]
diff --git a/test/files/run/macro-reify-typetag-notypeparams/Test.scala b/test/files/run/macro-reify-typetag-notypeparams/Test.scala
new file mode 100644
index 0000000000..041a44273d
--- /dev/null
+++ b/test/files/run/macro-reify-typetag-notypeparams/Test.scala
@@ -0,0 +1,6 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ println(implicitly[TypeTag[Int]])
+ println(implicitly[TypeTag[List[Int]]])
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-typetag-typeparams-notags.check b/test/files/run/macro-reify-typetag-typeparams-notags.check
new file mode 100644
index 0000000000..af4877e205
--- /dev/null
+++ b/test/files/run/macro-reify-typetag-typeparams-notags.check
@@ -0,0 +1,2 @@
+ConcreteTypeTag[T]
+ConcreteTypeTag[List[T]]
diff --git a/test/files/run/macro-reify-typetag-typeparams-notags/Test.scala b/test/files/run/macro-reify-typetag-typeparams-notags/Test.scala
new file mode 100644
index 0000000000..a89499e7fe
--- /dev/null
+++ b/test/files/run/macro-reify-typetag-typeparams-notags/Test.scala
@@ -0,0 +1,9 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ def fooNoTypeTag[T] = {
+ println(implicitly[TypeTag[T]])
+ println(implicitly[TypeTag[List[T]]])
+ }
+ fooNoTypeTag[Int]
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-typetag-typeparams-tags.check b/test/files/run/macro-reify-typetag-typeparams-tags.check
new file mode 100644
index 0000000000..d75b3c72b2
--- /dev/null
+++ b/test/files/run/macro-reify-typetag-typeparams-tags.check
@@ -0,0 +1,2 @@
+ConcreteTypeTag[Int]
+ConcreteTypeTag[List[Int]]
diff --git a/test/files/run/macro-reify-typetag-typeparams-tags/Test.scala b/test/files/run/macro-reify-typetag-typeparams-tags/Test.scala
new file mode 100644
index 0000000000..b32680a4b8
--- /dev/null
+++ b/test/files/run/macro-reify-typetag-typeparams-tags/Test.scala
@@ -0,0 +1,9 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ def fooTypeTag[T: TypeTag] = {
+ println(implicitly[TypeTag[T]])
+ println(implicitly[TypeTag[List[T]]])
+ }
+ fooTypeTag[Int]
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-typetag-usegroundtypetag.check b/test/files/run/macro-reify-typetag-usegroundtypetag.check
new file mode 100644
index 0000000000..d75b3c72b2
--- /dev/null
+++ b/test/files/run/macro-reify-typetag-usegroundtypetag.check
@@ -0,0 +1,2 @@
+ConcreteTypeTag[Int]
+ConcreteTypeTag[List[Int]]
diff --git a/test/files/run/macro-reify-typetag-usegroundtypetag/Test.scala b/test/files/run/macro-reify-typetag-usegroundtypetag/Test.scala
new file mode 100644
index 0000000000..de235f51cc
--- /dev/null
+++ b/test/files/run/macro-reify-typetag-usegroundtypetag/Test.scala
@@ -0,0 +1,9 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ def fooTypeTag[T: ConcreteTypeTag] = {
+ println(implicitly[TypeTag[T]])
+ println(implicitly[TypeTag[List[T]]])
+ }
+ fooTypeTag[Int]
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-unreify.check b/test/files/run/macro-reify-unreify.check
new file mode 100644
index 0000000000..a5334cc355
--- /dev/null
+++ b/test/files/run/macro-reify-unreify.check
@@ -0,0 +1 @@
+hello world = Expr[String("hello world")]("hello world")
diff --git a/test/files/run/macro-reify-unreify.flags b/test/files/run/macro-reify-unreify.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-reify-unreify.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-reify-unreify/Macros_1.scala b/test/files/run/macro-reify-unreify/Macros_1.scala
new file mode 100644
index 0000000000..1b0b9c6421
--- /dev/null
+++ b/test/files/run/macro-reify-unreify/Macros_1.scala
@@ -0,0 +1,19 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Macros {
+ def foo(s: String) = macro Impls.foo
+
+ object Impls {
+ def foo(c: Ctx)(s: c.Expr[String]) = {
+ import c.mirror._
+
+ val world = c.reifyTree(c.reflectMirrorPrefix, s.tree)
+ val greeting = c.reifyTree(c.reflectMirrorPrefix, c.typeCheck(Apply(Select(Literal(Constant("hello ")), newTermName("$plus")), List(c.unreifyTree(world)))))
+ val typedGreeting = Expr[String](greeting)
+
+ c.reify {
+ println("hello " + s.eval + " = " + typedGreeting.eval)
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-unreify/Test_2.scala b/test/files/run/macro-reify-unreify/Test_2.scala
new file mode 100644
index 0000000000..0a762f7ad7
--- /dev/null
+++ b/test/files/run/macro-reify-unreify/Test_2.scala
@@ -0,0 +1,3 @@
+object Test extends App {
+ Macros.foo("world")
+} \ No newline at end of file
diff --git a/test/files/run/macro-reify-value-outside-reify.check b/test/files/run/macro-reify-value-outside-reify.check
new file mode 100644
index 0000000000..2f562a182f
--- /dev/null
+++ b/test/files/run/macro-reify-value-outside-reify.check
@@ -0,0 +1 @@
+42
diff --git a/test/files/run/macro-reify-value-outside-reify.flags b/test/files/run/macro-reify-value-outside-reify.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-reify-value-outside-reify.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-reify-value-outside-reify/Impls_Macros_1.scala b/test/files/run/macro-reify-value-outside-reify/Impls_Macros_1.scala
new file mode 100644
index 0000000000..28ec1ace67
--- /dev/null
+++ b/test/files/run/macro-reify-value-outside-reify/Impls_Macros_1.scala
@@ -0,0 +1,9 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int]) = c.literal(x.value)
+}
+
+object Macros {
+ def foo(x: Int) = macro Impls.foo
+}
diff --git a/test/files/run/macro-reify-value-outside-reify/Test_2.scala b/test/files/run/macro-reify-value-outside-reify/Test_2.scala
new file mode 100644
index 0000000000..8225eb0b39
--- /dev/null
+++ b/test/files/run/macro-reify-value-outside-reify/Test_2.scala
@@ -0,0 +1,6 @@
+object Test extends App {
+ import scala.reflect.mirror._
+ val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
+ try println(tree.eval)
+ catch { case ex: Throwable => println(ex.getMessage) }
+}
diff --git a/test/files/run/macro-repl-basic.check b/test/files/run/macro-repl-basic.check
index f8f0d3ad29..9e0f9aa1a2 100644
--- a/test/files/run/macro-repl-basic.check
+++ b/test/files/run/macro-repl-basic.check
@@ -1,25 +1,54 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
-
-scala>
-
-scala> object Macros {
- object Shmacros {
- def macro foo(x: Int): Int = x
- }
- def macro bar(x: Int): Int = x
-}; class Macros {
- def macro quux(x: Int): Int = x
-}
-defined module Macros
-defined class Macros
-
-scala>
-
-scala> import Macros.Shmacros._
-import Macros.Shmacros._
-
-scala> println(foo(2) + Macros.bar(2) * new Macros().quux(4))
-10
-
-scala>
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> import language.experimental.macros
+import language.experimental.macros
+
+scala> import scala.reflect.makro.{Context => Ctx}
+import scala.reflect.makro.{Context=>Ctx}
+
+scala>
+
+scala> object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int]) = {
+ import c.mirror._
+ val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1))))
+ Expr[Int](body)
+ }
+
+ def bar(c: Ctx)(x: c.Expr[Int]) = {
+ import c.mirror._
+ val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2))))
+ Expr[Int](body)
+ }
+
+ def quux(c: Ctx)(x: c.Expr[Int]) = {
+ import c.mirror._
+ val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(3))))
+ Expr[Int](body)
+ }
+}
+defined module Impls
+
+scala> object Macros {
+ object Shmacros {
+ def foo(x: Int): Int = macro Impls.foo
+ }
+ def bar(x: Int): Int = macro Impls.bar
+}; class Macros {
+ def quux(x: Int): Int = macro Impls.quux
+}
+defined module Macros
+defined class Macros
+
+scala>
+
+scala> import Macros.Shmacros._
+import Macros.Shmacros._
+
+scala> println(foo(2) + Macros.bar(2) * new Macros().quux(4))
+31
+
+scala>
diff --git a/test/files/run/macro-repl-basic.scala b/test/files/run/macro-repl-basic.scala
index 9b1a53343b..e8849b4b56 100644
--- a/test/files/run/macro-repl-basic.scala
+++ b/test/files/run/macro-repl-basic.scala
@@ -1,18 +1,39 @@
import scala.tools.partest.ReplTest
object Test extends ReplTest {
- override def extraSettings = "-Xmacros"
def code = """
+ |import language.experimental.macros
+ |import scala.reflect.makro.{Context => Ctx}
+ |
+ |object Impls {
+ | def foo(c: Ctx)(x: c.Expr[Int]) = {
+ | import c.mirror._
+ | val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1))))
+ | Expr[Int](body)
+ | }
+ |
+ | def bar(c: Ctx)(x: c.Expr[Int]) = {
+ | import c.mirror._
+ | val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2))))
+ | Expr[Int](body)
+ | }
+ |
+ | def quux(c: Ctx)(x: c.Expr[Int]) = {
+ | import c.mirror._
+ | val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(3))))
+ | Expr[Int](body)
+ | }
+ |}
|object Macros {
| object Shmacros {
- | def macro foo(x: Int): Int = x
+ | def foo(x: Int): Int = macro Impls.foo
| }
- | def macro bar(x: Int): Int = x
+ | def bar(x: Int): Int = macro Impls.bar
|}; class Macros {
- | def macro quux(x: Int): Int = x
+ | def quux(x: Int): Int = macro Impls.quux
|}
|
|import Macros.Shmacros._
|println(foo(2) + Macros.bar(2) * new Macros().quux(4))
|""".stripMargin
-} \ No newline at end of file
+}
diff --git a/test/files/run/macro-repl-dontexpand.check b/test/files/run/macro-repl-dontexpand.check
index d2bb89b6f7..35845f0cff 100644
--- a/test/files/run/macro-repl-dontexpand.check
+++ b/test/files/run/macro-repl-dontexpand.check
@@ -3,7 +3,10 @@ Type :help for more information.
scala>
-scala> def macro foo = ???
+scala> def bar(c: scala.reflect.makro.Context) = ???
+bar: (c: scala.reflect.makro.Context)Nothing
+
+scala> def foo = macro bar
foo: Any
scala>
diff --git a/test/files/run/macro-repl-dontexpand.scala b/test/files/run/macro-repl-dontexpand.scala
index 254bce894c..cd1b2e1969 100644
--- a/test/files/run/macro-repl-dontexpand.scala
+++ b/test/files/run/macro-repl-dontexpand.scala
@@ -1,8 +1,9 @@
import scala.tools.partest.ReplTest
object Test extends ReplTest {
- override def extraSettings = "-Xmacros"
+ override def extraSettings = "-language:experimental.macros"
def code = """
- |def macro foo = ???
+ |def bar(c: scala.reflect.makro.Context) = ???
+ |def foo = macro bar
|""".stripMargin
-} \ No newline at end of file
+}
diff --git a/test/files/run/macro-rettype-mismatch.flags b/test/files/run/macro-rettype-mismatch.flags
index 7fea2ff901..cd66464f2f 100644
--- a/test/files/run/macro-rettype-mismatch.flags
+++ b/test/files/run/macro-rettype-mismatch.flags
@@ -1 +1 @@
--Xmacros \ No newline at end of file
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-rettype-mismatch/Macros_1.scala b/test/files/run/macro-rettype-mismatch/Macros_1.scala
deleted file mode 100644
index 64e5b93468..0000000000
--- a/test/files/run/macro-rettype-mismatch/Macros_1.scala
+++ /dev/null
@@ -1,3 +0,0 @@
-object Macros {
- def macro foo(x: Int): String = x
-} \ No newline at end of file
diff --git a/test/files/run/macro-rettype-mismatch/Test_2.scala b/test/files/run/macro-rettype-mismatch/Test_2.scala
deleted file mode 100644
index 39a7c7ad1a..0000000000
--- a/test/files/run/macro-rettype-mismatch/Test_2.scala
+++ /dev/null
@@ -1,16 +0,0 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
-
-object Test extends App {
- import scala.reflect.mirror._
- val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(2))))
-
- val stderr = new java.io.ByteArrayOutputStream()
- Console.setErr(new java.io.PrintStream(stderr))
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- try { toolbox.runExpr(tree) }
- catch { case ex: Throwable => println(stderr); println(ex) }
-}
diff --git a/test/files/run/macro-settings.check b/test/files/run/macro-settings.check
new file mode 100644
index 0000000000..33784d1c15
--- /dev/null
+++ b/test/files/run/macro-settings.check
@@ -0,0 +1 @@
+List(hello=1)
diff --git a/test/files/run/macro-settings.flags b/test/files/run/macro-settings.flags
new file mode 100644
index 0000000000..15479e30b8
--- /dev/null
+++ b/test/files/run/macro-settings.flags
@@ -0,0 +1 @@
+-language:experimental.macros -Xmacro-settings:hello=1 \ No newline at end of file
diff --git a/test/files/run/macro-settings/Impls_Macros_1.scala b/test/files/run/macro-settings/Impls_Macros_1.scala
new file mode 100644
index 0000000000..8c7254c79a
--- /dev/null
+++ b/test/files/run/macro-settings/Impls_Macros_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.Context
+
+object Impls {
+ def impl(c: Context) = c.reify {
+ println(c.literal(c.settings.toString).eval)
+ }
+}
+
+object Macros {
+ def foo = macro Impls.impl
+} \ No newline at end of file
diff --git a/test/files/run/macro-settings/Test_2.scala b/test/files/run/macro-settings/Test_2.scala
new file mode 100644
index 0000000000..acfddae942
--- /dev/null
+++ b/test/files/run/macro-settings/Test_2.scala
@@ -0,0 +1,3 @@
+object Test extends App {
+ Macros.foo
+} \ No newline at end of file
diff --git a/test/files/run/macro-sip19-revised.check b/test/files/run/macro-sip19-revised.check
new file mode 100644
index 0000000000..aa2fbd11d3
--- /dev/null
+++ b/test/files/run/macro-sip19-revised.check
@@ -0,0 +1,5 @@
+hey, i've been called from SourceLocation1(null,Test_2.scala,11,251)
+hey, i've been called from SourceLocation1(SourceLocation1(null,Test_2.scala,11,251),Test_2.scala,8,222)
+hey, i've been called from SourceLocation1(SourceLocation1(SourceLocation1(null,Test_2.scala,11,251),Test_2.scala,8,222),Test_2.scala,8,222)
+hey, i've been called from SourceLocation1(SourceLocation1(SourceLocation1(SourceLocation1(null,Test_2.scala,11,251),Test_2.scala,8,222),Test_2.scala,8,222),Test_2.scala,6,180)
+2
diff --git a/test/files/run/macro-sip19-revised.flags b/test/files/run/macro-sip19-revised.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-sip19-revised.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-sip19-revised/Impls_Macros_1.scala b/test/files/run/macro-sip19-revised/Impls_Macros_1.scala
new file mode 100644
index 0000000000..e8f6e1df85
--- /dev/null
+++ b/test/files/run/macro-sip19-revised/Impls_Macros_1.scala
@@ -0,0 +1,34 @@
+import scala.reflect.makro.Context
+
+object Macros {
+ def impl(c: Context) = {
+ import c.mirror._
+
+ val inscope = c.inferImplicitValue(staticClass("SourceLocation").asType)
+ val outer = Expr[SourceLocation](if (!inscope.isEmpty) inscope else Literal(Constant(null)))
+
+ val Apply(fun, args) = c.enclosingImplicits(0)._2
+ val fileName = fun.pos.fileInfo.getName
+ val line = fun.pos.line
+ val charOffset = fun.pos.point
+ c.reify { SourceLocation1(outer.eval, c.literal(fileName).eval, c.literal(line).eval, c.literal(charOffset).eval) }
+ }
+
+ implicit def sourceLocation: SourceLocation1 = macro impl
+}
+
+trait SourceLocation {
+ /** Source location of the outermost call */
+ val outer: SourceLocation
+
+ /** The name of the source file */
+ val fileName: String
+
+ /** The line number */
+ val line: Int
+
+ /** The character offset */
+ val charOffset: Int
+}
+
+case class SourceLocation1(val outer: SourceLocation, val fileName: String, val line: Int, val charOffset: Int) extends SourceLocation
diff --git a/test/files/run/macro-sip19-revised/Test_2.scala b/test/files/run/macro-sip19-revised/Test_2.scala
new file mode 100644
index 0000000000..d9a4d7d4fc
--- /dev/null
+++ b/test/files/run/macro-sip19-revised/Test_2.scala
@@ -0,0 +1,12 @@
+import Macros._
+
+object Test extends App {
+ def foo(x: Int, y: Int)(implicit loc: SourceLocation): Int = {
+ println("hey, i've been called from %s".format(loc))
+ if (x < y) foo(y, x)
+ else if (y == 0) x
+ else foo(x - y, y)
+ }
+
+ println(foo(4, 2))
+}
diff --git a/test/files/run/macro-sip19.check b/test/files/run/macro-sip19.check
new file mode 100644
index 0000000000..6b317ccb47
--- /dev/null
+++ b/test/files/run/macro-sip19.check
@@ -0,0 +1,5 @@
+hey, i've been called from SourceLocation(Test_2.scala,15,366)
+hey, i've been called from SourceLocation(Test_2.scala,11,331)
+hey, i've been called from SourceLocation(Test_2.scala,11,331)
+hey, i've been called from SourceLocation(Test_2.scala,9,285)
+2
diff --git a/test/files/run/macro-sip19.flags b/test/files/run/macro-sip19.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-sip19.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-sip19/Impls_Macros_1.scala b/test/files/run/macro-sip19/Impls_Macros_1.scala
new file mode 100644
index 0000000000..39b29ad64c
--- /dev/null
+++ b/test/files/run/macro-sip19/Impls_Macros_1.scala
@@ -0,0 +1,25 @@
+import scala.reflect.makro.Context
+
+object Macros {
+ def impl(c: Context) = {
+ import c.mirror._
+ val Apply(fun, args) = c.enclosingImplicits(0)._2
+ val fileName = fun.pos.fileInfo.getName
+ val line = fun.pos.line
+ val charOffset = fun.pos.point
+ c.reify { SourceLocation(c.literal(fileName).eval, c.literal(line).eval, c.literal(charOffset).eval) }
+ }
+
+ implicit def sourceLocation: SourceLocation = macro impl
+}
+
+case class SourceLocation(
+ /** The name of the source file */
+ val fileName: String,
+
+ /** The line number */
+ val line: Int,
+
+ /** The character offset */
+ val charOffset: Int
+)
diff --git a/test/files/run/macro-sip19/Test_2.scala b/test/files/run/macro-sip19/Test_2.scala
new file mode 100644
index 0000000000..32326e6352
--- /dev/null
+++ b/test/files/run/macro-sip19/Test_2.scala
@@ -0,0 +1,16 @@
+import Macros._
+
+object Test extends App {
+ def foo(x: Int, y: Int)(implicit loc0: SourceLocation): Int = {
+ var loc = loc0;
+ {
+ var loc0 = 0 // shadow loc0 to disambiguate with the implicit macro
+ println("hey, i've been called from %s".format(loc))
+ if (x < y) foo(y, x)
+ else if (y == 0) x
+ else foo(x - y, y)
+ }
+ }
+
+ println(foo(4, 2))
+}
diff --git a/test/files/run/macro-typecheck-implicitsdisabled.check b/test/files/run/macro-typecheck-implicitsdisabled.check
new file mode 100644
index 0000000000..aa6c8e1f07
--- /dev/null
+++ b/test/files/run/macro-typecheck-implicitsdisabled.check
@@ -0,0 +1,2 @@
+scala.this.Predef.any2ArrowAssoc[Int](1).->[Int](2)
+scala.reflect.internal.Types$TypeError: value -> is not a member of Int
diff --git a/test/files/run/macro-typecheck-implicitsdisabled.flags b/test/files/run/macro-typecheck-implicitsdisabled.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-typecheck-implicitsdisabled.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala b/test/files/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala
new file mode 100644
index 0000000000..4f0f76aed6
--- /dev/null
+++ b/test/files/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala
@@ -0,0 +1,28 @@
+import scala.reflect.makro.Context
+
+object Macros {
+ def impl_with_implicits_enabled(c: Context) = {
+ import c.mirror._
+
+ val tree1 = Apply(Select(Literal(Constant(1)), newTermName("$minus$greater")), List(Literal(Constant(2))))
+ val ttree1 = c.typeCheck(tree1, withImplicitViewsDisabled = false)
+ c.literal(ttree1.toString)
+ }
+
+ def foo_with_implicits_enabled = macro impl_with_implicits_enabled
+
+ def impl_with_implicits_disabled(c: Context) = {
+ import c.mirror._
+
+ try {
+ val tree2 = Apply(Select(Literal(Constant(1)), newTermName("$minus$greater")), List(Literal(Constant(2))))
+ val ttree2 = c.typeCheck(tree2, withImplicitViewsDisabled = true)
+ c.literal(ttree2.toString)
+ } catch {
+ case ex: Throwable =>
+ c.literal(ex.toString)
+ }
+ }
+
+ def foo_with_implicits_disabled = macro impl_with_implicits_disabled
+} \ No newline at end of file
diff --git a/test/files/run/macro-typecheck-implicitsdisabled/Test_2.scala b/test/files/run/macro-typecheck-implicitsdisabled/Test_2.scala
new file mode 100644
index 0000000000..127e955f0e
--- /dev/null
+++ b/test/files/run/macro-typecheck-implicitsdisabled/Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ println(Macros.foo_with_implicits_enabled)
+ println(Macros.foo_with_implicits_disabled)
+} \ No newline at end of file
diff --git a/test/files/run/macro-typecheck-macrosdisabled.check b/test/files/run/macro-typecheck-macrosdisabled.check
new file mode 100644
index 0000000000..b432a539fc
--- /dev/null
+++ b/test/files/run/macro-typecheck-macrosdisabled.check
@@ -0,0 +1,5 @@
+{
+ val $mr: reflect.mirror.type = scala.reflect.`package`.mirror;
+ $mr.Expr.apply[Int(2)]($mr.Literal.apply($mr.Constant.apply(2)))($mr.ConcreteTypeTag.apply[Int(2)]($mr.ConstantType.apply($mr.Constant.apply(2))))
+}
+mr.reify[Int](2)
diff --git a/test/files/run/macro-typecheck-macrosdisabled.flags b/test/files/run/macro-typecheck-macrosdisabled.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-typecheck-macrosdisabled.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala b/test/files/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala
new file mode 100644
index 0000000000..c253f0b1fb
--- /dev/null
+++ b/test/files/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala
@@ -0,0 +1,36 @@
+import scala.reflect.makro.Context
+
+object Macros {
+ def impl_with_macros_enabled(c: Context) = {
+ import c.mirror._
+
+ // todo. doesn't work. why?
+ //val mrPkg = staticModule("scala.reflect.package")
+ //val mrSym = selectTerm(mrPkg, "mirror")
+ //val NullaryMethodType(mrTpe) = mrSym.typeSignature
+ //val mr = newFreeTerm("mr", mrTpe, scala.reflect.mirror, null)
+ //val tree1 = Apply(Select(Ident(mr), newTermName("reify")), List(Literal(Constant(2))))
+
+ val mr = Select(Select(Select(Ident(newTermName("scala")), newTermName("reflect")), newTermName("package")), newTermName("mirror"))
+ val tree1 = Apply(Select(mr, newTermName("reify")), List(Literal(Constant(2))))
+ val ttree1 = c.typeCheck(tree1, withMacrosDisabled = false)
+ c.literal(ttree1.toString)
+ }
+
+ def foo_with_macros_enabled = macro impl_with_macros_enabled
+
+ def impl_with_macros_disabled(c: Context) = {
+ import c.mirror._
+
+ val mrPkg = staticModule("scala.reflect.package")
+ val mrSym = selectTerm(mrPkg, "mirror")
+ val NullaryMethodType(mrTpe) = mrSym.typeSignature
+ val mr = newFreeTerm("mr", mrTpe, scala.reflect.mirror, null)
+
+ val tree2 = Apply(Select(Ident(mr), newTermName("reify")), List(Literal(Constant(2))))
+ val ttree2 = c.typeCheck(tree2, withMacrosDisabled = true)
+ c.literal(ttree2.toString)
+ }
+
+ def foo_with_macros_disabled = macro impl_with_macros_disabled
+} \ No newline at end of file
diff --git a/test/files/run/macro-typecheck-macrosdisabled/Test_2.scala b/test/files/run/macro-typecheck-macrosdisabled/Test_2.scala
new file mode 100644
index 0000000000..bdba39195b
--- /dev/null
+++ b/test/files/run/macro-typecheck-macrosdisabled/Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ println(Macros.foo_with_macros_enabled)
+ println(Macros.foo_with_macros_disabled)
+} \ No newline at end of file
diff --git a/test/files/run/macro-undetparams-consfromsls.check b/test/files/run/macro-undetparams-consfromsls.check
new file mode 100644
index 0000000000..49e9140d5a
--- /dev/null
+++ b/test/files/run/macro-undetparams-consfromsls.check
@@ -0,0 +1,5 @@
+A = ConcreteTypeTag[Int]
+B = ConcreteTypeTag[Nothing]
+List(1)
+A = ConcreteTypeTag[Any]
+List(abc, 1)
diff --git a/test/files/run/macro-undetparams-consfromsls.flags b/test/files/run/macro-undetparams-consfromsls.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-undetparams-consfromsls.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-undetparams-consfromsls/Impls_Macros_1.scala b/test/files/run/macro-undetparams-consfromsls/Impls_Macros_1.scala
new file mode 100644
index 0000000000..c22ff96028
--- /dev/null
+++ b/test/files/run/macro-undetparams-consfromsls/Impls_Macros_1.scala
@@ -0,0 +1,17 @@
+import scala.reflect.makro.Context
+
+object Macros {
+ def cons_impl[A: c.TypeTag](c: Context)(x: c.Expr[A], xs: c.Expr[List[A]]): c.Expr[List[A]] = c.reify {
+ println("A = " + c.literal(implicitly[c.TypeTag[A]].toString).eval)
+ x.eval :: xs.eval
+ }
+
+ def nil_impl[B: c.TypeTag](c: Context): c.Expr[List[B]] = c.reify {
+ println("B = " + c.literal(implicitly[c.TypeTag[B]].toString).eval)
+ Nil
+ }
+
+ def cons[A](x: A, xs: List[A]): List[A] = macro cons_impl[A]
+
+ def nil[B]: List[B] = macro nil_impl[B]
+} \ No newline at end of file
diff --git a/test/files/run/macro-undetparams-consfromsls/Test_2.scala b/test/files/run/macro-undetparams-consfromsls/Test_2.scala
new file mode 100644
index 0000000000..f2c2ce0051
--- /dev/null
+++ b/test/files/run/macro-undetparams-consfromsls/Test_2.scala
@@ -0,0 +1,7 @@
+object Test extends App {
+ import Macros._
+ val xs = cons(1, nil)
+ println(xs)
+ val ys = cons("abc", xs)
+ println(ys)
+} \ No newline at end of file
diff --git a/test/files/run/macro-undetparams-implicitval.check b/test/files/run/macro-undetparams-implicitval.check
new file mode 100644
index 0000000000..6c2b601aa5
--- /dev/null
+++ b/test/files/run/macro-undetparams-implicitval.check
@@ -0,0 +1 @@
+ConcreteTypeTag[Nothing]
diff --git a/test/files/run/macro-undetparams-implicitval.flags b/test/files/run/macro-undetparams-implicitval.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-undetparams-implicitval.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-undetparams-implicitval/Test.scala b/test/files/run/macro-undetparams-implicitval/Test.scala
new file mode 100644
index 0000000000..5278295451
--- /dev/null
+++ b/test/files/run/macro-undetparams-implicitval/Test.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ def foo[T: TypeTag] = println(implicitly[TypeTag[T]])
+ foo
+} \ No newline at end of file
diff --git a/test/files/run/macro-undetparams-macroitself.check b/test/files/run/macro-undetparams-macroitself.check
new file mode 100644
index 0000000000..e57fc1217b
--- /dev/null
+++ b/test/files/run/macro-undetparams-macroitself.check
@@ -0,0 +1,2 @@
+ConcreteTypeTag[Int]
+ConcreteTypeTag[String]
diff --git a/test/files/run/macro-undetparams-macroitself.flags b/test/files/run/macro-undetparams-macroitself.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/macro-undetparams-macroitself.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-undetparams-macroitself/Impls_Macros_1.scala b/test/files/run/macro-undetparams-macroitself/Impls_Macros_1.scala
new file mode 100644
index 0000000000..9d65e8b0da
--- /dev/null
+++ b/test/files/run/macro-undetparams-macroitself/Impls_Macros_1.scala
@@ -0,0 +1,7 @@
+import scala.reflect.makro.Context
+
+object Macros {
+ def impl[T: c.TypeTag](c: Context)(foo: c.Expr[T]): c.Expr[Unit] = c.reify { println(c.literal(implicitly[c.TypeTag[T]].toString).eval) }
+
+ def foo[T](foo: T) = macro impl[T]
+} \ No newline at end of file
diff --git a/test/files/run/macro-undetparams-macroitself/Test_2.scala b/test/files/run/macro-undetparams-macroitself/Test_2.scala
new file mode 100644
index 0000000000..1a93ff1304
--- /dev/null
+++ b/test/files/run/macro-undetparams-macroitself/Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ Macros.foo(42)
+ Macros.foo("42")
+} \ No newline at end of file
diff --git a/test/files/run/manifests.scala b/test/files/run/manifests.scala
index 6b6ea80b34..2d64bf18a9 100644
--- a/test/files/run/manifests.scala
+++ b/test/files/run/manifests.scala
@@ -4,29 +4,29 @@ object Test
val CO, IN, CONTRA = Value
}
import Variances.{ CO, IN, CONTRA }
-
+
object SubtypeRelationship extends Enumeration {
val NONE, SAME, SUB, SUPER = Value
}
import SubtypeRelationship.{ NONE, SAME, SUB, SUPER }
-
+
class VarianceTester[T, U, CC[_]](expected: Variances.Value)(
implicit ev1: Manifest[T], ev2: Manifest[U], ev3: Manifest[CC[T]], ev4: Manifest[CC[U]]) {
-
- def elements = List(ev1 <:< ev2, ev2 <:< ev1)
- def containers = List(ev3 <:< ev4, ev4 <:< ev3)
+
+ def elements = List(ev1.tpe <:< ev2.tpe, ev2.tpe <:< ev1.tpe)
+ def containers = List(ev3.tpe <:< ev4.tpe, ev4.tpe <:< ev3.tpe)
def isUnrelated = typeCompare[T, U] == NONE
def isSame = typeCompare[T, U] == SAME
def isSub = typeCompare[T, U] == SUB
def isSuper = typeCompare[T, U] == SUPER
-
+
def showsCovariance = (elements == containers)
def showsContravariance = (elements == containers.reverse)
def showsInvariance = containers forall (_ == isSame)
def allContainerVariances = List(showsCovariance, showsInvariance, showsContravariance)
-
+
def showsExpectedVariance =
if (isUnrelated) allContainerVariances forall (_ == false)
else if (isSame) allContainerVariances forall (_ == true)
@@ -36,64 +36,57 @@ object Test
case CONTRA => showsContravariance && !showsCovariance && !showsInvariance
}
}
-
+
def showsCovariance[T, U, CC[_]](implicit ev1: Manifest[T], ev2: Manifest[U], ev3: Manifest[CC[T]], ev4: Manifest[CC[U]]) =
new VarianceTester[T, U, CC](CO) showsExpectedVariance
def showsInvariance[T, U, CC[_]](implicit ev1: Manifest[T], ev2: Manifest[U], ev3: Manifest[CC[T]], ev4: Manifest[CC[U]]) =
new VarianceTester[T, U, CC](IN) showsExpectedVariance
-
+
def showsContravariance[T, U, CC[_]](implicit ev1: Manifest[T], ev2: Manifest[U], ev3: Manifest[CC[T]], ev4: Manifest[CC[U]]) =
new VarianceTester[T, U, CC](CONTRA) showsExpectedVariance
-
- def typeCompare[T, U](implicit ev1: Manifest[T], ev2: Manifest[U]) = {
- // checking types as well
- if ((ev1 <:< ev2) != (ev1.tpe <:< ev2.tpe))
- println("Failed! " + ((ev1, ev2)))
-
- if ((ev2 <:< ev1) != (ev2.tpe <:< ev1.tpe))
- println("Failed! " + ((ev2, ev1)))
- (ev1 <:< ev2, ev2 <:< ev1) match {
+ def typeCompare[T, U](implicit ev1: Manifest[T], ev2: Manifest[U]) = {
+ (ev1.tpe <:< ev2.tpe, ev2.tpe <:< ev1.tpe) match {
case (true, true) => SAME
case (true, false) => SUB
case (false, true) => SUPER
case (false, false) => NONE
}
}
-
+
def assertAnyRef[T: Manifest] = List(
- manifest[T] <:< manifest[Any],
- manifest[T] <:< manifest[AnyRef],
- !(manifest[T] <:< manifest[AnyVal])
+ manifest[T].tpe <:< manifest[Any].tpe,
+ manifest[T].tpe <:< manifest[AnyRef].tpe,
+ !(manifest[T].tpe <:< manifest[AnyVal].tpe)
) foreach (assert(_, "assertAnyRef"))
-
+
def assertAnyVal[T: Manifest] = List(
- manifest[T] <:< manifest[Any],
- !(manifest[T] <:< manifest[AnyRef]),
- manifest[T] <:< manifest[AnyVal]
+ manifest[T].tpe <:< manifest[Any].tpe,
+ !(manifest[T].tpe <:< manifest[AnyRef].tpe),
+ manifest[T].tpe <:< manifest[AnyVal].tpe
) foreach (assert(_, "assertAnyVal"))
-
+
def assertSameType[T: Manifest, U: Manifest] = assert(typeCompare[T, U] == SAME, "assertSameType")
def assertSuperType[T: Manifest, U: Manifest] = assert(typeCompare[T, U] == SUPER, "assertSuperType")
def assertSubType[T: Manifest, U: Manifest] = assert(typeCompare[T, U] == SUB, "assertSubType")
def assertNoRelationship[T: Manifest, U: Manifest] = assert(typeCompare[T, U] == NONE, "assertNoRelationship")
-
+
def testVariancesVia[T: Manifest, U: Manifest] = assert(
- typeCompare[T, U] == SUB &&
+ typeCompare[T, U] == SUB &&
showsCovariance[T, U, List] &&
showsInvariance[T, U, Set],
"testVariancesVia"
)
-
+
def runAllTests = {
assertAnyVal[AnyVal]
assertAnyVal[Unit]
- assertAnyVal[Int]
- assertAnyVal[Double]
+ assertAnyVal[Int]
+ assertAnyVal[Double]
assertAnyVal[Boolean]
assertAnyVal[Char]
-
+
assertAnyRef[AnyRef]
assertAnyRef[java.lang.Object]
assertAnyRef[java.lang.Integer]
@@ -103,7 +96,7 @@ object Test
assertAnyRef[String]
assertAnyRef[scala.List[String]]
assertAnyRef[scala.List[_]]
-
+
// variance doesn't work yet
// testVariancesVia[String, Any]
// testVariancesVia[String, AnyRef]
@@ -111,11 +104,11 @@ object Test
assertSubType[List[String], List[Any]]
assertSubType[List[String], List[AnyRef]]
assertNoRelationship[List[String], List[AnyVal]]
-
+
assertSubType[List[Int], List[Any]]
assertSubType[List[Int], List[AnyVal]]
assertNoRelationship[List[Int], List[AnyRef]]
-
+
// Nothing
assertSubType[Nothing, Any]
assertSubType[Nothing, AnyVal]
@@ -124,7 +117,7 @@ object Test
assertSubType[Nothing, List[String]]
assertSubType[Nothing, Null]
assertSameType[Nothing, Nothing]
-
+
// Null
assertSubType[Null, Any]
assertNoRelationship[Null, AnyVal]
@@ -133,7 +126,7 @@ object Test
assertSubType[Null, List[String]]
assertSameType[Null, Null]
assertSuperType[Null, Nothing]
-
+
// Any
assertSameType[Any, Any]
assertSuperType[Any, AnyVal]
@@ -142,7 +135,7 @@ object Test
assertSuperType[Any, List[String]]
assertSuperType[Any, Null]
assertSuperType[Any, Nothing]
-
+
// Misc unrelated types
assertNoRelationship[Unit, AnyRef]
assertNoRelationship[Unit, Int]
diff --git a/test/files/run/patmat_unapp_abstype.check b/test/files/run/patmat_unapp_abstype.check
index ac28ccdb95..72239d16cd 100644
--- a/test/files/run/patmat_unapp_abstype.check
+++ b/test/files/run/patmat_unapp_abstype.check
@@ -1,2 +1,4 @@
TypeRef
none of the above
+Bar
+Foo
diff --git a/test/files/run/patmat_unapp_abstype.flags b/test/files/run/patmat_unapp_abstype.flags
new file mode 100644
index 0000000000..ba80cad69b
--- /dev/null
+++ b/test/files/run/patmat_unapp_abstype.flags
@@ -0,0 +1 @@
+-Xoldpatmat
diff --git a/test/files/run/patmat_unapp_abstype.scala b/test/files/run/patmat_unapp_abstype.scala
index e5adec5c16..45496f08a2 100644
--- a/test/files/run/patmat_unapp_abstype.scala
+++ b/test/files/run/patmat_unapp_abstype.scala
@@ -19,6 +19,11 @@ trait TypesUser extends TypesAPI {
def shouldNotCrash(tp: Type): Unit = {
tp match {
case TypeRef(x) => println("TypeRef")
+ // the above checks tp.isInstanceOf[TypeRef], which is erased to tp.isInstanceOf[Type]
+ // before calling TypeRef.unapply(tp), which will then crash unless tp.isInstanceOf[TypesImpl#TypeRef] (which is not implied by tp.isInstanceOf[Type])
+ // tp.isInstanceOf[TypesImpl#TypeRef] is equivalent to classOf[TypesImpl#TypeRef].isAssignableFrom(tp.getClass)
+ // this is equivalent to manifest
+ // it is NOT equivalent to manifest[Type] <:< typeRefMani
case MethodType(x) => println("MethodType")
case _ => println("none of the above")
}
@@ -32,8 +37,47 @@ trait TypesImpl extends TypesAPI {
//lazy val typeRefMani = manifest[TypeRef]
}
-object Test extends TypesImpl with TypesUser with App {
- shouldNotCrash(TypeRef(10)) // should and does print "TypeRef"
- // once #1697/#2337 are fixed, this should generate the correct output
- shouldNotCrash(MethodType(10)) // should print "MethodType" but prints "none of the above" -- good one, pattern matcher!
-} \ No newline at end of file
+trait Foos {
+ trait Bar
+ type Foo <: Bar
+ trait FooExtractor {
+ def unapply(foo: Foo): Option[Int]
+ }
+ val Foo: FooExtractor
+}
+
+trait RealFoos extends Foos {
+ class Foo(val x: Int) extends Bar
+ object Foo extends FooExtractor {
+ def unapply(foo: Foo): Option[Int] = Some(foo.x)
+ }
+}
+
+trait Intermed extends Foos {
+ def crash(bar: Bar): Unit =
+ bar match {
+ case Foo(x) => println("Foo")
+ case _ => println("Bar")
+ }
+}
+
+object TestUnappStaticallyKnownSynthetic extends TypesImpl with TypesUser {
+ def test() = {
+ shouldNotCrash(TypeRef(10)) // should and does print "TypeRef"
+ // once #1697/#2337 are fixed, this should generate the correct output
+ shouldNotCrash(MethodType(10)) // should print "MethodType" but prints "none of the above" -- good one, pattern matcher!
+ }
+}
+
+object TestUnappDynamicSynth extends RealFoos with Intermed {
+ case class FooToo(n: Int) extends Bar
+ def test() = {
+ crash(FooToo(10))
+ crash(new Foo(5))
+ }
+}
+
+object Test extends App {
+ TestUnappStaticallyKnownSynthetic.test()
+ TestUnappDynamicSynth.test()
+}
diff --git a/test/files/run/primitive-sigs-2.check b/test/files/run/primitive-sigs-2.check
index feb0619525..1b6e24ed20 100644
--- a/test/files/run/primitive-sigs-2.check
+++ b/test/files/run/primitive-sigs-2.check
@@ -1,7 +1,7 @@
-T<java.lang.Object>
-List(A, char, class java.lang.Object)
-a
-public <T> java.lang.Object Arr.arr4(java.lang.Object[],scala.reflect.Manifest<T>)
-public float[] Arr.arr3(float[][])
-public scala.collection.immutable.List<java.lang.Character> Arr.arr2(java.lang.Character[])
-public scala.collection.immutable.List<java.lang.Object> Arr.arr1(int[])
+T<java.lang.Object>
+List(A, char, class java.lang.Object)
+a
+public <T> java.lang.Object Arr.arr4(java.lang.Object[],scala.reflect.api.TypeTags.scala.reflect.api.TypeTags$ConcreteTypeTag<T>)
+public float[] Arr.arr3(float[][])
+public scala.collection.immutable.List<java.lang.Character> Arr.arr2(java.lang.Character[])
+public scala.collection.immutable.List<java.lang.Object> Arr.arr1(int[])
diff --git a/test/files/run/reify_ann1a.check b/test/files/run/reify_ann1a.check
index 66dce778a8..a3944ae1ee 100644
--- a/test/files/run/reify_ann1a.check
+++ b/test/files/run/reify_ann1a.check
@@ -1,30 +1,30 @@
-{
- @new ann(immutable.this.List.apply[String]("1a")) @new ann(immutable.this.List.apply[String]("1b")) class C[@new ann(immutable.this.List.apply[String]("2a")) @new ann(immutable.this.List.apply[String]("2b")) T] extends scala.AnyRef {
- @new ann(immutable.this.List.apply[String]("3a")) @new ann(immutable.this.List.apply[String]("3b")) <paramaccessor> private[this] val x: T @ann(immutable.this.List.apply[String]("4a")) @ann(immutable.this.List.apply[String]("4b")) = _;
- def <init>(@new ann(immutable.this.List.apply[String]("3a")) @new ann(immutable.this.List.apply[String]("3b")) x: T @ann(immutable.this.List.apply[String]("4a")) @ann(immutable.this.List.apply[String]("4b"))) = {
- super.<init>();
- ()
- };
- @new ann(immutable.this.List.apply[String]("5a")) @new ann(immutable.this.List.apply[String]("5b")) def f(x: Int @ann(immutable.this.List.apply[String]("6b")) @ann(immutable.this.List.apply[String]("6a"))): Int = {
- @new ann(immutable.this.List.apply[String]("7a")) @new ann(immutable.this.List.apply[String]("7b")) val r: Int @ann(immutable.this.List.apply[String]("8b")) @ann(immutable.this.List.apply[String]("8a")) = ((x.$plus(3): Int @ann(immutable.this.List.apply[String]("8a"))): Int @ann(immutable.this.List.apply[String]("8b")) @ann(immutable.this.List.apply[String]("8a")));
- val s: Int @ann(immutable.this.List.apply[String]("9b")) @ann(immutable.this.List.apply[String]("9a")) = (4: Int @ann(immutable.this.List.apply[String]("9b")) @ann(immutable.this.List.apply[String]("9a")));
- r.$plus(s)
- }
- };
- ()
-}
-{
- @ann(immutable.this.List.apply[String]("1a")) @ann(immutable.this.List.apply[String]("1b")) class C[@ann(immutable.this.List.apply[String]("2a")) @ann(immutable.this.List.apply[String]("2b")) T] extends scala.AnyRef {
- @ann(immutable.this.List.apply[String]("3a")) @ann(immutable.this.List.apply[String]("3b")) <paramaccessor> private[this] val x: T @ann(immutable.this.List.apply[String]("4b")) @ann(immutable.this.List.apply[String]("4a")) = _;
- def <init>(@ann(immutable.this.List.apply[String]("3a")) @ann(immutable.this.List.apply[String]("3b")) x: T @ann(immutable.this.List.apply[String]("4b")) @ann(immutable.this.List.apply[String]("4a"))): C[T] = {
- C.super.<init>();
- ()
- };
- @ann(immutable.this.List.apply[String]("5a")) @ann(immutable.this.List.apply[String]("5b")) def f(x: Int @ann(immutable.this.List.apply[String]("6b")) @ann(immutable.this.List.apply[String]("6a"))): Int = {
- @ann(immutable.this.List.apply[String]("7a")) @ann(immutable.this.List.apply[String]("7b")) val r: Int @ann(immutable.this.List.apply[String]("8b")) @ann(immutable.this.List.apply[String]("8a")) = ((x.+(3): Int @ann(immutable.this.List.apply[String]("8a"))): Int @ann(immutable.this.List.apply[String]("8b")) @ann(immutable.this.List.apply[String]("8a")));
- val s: Int @ann(immutable.this.List.apply[String]("9b")) @ann(immutable.this.List.apply[String]("9a")) = (4: Int @ann(immutable.this.List.apply[String]("9b")) @ann(immutable.this.List.apply[String]("9a")));
- r.+(s)
- }
- };
- ()
-}
+{
+ @new ann(immutable.this.List.apply("1a")) @new ann(immutable.this.List.apply("1b")) class C[@new ann(immutable.this.List.apply("2a")) @new ann(immutable.this.List.apply("2b")) T >: Nothing <: Any] extends Object {
+ @new ann(immutable.this.List.apply("3a")) @new ann(immutable.this.List.apply("3b")) <paramaccessor> private[this] val x: T @ann(immutable.this.List.apply("4a")) @ann(immutable.this.List.apply("4b")) = _;
+ def <init>(@new ann(immutable.this.List.apply("3a")) @new ann(immutable.this.List.apply("3b")) x: T @ann(immutable.this.List.apply("4a")) @ann(immutable.this.List.apply("4b"))) = {
+ super.<init>();
+ ()
+ };
+ @new ann(immutable.this.List.apply("5a")) @new ann(immutable.this.List.apply("5b")) def f(x: Int @ann(immutable.this.List.apply("6a")) @ann(immutable.this.List.apply("6b"))) = {
+ @new ann(immutable.this.List.apply("7a")) @new ann(immutable.this.List.apply("7b")) val r = x.$plus(3): @ann(immutable.this.List.apply("8a")): @ann(immutable.this.List.apply("8b"));
+ val s = (4: Int @ann(immutable.this.List.apply("9a")) @ann(immutable.this.List.apply("9b")));
+ r.$plus(s)
+ }
+ };
+ ()
+}
+{
+ @ann(immutable.this.List.apply[String]("1a")) @ann(immutable.this.List.apply[String]("1b")) class C[@ann(immutable.this.List.apply[String]("2a")) @ann(immutable.this.List.apply[String]("2b")) T] extends Object {
+ @ann(immutable.this.List.apply[String]("3a")) @ann(immutable.this.List.apply[String]("3b")) <paramaccessor> private[this] val x: T @ann(immutable.this.List.apply[String]("4b")) @ann(immutable.this.List.apply[String]("4a")) = _;
+ def <init>(@ann(immutable.this.List.apply[String]("3a")) @ann(immutable.this.List.apply[String]("3b")) x: T @ann(immutable.this.List.apply[String]("4b")) @ann(immutable.this.List.apply[String]("4a"))): C[T] = {
+ C.super.<init>();
+ ()
+ };
+ @ann(immutable.this.List.apply[String]("5a")) @ann(immutable.this.List.apply[String]("5b")) def f(x: Int @ann(immutable.this.List.apply[String]("6b")) @ann(immutable.this.List.apply[String]("6a"))): Int = {
+ @ann(immutable.this.List.apply[String]("7a")) @ann(immutable.this.List.apply[String]("7b")) val r: Int @ann(immutable.this.List.apply[String]("8b")) @ann(immutable.this.List.apply[String]("8a")) = ((x.+(3): Int @ann(immutable.this.List.apply[String]("8a"))): Int @ann(immutable.this.List.apply[String]("8b")) @ann(immutable.this.List.apply[String]("8a")));
+ val s: Int @ann(immutable.this.List.apply[String]("9b")) @ann(immutable.this.List.apply[String]("9a")) = (4: Int @ann(immutable.this.List.apply[String]("9b")) @ann(immutable.this.List.apply[String]("9a")));
+ r.+(s)
+ }
+ };
+ ()
+}
diff --git a/test/files/run/reify_ann1a.scala b/test/files/run/reify_ann1a.scala
index 1ca170904b..1f5d1daccd 100644
--- a/test/files/run/reify_ann1a.scala
+++ b/test/files/run/reify_ann1a.scala
@@ -1,14 +1,10 @@
-import scala.reflect._
-import scala.reflect.api._
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
class ann(bar: List[String]) extends StaticAnnotation
object Test extends App {
// test 1: reify
- val tree = scala.reflect.Code.lift{
+ val tree = reify{
@ann(bar=List("1a")) @ann(bar=List("1b")) class C[@ann(bar=List("2a")) @ann(bar=List("2b")) T](@ann(bar=List("3a")) @ann(bar=List("3b")) x: T @ann(bar=List("4a")) @ann(bar=List("4b"))) {
@ann(bar=List("5a")) @ann(bar=List("5b")) def f(x: Int @ann(bar=List("6a")) @ann(bar=List("6b"))) = {
@ann(bar=List("7a")) @ann(bar=List("7b")) val r = (x + 3): @ann(bar=List("8a")) @ann(bar=List("8b"))
@@ -20,8 +16,7 @@ object Test extends App {
println(tree.toString)
// test 2: import and typecheck
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val ttree = toolbox.typeCheck(tree)
println(ttree.toString)
diff --git a/test/files/run/reify_ann1b.check b/test/files/run/reify_ann1b.check
index 9bc65a422e..bae838f15f 100644
--- a/test/files/run/reify_ann1b.check
+++ b/test/files/run/reify_ann1b.check
@@ -1,30 +1,30 @@
-{
- @new ann(bar = "1a") @new ann(bar = "1b") class C[@new ann(bar = "2a") @new ann(bar = "2b") T] extends scala.AnyRef {
- @new ann(bar = "3a") @new ann(bar = "3b") <paramaccessor> private[this] val x: T @ann(bar = "4a") @ann(bar = "4b") = _;
- def <init>(@new ann(bar = "3a") @new ann(bar = "3b") x: T @ann(bar = "4a") @ann(bar = "4b")) = {
- super.<init>();
- ()
- };
- @new ann(bar = "5a") @new ann(bar = "5b") def f(x: Int @ann(bar = "6b") @ann(bar = "6a")): Int = {
- @new ann(bar = "7a") @new ann(bar = "7b") val r: Int @ann(bar = "8b") @ann(bar = "8a") = ((x.$plus(3): Int @ann(bar = "8a")): Int @ann(bar = "8b") @ann(bar = "8a"));
- val s: Int @ann(bar = "9b") @ann(bar = "9a") = (4: Int @ann(bar = "9b") @ann(bar = "9a"));
- r.$plus(s)
- }
- };
- ()
-}
-{
- @ann(bar = "1a") @ann(bar = "1b") class C[@ann(bar = "2a") @ann(bar = "2b") T] extends scala.AnyRef {
- @ann(bar = "3a") @ann(bar = "3b") <paramaccessor> private[this] val x: T @ann(bar = "4b") @ann(bar = "4a") = _;
- def <init>(@ann(bar = "3a") @ann(bar = "3b") x: T @ann(bar = "4b") @ann(bar = "4a")): C[T] = {
- C.super.<init>();
- ()
- };
- @ann(bar = "5a") @ann(bar = "5b") def f(x: Int @ann(bar = "6b") @ann(bar = "6a")): Int = {
- @ann(bar = "7a") @ann(bar = "7b") val r: Int @ann(bar = "8b") @ann(bar = "8a") = ((x.+(3): Int @ann(bar = "8a")): Int @ann(bar = "8b") @ann(bar = "8a"));
- val s: Int @ann(bar = "9b") @ann(bar = "9a") = (4: Int @ann(bar = "9b") @ann(bar = "9a"));
- r.+(s)
- }
- };
- ()
-}
+{
+ @new ann(bar = "1a") @new ann(bar = "1b") class C[@new ann(bar = "2a") @new ann(bar = "2b") T >: Nothing <: Any] extends Object {
+ @new ann(bar = "3a") @new ann(bar = "3b") <paramaccessor> private[this] val x: T @ann(bar = "4a") @ann(bar = "4b") = _;
+ def <init>(@new ann(bar = "3a") @new ann(bar = "3b") x: T @ann(bar = "4a") @ann(bar = "4b")) = {
+ super.<init>();
+ ()
+ };
+ @new ann(bar = "5a") @new ann(bar = "5b") def f(x: Int @ann(bar = "6a") @ann(bar = "6b")) = {
+ @new ann(bar = "7a") @new ann(bar = "7b") val r = x.$plus(3): @ann(bar = "8a"): @ann(bar = "8b");
+ val s = (4: Int @ann(bar = "9a") @ann(bar = "9b"));
+ r.$plus(s)
+ }
+ };
+ ()
+}
+{
+ @ann(bar = "1a") @ann(bar = "1b") class C[@ann(bar = "2a") @ann(bar = "2b") T] extends Object {
+ @ann(bar = "3a") @ann(bar = "3b") <paramaccessor> private[this] val x: T @ann(bar = "4b") @ann(bar = "4a") = _;
+ def <init>(@ann(bar = "3a") @ann(bar = "3b") x: T @ann(bar = "4b") @ann(bar = "4a")): C[T] = {
+ C.super.<init>();
+ ()
+ };
+ @ann(bar = "5a") @ann(bar = "5b") def f(x: Int @ann(bar = "6b") @ann(bar = "6a")): Int = {
+ @ann(bar = "7a") @ann(bar = "7b") val r: Int @ann(bar = "8b") @ann(bar = "8a") = ((x.+(3): Int @ann(bar = "8a")): Int @ann(bar = "8b") @ann(bar = "8a"));
+ val s: Int @ann(bar = "9b") @ann(bar = "9a") = (4: Int @ann(bar = "9b") @ann(bar = "9a"));
+ r.+(s)
+ }
+ };
+ ()
+}
diff --git a/test/files/run/reify_ann1b.scala b/test/files/run/reify_ann1b.scala
index 9bdc712227..13d861a15c 100644
--- a/test/files/run/reify_ann1b.scala
+++ b/test/files/run/reify_ann1b.scala
@@ -1,14 +1,10 @@
-import scala.reflect._
-import scala.reflect.api._
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
class ann(bar: String) extends ClassfileAnnotation
object Test extends App {
// test 1: reify
- val tree = scala.reflect.Code.lift{
+ val tree = reify{
@ann(bar="1a") @ann(bar="1b") class C[@ann(bar="2a") @ann(bar="2b") T](@ann(bar="3a") @ann(bar="3b") x: T @ann(bar="4a") @ann(bar="4b")) {
@ann(bar="5a") @ann(bar="5b") def f(x: Int @ann(bar="6a") @ann(bar="6b")) = {
@ann(bar="7a") @ann(bar="7b") val r = (x + 3): @ann(bar="8a") @ann(bar="8b")
@@ -20,8 +16,7 @@ object Test extends App {
println(tree.toString)
// test 2: import and typecheck
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val ttree = toolbox.typeCheck(tree)
println(ttree.toString)
diff --git a/test/files/run/reify_ann2a.check b/test/files/run/reify_ann2a.check
new file mode 100644
index 0000000000..5022c50ca8
--- /dev/null
+++ b/test/files/run/reify_ann2a.check
@@ -0,0 +1,44 @@
+{
+ class ann extends StaticAnnotation {
+ <paramaccessor> private[this] val bar: List[String] = _;
+ def <init>(bar: List[String]) = {
+ super.<init>();
+ ()
+ }
+ };
+ @new ann(immutable.this.List.apply("1a")) @new ann(immutable.this.List.apply("1b")) class C[@new ann(immutable.this.List.apply("2a")) @new ann(immutable.this.List.apply("2b")) T >: Nothing <: Any] extends Object {
+ @new ann(immutable.this.List.apply("3a")) @new ann(immutable.this.List.apply("3b")) <paramaccessor> private[this] val x: T @ann(immutable.this.List.apply("4a")) @ann(immutable.this.List.apply("4b")) = _;
+ def <init>(@new ann(immutable.this.List.apply("3a")) @new ann(immutable.this.List.apply("3b")) x: T @ann(immutable.this.List.apply("4a")) @ann(immutable.this.List.apply("4b"))) = {
+ super.<init>();
+ ()
+ };
+ @new ann(immutable.this.List.apply("5a")) @new ann(immutable.this.List.apply("5b")) def f(x: Int @ann(immutable.this.List.apply("6a")) @ann(immutable.this.List.apply("6b"))) = {
+ @new ann(immutable.this.List.apply("7a")) @new ann(immutable.this.List.apply("7b")) val r = x.$plus(3): @ann(immutable.this.List.apply("8a")): @ann(immutable.this.List.apply("8b"));
+ val s = (4: Int @ann(immutable.this.List.apply("9a")) @ann(immutable.this.List.apply("9b")));
+ r.$plus(s)
+ }
+ };
+ ()
+}
+{
+ class ann extends scala.annotation.Annotation with scala.annotation.StaticAnnotation {
+ <paramaccessor> private[this] val bar: List[String] = _;
+ def <init>(bar: List[String]): ann = {
+ ann.super.<init>();
+ ()
+ }
+ };
+ @ann(immutable.this.List.apply[String]("1a")) @ann(immutable.this.List.apply[String]("1b")) class C[@ann(immutable.this.List.apply[String]("2a")) @ann(immutable.this.List.apply[String]("2b")) T] extends Object {
+ @ann(immutable.this.List.apply[String]("3a")) @ann(immutable.this.List.apply[String]("3b")) <paramaccessor> private[this] val x: T @ann(immutable.this.List.apply[String]("4b")) @ann(immutable.this.List.apply[String]("4a")) = _;
+ def <init>(@ann(immutable.this.List.apply[String]("3a")) @ann(immutable.this.List.apply[String]("3b")) x: T @ann(immutable.this.List.apply[String]("4b")) @ann(immutable.this.List.apply[String]("4a"))): C[T] = {
+ C.super.<init>();
+ ()
+ };
+ @ann(immutable.this.List.apply[String]("5a")) @ann(immutable.this.List.apply[String]("5b")) def f(x: Int @ann(immutable.this.List.apply[String]("6b")) @ann(immutable.this.List.apply[String]("6a"))): Int = {
+ @ann(immutable.this.List.apply[String]("7a")) @ann(immutable.this.List.apply[String]("7b")) val r: Int @ann(immutable.this.List.apply[String]("8b")) @ann(immutable.this.List.apply[String]("8a")) = ((x.+(3): Int @ann(immutable.this.List.apply[String]("8a"))): Int @ann(immutable.this.List.apply[String]("8b")) @ann(immutable.this.List.apply[String]("8a")));
+ val s: Int @ann(immutable.this.List.apply[String]("9b")) @ann(immutable.this.List.apply[String]("9a")) = (4: Int @ann(immutable.this.List.apply[String]("9b")) @ann(immutable.this.List.apply[String]("9a")));
+ r.+(s)
+ }
+ };
+ ()
+}
diff --git a/test/files/neg/reify_ann2a.scala b/test/files/run/reify_ann2a.scala
index 8de0984074..370abadba0 100644
--- a/test/files/neg/reify_ann2a.scala
+++ b/test/files/run/reify_ann2a.scala
@@ -1,12 +1,8 @@
-import scala.reflect._
-import scala.reflect.api._
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
// test 1: reify
- val tree = scala.reflect.Code.lift{
+ val tree = reify{
class ann(bar: List[String]) extends StaticAnnotation
@ann(bar=List("1a")) @ann(bar=List("1b")) class C[@ann(bar=List("2a")) @ann(bar=List("2b")) T](@ann(bar=List("3a")) @ann(bar=List("3b")) x: T @ann(bar=List("4a")) @ann(bar=List("4b"))) {
@@ -20,8 +16,7 @@ object Test extends App {
println(tree.toString)
// test 2: import and typecheck
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val ttree = toolbox.typeCheck(tree)
println(ttree.toString)
diff --git a/test/files/run/reify_ann3.check b/test/files/run/reify_ann3.check
new file mode 100644
index 0000000000..9452a9701e
--- /dev/null
+++ b/test/files/run/reify_ann3.check
@@ -0,0 +1,21 @@
+{
+ class Tree[A >: Nothing <: Any, B >: Nothing <: Any] extends Object {
+ @new inline @getter() final <paramaccessor> val key: A = _;
+ def <init>(key: A) = {
+ super.<init>();
+ ()
+ }
+ };
+ ()
+}
+{
+ class Tree[A, B] extends Object {
+ final <paramaccessor> private[this] val key: A = _;
+ @inline @scala.annotation.meta.getter final <stable> <accessor> <paramaccessor> def key: A = Tree.this.key;
+ def <init>(key: A): Tree[A,B] = {
+ Tree.super.<init>();
+ ()
+ }
+ };
+ ()
+}
diff --git a/test/files/run/reify_ann3.scala b/test/files/run/reify_ann3.scala
new file mode 100644
index 0000000000..d65e641619
--- /dev/null
+++ b/test/files/run/reify_ann3.scala
@@ -0,0 +1,19 @@
+import scala.reflect.mirror._
+import scala.annotation._
+import scala.annotation.meta._
+
+object Test extends App {
+ // test 1: reify
+ val tree = reify{
+ class Tree[A, +B](@(inline @getter) final val key: A)
+ }.tree
+ println(tree.toString)
+
+ // test 2: import and typecheck
+ val toolbox = mkToolBox()
+ val ttree = toolbox.typeCheck(tree)
+ println(ttree.toString)
+
+ // test 3: import and compile
+ toolbox.runExpr(tree)
+}
diff --git a/test/files/run/reify_ann4.check b/test/files/run/reify_ann4.check
new file mode 100644
index 0000000000..406ee7bc08
--- /dev/null
+++ b/test/files/run/reify_ann4.check
@@ -0,0 +1,32 @@
+{
+ class D extends StaticAnnotation {
+ def <init>() = {
+ super.<init>();
+ ()
+ }
+ };
+ class C extends Object {
+ def <init>() = {
+ super.<init>();
+ ()
+ }
+ };
+ val c1 = new C @D();
+ ()
+}
+{
+ class D extends scala.annotation.Annotation with scala.annotation.StaticAnnotation {
+ def <init>(): D = {
+ D.super.<init>();
+ ()
+ }
+ };
+ class C extends Object {
+ def <init>(): C = {
+ C.super.<init>();
+ ()
+ }
+ };
+ val c1: C = new C @D();
+ ()
+}
diff --git a/test/files/run/reify_ann4.scala b/test/files/run/reify_ann4.scala
new file mode 100644
index 0000000000..5655812689
--- /dev/null
+++ b/test/files/run/reify_ann4.scala
@@ -0,0 +1,23 @@
+import scala.reflect.mirror._
+import scala.annotation._
+import scala.annotation.meta._
+
+object Test extends App {
+ // test 1: reify
+ val tree = reify{
+ class D extends StaticAnnotation
+ class C
+ val c1 = new C @D
+ //val c2 = (new C) @D // illegal syntax
+ //val c3 = c1 @D // illegal syntax
+ }.tree
+ println(tree.toString)
+
+ // test 2: import and typecheck
+ val toolbox = mkToolBox()
+ val ttree = toolbox.typeCheck(tree)
+ println(ttree.toString)
+
+ // test 3: import and compile
+ toolbox.runExpr(tree)
+}
diff --git a/test/files/run/reify_ann5.check b/test/files/run/reify_ann5.check
new file mode 100644
index 0000000000..ecf08eebb2
--- /dev/null
+++ b/test/files/run/reify_ann5.check
@@ -0,0 +1,22 @@
+{
+ class C extends Object {
+ @new inline @beanGetter() @new BeanProperty() <paramaccessor> val x: Int = _;
+ def <init>(x: Int) = {
+ super.<init>();
+ ()
+ }
+ };
+ ()
+}
+{
+ class C extends Object {
+ @scala.beans.BeanProperty <paramaccessor> private[this] val x: Int = _;
+ <stable> <accessor> <paramaccessor> def x: Int = C.this.x;
+ def <init>(x: Int): C = {
+ C.super.<init>();
+ ()
+ };
+ @inline @scala.annotation.meta.beanGetter def getX(): Int = C.this.x
+ };
+ ()
+}
diff --git a/test/files/run/reify_ann5.scala b/test/files/run/reify_ann5.scala
new file mode 100644
index 0000000000..aecc61de46
--- /dev/null
+++ b/test/files/run/reify_ann5.scala
@@ -0,0 +1,20 @@
+import scala.reflect.mirror._
+import scala.annotation._
+import scala.annotation.meta._
+import scala.beans._
+
+object Test extends App {
+ // test 1: reify
+ val tree = reify{
+ class C(@BeanProperty @(inline @beanGetter) val x: Int)
+ }.tree
+ println(tree.toString)
+
+ // test 2: import and typecheck
+ val toolbox = mkToolBox()
+ val ttree = toolbox.typeCheck(tree)
+ println(ttree.toString)
+
+ // test 3: import and compile
+ toolbox.runExpr(tree)
+}
diff --git a/test/files/run/reify_anonymous.scala b/test/files/run/reify_anonymous.scala
index af16f2f8fd..cd740f0190 100644
--- a/test/files/run/reify_anonymous.scala
+++ b/test/files/run/reify_anonymous.scala
@@ -1,13 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
println(new {def x = 2; def y = x * x}.y)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/reify_classfileann_a.check b/test/files/run/reify_classfileann_a.check
index 419d916907..685ecf5de6 100644
--- a/test/files/run/reify_classfileann_a.check
+++ b/test/files/run/reify_classfileann_a.check
@@ -1,18 +1,18 @@
-{
- @new ann(bar = "1", quux = Array("2", "3"), baz = new ann(bar = "4")) class C extends scala.AnyRef {
- def <init>() = {
- super.<init>();
- ()
- }
- };
- ()
-}
-{
- @ann(bar = "1", quux = ["2", "3"], baz = ann(bar = "4")) class C extends scala.AnyRef {
- def <init>(): C = {
- C.super.<init>();
- ()
- }
- };
- ()
-}
+{
+ @new ann(bar = "1", quux = Array("2", "3"), baz = new ann(bar = "4")) class C extends Object {
+ def <init>() = {
+ super.<init>();
+ ()
+ }
+ };
+ ()
+}
+{
+ @ann(bar = "1", quux = ["2", "3"], baz = ann(bar = "4")) class C extends Object {
+ def <init>(): C = {
+ C.super.<init>();
+ ()
+ }
+ };
+ ()
+}
diff --git a/test/files/run/reify_classfileann_a.scala b/test/files/run/reify_classfileann_a.scala
index c77bd3b8a2..c3e7d8d2e9 100644
--- a/test/files/run/reify_classfileann_a.scala
+++ b/test/files/run/reify_classfileann_a.scala
@@ -1,21 +1,16 @@
-import scala.reflect._
-import scala.reflect.api._
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends ClassfileAnnotation
object Test extends App {
// test 1: reify
- val tree = scala.reflect.Code.lift{
+ val tree = reify{
@ann(bar="1", quux=Array("2", "3"), baz = new ann(bar = "4")) class C
}.tree
println(tree.toString)
// test 2: import and typecheck
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val ttree = toolbox.typeCheck(tree)
println(ttree.toString)
diff --git a/test/files/run/reify_classfileann_b.check b/test/files/run/reify_classfileann_b.check
new file mode 100644
index 0000000000..0aac9aeb2a
--- /dev/null
+++ b/test/files/run/reify_classfileann_b.check
@@ -0,0 +1,20 @@
+{
+ class C extends Object {
+ def <init>() = {
+ super.<init>();
+ ()
+ };
+ def x: Int = 2: @ann(bar = "1",quux = Array("2", "3"),baz = new ann(bar = "4"))
+ };
+ ()
+}
+{
+ class C extends Object {
+ def <init>(): C = {
+ C.super.<init>();
+ ()
+ };
+ def x: Int = (2: Int(2) @ann(bar = "1", quux = ["2", "3"], baz = ann(bar = "4")))
+ };
+ ()
+}
diff --git a/test/pending/run/reify_classfileann_b.scala b/test/files/run/reify_classfileann_b.scala
index c31826377a..4e50494af3 100644
--- a/test/pending/run/reify_classfileann_b.scala
+++ b/test/files/run/reify_classfileann_b.scala
@@ -1,14 +1,10 @@
-import scala.reflect._
-import scala.reflect.api._
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends ClassfileAnnotation
object Test extends App {
// test 1: reify
- val tree = scala.reflect.Code.lift{
+ val tree = reify{
class C {
def x: Int = {
2: @ann(bar="1", quux=Array("2", "3"), baz = new ann(bar = "4"))
@@ -17,8 +13,11 @@ object Test extends App {
}.tree
println(tree.toString)
- // test 2: import and compile
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ // test 2: import and typecheck
+ val toolbox = mkToolBox()
+ val ttree = toolbox.typeCheck(tree)
+ println(ttree.toString)
+
+ // test 3: import and compile
toolbox.runExpr(tree)
} \ No newline at end of file
diff --git a/test/files/run/reify_closure1.scala b/test/files/run/reify_closure1.scala
index 7cb3aff17d..3f5c8a8724 100644
--- a/test/files/run/reify_closure1.scala
+++ b/test/files/run/reify_closure1.scala
@@ -1,15 +1,12 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
def foo[T](ys: List[T]): Int => Int = {
- val fun = reflect.Code.lift{(x: Int) => {
+ val fun = reify{(x: Int) => {
x
}}
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val dyn = toolbox.runExpr(fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/files/run/reify_closure2a.scala b/test/files/run/reify_closure2a.scala
index cf367aa63f..f5669a0e2c 100644
--- a/test/files/run/reify_closure2a.scala
+++ b/test/files/run/reify_closure2a.scala
@@ -1,15 +1,12 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
def foo(y: Int): Int => Int = {
- val fun = reflect.Code.lift{(x: Int) => {
+ val fun = reify{(x: Int) => {
x + y
}}
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val dyn = toolbox.runExpr(fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/files/run/reify_closure3a.scala b/test/files/run/reify_closure3a.scala
index d322b970b6..056a705d7d 100644
--- a/test/files/run/reify_closure3a.scala
+++ b/test/files/run/reify_closure3a.scala
@@ -1,17 +1,14 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
def foo(y: Int): Int => Int = {
def y1 = y
- val fun = reflect.Code.lift{(x: Int) => {
+ val fun = reify{(x: Int) => {
x + y1
}}
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val dyn = toolbox.runExpr(fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/files/run/reify_closure4a.scala b/test/files/run/reify_closure4a.scala
index bbedd7e092..a63d20e561 100644
--- a/test/files/run/reify_closure4a.scala
+++ b/test/files/run/reify_closure4a.scala
@@ -1,17 +1,14 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
def foo(y: Int): Int => Int = {
val y1 = y
- val fun = reflect.Code.lift{(x: Int) => {
+ val fun = reify{(x: Int) => {
x + y1
}}
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val dyn = toolbox.runExpr(fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/files/run/reify_closure5a.scala b/test/files/run/reify_closure5a.scala
index 193e18103a..2e8b413f4c 100644
--- a/test/files/run/reify_closure5a.scala
+++ b/test/files/run/reify_closure5a.scala
@@ -1,19 +1,18 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- def foo[T](ys: List[T]): Int => Int = {
- val fun = reflect.Code.lift{(x: Int) => {
+ def foo[T: TypeTag](ys: List[T]): Int => Int = {
+ val fun = reify{(x: Int) => {
x + ys.length
}}
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val dyn = toolbox.runExpr(fun.tree)
dyn.asInstanceOf[Int => Int]
}
- println(foo(List(1, 2, 3))(10))
- println(foo(List(1, 2, 3, 4))(10))
+ var fun1 = foo(List(1, 2, 3))
+ println(fun1(10))
+ var fun2 = foo(List(1, 2, 3, 4))
+ println(fun2(10))
}
diff --git a/test/files/run/reify_closure6.scala b/test/files/run/reify_closure6.scala
index 6aff83cb94..2cbd4ce819 100644
--- a/test/files/run/reify_closure6.scala
+++ b/test/files/run/reify_closure6.scala
@@ -1,13 +1,11 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
var q = 0
- def foo[T](ys: List[T]): Int => Int = {
+ def foo[T: TypeTag](ys: List[T]): Int => Int = {
val z = 1
var y = 0
- val fun = reflect.Code.lift{(x: Int) => {
+ val fun = reify{(x: Int) => {
y += 1
q += 1
println("q = " + q)
@@ -15,13 +13,14 @@ object Test extends App {
x + ys.length * z + q + y
}}
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val dyn = toolbox.runExpr(fun.tree)
dyn.asInstanceOf[Int => Int]
}
- println("first invocation = " + foo(List(1, 2, 3))(10))
- println("second invocation = " + foo(List(1, 2, 3, 4))(10))
+ val fun1 = foo(List(1, 2, 3))
+ println("first invocation = " + fun1(10))
+ val fun2 = foo(List(1, 2, 3, 4))
+ println("second invocation = " + fun2(10))
println("q after second invocation = " + q)
} \ No newline at end of file
diff --git a/test/files/run/reify_closure7.scala b/test/files/run/reify_closure7.scala
index 46002d8d6c..b9f87dbdeb 100644
--- a/test/files/run/reify_closure7.scala
+++ b/test/files/run/reify_closure7.scala
@@ -1,14 +1,12 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
var q = 0
var clo: Int => Int = null
- def foo[T](ys: List[T]): Int => Int = {
+ def foo[T: TypeTag](ys: List[T]): Int => Int = {
val z = 1
var y = 0
- val fun = reflect.Code.lift{(x: Int) => {
+ val fun = reify{(x: Int) => {
y += 1
q += 1
println("q = " + q)
@@ -17,8 +15,7 @@ object Test extends App {
}}
if (clo == null) {
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val dyn = toolbox.runExpr(fun.tree)
clo = dyn.asInstanceOf[Int => Int]
}
@@ -26,6 +23,8 @@ object Test extends App {
clo
}
- println("first invocation = " + foo(List(1, 2, 3))(10))
- println("second invocation = " + foo(List(1, 2, 3, 4))(10))
+ val fun1 = foo(List(1, 2, 3))
+ println("first invocation = " + fun1(10))
+ val fun2 = foo(List(1, 2, 3, 4))
+ println("second invocation = " + fun2(10))
}
diff --git a/test/files/run/reify_closure8a.scala b/test/files/run/reify_closure8a.scala
index 805d8ff855..9de121b42f 100644
--- a/test/files/run/reify_closure8a.scala
+++ b/test/files/run/reify_closure8a.scala
@@ -1,15 +1,11 @@
-import scala.reflect.Code._
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
class Foo(val y: Int) {
- def fun = lift{y}
+ def fun = reify{y}
}
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val dyn = toolbox.runExpr(new Foo(10).fun.tree)
val foo = dyn.asInstanceOf[Int]
println(foo)
diff --git a/test/files/run/reify_closure8b.check b/test/files/run/reify_closure8b.check
new file mode 100644
index 0000000000..e0ec7d2c8f
--- /dev/null
+++ b/test/files/run/reify_closure8b.check
@@ -0,0 +1,3 @@
+scala.reflect.runtime.ToolBoxes$ToolBox$ToolBoxError: reflective compilation has failed:
+
+value y is not a member of Test.Foo
diff --git a/test/files/run/reify_closure8b.scala b/test/files/run/reify_closure8b.scala
new file mode 100644
index 0000000000..431da3230e
--- /dev/null
+++ b/test/files/run/reify_closure8b.scala
@@ -0,0 +1,18 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ // will fail because y is a private field
+ // reification doesn't magically make unavailable stuff available
+ class Foo(y: Int) {
+ def fun = reify{y}
+ }
+
+ try {
+ val dyn = mkToolBox().runExpr(new Foo(10).fun.tree)
+ val foo = dyn.asInstanceOf[Int]
+ println(foo)
+ } catch {
+ case ex: Throwable =>
+ println(ex)
+ }
+}
diff --git a/test/files/run/reify_closures10.scala b/test/files/run/reify_closures10.scala
index b6ec8e8911..0ccce77a94 100644
--- a/test/files/run/reify_closures10.scala
+++ b/test/files/run/reify_closures10.scala
@@ -1,14 +1,10 @@
-import scala.reflect.Code._
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
val x = 2
val y = 3
- val code = lift{println(x + y); x + y}
+ val code = reify{println(x + y); x + y}
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
println(toolbox.runExpr(code.tree))
}
diff --git a/test/files/run/reify_complex.scala b/test/files/run/reify_complex.scala
index 0d9aeb28c5..ecc25ffca5 100644
--- a/test/files/run/reify_complex.scala
+++ b/test/files/run/reify_complex.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
class Complex(val re: Double, val im: Double) {
def + (that: Complex) =
new Complex(re + that.re, im + that.im)
@@ -22,9 +20,5 @@ object Test extends App {
}
val x = new Complex(2, 1); val y = new Complex(1, 3)
println(x + y)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/reify_extendbuiltins.scala b/test/files/run/reify_extendbuiltins.scala
index 0aaec7cdf2..f95e9ab6ec 100644
--- a/test/files/run/reify_extendbuiltins.scala
+++ b/test/files/run/reify_extendbuiltins.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
def fact(n: Int): BigInt =
if (n == 0) 1 else fact(n-1) * n
class Factorizer(n: Int) {
@@ -12,9 +10,5 @@ object Test extends App {
implicit def int2fact(n: Int) = new Factorizer(n)
println("10! = " + (10!))
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/reify_for1.scala b/test/files/run/reify_for1.scala
index d1b60d878b..9d1e32f7e5 100644
--- a/test/files/run/reify_for1.scala
+++ b/test/files/run/reify_for1.scala
@@ -1,15 +1,9 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
val sumOfSquares1 = (for (i <- 1 to 100; if (i % 3 == 0)) yield Math.pow(i, 2)).sum
val sumOfSquares2 = (1 to 100).filter(_ % 3 == 0).map(Math.pow(_, 2)).sum
assert(sumOfSquares1 == sumOfSquares2)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/reify_fors.flags b/test/files/run/reify_fors.flags
new file mode 100644
index 0000000000..ba80cad69b
--- /dev/null
+++ b/test/files/run/reify_fors.flags
@@ -0,0 +1 @@
+-Xoldpatmat
diff --git a/test/files/run/reify_fors.scala b/test/files/run/reify_fors.scala
index 27ee85d18b..635fce049e 100644
--- a/test/files/run/reify_fors.scala
+++ b/test/files/run/reify_fors.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
object Persons {
/** A list of persons. To create a list, we use Predef.List
* which takes a variable number of arguments and constructs
@@ -98,9 +96,5 @@ object Test extends App {
val ys = List(2.0, 1.0, 3.0)
println("scalProd(" + xs + ", " + ys +") = " + scalProd(xs, ys))
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/reify_generic.scala b/test/files/run/reify_generic.scala
index 6a4ff148c4..7033c4e237 100644
--- a/test/files/run/reify_generic.scala
+++ b/test/files/run/reify_generic.scala
@@ -1,14 +1,8 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
val product = List(1, 2, 3).head * List[Any](4, 2, 0).head.asInstanceOf[Int]
println(product)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/reify_generic2.scala b/test/files/run/reify_generic2.scala
index 9413f41eb5..8f9def318e 100644
--- a/test/files/run/reify_generic2.scala
+++ b/test/files/run/reify_generic2.scala
@@ -1,15 +1,9 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
class C
val product = List(new C, new C).length * List[C](new C, new C).length
println(product)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/reify_getter.scala b/test/files/run/reify_getter.scala
index 33f36888a7..8bae293e72 100644
--- a/test/files/run/reify_getter.scala
+++ b/test/files/run/reify_getter.scala
@@ -1,18 +1,15 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ val code = reify {
class C {
val x = 2
}
new C().x
- };
+ }
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val evaluated = toolbox.runExpr(code.tree)
println("evaluated = " + evaluated)
}
diff --git a/test/files/run/reify_implicits.scala b/test/files/run/reify_implicits.scala
index 953eabe6c2..60971c3cfb 100644
--- a/test/files/run/reify_implicits.scala
+++ b/test/files/run/reify_implicits.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
implicit def arrayWrapper[A : ClassManifest](x: Array[A]) =
new {
def sort(p: (A, A) => Boolean) = {
@@ -12,9 +10,5 @@ object Test extends App {
}
val x = Array(2, 3, 1, 4)
println("x = "+ x.sort((x: Int, y: Int) => x < y).toList)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/reify_inheritance.scala b/test/files/run/reify_inheritance.scala
index 78a64c264e..dd86c355a3 100644
--- a/test/files/run/reify_inheritance.scala
+++ b/test/files/run/reify_inheritance.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
class C {
def x = 2
def y = x * x
@@ -14,9 +12,5 @@ object Test extends App {
}
println(new D().y * new C().x)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/reify_inner1.scala b/test/files/run/reify_inner1.scala
index 546fe36d16..ea77ece6df 100644
--- a/test/files/run/reify_inner1.scala
+++ b/test/files/run/reify_inner1.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
class C {
class D {
val x = 2
@@ -13,9 +11,5 @@ object Test extends App {
val outer = new C()
val inner = new outer.D()
println(inner.x)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/reify_inner2.scala b/test/files/run/reify_inner2.scala
index 613614b989..67c403f7e5 100644
--- a/test/files/run/reify_inner2.scala
+++ b/test/files/run/reify_inner2.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
class C {
object D {
val x = 2
@@ -13,9 +11,5 @@ object Test extends App {
val outer = new C()
val inner = outer.D
println(inner.x)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/reify_inner3.scala b/test/files/run/reify_inner3.scala
index e9fb636dce..ad401d81da 100644
--- a/test/files/run/reify_inner3.scala
+++ b/test/files/run/reify_inner3.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
object C {
class D {
val x = 2
@@ -13,9 +11,5 @@ object Test extends App {
val outer = C
val inner = new outer.D
println(inner.x)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/reify_inner4.scala b/test/files/run/reify_inner4.scala
index 33870b0983..140c8e9ed4 100644
--- a/test/files/run/reify_inner4.scala
+++ b/test/files/run/reify_inner4.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
object C {
object D {
val x = 2
@@ -13,9 +11,5 @@ object Test extends App {
val outer = C
val inner = outer.D
println(inner.x)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/reify_maps.flags b/test/files/run/reify_maps.flags
new file mode 100644
index 0000000000..ba80cad69b
--- /dev/null
+++ b/test/files/run/reify_maps.flags
@@ -0,0 +1 @@
+-Xoldpatmat
diff --git a/test/files/run/reify_maps.scala b/test/files/run/reify_maps.scala
index d3d95ffa24..3fcc21892f 100644
--- a/test/files/run/reify_maps.scala
+++ b/test/files/run/reify_maps.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
val colors = Map("red" -> 0xFF0000,
"turquoise" -> 0x00FFFF,
"black" -> 0x000000,
@@ -17,9 +15,5 @@ object Test extends App {
"Unknown color: " + name
}
)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/reify_metalevel_breach_+0_refers_to_1.check b/test/files/run/reify_metalevel_breach_+0_refers_to_1.check
new file mode 100644
index 0000000000..5bfed17f8e
--- /dev/null
+++ b/test/files/run/reify_metalevel_breach_+0_refers_to_1.check
@@ -0,0 +1 @@
+evaluated = 2 \ No newline at end of file
diff --git a/test/files/run/reify_metalevel_breach_+0_refers_to_1.scala b/test/files/run/reify_metalevel_breach_+0_refers_to_1.scala
new file mode 100644
index 0000000000..fe23bc8438
--- /dev/null
+++ b/test/files/run/reify_metalevel_breach_+0_refers_to_1.scala
@@ -0,0 +1,13 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ val code = reify{
+ val x = 2
+ val inner = reify{x}
+ inner.eval
+ };
+
+ val toolbox = mkToolBox()
+ val evaluated = toolbox.runExpr(code.tree)
+ println("evaluated = " + evaluated)
+}
diff --git a/test/files/run/reify_metalevel_breach_-1_refers_to_0_a.check b/test/files/run/reify_metalevel_breach_-1_refers_to_0_a.check
new file mode 100644
index 0000000000..5bfed17f8e
--- /dev/null
+++ b/test/files/run/reify_metalevel_breach_-1_refers_to_0_a.check
@@ -0,0 +1 @@
+evaluated = 2 \ No newline at end of file
diff --git a/test/files/run/reify_metalevel_breach_-1_refers_to_0_a.scala b/test/files/run/reify_metalevel_breach_-1_refers_to_0_a.scala
new file mode 100644
index 0000000000..5d98a38592
--- /dev/null
+++ b/test/files/run/reify_metalevel_breach_-1_refers_to_0_a.scala
@@ -0,0 +1,11 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ val x = 2
+ val outer = reify{reify{x}}
+ val code = reify{outer.eval.eval}
+
+ val toolbox = mkToolBox()
+ val evaluated = toolbox.runExpr(code.tree)
+ println("evaluated = " + evaluated)
+}
diff --git a/test/files/run/reify_metalevel_breach_-1_refers_to_0_b.check b/test/files/run/reify_metalevel_breach_-1_refers_to_0_b.check
new file mode 100644
index 0000000000..5bfed17f8e
--- /dev/null
+++ b/test/files/run/reify_metalevel_breach_-1_refers_to_0_b.check
@@ -0,0 +1 @@
+evaluated = 2 \ No newline at end of file
diff --git a/test/files/run/reify_metalevel_breach_-1_refers_to_0_b.scala b/test/files/run/reify_metalevel_breach_-1_refers_to_0_b.scala
new file mode 100644
index 0000000000..ca31d83acd
--- /dev/null
+++ b/test/files/run/reify_metalevel_breach_-1_refers_to_0_b.scala
@@ -0,0 +1,15 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ val x = 2
+ val code = reify{
+ {
+ val inner = reify{reify{x}}
+ inner.eval
+ }.eval
+ }
+
+ val toolbox = mkToolBox()
+ val evaluated = toolbox.runExpr(code.tree)
+ println("evaluated = " + evaluated)
+}
diff --git a/test/files/run/reify_metalevel_breach_-1_refers_to_1.check b/test/files/run/reify_metalevel_breach_-1_refers_to_1.check
new file mode 100644
index 0000000000..5bfed17f8e
--- /dev/null
+++ b/test/files/run/reify_metalevel_breach_-1_refers_to_1.check
@@ -0,0 +1 @@
+evaluated = 2 \ No newline at end of file
diff --git a/test/files/run/reify_metalevel_breach_-1_refers_to_1.scala b/test/files/run/reify_metalevel_breach_-1_refers_to_1.scala
new file mode 100644
index 0000000000..56d85c6ba1
--- /dev/null
+++ b/test/files/run/reify_metalevel_breach_-1_refers_to_1.scala
@@ -0,0 +1,13 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ val code = reify{
+ val x = 2
+ val inner = reify{reify{x}}
+ inner.eval.eval
+ };
+
+ val toolbox = mkToolBox()
+ val evaluated = toolbox.runExpr(code.tree)
+ println("evaluated = " + evaluated)
+}
diff --git a/test/files/run/reify_nested_inner_refers_to_global.check b/test/files/run/reify_nested_inner_refers_to_global.check
new file mode 100644
index 0000000000..7ff4c83d37
--- /dev/null
+++ b/test/files/run/reify_nested_inner_refers_to_global.check
@@ -0,0 +1 @@
+evaluated = 2
diff --git a/test/files/run/reify_nested_inner_refers_to_global.scala b/test/files/run/reify_nested_inner_refers_to_global.scala
new file mode 100644
index 0000000000..14899bcf99
--- /dev/null
+++ b/test/files/run/reify_nested_inner_refers_to_global.scala
@@ -0,0 +1,14 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ val code = {
+ val x = 2
+ reify{
+ reify{x}.eval
+ }
+ }
+
+ val toolbox = mkToolBox()
+ val evaluated = toolbox.runExpr(code.tree)
+ println("evaluated = " + evaluated)
+}
diff --git a/test/files/run/reify_nested_inner_refers_to_local.check b/test/files/run/reify_nested_inner_refers_to_local.check
new file mode 100644
index 0000000000..5bfed17f8e
--- /dev/null
+++ b/test/files/run/reify_nested_inner_refers_to_local.check
@@ -0,0 +1 @@
+evaluated = 2 \ No newline at end of file
diff --git a/test/files/run/reify_nested_inner_refers_to_local.scala b/test/files/run/reify_nested_inner_refers_to_local.scala
new file mode 100644
index 0000000000..fd56585f72
--- /dev/null
+++ b/test/files/run/reify_nested_inner_refers_to_local.scala
@@ -0,0 +1,12 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ val code = reify{
+ val x = 2
+ reify{x}.eval
+ };
+
+ val toolbox = mkToolBox()
+ val evaluated = toolbox.runExpr(code.tree)
+ println("evaluated = " + evaluated)
+}
diff --git a/test/files/run/reify_nested_outer_refers_to_global.check b/test/files/run/reify_nested_outer_refers_to_global.check
new file mode 100644
index 0000000000..7ff4c83d37
--- /dev/null
+++ b/test/files/run/reify_nested_outer_refers_to_global.check
@@ -0,0 +1 @@
+evaluated = 2
diff --git a/test/files/run/reify_nested_outer_refers_to_global.scala b/test/files/run/reify_nested_outer_refers_to_global.scala
new file mode 100644
index 0000000000..f34e4fe04b
--- /dev/null
+++ b/test/files/run/reify_nested_outer_refers_to_global.scala
@@ -0,0 +1,16 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ val code = {
+ val x = 2
+ val outer = reify{x}
+ reify{
+ val x = 42
+ outer.eval
+ };
+ }
+
+ val toolbox = mkToolBox()
+ val evaluated = toolbox.runExpr(code.tree)
+ println("evaluated = " + evaluated)
+}
diff --git a/test/files/run/reify_nested_outer_refers_to_local.check b/test/files/run/reify_nested_outer_refers_to_local.check
new file mode 100644
index 0000000000..7ff4c83d37
--- /dev/null
+++ b/test/files/run/reify_nested_outer_refers_to_local.check
@@ -0,0 +1 @@
+evaluated = 2
diff --git a/test/files/run/reify_nested_outer_refers_to_local.scala b/test/files/run/reify_nested_outer_refers_to_local.scala
new file mode 100644
index 0000000000..e16c851d8d
--- /dev/null
+++ b/test/files/run/reify_nested_outer_refers_to_local.scala
@@ -0,0 +1,16 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ val outer = {
+ val x = 2
+ reify{x}
+ }
+ val code = reify{
+ val x = 42
+ outer.eval
+ };
+
+ val toolbox = mkToolBox()
+ val evaluated = toolbox.runExpr(code.tree)
+ println("evaluated = " + evaluated)
+}
diff --git a/test/files/run/reify_newimpl_01.check b/test/files/run/reify_newimpl_01.check
new file mode 100644
index 0000000000..d8263ee986
--- /dev/null
+++ b/test/files/run/reify_newimpl_01.check
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_01.scala b/test/files/run/reify_newimpl_01.scala
new file mode 100644
index 0000000000..f7539a15b0
--- /dev/null
+++ b/test/files/run/reify_newimpl_01.scala
@@ -0,0 +1,11 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ val x = 2
+ val code = reify {
+ x
+ }
+ println(code.eval)
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_02.check b/test/files/run/reify_newimpl_02.check
new file mode 100644
index 0000000000..d8263ee986
--- /dev/null
+++ b/test/files/run/reify_newimpl_02.check
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_02.scala b/test/files/run/reify_newimpl_02.scala
new file mode 100644
index 0000000000..2c085efa04
--- /dev/null
+++ b/test/files/run/reify_newimpl_02.scala
@@ -0,0 +1,11 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ var x = 2
+ val code = reify {
+ x
+ }
+ println(code.eval)
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_03.check b/test/files/run/reify_newimpl_03.check
new file mode 100644
index 0000000000..d8263ee986
--- /dev/null
+++ b/test/files/run/reify_newimpl_03.check
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_03.scala b/test/files/run/reify_newimpl_03.scala
new file mode 100644
index 0000000000..361cfc50bb
--- /dev/null
+++ b/test/files/run/reify_newimpl_03.scala
@@ -0,0 +1,11 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ val code = reify {
+ val x = 2
+ reify{x}.eval
+ }
+ println(code.eval)
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_04.check b/test/files/run/reify_newimpl_04.check
new file mode 100644
index 0000000000..d8263ee986
--- /dev/null
+++ b/test/files/run/reify_newimpl_04.check
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_04.scala b/test/files/run/reify_newimpl_04.scala
new file mode 100644
index 0000000000..d80a7c9ffd
--- /dev/null
+++ b/test/files/run/reify_newimpl_04.scala
@@ -0,0 +1,11 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ val code = reify {
+ var x = 2
+ reify{x}.eval
+ }
+ println(code.eval)
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_05.check b/test/files/run/reify_newimpl_05.check
new file mode 100644
index 0000000000..d8263ee986
--- /dev/null
+++ b/test/files/run/reify_newimpl_05.check
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_05.scala b/test/files/run/reify_newimpl_05.scala
new file mode 100644
index 0000000000..85c1711bdb
--- /dev/null
+++ b/test/files/run/reify_newimpl_05.scala
@@ -0,0 +1,12 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ val code = reify {
+ var x = 2
+ def y = x // forcibly captures x
+ reify{x}.eval
+ }
+ println(code.eval)
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_06.check b/test/files/run/reify_newimpl_06.check
new file mode 100644
index 0000000000..d8263ee986
--- /dev/null
+++ b/test/files/run/reify_newimpl_06.check
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_06.scala b/test/files/run/reify_newimpl_06.scala
new file mode 100644
index 0000000000..257b54167a
--- /dev/null
+++ b/test/files/run/reify_newimpl_06.scala
@@ -0,0 +1,11 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ class C(val y: Int) {
+ val code = reify {
+ reify{y}.eval
+ }
+ }
+
+ println(new C(2).code.eval)
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_09.check b/test/files/run/reify_newimpl_09.check
new file mode 100644
index 0000000000..220bd6875a
--- /dev/null
+++ b/test/files/run/reify_newimpl_09.check
@@ -0,0 +1 @@
+List(2) \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_09.scala b/test/files/run/reify_newimpl_09.scala
new file mode 100644
index 0000000000..2c81945a2a
--- /dev/null
+++ b/test/files/run/reify_newimpl_09.scala
@@ -0,0 +1,11 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ type T = Int
+ val code = reify {
+ List[T](2)
+ }
+ println(code.eval)
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_10.check b/test/files/run/reify_newimpl_10.check
new file mode 100644
index 0000000000..220bd6875a
--- /dev/null
+++ b/test/files/run/reify_newimpl_10.check
@@ -0,0 +1 @@
+List(2) \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_10.scala b/test/files/run/reify_newimpl_10.scala
new file mode 100644
index 0000000000..6e70b4d216
--- /dev/null
+++ b/test/files/run/reify_newimpl_10.scala
@@ -0,0 +1,12 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ type T = Int
+ implicit val tt = implicitly[TypeTag[String]].asInstanceOf[TypeTag[T]] // this "mistake" is made for a reason!
+ val code = reify {
+ List[T](2)
+ }
+ println(code.eval)
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_11.check b/test/files/run/reify_newimpl_11.check
new file mode 100644
index 0000000000..e2a8206132
--- /dev/null
+++ b/test/files/run/reify_newimpl_11.check
@@ -0,0 +1,2 @@
+scala.reflect.runtime.ToolBoxes$ToolBox$ToolBoxError: reflective toolbox has failed:
+unresolved free type variables (namely: T defined by C in reify_newimpl_11.scala:4:11). have you forgot to use TypeTag annotations for type parameters external to a reifee? if you have troubles tracking free type variables, consider using -Xlog-free-types
diff --git a/test/files/run/reify_newimpl_11.scala b/test/files/run/reify_newimpl_11.scala
new file mode 100644
index 0000000000..4e91c7a457
--- /dev/null
+++ b/test/files/run/reify_newimpl_11.scala
@@ -0,0 +1,17 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ class C[T] {
+ val code = reify {
+ List[T](2.asInstanceOf[T])
+ }
+ println(code.eval)
+ }
+
+ try {
+ new C[Int]
+ } catch {
+ case ex: Throwable =>
+ println(ex)
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_12.check b/test/files/run/reify_newimpl_12.check
new file mode 100644
index 0000000000..220bd6875a
--- /dev/null
+++ b/test/files/run/reify_newimpl_12.check
@@ -0,0 +1 @@
+List(2) \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_12.scala b/test/files/run/reify_newimpl_12.scala
new file mode 100644
index 0000000000..433168ce28
--- /dev/null
+++ b/test/files/run/reify_newimpl_12.scala
@@ -0,0 +1,12 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ class C[T: TypeTag] {
+ val code = reify {
+ List[T](2.asInstanceOf[T])
+ }
+ println(code.eval)
+ }
+
+ new C[Int]
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_13.check b/test/files/run/reify_newimpl_13.check
new file mode 100644
index 0000000000..7c47310cf2
--- /dev/null
+++ b/test/files/run/reify_newimpl_13.check
@@ -0,0 +1,2 @@
+scala.reflect.runtime.ToolBoxes$ToolBox$ToolBoxError: reflective toolbox has failed:
+unresolved free type variables (namely: T defined by C in reify_newimpl_13.scala:5:13). have you forgot to use TypeTag annotations for type parameters external to a reifee? if you have troubles tracking free type variables, consider using -Xlog-free-types
diff --git a/test/files/run/reify_newimpl_13.scala b/test/files/run/reify_newimpl_13.scala
new file mode 100644
index 0000000000..dd1980b74f
--- /dev/null
+++ b/test/files/run/reify_newimpl_13.scala
@@ -0,0 +1,19 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ class C[T] {
+ val code = reify {
+ List[T](2.asInstanceOf[T])
+ }
+ println(code.eval)
+ }
+
+ try {
+ new C[Int]
+ } catch {
+ case ex: Throwable =>
+ println(ex)
+ }
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_14.check b/test/files/run/reify_newimpl_14.check
new file mode 100644
index 0000000000..220bd6875a
--- /dev/null
+++ b/test/files/run/reify_newimpl_14.check
@@ -0,0 +1 @@
+List(2) \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_14.scala b/test/files/run/reify_newimpl_14.scala
new file mode 100644
index 0000000000..3f52f19cfb
--- /dev/null
+++ b/test/files/run/reify_newimpl_14.scala
@@ -0,0 +1,14 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ class C[T: TypeTag] {
+ val code = reify {
+ List[T](2.asInstanceOf[T])
+ }
+ println(code.eval)
+ }
+
+ new C[Int]
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_15.check b/test/files/run/reify_newimpl_15.check
new file mode 100644
index 0000000000..220bd6875a
--- /dev/null
+++ b/test/files/run/reify_newimpl_15.check
@@ -0,0 +1 @@
+List(2) \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_15.scala b/test/files/run/reify_newimpl_15.scala
new file mode 100644
index 0000000000..b707b2583d
--- /dev/null
+++ b/test/files/run/reify_newimpl_15.scala
@@ -0,0 +1,13 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ class C {
+ type T = Int
+ val code = reify {
+ List[T](2)
+ }
+ println(code.eval)
+ }
+
+ new C
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_16.check b/test/files/run/reify_newimpl_16.check
new file mode 100644
index 0000000000..220bd6875a
--- /dev/null
+++ b/test/files/run/reify_newimpl_16.check
@@ -0,0 +1 @@
+List(2) \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_16.scala b/test/files/run/reify_newimpl_16.scala
new file mode 100644
index 0000000000..98fc15878c
--- /dev/null
+++ b/test/files/run/reify_newimpl_16.scala
@@ -0,0 +1,15 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ class C {
+ type T = Int
+ val code = reify {
+ List[T](2)
+ }
+ println(code.eval)
+ }
+
+ new C
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_17.check b/test/files/run/reify_newimpl_17.check
new file mode 100644
index 0000000000..0fb9ddfc2d
--- /dev/null
+++ b/test/files/run/reify_newimpl_17.check
@@ -0,0 +1,2 @@
+scala.reflect.runtime.ToolBoxes$ToolBox$ToolBoxError: reflective toolbox has failed:
+unresolved free type variables (namely: U defined by C in reify_newimpl_17.scala:4:11). have you forgot to use TypeTag annotations for type parameters external to a reifee? if you have troubles tracking free type variables, consider using -Xlog-free-types
diff --git a/test/files/run/reify_newimpl_17.scala b/test/files/run/reify_newimpl_17.scala
new file mode 100644
index 0000000000..331777fcfb
--- /dev/null
+++ b/test/files/run/reify_newimpl_17.scala
@@ -0,0 +1,18 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ class C[U] {
+ type T = U
+ val code = reify {
+ List[T](2.asInstanceOf[T])
+ }
+ println(code.eval)
+ }
+
+ try {
+ new C[Int]
+ } catch {
+ case ex: Throwable =>
+ println(ex)
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_18.check b/test/files/run/reify_newimpl_18.check
new file mode 100644
index 0000000000..a7029974a4
--- /dev/null
+++ b/test/files/run/reify_newimpl_18.check
@@ -0,0 +1 @@
+List(2)
diff --git a/test/files/run/reify_newimpl_18.scala b/test/files/run/reify_newimpl_18.scala
new file mode 100644
index 0000000000..704e54928a
--- /dev/null
+++ b/test/files/run/reify_newimpl_18.scala
@@ -0,0 +1,13 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ class C[U: TypeTag] {
+ type T = U
+ val code = reify {
+ List[T](2.asInstanceOf[T])
+ }
+ println(code.eval)
+ }
+
+ new C[Int]
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_19.check b/test/files/run/reify_newimpl_19.check
new file mode 100644
index 0000000000..32f9300f53
--- /dev/null
+++ b/test/files/run/reify_newimpl_19.check
@@ -0,0 +1,2 @@
+scala.reflect.runtime.ToolBoxes$ToolBox$ToolBoxError: reflective toolbox has failed:
+unresolved free type variables (namely: T defined by C in reify_newimpl_19.scala:5:10). have you forgot to use TypeTag annotations for type parameters external to a reifee? if you have troubles tracking free type variables, consider using -Xlog-free-types
diff --git a/test/files/run/reify_newimpl_19.scala b/test/files/run/reify_newimpl_19.scala
new file mode 100644
index 0000000000..0ea8ae6992
--- /dev/null
+++ b/test/files/run/reify_newimpl_19.scala
@@ -0,0 +1,18 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ class C {
+ type T
+ val code = reify {
+ List[T](2.asInstanceOf[T])
+ }
+ println(code.eval)
+ }
+
+ try {
+ new C { val T = Int }
+ } catch {
+ case ex: Throwable =>
+ println(ex)
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_20.check b/test/files/run/reify_newimpl_20.check
new file mode 100644
index 0000000000..a7029974a4
--- /dev/null
+++ b/test/files/run/reify_newimpl_20.check
@@ -0,0 +1 @@
+List(2)
diff --git a/test/files/run/reify_newimpl_20.scala b/test/files/run/reify_newimpl_20.scala
new file mode 100644
index 0000000000..16895a449e
--- /dev/null
+++ b/test/files/run/reify_newimpl_20.scala
@@ -0,0 +1,14 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ class C {
+ type T
+ implicit val tt: TypeTag[T] = implicitly[TypeTag[Int]].asInstanceOf[TypeTag[T]]
+ val code = reify {
+ List[T](2.asInstanceOf[T])
+ }
+ println(code.eval)
+ }
+
+ new C { type T = String } // this "mistake" is made for a reason!
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_21.check b/test/files/run/reify_newimpl_21.check
new file mode 100644
index 0000000000..a7029974a4
--- /dev/null
+++ b/test/files/run/reify_newimpl_21.check
@@ -0,0 +1 @@
+List(2)
diff --git a/test/files/run/reify_newimpl_21.scala b/test/files/run/reify_newimpl_21.scala
new file mode 100644
index 0000000000..99f9ac9089
--- /dev/null
+++ b/test/files/run/reify_newimpl_21.scala
@@ -0,0 +1,18 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ trait C {
+ type T
+ implicit val tt: TypeTag[T]
+ lazy val code = reify {
+ List[T](2.asInstanceOf[T])
+ }
+ }
+
+ class D extends C {
+ type T = String // this "mistake" is made for a reason!
+ override val tt: TypeTag[T] = implicitly[TypeTag[Int]].asInstanceOf[TypeTag[T]]
+ }
+
+ println((new D).code.eval)
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_22.check b/test/files/run/reify_newimpl_22.check
new file mode 100644
index 0000000000..51699cbc29
--- /dev/null
+++ b/test/files/run/reify_newimpl_22.check
@@ -0,0 +1,23 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> import scala.reflect.mirror._
+import scala.reflect.mirror._
+
+scala> {
+ val x = 2
+ val code = reify {
+ x
+ }
+ println(code.eval)
+}
+<console>:13: free term: Ident(newTermName("x")) defined by res0 in <console>:12:21
+ val code = reify {
+ ^
+2
+
+scala>
+
+scala>
diff --git a/test/files/run/reify_newimpl_22.scala b/test/files/run/reify_newimpl_22.scala
new file mode 100644
index 0000000000..a211ad360c
--- /dev/null
+++ b/test/files/run/reify_newimpl_22.scala
@@ -0,0 +1,15 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ override def extraSettings = "-Xlog-free-terms"
+ def code = """
+import scala.reflect.mirror._
+{
+ val x = 2
+ val code = reify {
+ x
+ }
+ println(code.eval)
+}
+ """
+}
diff --git a/test/files/run/reify_newimpl_23.check b/test/files/run/reify_newimpl_23.check
new file mode 100644
index 0000000000..33d15190fb
--- /dev/null
+++ b/test/files/run/reify_newimpl_23.check
@@ -0,0 +1,22 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> import scala.reflect.mirror._
+import scala.reflect.mirror._
+
+scala> def foo[T]{
+ val code = reify {
+ List[T]()
+ }
+ println(code.eval)
+}
+<console>:11: free type: Ident(newTypeName("T")) defined by foo in <console>:10:16
+ val code = reify {
+ ^
+foo: [T]=> Unit
+
+scala>
+
+scala>
diff --git a/test/files/run/reify_newimpl_23.scala b/test/files/run/reify_newimpl_23.scala
new file mode 100644
index 0000000000..15da4e497e
--- /dev/null
+++ b/test/files/run/reify_newimpl_23.scala
@@ -0,0 +1,14 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ override def extraSettings = "-Xlog-free-types"
+ def code = """
+import scala.reflect.mirror._
+def foo[T]{
+ val code = reify {
+ List[T]()
+ }
+ println(code.eval)
+}
+ """
+}
diff --git a/test/files/run/reify_newimpl_24.check b/test/files/run/reify_newimpl_24.check
new file mode 100644
index 0000000000..66b18c790e
--- /dev/null
+++ b/test/files/run/reify_newimpl_24.check
@@ -0,0 +1,24 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> import scala.reflect.mirror._
+import scala.reflect.mirror._
+
+scala> {
+ val x = 2
+ val code = reify {
+ val y = reify { x }
+ y.eval
+ }
+ println(code.eval)
+}
+<console>:15: this splice cannot be resolved statically
+ y.eval
+ ^
+2
+
+scala>
+
+scala>
diff --git a/test/files/run/reify_newimpl_24.scala b/test/files/run/reify_newimpl_24.scala
new file mode 100644
index 0000000000..7b21eeeb10
--- /dev/null
+++ b/test/files/run/reify_newimpl_24.scala
@@ -0,0 +1,16 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ override def extraSettings = "-Xlog-runtime-splices"
+ def code = """
+import scala.reflect.mirror._
+{
+ val x = 2
+ val code = reify {
+ val y = reify { x }
+ y.eval
+ }
+ println(code.eval)
+}
+ """
+}
diff --git a/test/files/run/reify_newimpl_25.check b/test/files/run/reify_newimpl_25.check
new file mode 100644
index 0000000000..37ff83c9ee
--- /dev/null
+++ b/test/files/run/reify_newimpl_25.check
@@ -0,0 +1,21 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> import scala.reflect.mirror._
+import scala.reflect.mirror._
+
+scala> {
+ val x = "2"
+ val tt = implicitly[TypeTag[x.type]]
+ println(tt)
+}
+<console>:13: free term: Ident(newTermName("x")) defined by res0 in <console>:12:21
+ val tt = implicitly[TypeTag[x.type]]
+ ^
+ConcreteTypeTag[x.type]
+
+scala>
+
+scala>
diff --git a/test/files/run/reify_newimpl_25.scala b/test/files/run/reify_newimpl_25.scala
new file mode 100644
index 0000000000..1f66f5e681
--- /dev/null
+++ b/test/files/run/reify_newimpl_25.scala
@@ -0,0 +1,13 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ override def extraSettings = "-Xlog-free-terms"
+ def code = """
+import scala.reflect.mirror._
+{
+ val x = "2"
+ val tt = implicitly[TypeTag[x.type]]
+ println(tt)
+}
+ """
+}
diff --git a/test/files/run/reify_newimpl_26.check b/test/files/run/reify_newimpl_26.check
new file mode 100644
index 0000000000..bfbf1d653d
--- /dev/null
+++ b/test/files/run/reify_newimpl_26.check
@@ -0,0 +1,23 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> import scala.reflect.mirror._
+import scala.reflect.mirror._
+
+scala> def foo[T]{
+ val tt = implicitly[TypeTag[List[T]]]
+ println(tt)
+}
+<console>:11: free type: Ident(newTypeName("T")) defined by foo in <console>:10:16
+ val tt = implicitly[TypeTag[List[T]]]
+ ^
+foo: [T]=> Unit
+
+scala> foo[Int]
+ConcreteTypeTag[List[T]]
+
+scala>
+
+scala>
diff --git a/test/files/run/reify_newimpl_26.scala b/test/files/run/reify_newimpl_26.scala
new file mode 100644
index 0000000000..f2dd1bfc4e
--- /dev/null
+++ b/test/files/run/reify_newimpl_26.scala
@@ -0,0 +1,13 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ override def extraSettings = "-Xlog-free-types"
+ def code = """
+import scala.reflect.mirror._
+def foo[T]{
+ val tt = implicitly[TypeTag[List[T]]]
+ println(tt)
+}
+foo[Int]
+ """
+}
diff --git a/test/files/run/reify_newimpl_27.check b/test/files/run/reify_newimpl_27.check
new file mode 100644
index 0000000000..a7029974a4
--- /dev/null
+++ b/test/files/run/reify_newimpl_27.check
@@ -0,0 +1 @@
+List(2)
diff --git a/test/files/run/reify_newimpl_27.scala b/test/files/run/reify_newimpl_27.scala
new file mode 100644
index 0000000000..b3d6d5c865
--- /dev/null
+++ b/test/files/run/reify_newimpl_27.scala
@@ -0,0 +1,13 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ object C {
+ type T = Int
+ val code = reify {
+ List[T](2)
+ }
+ println(code.eval)
+ }
+
+ C
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_28.check b/test/files/run/reify_newimpl_28.check
new file mode 100644
index 0000000000..a7029974a4
--- /dev/null
+++ b/test/files/run/reify_newimpl_28.check
@@ -0,0 +1 @@
+List(2)
diff --git a/test/files/run/reify_newimpl_28.scala b/test/files/run/reify_newimpl_28.scala
new file mode 100644
index 0000000000..f7874b8548
--- /dev/null
+++ b/test/files/run/reify_newimpl_28.scala
@@ -0,0 +1,15 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ object C {
+ type T = Int
+ val code = reify {
+ List[T](2)
+ }
+ println(code.eval)
+ }
+
+ C
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_29.check b/test/files/run/reify_newimpl_29.check
new file mode 100644
index 0000000000..a7029974a4
--- /dev/null
+++ b/test/files/run/reify_newimpl_29.check
@@ -0,0 +1 @@
+List(2)
diff --git a/test/files/run/reify_newimpl_29.scala b/test/files/run/reify_newimpl_29.scala
new file mode 100644
index 0000000000..e32762f335
--- /dev/null
+++ b/test/files/run/reify_newimpl_29.scala
@@ -0,0 +1,13 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ class C {
+ type T = Int
+ val code = reify {
+ List[C#T](2)
+ }
+ println(code.eval)
+ }
+
+ new C
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_30.check b/test/files/run/reify_newimpl_30.check
new file mode 100644
index 0000000000..a7029974a4
--- /dev/null
+++ b/test/files/run/reify_newimpl_30.check
@@ -0,0 +1 @@
+List(2)
diff --git a/test/files/run/reify_newimpl_30.scala b/test/files/run/reify_newimpl_30.scala
new file mode 100644
index 0000000000..e4ba3221e1
--- /dev/null
+++ b/test/files/run/reify_newimpl_30.scala
@@ -0,0 +1,15 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ class C {
+ type T = Int
+ val code = reify {
+ List[C#T](2)
+ }
+ println(code.eval)
+ }
+
+ new C
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_31.check b/test/files/run/reify_newimpl_31.check
new file mode 100644
index 0000000000..a7029974a4
--- /dev/null
+++ b/test/files/run/reify_newimpl_31.check
@@ -0,0 +1 @@
+List(2)
diff --git a/test/files/run/reify_newimpl_31.scala b/test/files/run/reify_newimpl_31.scala
new file mode 100644
index 0000000000..20a851e32e
--- /dev/null
+++ b/test/files/run/reify_newimpl_31.scala
@@ -0,0 +1,13 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ object C {
+ type T = Int
+ val code = reify {
+ List[C.T](2)
+ }
+ println(code.eval)
+ }
+
+ C
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_32.check b/test/files/run/reify_newimpl_32.check
new file mode 100644
index 0000000000..a7029974a4
--- /dev/null
+++ b/test/files/run/reify_newimpl_32.check
@@ -0,0 +1 @@
+List(2)
diff --git a/test/files/run/reify_newimpl_32.scala b/test/files/run/reify_newimpl_32.scala
new file mode 100644
index 0000000000..788486ec00
--- /dev/null
+++ b/test/files/run/reify_newimpl_32.scala
@@ -0,0 +1,15 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ object C {
+ type T = Int
+ val code = reify {
+ List[C.T](2)
+ }
+ println(code.eval)
+ }
+
+ C
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_33.check b/test/files/run/reify_newimpl_33.check
new file mode 100644
index 0000000000..a7029974a4
--- /dev/null
+++ b/test/files/run/reify_newimpl_33.check
@@ -0,0 +1 @@
+List(2)
diff --git a/test/files/run/reify_newimpl_33.scala b/test/files/run/reify_newimpl_33.scala
new file mode 100644
index 0000000000..84a8258256
--- /dev/null
+++ b/test/files/run/reify_newimpl_33.scala
@@ -0,0 +1,14 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ object C {
+ type T = Int
+ val c = C
+ val code = reify {
+ List[c.T](2)
+ }
+ println(code.eval)
+ }
+
+ C
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_34.check b/test/files/run/reify_newimpl_34.check
new file mode 100644
index 0000000000..a7029974a4
--- /dev/null
+++ b/test/files/run/reify_newimpl_34.check
@@ -0,0 +1 @@
+List(2)
diff --git a/test/files/run/reify_newimpl_34.scala b/test/files/run/reify_newimpl_34.scala
new file mode 100644
index 0000000000..5935ab385c
--- /dev/null
+++ b/test/files/run/reify_newimpl_34.scala
@@ -0,0 +1,16 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ object C {
+ type T = Int
+ lazy val c = C
+ val code = reify {
+ List[c.T](2)
+ }
+ println(code.eval)
+ }
+
+ C
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_36.check b/test/files/run/reify_newimpl_36.check
new file mode 100644
index 0000000000..2f562a182f
--- /dev/null
+++ b/test/files/run/reify_newimpl_36.check
@@ -0,0 +1 @@
+42
diff --git a/test/files/run/reify_newimpl_36.scala b/test/files/run/reify_newimpl_36.scala
new file mode 100644
index 0000000000..c76efce27a
--- /dev/null
+++ b/test/files/run/reify_newimpl_36.scala
@@ -0,0 +1,14 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ val x = 42
+ def foo() = reify(reify(x));
+ {
+ val x = 2
+ val code1 = foo()
+ val code2 = code1.eval
+ println(code2.eval)
+ }
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_37.check b/test/files/run/reify_newimpl_37.check
new file mode 100644
index 0000000000..2f562a182f
--- /dev/null
+++ b/test/files/run/reify_newimpl_37.check
@@ -0,0 +1 @@
+42
diff --git a/test/files/run/reify_newimpl_37.scala b/test/files/run/reify_newimpl_37.scala
new file mode 100644
index 0000000000..e83d35dbe1
--- /dev/null
+++ b/test/files/run/reify_newimpl_37.scala
@@ -0,0 +1,15 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ val x = 42
+ def foo() = reify(reify(reify(x)));
+ {
+ val x = 2
+ val code1 = foo()
+ val code2 = code1.eval
+ val code3 = code2.eval
+ println(code3.eval)
+ }
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_38.check b/test/files/run/reify_newimpl_38.check
new file mode 100644
index 0000000000..2f562a182f
--- /dev/null
+++ b/test/files/run/reify_newimpl_38.check
@@ -0,0 +1 @@
+42
diff --git a/test/files/run/reify_newimpl_38.scala b/test/files/run/reify_newimpl_38.scala
new file mode 100644
index 0000000000..70ef49ecf7
--- /dev/null
+++ b/test/files/run/reify_newimpl_38.scala
@@ -0,0 +1,14 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ val x = 42
+ def foo() = reify{ val y = x; reify(y) };
+ {
+ val x = 2
+ val code1 = foo()
+ val code2 = code1.eval
+ println(code2.eval)
+ }
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_39.check b/test/files/run/reify_newimpl_39.check
new file mode 100644
index 0000000000..2f562a182f
--- /dev/null
+++ b/test/files/run/reify_newimpl_39.check
@@ -0,0 +1 @@
+42
diff --git a/test/files/run/reify_newimpl_39.scala b/test/files/run/reify_newimpl_39.scala
new file mode 100644
index 0000000000..faa45d917d
--- /dev/null
+++ b/test/files/run/reify_newimpl_39.scala
@@ -0,0 +1,15 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ val x = 42
+ def foo() = reify{ val y = x; reify{ val z = y; reify(z) } };
+ {
+ val x = 2
+ val code1 = foo()
+ val code2 = code1.eval
+ val code3 = code2.eval
+ println(code3.eval)
+ }
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_40.check b/test/files/run/reify_newimpl_40.check
new file mode 100644
index 0000000000..94c5a65fe0
--- /dev/null
+++ b/test/files/run/reify_newimpl_40.check
@@ -0,0 +1 @@
+74088
diff --git a/test/files/run/reify_newimpl_40.scala b/test/files/run/reify_newimpl_40.scala
new file mode 100644
index 0000000000..a983a92324
--- /dev/null
+++ b/test/files/run/reify_newimpl_40.scala
@@ -0,0 +1,15 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ val x = 42
+ def foo() = reify{ val y = x; reify{ val z = y * x; reify(z * x) } };
+ {
+ val x = 2
+ val code1 = foo()
+ val code2 = code1.eval
+ val code3 = code2.eval
+ println(code3.eval)
+ }
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_41.check b/test/files/run/reify_newimpl_41.check
new file mode 100644
index 0000000000..0b427f2ee6
--- /dev/null
+++ b/test/files/run/reify_newimpl_41.check
@@ -0,0 +1,3 @@
+42
+44
+43 \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_41.scala b/test/files/run/reify_newimpl_41.scala
new file mode 100644
index 0000000000..9aedccc98a
--- /dev/null
+++ b/test/files/run/reify_newimpl_41.scala
@@ -0,0 +1,17 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ var _x = 42
+ def x = { val x0 = _x; _x += 1; x0 }
+ var _y = 1
+ def y = { val y0 = _y + _x; _y += y0; y0 }
+ val code = reify {
+ def foo = y // ensures that y is the first freevar we find
+ println(x)
+ println(y)
+ println(x)
+ }
+ code.eval
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_42.check b/test/files/run/reify_newimpl_42.check
new file mode 100644
index 0000000000..0b427f2ee6
--- /dev/null
+++ b/test/files/run/reify_newimpl_42.check
@@ -0,0 +1,3 @@
+42
+44
+43 \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_42.scala b/test/files/run/reify_newimpl_42.scala
new file mode 100644
index 0000000000..1e21bd59bc
--- /dev/null
+++ b/test/files/run/reify_newimpl_42.scala
@@ -0,0 +1,16 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ var _x = 42
+ def x = { val x0 = _x; _x += 1; x0 }
+ var _y = 1
+ def y = { val y0 = _y + _x; _y += y0; y0 }
+ val code = reify {
+ println(x)
+ println(y)
+ println(x)
+ }
+ code.eval
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_43.check b/test/files/run/reify_newimpl_43.check
new file mode 100644
index 0000000000..7a754f414c
--- /dev/null
+++ b/test/files/run/reify_newimpl_43.check
@@ -0,0 +1,2 @@
+1
+2 \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_43.scala b/test/files/run/reify_newimpl_43.scala
new file mode 100644
index 0000000000..962461db8b
--- /dev/null
+++ b/test/files/run/reify_newimpl_43.scala
@@ -0,0 +1,15 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ var counter = 0
+ lazy val x = { counter += 1; counter }
+ lazy val y = { counter += 1; counter }
+ val code = reify {
+ def foo = y // ensures that y is the first freevar we find
+ println(x)
+ println(y)
+ }
+ code.eval
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_44.check b/test/files/run/reify_newimpl_44.check
new file mode 100644
index 0000000000..7a754f414c
--- /dev/null
+++ b/test/files/run/reify_newimpl_44.check
@@ -0,0 +1,2 @@
+1
+2 \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_44.scala b/test/files/run/reify_newimpl_44.scala
new file mode 100644
index 0000000000..962461db8b
--- /dev/null
+++ b/test/files/run/reify_newimpl_44.scala
@@ -0,0 +1,15 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ var counter = 0
+ lazy val x = { counter += 1; counter }
+ lazy val y = { counter += 1; counter }
+ val code = reify {
+ def foo = y // ensures that y is the first freevar we find
+ println(x)
+ println(y)
+ }
+ code.eval
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_45.check b/test/files/run/reify_newimpl_45.check
new file mode 100644
index 0000000000..6e14f71e26
--- /dev/null
+++ b/test/files/run/reify_newimpl_45.check
@@ -0,0 +1,2 @@
+List(free type T)
+ima worx: 2 \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_45.scala b/test/files/run/reify_newimpl_45.scala
new file mode 100644
index 0000000000..241b7d4bc3
--- /dev/null
+++ b/test/files/run/reify_newimpl_45.scala
@@ -0,0 +1,12 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ class C[T >: Null] {
+ val code = reify{val x: T = "2".asInstanceOf[T]; println("ima worx: %s".format(x)); x}
+ println(freeTypes(code))
+ val T = freeTypes(code)(0)
+ mkToolBox().runExpr(code, Map(T -> definitions.StringClass.asType))
+ }
+
+ new C[String]
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_47.check b/test/files/run/reify_newimpl_47.check
new file mode 100644
index 0000000000..d8263ee986
--- /dev/null
+++ b/test/files/run/reify_newimpl_47.check
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_47.scala b/test/files/run/reify_newimpl_47.scala
new file mode 100644
index 0000000000..bd1bd1fe65
--- /dev/null
+++ b/test/files/run/reify_newimpl_47.scala
@@ -0,0 +1,15 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ val outer = {
+ val x = 2
+ reify{x}
+ }
+
+ val code = reify{
+ val x = 42
+ outer.eval
+ }
+
+ println(code.eval)
+}
diff --git a/test/files/run/reify_newimpl_48.check b/test/files/run/reify_newimpl_48.check
new file mode 100644
index 0000000000..f11c82a4cb
--- /dev/null
+++ b/test/files/run/reify_newimpl_48.check
@@ -0,0 +1 @@
+9 \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_48.scala b/test/files/run/reify_newimpl_48.scala
new file mode 100644
index 0000000000..1522509907
--- /dev/null
+++ b/test/files/run/reify_newimpl_48.scala
@@ -0,0 +1,20 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ val outer1 = {
+ val x = 2
+ reify{x}
+ }
+
+ val outer2 = {
+ val x = 3
+ reify{x}
+ }
+
+ val code = reify{
+ val x = 4
+ x + outer1.eval + outer2.eval
+ }
+
+ println(code.eval)
+}
diff --git a/test/files/run/reify_newimpl_49.check b/test/files/run/reify_newimpl_49.check
new file mode 100644
index 0000000000..d8a621df00
--- /dev/null
+++ b/test/files/run/reify_newimpl_49.check
@@ -0,0 +1,3 @@
+3
+3
+5 \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_49.scala b/test/files/run/reify_newimpl_49.scala
new file mode 100644
index 0000000000..68d968e28b
--- /dev/null
+++ b/test/files/run/reify_newimpl_49.scala
@@ -0,0 +1,15 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ var y = 1
+ def x = { y += 2; y }
+ val code = reify {
+ def foo = y // ensures that y is the first freevar we find
+ println(x)
+ println(y)
+ println(x)
+ }
+ code.eval
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_50.check b/test/files/run/reify_newimpl_50.check
new file mode 100644
index 0000000000..d8a621df00
--- /dev/null
+++ b/test/files/run/reify_newimpl_50.check
@@ -0,0 +1,3 @@
+3
+3
+5 \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_50.scala b/test/files/run/reify_newimpl_50.scala
new file mode 100644
index 0000000000..b81d72a4eb
--- /dev/null
+++ b/test/files/run/reify_newimpl_50.scala
@@ -0,0 +1,14 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ var y = 1
+ def x = { y += 2; y }
+ val code = reify {
+ println(x)
+ println(y)
+ println(x)
+ }
+ code.eval
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_51.check b/test/files/run/reify_newimpl_51.check
new file mode 100644
index 0000000000..9a4ddeacd3
--- /dev/null
+++ b/test/files/run/reify_newimpl_51.check
@@ -0,0 +1,3 @@
+2
+1
+2 \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_51.scala b/test/files/run/reify_newimpl_51.scala
new file mode 100644
index 0000000000..ccbae2e160
--- /dev/null
+++ b/test/files/run/reify_newimpl_51.scala
@@ -0,0 +1,17 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ var counter = 0
+ lazy val x = { counter += 1; counter }
+ lazy val y = { counter += 1; counter }
+ val code = reify {
+ def foo = y // ensures that y is the first freevar we find
+ val bar = reify { println(x * y) }
+ bar.eval
+ println(x)
+ println(y)
+ }
+ code.eval
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_52.check b/test/files/run/reify_newimpl_52.check
new file mode 100644
index 0000000000..9359a2b211
--- /dev/null
+++ b/test/files/run/reify_newimpl_52.check
@@ -0,0 +1,3 @@
+2
+2
+1 \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_52.scala b/test/files/run/reify_newimpl_52.scala
new file mode 100644
index 0000000000..60b16d3618
--- /dev/null
+++ b/test/files/run/reify_newimpl_52.scala
@@ -0,0 +1,17 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ var counter = 0
+ lazy val x = { counter += 1; counter }
+ lazy val y = { counter += 1; counter }
+ val code = reify {
+ def foo = y // ensures that y is the first freevar we find
+ val bar = reify { println(y * x) }
+ bar.eval
+ println(x)
+ println(y)
+ }
+ code.eval
+ }
+} \ No newline at end of file
diff --git a/test/files/run/reify_printf.scala b/test/files/run/reify_printf.scala
index cd6052bc5e..dc092c1a85 100644
--- a/test/files/run/reify_printf.scala
+++ b/test/files/run/reify_printf.scala
@@ -1,19 +1,15 @@
import java.io.{ ByteArrayOutputStream, PrintStream }
-import scala.reflect.Code
import scala.reflect.mirror._
import scala.reflect.api._
import scala.reflect.api.Trees
import scala.reflect.internal.Types
-import reflect.runtime.Mirror.ToolBox
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
import scala.util.matching.Regex
object Test extends App {
- val tree = tree_printf(Code.lift("hello %s").tree, Code.lift("world").tree)
+ val tree = tree_printf(reify("hello %s").tree, reify("world").tree)
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter, args mkString " ")
+ import scala.reflect.mirror._
+ val toolbox = mkToolBox()
val output = new ByteArrayOutputStream()
Console.setOut(new PrintStream(output))
@@ -22,6 +18,7 @@ object Test extends App {
assert(output.toString() == "hello world", output.toString() +" == hello world")
/*
+ // upd. Oh, good old times, our very-very first experiments with macros :)
macro def printf(format: String, params: Any*) : String = tree_printf(format: Tree, (params: Seq[Tree]): _*)
*/
diff --git a/test/files/run/reify_sort.scala b/test/files/run/reify_sort.scala
index 5984a64967..0b373b358f 100644
--- a/test/files/run/reify_sort.scala
+++ b/test/files/run/reify_sort.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
/** Nested methods can use and even update everything
* visible in their scope (including local variables or
* arguments of enclosing methods).
@@ -48,9 +46,5 @@ object Test extends App {
println(ar)
sort(ar)
println(ar)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/reify_sort1.scala b/test/files/run/reify_sort1.scala
index 6f365dea26..56125619e9 100644
--- a/test/files/run/reify_sort1.scala
+++ b/test/files/run/reify_sort1.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
def sort(a: List[Int]): List[Int] = {
if (a.length < 2)
a
@@ -18,9 +16,5 @@ object Test extends App {
val xs = List(6, 2, 8, 5, 1)
println(xs)
println(sort(xs))
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/reify_this.scala b/test/files/run/reify_this.scala
index ee1f116013..280d735ab6 100644
--- a/test/files/run/reify_this.scala
+++ b/test/files/run/reify_this.scala
@@ -1,30 +1,19 @@
-import scala.reflect._
-import scala.reflect.Code._
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
trait Eval {
- def eval(code: Code): Any = eval(code.tree)
-
- def eval(tree: Tree): Any = {
- val settings = new Settings
- val reporter = new ConsoleReporter(settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(tree)
- }
+ def eval(tree: Expr[_]) = tree.eval
}
object Test extends App with Eval {
// select a value from package
- eval(lift{println("foo")})
- eval(lift{println((new Object).toString == (new Object).toString)})
+ eval(reify{println("foo")})
+ eval(reify{println((new Object).toString == (new Object).toString)})
// select a type from package
- eval(lift{val x: Any = 2; println(x)})
- eval(lift{val x: Object = "bar"; println(x)})
+ eval(reify{val x: Any = 2; println(x)})
+ eval(reify{val x: Object = "bar"; println(x)})
// select a value from module
val x = 2
- eval(lift{println(x)})
+ eval(reify{println(x)})
}
diff --git a/test/files/run/reify_timeofday.scala b/test/files/run/reify_timeofday.scala
index 122d7a6d52..481ab04df5 100644
--- a/test/files/run/reify_timeofday.scala
+++ b/test/files/run/reify_timeofday.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
class DateError extends Exception
/** Simulating properties in Scala
@@ -39,9 +37,5 @@ object Test extends App {
case de: DateError => println("DateError")
case e: Exception => println("Exception")
}
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/reify_typerefs_1a.check b/test/files/run/reify_typerefs_1a.check
new file mode 100644
index 0000000000..919c298ba3
--- /dev/null
+++ b/test/files/run/reify_typerefs_1a.check
@@ -0,0 +1 @@
+evaluated = List(Expression, Expression) \ No newline at end of file
diff --git a/test/files/run/reify_typerefs_1a.scala b/test/files/run/reify_typerefs_1a.scala
new file mode 100644
index 0000000000..15d8d17835
--- /dev/null
+++ b/test/files/run/reify_typerefs_1a.scala
@@ -0,0 +1,15 @@
+import scala.reflect.mirror._
+
+class Expression {
+ override def toString = "Expression"
+}
+
+object Test extends App {
+ val code = reify {
+ List(new Expression, new Expression)
+ };
+
+ val toolbox = mkToolBox()
+ val evaluated = toolbox.runExpr(code.tree)
+ println("evaluated = " + evaluated)
+}
diff --git a/test/files/run/reify_typerefs_1b.check b/test/files/run/reify_typerefs_1b.check
new file mode 100644
index 0000000000..919c298ba3
--- /dev/null
+++ b/test/files/run/reify_typerefs_1b.check
@@ -0,0 +1 @@
+evaluated = List(Expression, Expression) \ No newline at end of file
diff --git a/test/files/run/reify_typerefs_1b.scala b/test/files/run/reify_typerefs_1b.scala
new file mode 100644
index 0000000000..06ce1e35ac
--- /dev/null
+++ b/test/files/run/reify_typerefs_1b.scala
@@ -0,0 +1,15 @@
+import scala.reflect.mirror._
+
+object Expression {
+ override def toString = "Expression"
+}
+
+object Test extends App {
+ val code = reify {
+ List(Expression, Expression)
+ };
+
+ val toolbox = mkToolBox()
+ val evaluated = toolbox.runExpr(code.tree)
+ println("evaluated = " + evaluated)
+}
diff --git a/test/files/run/reify_typerefs_2a.check b/test/files/run/reify_typerefs_2a.check
new file mode 100644
index 0000000000..919c298ba3
--- /dev/null
+++ b/test/files/run/reify_typerefs_2a.check
@@ -0,0 +1 @@
+evaluated = List(Expression, Expression) \ No newline at end of file
diff --git a/test/files/run/reify_typerefs_2a.scala b/test/files/run/reify_typerefs_2a.scala
new file mode 100644
index 0000000000..d03efea222
--- /dev/null
+++ b/test/files/run/reify_typerefs_2a.scala
@@ -0,0 +1,17 @@
+import scala.reflect.mirror._
+
+package foo {
+ class Expression {
+ override def toString = "Expression"
+ }
+}
+
+object Test extends App {
+ val code = reify {
+ List(new foo.Expression, new foo.Expression)
+ };
+
+ val toolbox = mkToolBox()
+ val evaluated = toolbox.runExpr(code.tree)
+ println("evaluated = " + evaluated)
+}
diff --git a/test/files/run/reify_typerefs_2b.check b/test/files/run/reify_typerefs_2b.check
new file mode 100644
index 0000000000..919c298ba3
--- /dev/null
+++ b/test/files/run/reify_typerefs_2b.check
@@ -0,0 +1 @@
+evaluated = List(Expression, Expression) \ No newline at end of file
diff --git a/test/files/run/reify_typerefs_2b.scala b/test/files/run/reify_typerefs_2b.scala
new file mode 100644
index 0000000000..3d9f7d61b8
--- /dev/null
+++ b/test/files/run/reify_typerefs_2b.scala
@@ -0,0 +1,17 @@
+import scala.reflect.mirror._
+
+package foo {
+ object Expression {
+ override def toString = "Expression"
+ }
+}
+
+object Test extends App {
+ val code = reify {
+ List(foo.Expression, foo.Expression)
+ };
+
+ val toolbox = mkToolBox()
+ val evaluated = toolbox.runExpr(code.tree)
+ println("evaluated = " + evaluated)
+}
diff --git a/test/files/run/reify_typerefs_3a.check b/test/files/run/reify_typerefs_3a.check
new file mode 100644
index 0000000000..919c298ba3
--- /dev/null
+++ b/test/files/run/reify_typerefs_3a.check
@@ -0,0 +1 @@
+evaluated = List(Expression, Expression) \ No newline at end of file
diff --git a/test/files/run/reify_typerefs_3a.scala b/test/files/run/reify_typerefs_3a.scala
new file mode 100644
index 0000000000..4128073f60
--- /dev/null
+++ b/test/files/run/reify_typerefs_3a.scala
@@ -0,0 +1,17 @@
+import scala.reflect.mirror._
+
+object foo {
+ class Expression {
+ override def toString = "Expression"
+ }
+}
+
+object Test extends App {
+ val code = reify {
+ List(new foo.Expression, new foo.Expression)
+ };
+
+ val toolbox = mkToolBox()
+ val evaluated = toolbox.runExpr(code.tree)
+ println("evaluated = " + evaluated)
+}
diff --git a/test/files/run/reify_typerefs_3b.check b/test/files/run/reify_typerefs_3b.check
new file mode 100644
index 0000000000..919c298ba3
--- /dev/null
+++ b/test/files/run/reify_typerefs_3b.check
@@ -0,0 +1 @@
+evaluated = List(Expression, Expression) \ No newline at end of file
diff --git a/test/files/run/reify_typerefs_3b.scala b/test/files/run/reify_typerefs_3b.scala
new file mode 100644
index 0000000000..a7ede00c9c
--- /dev/null
+++ b/test/files/run/reify_typerefs_3b.scala
@@ -0,0 +1,17 @@
+import scala.reflect.mirror._
+
+object foo {
+ object Expression {
+ override def toString = "Expression"
+ }
+}
+
+object Test extends App {
+ val code = reify {
+ List(foo.Expression, foo.Expression)
+ };
+
+ val toolbox = mkToolBox()
+ val evaluated = toolbox.runExpr(code.tree)
+ println("evaluated = " + evaluated)
+}
diff --git a/test/files/run/reify_varargs.scala b/test/files/run/reify_varargs.scala
index 175cfb5db0..fe8f03b702 100644
--- a/test/files/run/reify_varargs.scala
+++ b/test/files/run/reify_varargs.scala
@@ -1,16 +1,10 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
val msg = java.text.MessageFormat.format(
"On {1} there was {2} on planet {0}.",
"Hoth", "the fifth of August", "a disturbance in the Force")
println("Message="+msg)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/repl-parens.check b/test/files/run/repl-parens.check
index 69f0a9ce30..4b7ce6b059 100644
--- a/test/files/run/repl-parens.check
+++ b/test/files/run/repl-parens.check
@@ -34,7 +34,7 @@ res7: (Int, Int) = (4,4)
scala> (((2 + 2)), ((2 + 2)), 2)
res8: (Int, Int, Int) = (4,4,2)
-scala> ((((2 + 2)), ((2 + 2)), 2).productIterator ++ Iterator(3) mkString)
+scala> (((((2 + 2)), ((2 + 2)), 2).productIterator ++ Iterator(3)).mkString)
res9: String = 4423
scala>
diff --git a/test/files/run/repl-parens.scala b/test/files/run/repl-parens.scala
index c1cf9b50e1..e25933b1a2 100644
--- a/test/files/run/repl-parens.scala
+++ b/test/files/run/repl-parens.scala
@@ -11,7 +11,7 @@ object Test extends ReplTest {
5 ; ( (2 + 2 ) ) ; ((5))
(((2 + 2)), ((2 + 2)))
(((2 + 2)), ((2 + 2)), 2)
-((((2 + 2)), ((2 + 2)), 2).productIterator ++ Iterator(3) mkString)
+(((((2 + 2)), ((2 + 2)), 2).productIterator ++ Iterator(3)).mkString)
55 ; ((2 + 2)) ; (1, 2, 3)
55 ; (x: Int) => x + 1 ; () => ((5))
@@ -26,4 +26,4 @@ foo(5)(10)(15)+foo(5)(10)(15)
List(1) ++ List('a')
""".trim
-} \ No newline at end of file
+}
diff --git a/test/files/run/repl-power.check b/test/files/run/repl-power.check
index 1e7b6f0cd8..e439a2a7f4 100644
--- a/test/files/run/repl-power.check
+++ b/test/files/run/repl-power.check
@@ -14,6 +14,7 @@ scala> global.emptyValDef // "it is imported twice in the same scope by ..."
res0: $r.global.emptyValDef.type = private val _ = _
scala> val tp = ArrayClass[scala.util.Random] // magic with manifests
+warning: there were 2 feature warnings; re-run with -feature for details
tp: $r.global.Type = Array[scala.util.Random]
scala> tp.memberType(Array_apply) // evidence
diff --git a/test/files/run/repl-suppressed-warnings.scala b/test/files/run/repl-suppressed-warnings.scala
index a78b00f36e..9afbbaf1a5 100644
--- a/test/files/run/repl-suppressed-warnings.scala
+++ b/test/files/run/repl-suppressed-warnings.scala
@@ -1,6 +1,7 @@
import scala.tools.partest.ReplTest
object Test extends ReplTest {
+ override def extraSettings = "-Xoldpatmat"
def code = """
// "Is this thing on?" Not working on first couple
diff --git a/test/files/run/t1195.check b/test/files/run/t1195.check
index d023bc91f7..554e3fd03d 100644
--- a/test/files/run/t1195.check
+++ b/test/files/run/t1195.check
@@ -1,6 +1,6 @@
-_ <: scala.runtime.AbstractFunction1[Int, _ <: Object with scala.Product with scala.Serializable] with scala.Serializable with java.lang.Object
-_ <: Object with scala.Product with scala.Serializable
-Object with scala.Product with scala.Serializable
-_ <: scala.runtime.AbstractFunction1[Int, _ <: Object with scala.Product with scala.Serializable] with scala.Serializable with java.lang.Object
-_ <: Object with scala.Product with scala.Serializable
-Object with scala.Product with scala.Serializable
+ConcreteTypeTag[Bar.type], underlying = <: scala.runtime.AbstractFunction1[Int,Bar] with Serializable{case def unapply(x$0: Bar): Option[Int]} with Singleton
+ConcreteTypeTag[Bar], underlying = <: Product with Serializable{val x: Int; def copy(x: Int): Bar; def copy$default$1: Int; def _1: Int}
+ConcreteTypeTag[Product with Serializable], underlying = Product with Serializable
+ConcreteTypeTag[Bar.type], underlying = <: scala.runtime.AbstractFunction1[Int,Bar] with Serializable{case def unapply(x$0: Bar): Option[Int]} with Singleton
+ConcreteTypeTag[Bar], underlying = <: Product with Serializable{val x: Int; def copy(x: Int): Bar; def copy$default$1: Int; def _1: Int}
+ConcreteTypeTag[Product with Serializable], underlying = Product with Serializable
diff --git a/test/files/run/t1195.scala b/test/files/run/t1195.scala
index 81ef5bdb0e..93b1dcbd07 100644
--- a/test/files/run/t1195.scala
+++ b/test/files/run/t1195.scala
@@ -6,8 +6,8 @@ object Test {
val f1 = f()
val g1 = g()
val h1 = h()
-
- def m[T: Manifest](x: T) = println(manifest[T])
+
+ def m[T: Manifest](x: T) = println(manifest[T] + ", underlying = " + manifest[T].sym.typeSignature)
def main(args: Array[String]): Unit = {
m(f)
diff --git a/test/files/run/t2886.check b/test/files/run/t2886.check
index 5fe1e73a45..8d97a82799 100644
--- a/test/files/run/t2886.check
+++ b/test/files/run/t2886.check
@@ -1,5 +1,5 @@
-((x: scala.Predef.String) => {
- val x$1 = x;
- val x$2 = x;
- Test.test(x$2, x$1)
-})
+((x: String) => {
+ val x$1 = x;
+ val x$2 = x;
+ Test.this.test(x$2, x$1)
+})
diff --git a/test/files/run/t2886.scala b/test/files/run/t2886.scala
new file mode 100644
index 0000000000..e0835a0a44
--- /dev/null
+++ b/test/files/run/t2886.scala
@@ -0,0 +1,9 @@
+import scala.reflect.mirror._
+
+object Test {
+ def test(name: String, address: String) = null
+ def main(args: Array[String]) = {
+ val tree = reify((x:String) => test(address=x,name=x)).tree
+ println(tree)
+ }
+}
diff --git a/test/files/run/t3507.check b/test/files/run/t3507.check
new file mode 100644
index 0000000000..50ab029592
--- /dev/null
+++ b/test/files/run/t3507.check
@@ -0,0 +1 @@
+ConcreteTypeTag[_1.type#b.c.type]
diff --git a/test/files/neg/t3507.scala b/test/files/run/t3507.scala
index 32688d3934..3cdd40a881 100644
--- a/test/files/neg/t3507.scala
+++ b/test/files/run/t3507.scala
@@ -5,11 +5,11 @@ class A {
def m = b.c
}
-object Test {
+object Test extends App {
var a: A = new A // mutable
val c /*: object _1.b.c forSome { val _1: A } */ = a.m // widening using existential
-
- def mani[T: Manifest](x: T) = ()
+
+ def mani[T: Manifest](x: T) = println(manifest[T])
mani/*[object _1.b.c]*/(c) // kaboom in manifestOfType / TreeGen.mkAttributedQualifier
// --> _1 is not in scope here
} \ No newline at end of file
diff --git a/test/files/run/t3758.check b/test/files/run/t3758.check
new file mode 100644
index 0000000000..9c6ab655a3
--- /dev/null
+++ b/test/files/run/t3758.check
@@ -0,0 +1,6 @@
+List(String)
+List(Int)
+List(Float)
+List(String)
+List(Int)
+List(Float)
diff --git a/test/files/run/t3758.scala b/test/files/run/t3758.scala
index 18750b0a9c..10bfb5724b 100644
--- a/test/files/run/t3758.scala
+++ b/test/files/run/t3758.scala
@@ -1,10 +1,10 @@
object Test {
def main(args: Array[String]): Unit = {
- assert(classManifest[Array[String]].typeArguments contains classManifest[String])
- assert(classManifest[Array[Int]].typeArguments contains classManifest[Int])
- assert(classManifest[Array[Float]].typeArguments contains classManifest[Float])
- assert(manifest[Array[String]].typeArguments contains manifest[String])
- assert(manifest[Array[Int]].typeArguments contains manifest[Int])
- assert(manifest[Array[Float]].typeArguments contains manifest[Float])
+ println(classManifest[Array[String]].tpe.typeArguments)
+ println(classManifest[Array[Int]].tpe.typeArguments)
+ println(classManifest[Array[Float]].tpe.typeArguments)
+ println(manifest[Array[String]].tpe.typeArguments)
+ println(manifest[Array[Int]].tpe.typeArguments)
+ println(manifest[Array[Float]].tpe.typeArguments)
}
}
diff --git a/test/files/run/t3835.scala b/test/files/run/t3835.scala
index 49e591195f..c120a61f6e 100644
--- a/test/files/run/t3835.scala
+++ b/test/files/run/t3835.scala
@@ -1,4 +1,9 @@
object Test extends App {
- println((1, 2, 3) match { case (r, \u03b8, \u03c6) => r + \u03b8 + \u03c6 })
- println(1 match { case \u00e9 => \u00e9 })
+ // work around optimizer bug SI-5672 -- generates wrong bytecode for switches in arguments
+ // virtpatmat happily emits a switch for a one-case switch, whereas -Xoldpatmat did not
+ // this is not the focus of this test, hence the temporary workaround
+ def a = (1, 2, 3) match { case (r, \u03b8, \u03c6) => r + \u03b8 + \u03c6 }
+ println(a)
+ def b = (1 match { case \u00e9 => \u00e9 })
+ println(b)
}
diff --git a/test/files/run/t4110.check b/test/files/run/t4110.check
index 8b005989de..28f220e1fe 100644
--- a/test/files/run/t4110.check
+++ b/test/files/run/t4110.check
@@ -1,2 +1,2 @@
-Object with Test$A with Test$B
-Object with Test$A with Test$B
+ConcreteTypeTag[Test.A with Test.B]
+ConcreteTypeTag[Test.A with Test.B]
diff --git a/test/files/run/t4172.check b/test/files/run/t4172.check
index da467e27ea..4598e02d1f 100644
--- a/test/files/run/t4172.check
+++ b/test/files/run/t4172.check
@@ -4,6 +4,8 @@ Type :help for more information.
scala>
scala> val c = { class C { override def toString = "C" }; ((new C, new C { def f = 2 })) }
+warning: there were 1 feature warnings; re-run with -feature for details
+warning: there were 1 feature warnings; re-run with -feature for details
c: (C, C{def f: Int}) forSome { type C <: Object } = (C,C)
scala>
diff --git a/test/files/run/t4317/S_1.scala b/test/files/run/t4317/S_1.scala
index 2de408268c..2756c879eb 100644
--- a/test/files/run/t4317/S_1.scala
+++ b/test/files/run/t4317/S_1.scala
@@ -1,3 +1,5 @@
+import language.existentials
+
object S_1 {
def foo1(x: Class[_ <: AnyRef]) = 0
def foo2(x: Class[_ <: AnyRef], y: Int) = 99
diff --git a/test/files/run/t4710.check b/test/files/run/t4710.check
index aa2f08d452..7c2b10b098 100644
--- a/test/files/run/t4710.check
+++ b/test/files/run/t4710.check
@@ -2,6 +2,7 @@ Type in expressions to have them evaluated.
Type :help for more information.
scala> def method : String = { implicit def f(s: Symbol) = "" ; 'symbol }
+warning: there were 1 feature warnings; re-run with -feature for details
method: String
scala>
diff --git a/test/files/run/t5224.check b/test/files/run/t5224.check
index 28bc75d4fd..c754f23551 100644
--- a/test/files/run/t5224.check
+++ b/test/files/run/t5224.check
@@ -1,9 +1,9 @@
-{
- @new Foo(bar = "qwe") class C extends scala.AnyRef {
- def <init>() = {
- super.<init>();
- ()
- }
- };
- ()
-}
+{
+ @new Foo(bar = "qwe") class C extends Object {
+ def <init>() = {
+ super.<init>();
+ ()
+ }
+ };
+ ()
+}
diff --git a/test/files/run/t5224.scala b/test/files/run/t5224.scala
index 2226a69a05..93b244e03e 100644
--- a/test/files/run/t5224.scala
+++ b/test/files/run/t5224.scala
@@ -1,9 +1,8 @@
-import scala.reflect._
-import scala.reflect.api._
+import scala.reflect.mirror._
class Foo(bar: String) extends ClassfileAnnotation
object Test extends App {
- val tree = scala.reflect.Code.lift{@Foo(bar = "qwe") class C}.tree
+ val tree = reify{@Foo(bar = "qwe") class C}.tree
println(tree.toString)
} \ No newline at end of file
diff --git a/test/files/run/t5225_1.check b/test/files/run/t5225_1.check
index 719da572c7..40db2468b1 100644
--- a/test/files/run/t5225_1.check
+++ b/test/files/run/t5225_1.check
@@ -1,4 +1,4 @@
-{
- @new transient() @new volatile() var x: Int = 2;
- ()
-}
+{
+ @new transient() @new volatile() var x = 2;
+ ()
+}
diff --git a/test/files/run/t5225_1.scala b/test/files/run/t5225_1.scala
index a655b7dd71..5e1d3b1f17 100644
--- a/test/files/run/t5225_1.scala
+++ b/test/files/run/t5225_1.scala
@@ -1,7 +1,6 @@
-import scala.reflect._
-import scala.reflect.api._
+import scala.reflect.mirror._
object Test extends App {
- val tree = scala.reflect.Code.lift{@transient @volatile var x = 2}.tree
+ val tree = reify{@transient @volatile var x = 2}.tree
println(tree.toString)
} \ No newline at end of file
diff --git a/test/files/run/t5225_2.check b/test/files/run/t5225_2.check
index c4f6b4761e..8cd2ddc1a4 100644
--- a/test/files/run/t5225_2.check
+++ b/test/files/run/t5225_2.check
@@ -1,4 +1,4 @@
-{
- def foo(@new cloneable() x: Int): String = "";
- ()
-}
+{
+ def foo(@new cloneable() x: Int) = "";
+ ()
+}
diff --git a/test/files/run/t5225_2.scala b/test/files/run/t5225_2.scala
index 65ea9b2f73..4cab640fe8 100644
--- a/test/files/run/t5225_2.scala
+++ b/test/files/run/t5225_2.scala
@@ -1,7 +1,6 @@
-import scala.reflect._
-import scala.reflect.api._
+import scala.reflect.mirror._
object Test extends App {
- val tree = scala.reflect.Code.lift{def foo(@cloneable x: Int) = ""}.tree
+ val tree = reify{def foo(@cloneable x: Int) = ""}.tree
println(tree.toString)
} \ No newline at end of file
diff --git a/test/files/run/t5229_1.scala b/test/files/run/t5229_1.scala
index d5af569656..273079a89d 100644
--- a/test/files/run/t5229_1.scala
+++ b/test/files/run/t5229_1.scala
@@ -1,13 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
object C
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5229_2.scala b/test/files/run/t5229_2.scala
index 07f9ac6b84..85bf78ba31 100644
--- a/test/files/run/t5229_2.scala
+++ b/test/files/run/t5229_2.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ val code = reify {
object C {
val x = 2
}
@@ -11,8 +9,7 @@ object Test extends App {
println(C.x)
};
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val evaluated = toolbox.runExpr(code.tree)
println("evaluated = " + evaluated)
}
diff --git a/test/files/run/t5230.scala b/test/files/run/t5230.scala
index d3106ca05c..e0632f591c 100644
--- a/test/files/run/t5230.scala
+++ b/test/files/run/t5230.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ val code = reify {
class C {
val x = 2
}
@@ -11,8 +9,7 @@ object Test extends App {
println(new C().x)
};
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val evaluated = toolbox.runExpr(code.tree)
println("evaluated = " + evaluated)
}
diff --git a/test/files/run/t5258a.scala b/test/files/run/t5258a.scala
deleted file mode 100644
index 8cc4249e06..0000000000
--- a/test/files/run/t5258a.scala
+++ /dev/null
@@ -1,13 +0,0 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
-
-object Test extends App {
- val code = scala.reflect.Code.lift{
- println(classOf[Int])
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
-} \ No newline at end of file
diff --git a/test/files/run/t5266_1.scala b/test/files/run/t5266_1.scala
index 4262bc7a7b..ebb432be71 100644
--- a/test/files/run/t5266_1.scala
+++ b/test/files/run/t5266_1.scala
@@ -1,15 +1,12 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ val code = reify {
def x = 2
println(x)
};
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val evaluated = toolbox.runExpr(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/t5266_2.scala b/test/files/run/t5266_2.scala
index d0f718dbd7..27c91c35a8 100644
--- a/test/files/run/t5266_2.scala
+++ b/test/files/run/t5266_2.scala
@@ -1,16 +1,13 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ val code = reify {
def x = 2
def y = x
println(y)
};
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val evaluated = toolbox.runExpr(code.tree)
println("evaluated = " + evaluated)
}
diff --git a/test/files/run/t5269.scala b/test/files/run/t5269.scala
index cab99f17e6..9026090b29 100644
--- a/test/files/run/t5269.scala
+++ b/test/files/run/t5269.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
trait Z {
val z = 2
}
@@ -13,9 +11,5 @@ object Test extends App {
}
new X().println()
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5270.scala b/test/files/run/t5270.scala
index 934cc13dea..476b610148 100644
--- a/test/files/run/t5270.scala
+++ b/test/files/run/t5270.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
class Y {
def y = 100
}
@@ -17,9 +15,5 @@ object Test extends App {
}
new X().println()
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5271_1.check b/test/files/run/t5271_1.check
index 9b956da17a..7a728e5164 100644
--- a/test/files/run/t5271_1.check
+++ b/test/files/run/t5271_1.check
@@ -1,11 +1,11 @@
-{
- case class C extends Object with Product with Serializable {
- <caseaccessor> <paramaccessor> val foo : Int = _;
- <caseaccessor> <paramaccessor> val bar : Int = _;
- def <init>(foo: Int, bar: Int) = {
- super.<init>();
- ()
- }
- };
- ()
-}
+{
+ case class C extends Product with Serializable {
+ <caseaccessor> <paramaccessor> val foo: Int = _;
+ <caseaccessor> <paramaccessor> val bar: Int = _;
+ def <init>(foo: Int, bar: Int) = {
+ super.<init>();
+ ()
+ }
+ };
+ ()
+}
diff --git a/test/files/run/t5271_1.scala b/test/files/run/t5271_1.scala
index fbc57aead7..5baa57c290 100644
--- a/test/files/run/t5271_1.scala
+++ b/test/files/run/t5271_1.scala
@@ -1,13 +1,10 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ val code = reify {
case class C(foo: Int, bar: Int)
};
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
println(code.tree)
}
diff --git a/test/files/run/t5271_2.check b/test/files/run/t5271_2.check
index 27297febb6..d8d6edeffc 100644
--- a/test/files/run/t5271_2.check
+++ b/test/files/run/t5271_2.check
@@ -1,12 +1,12 @@
-{
- case class C extends Object with Product with Serializable {
- <caseaccessor> <paramaccessor> val foo : Int = _;
- <caseaccessor> <paramaccessor> val bar : Int = _;
- def <init>(foo: Int, bar: Int) = {
- super.<init>();
- ()
- }
- };
- val c = C.apply(2, 2);
- scala.this.Predef.println(c.foo.$times(c.bar))
-}
+{
+ case class C extends Product with Serializable {
+ <caseaccessor> <paramaccessor> val foo: Int = _;
+ <caseaccessor> <paramaccessor> val bar: Int = _;
+ def <init>(foo: Int, bar: Int) = {
+ super.<init>();
+ ()
+ }
+ };
+ val c = C.apply(2, 2);
+ scala.this.Predef.println(c.foo.$times(c.bar))
+}
diff --git a/test/files/run/t5271_2.scala b/test/files/run/t5271_2.scala
index 4bfc574e00..9820ebe692 100644
--- a/test/files/run/t5271_2.scala
+++ b/test/files/run/t5271_2.scala
@@ -1,15 +1,12 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ val code = reify {
case class C(foo: Int, bar: Int)
val c = C(2, 2)
println(c.foo * c.bar)
};
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
println(code.tree)
}
diff --git a/test/files/run/t5271_3.check b/test/files/run/t5271_3.check
index 9331c78959..1d4f47c5df 100644
--- a/test/files/run/t5271_3.check
+++ b/test/files/run/t5271_3.check
@@ -1,19 +1,19 @@
-{
- object C extends scala.AnyRef with Serializable {
- def <init>() = {
- super.<init>();
- ()
- };
- def qwe: Int = 4
- };
- case class C extends Object with Product with Serializable {
- <caseaccessor> <paramaccessor> val foo : Int = _;
- <caseaccessor> <paramaccessor> val bar : Int = _;
- def <init>(foo: Int, bar: Int) = {
- super.<init>();
- ()
- }
- };
- val c = C.apply(2, 2);
- scala.this.Predef.println(c.foo.$times(c.bar).$eq$eq(C.qwe))
-}
+{
+ object C extends Object {
+ def <init>() = {
+ super.<init>();
+ ()
+ };
+ def qwe = 4
+ };
+ case class C extends Product with Serializable {
+ <caseaccessor> <paramaccessor> val foo: Int = _;
+ <caseaccessor> <paramaccessor> val bar: Int = _;
+ def <init>(foo: Int, bar: Int) = {
+ super.<init>();
+ ()
+ }
+ };
+ val c = C.apply(2, 2);
+ scala.this.Predef.println(c.foo.$times(c.bar).$eq$eq(C.qwe))
+}
diff --git a/test/files/run/t5271_3.scala b/test/files/run/t5271_3.scala
index a085bdca4c..5fd94f4a2b 100644
--- a/test/files/run/t5271_3.scala
+++ b/test/files/run/t5271_3.scala
@@ -1,16 +1,13 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ val code = reify {
object C { def qwe = 4 }
case class C(foo: Int, bar: Int)
val c = C(2, 2)
println(c.foo * c.bar == C.qwe)
};
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
println(code.tree)
}
diff --git a/test/files/run/t5271_4.scala b/test/files/run/t5271_4.scala
index c253b1adca..e13a331d9c 100644
--- a/test/files/run/t5271_4.scala
+++ b/test/files/run/t5271_4.scala
@@ -1,13 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
case object C
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5272_1.scala b/test/files/run/t5272_1.scala
index 882287f033..46472babf3 100644
--- a/test/files/run/t5272_1.scala
+++ b/test/files/run/t5272_1.scala
@@ -1,16 +1,10 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
2 match {
case 2 => println("okay")
case _ => println("not okay")
}
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5272_2.scala b/test/files/run/t5272_2.scala
index 48b6a670bb..f5bab44205 100644
--- a/test/files/run/t5272_2.scala
+++ b/test/files/run/t5272_2.scala
@@ -1,15 +1,9 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
2 match {
case x => println("okay" + x)
}
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5273_1.flags b/test/files/run/t5273_1.flags
new file mode 100644
index 0000000000..ba80cad69b
--- /dev/null
+++ b/test/files/run/t5273_1.flags
@@ -0,0 +1 @@
+-Xoldpatmat
diff --git a/test/files/run/t5273_1.scala b/test/files/run/t5273_1.scala
index 80460a4ae6..1b491923b2 100644
--- a/test/files/run/t5273_1.scala
+++ b/test/files/run/t5273_1.scala
@@ -1,16 +1,10 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
List(1, 2, 3) match {
case foo :: bar :: _ => println(foo * bar)
case _ => println("this is getting out of hand!")
}
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5273_2a.flags b/test/files/run/t5273_2a.flags
new file mode 100644
index 0000000000..ba80cad69b
--- /dev/null
+++ b/test/files/run/t5273_2a.flags
@@ -0,0 +1 @@
+-Xoldpatmat
diff --git a/test/files/run/t5273_2a.scala b/test/files/run/t5273_2a.scala
index a7a336d8a7..062ff79d11 100644
--- a/test/files/run/t5273_2a.scala
+++ b/test/files/run/t5273_2a.scala
@@ -1,14 +1,8 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
val foo :: bar :: _ = List(1, 2, 3)
println(foo * bar)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5273_2b.flags b/test/files/run/t5273_2b.flags
new file mode 100644
index 0000000000..ba80cad69b
--- /dev/null
+++ b/test/files/run/t5273_2b.flags
@@ -0,0 +1 @@
+-Xoldpatmat
diff --git a/test/files/run/t5273_2b.scala b/test/files/run/t5273_2b.scala
index 85c40f0607..82f1de89f7 100644
--- a/test/files/run/t5273_2b.scala
+++ b/test/files/run/t5273_2b.scala
@@ -1,15 +1,9 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
val RegexParser = """(.*) \d+([A-Z]+) \| (.*) \|.*""".r
val RegexParser(name, shortname, value) = "American Dollar 1USD | 2,8567 | sometext"
println("name = %s, shortname = %s, value = %s".format(name, shortname, value))
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5274_1.scala b/test/files/run/t5274_1.scala
index 74a5b81bcb..7ef332aa05 100644
--- a/test/files/run/t5274_1.scala
+++ b/test/files/run/t5274_1.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
def factorial(n: BigInt): BigInt =
if (n == 0) 1 else n * factorial(n-1)
@@ -11,9 +9,5 @@ object Test extends App {
println("50! = " + f50)
println("49! = " + f49)
println("50!/49! = " + (f50 / f49))
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5274_2.scala b/test/files/run/t5274_2.scala
index 5984a64967..0b373b358f 100644
--- a/test/files/run/t5274_2.scala
+++ b/test/files/run/t5274_2.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
/** Nested methods can use and even update everything
* visible in their scope (including local variables or
* arguments of enclosing methods).
@@ -48,9 +46,5 @@ object Test extends App {
println(ar)
sort(ar)
println(ar)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5275.scala b/test/files/run/t5275.scala
index 285d8a18a4..534672be3c 100644
--- a/test/files/run/t5275.scala
+++ b/test/files/run/t5275.scala
@@ -1,14 +1,8 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
class C(val foo: Int)
println(new C(2).foo)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5276_1a.scala b/test/files/run/t5276_1a.scala
index b717675824..a6e327c0e7 100644
--- a/test/files/run/t5276_1a.scala
+++ b/test/files/run/t5276_1a.scala
@@ -1,14 +1,8 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
lazy val x = 2
println(x)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5276_1b.scala b/test/files/run/t5276_1b.scala
index 1ff25504ca..1bc3e246c9 100644
--- a/test/files/run/t5276_1b.scala
+++ b/test/files/run/t5276_1b.scala
@@ -1,14 +1,8 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
implicit lazy val x = 2
println(implicitly[Int])
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5276_2a.scala b/test/files/run/t5276_2a.scala
index af5ff2a565..cdd87ddc9e 100644
--- a/test/files/run/t5276_2a.scala
+++ b/test/files/run/t5276_2a.scala
@@ -1,17 +1,11 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
class C {
lazy val x = 2
}
println(new C().x)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5276_2b.scala b/test/files/run/t5276_2b.scala
index 63904b2898..2fac951731 100644
--- a/test/files/run/t5276_2b.scala
+++ b/test/files/run/t5276_2b.scala
@@ -1,18 +1,12 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
class C {
implicit lazy val x = 2
def y = implicitly[Int]
}
println(new C().y)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5277_1.scala b/test/files/run/t5277_1.scala
index 0aaec7cdf2..f95e9ab6ec 100644
--- a/test/files/run/t5277_1.scala
+++ b/test/files/run/t5277_1.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
def fact(n: Int): BigInt =
if (n == 0) 1 else fact(n-1) * n
class Factorizer(n: Int) {
@@ -12,9 +10,5 @@ object Test extends App {
implicit def int2fact(n: Int) = new Factorizer(n)
println("10! = " + (10!))
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5277_2.scala b/test/files/run/t5277_2.scala
index 91ed55122a..5f1737f503 100644
--- a/test/files/run/t5277_2.scala
+++ b/test/files/run/t5277_2.scala
@@ -1,17 +1,11 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
def p(implicit i: Int) = print(i)
implicit val v = 2
println(p)
println(p(1))
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5279.scala b/test/files/run/t5279.scala
index cef58535d5..aab5588877 100644
--- a/test/files/run/t5279.scala
+++ b/test/files/run/t5279.scala
@@ -1,13 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
println(new Integer(10))
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5334_1.scala b/test/files/run/t5334_1.scala
index 9887bebf78..49dbea6b68 100644
--- a/test/files/run/t5334_1.scala
+++ b/test/files/run/t5334_1.scala
@@ -1,14 +1,12 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ val code = reify {
class C { override def toString = "C" }
- new C
+ val ret = new C
+ ret.asInstanceOf[Object]
};
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
println(toolbox.runExpr(code.tree))
}
diff --git a/test/files/run/t5334_2.scala b/test/files/run/t5334_2.scala
index 775a05aaf7..c6a77158dd 100644
--- a/test/files/run/t5334_2.scala
+++ b/test/files/run/t5334_2.scala
@@ -1,14 +1,12 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ val code = reify {
class C { override def toString() = "C" }
- List((new C, new C))
+ val ret = List((new C, new C))
+ ret.asInstanceOf[List[Any]]
};
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
println(toolbox.runExpr(code.tree))
}
diff --git a/test/files/run/t5335.scala b/test/files/run/t5335.scala
index 8e2ed59db6..a0fe6c5822 100644
--- a/test/files/run/t5335.scala
+++ b/test/files/run/t5335.scala
@@ -1,13 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
println(new {def x = 2}.x)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5415.scala b/test/files/run/t5415.scala
index 3db356da86..c6552f69b3 100644
--- a/test/files/run/t5415.scala
+++ b/test/files/run/t5415.scala
@@ -1,14 +1,10 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import scala.reflect.runtime.Mirror.ToolBox
-
object Test extends App{
case class Queryable2[T]() { def filter(predicate: T => Boolean) = ??? }
trait CoffeesTable{ def sales : Int }
val q = Queryable2[CoffeesTable]()
- val code = scala.reflect.Code.lift{q.filter(_.sales > 5)}
+ import scala.reflect.mirror._
+ val code = reify{q.filter(_.sales > 5)}
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val ttree = toolbox.typeCheck(code.tree)
}
diff --git a/test/files/run/t5419.check b/test/files/run/t5419.check
index 7e6d739354..50751b168e 100644
--- a/test/files/run/t5419.check
+++ b/test/files/run/t5419.check
@@ -1 +1 @@
-(5: Int(5) @Foo)
+5: @Foo.asInstanceOf[Int]
diff --git a/test/files/run/t5419.scala b/test/files/run/t5419.scala
index 695786e5c4..d65d8f38c8 100644
--- a/test/files/run/t5419.scala
+++ b/test/files/run/t5419.scala
@@ -1,9 +1,8 @@
-import scala.reflect._
-import scala.reflect.api._
+import scala.reflect.mirror._
class Foo extends StaticAnnotation
object Test extends App {
- val tree = scala.reflect.Code.lift{5: @Foo}.tree
+ val tree = reify{(5: @Foo).asInstanceOf[Int]}.tree
println(tree.toString)
} \ No newline at end of file
diff --git a/test/files/run/t5423.scala b/test/files/run/t5423.scala
index fc507c417b..645c8c7c1d 100644
--- a/test/files/run/t5423.scala
+++ b/test/files/run/t5423.scala
@@ -1,7 +1,4 @@
-import java.lang.Class
import scala.reflect.mirror._
-import scala.reflect.runtime.Mirror.ToolBox
-import scala.reflect.Code
final class table extends StaticAnnotation
@table class A
diff --git a/test/files/run/t5535.check b/test/files/run/t5535.check
new file mode 100644
index 0000000000..8da9829b78
--- /dev/null
+++ b/test/files/run/t5535.check
@@ -0,0 +1,20 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> def h()(i: Int) = 1 + i
+h: ()(i: Int)Int
+
+scala> println(h()(5))
+6
+
+scala> val f = h() _
+f: Int => Int = <function1>
+
+scala> println(f(10))
+11
+
+scala>
+
+scala>
diff --git a/test/files/run/t5535.scala b/test/files/run/t5535.scala
new file mode 100644
index 0000000000..7bc12f3470
--- /dev/null
+++ b/test/files/run/t5535.scala
@@ -0,0 +1,10 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ def code = """
+def h()(i: Int) = 1 + i
+println(h()(5))
+val f = h() _
+println(f(10))
+ """
+}
diff --git a/test/files/run/t5583.check b/test/files/run/t5583.check
new file mode 100644
index 0000000000..39b969fbe7
--- /dev/null
+++ b/test/files/run/t5583.check
@@ -0,0 +1,20 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> var s = 0
+s: Int = 0
+
+scala> for (i <- 1 to 10) {s += i}
+
+scala> for (i <- 1 to 10) {s += i}
+
+scala> for (i <- 1 to 10) {s += i}
+
+scala> println(s)
+165
+
+scala>
+
+scala>
diff --git a/test/files/run/t5583.scala b/test/files/run/t5583.scala
new file mode 100644
index 0000000000..8561a5946f
--- /dev/null
+++ b/test/files/run/t5583.scala
@@ -0,0 +1,11 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ def code = """
+var s = 0
+for (i <- 1 to 10) {s += i}
+for (i <- 1 to 10) {s += i}
+for (i <- 1 to 10) {s += i}
+println(s)
+ """
+}
diff --git a/test/files/run/toolbox_console_reporter.check b/test/files/run/toolbox_console_reporter.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/files/run/toolbox_console_reporter.check
diff --git a/test/files/run/toolbox_console_reporter.scala b/test/files/run/toolbox_console_reporter.scala
new file mode 100644
index 0000000000..fd244b40ec
--- /dev/null
+++ b/test/files/run/toolbox_console_reporter.scala
@@ -0,0 +1,16 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ // todo. cannot test this unfortunately, because ConsoleReporter grabs Console.out too early
+ // todo. and isn't affected by Console.setOut employed by partest to intercept output
+
+ //val toolbox = mkToolBox(reporter = mkConsoleReporter(), options = "-deprecation")
+ //toolbox.runExpr(reify{
+ // object Utils {
+ // @deprecated("test", "2.10.0")
+ // def foo { println("hello") }
+ // }
+ //
+ // Utils.foo
+ //})
+}
diff --git a/test/files/run/toolbox_default_reporter_is_silent.check b/test/files/run/toolbox_default_reporter_is_silent.check
new file mode 100644
index 0000000000..ef0493b275
--- /dev/null
+++ b/test/files/run/toolbox_default_reporter_is_silent.check
@@ -0,0 +1 @@
+hello
diff --git a/test/files/run/toolbox_default_reporter_is_silent.scala b/test/files/run/toolbox_default_reporter_is_silent.scala
new file mode 100644
index 0000000000..78606e2abc
--- /dev/null
+++ b/test/files/run/toolbox_default_reporter_is_silent.scala
@@ -0,0 +1,13 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ val toolbox = mkToolBox()
+ toolbox.runExpr(reify{
+ object Utils {
+ @deprecated("test", "2.10.0")
+ def foo { println("hello") }
+ }
+
+ Utils.foo
+ })
+}
diff --git a/test/files/run/toolbox_silent_reporter.check b/test/files/run/toolbox_silent_reporter.check
new file mode 100644
index 0000000000..2d05b1e3f8
--- /dev/null
+++ b/test/files/run/toolbox_silent_reporter.check
@@ -0,0 +1,4 @@
+hello
+============compiler messages============
+Info(NoPosition,method foo in object Utils is deprecated: test,WARNING)
+=========================================
diff --git a/test/files/run/toolbox_silent_reporter.scala b/test/files/run/toolbox_silent_reporter.scala
new file mode 100644
index 0000000000..7e9259946b
--- /dev/null
+++ b/test/files/run/toolbox_silent_reporter.scala
@@ -0,0 +1,16 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ val toolbox = mkToolBox(options = "-deprecation")
+ toolbox.runExpr(reify{
+ object Utils {
+ @deprecated("test", "2.10.0")
+ def foo { println("hello") }
+ }
+
+ Utils.foo
+ })
+ println("============compiler messages============")
+ toolbox.reporter.infos.foreach(println(_))
+ println("=========================================")
+} \ No newline at end of file
diff --git a/test/files/run/toolbox_typecheck_implicitsdisabled.check b/test/files/run/toolbox_typecheck_implicitsdisabled.check
new file mode 100644
index 0000000000..4bc64530ab
--- /dev/null
+++ b/test/files/run/toolbox_typecheck_implicitsdisabled.check
@@ -0,0 +1,5 @@
+{
+ import scala.Predef._;
+ scala.Predef.any2ArrowAssoc[Int](1).->[Int](2)
+}
+scala.reflect.runtime.ToolBoxes$ToolBox$ToolBoxError: reflective typecheck has failed: value -> is not a member of Int
diff --git a/test/files/run/toolbox_typecheck_implicitsdisabled.scala b/test/files/run/toolbox_typecheck_implicitsdisabled.scala
new file mode 100644
index 0000000000..9d52e91f73
--- /dev/null
+++ b/test/files/run/toolbox_typecheck_implicitsdisabled.scala
@@ -0,0 +1,24 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ val toolbox = mkToolBox()
+
+ val tree1 = Block(
+ Import(Select(Ident(newTermName("scala")), newTermName("Predef")), List(ImportSelector(nme.WILDCARD, -1, null, -1))),
+ Apply(Select(Literal(Constant(1)), newTermName("$minus$greater")), List(Literal(Constant(2))))
+ )
+ val ttree1 = toolbox.typeCheck(tree1, withImplicitViewsDisabled = false)
+ println(ttree1)
+
+ try {
+ val tree2 = Block(
+ Import(Select(Ident(newTermName("scala")), newTermName("Predef")), List(ImportSelector(nme.WILDCARD, -1, null, -1))),
+ Apply(Select(Literal(Constant(1)), newTermName("$minus$greater")), List(Literal(Constant(2))))
+ )
+ val ttree2 = toolbox.typeCheck(tree2, withImplicitViewsDisabled = true)
+ println(ttree2)
+ } catch {
+ case ex: Throwable =>
+ println(ex)
+ }
+} \ No newline at end of file
diff --git a/test/files/run/toolbox_typecheck_macrosdisabled.check b/test/files/run/toolbox_typecheck_macrosdisabled.check
new file mode 100644
index 0000000000..cf2420bc17
--- /dev/null
+++ b/test/files/run/toolbox_typecheck_macrosdisabled.check
@@ -0,0 +1,5 @@
+{
+ val $mr: mr.type = mr;
+ $mr.Expr.apply[Int(2)]($mr.Literal.apply($mr.Constant.apply(2)))($mr.ConcreteTypeTag.apply[Int(2)]($mr.ConstantType.apply($mr.Constant.apply(2))))
+}
+mr.reify[Int](2)
diff --git a/test/files/run/toolbox_typecheck_macrosdisabled.scala b/test/files/run/toolbox_typecheck_macrosdisabled.scala
new file mode 100644
index 0000000000..7d2707d5e1
--- /dev/null
+++ b/test/files/run/toolbox_typecheck_macrosdisabled.scala
@@ -0,0 +1,17 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ val toolbox = mkToolBox()
+ val mrPkg = staticModule("scala.reflect.package")
+ val mrSym = selectTerm(mrPkg, "mirror")
+ val NullaryMethodType(mrTpe) = mrSym.typeSignature
+ val mr = newFreeTerm("mr", mrTpe, scala.reflect.mirror, null)
+
+ val tree1 = Apply(Select(Ident(mr), newTermName("reify")), List(Literal(Constant(2))))
+ val ttree1 = toolbox.typeCheck(tree1, withMacrosDisabled = false)
+ println(ttree1)
+
+ val tree2 = Apply(Select(Ident(mr), newTermName("reify")), List(Literal(Constant(2))))
+ val ttree2 = toolbox.typeCheck(tree2, withMacrosDisabled = true)
+ println(ttree2)
+}
diff --git a/test/files/run/treePrint.scala b/test/files/run/treePrint.scala
index e0332a705f..4a80e2824d 100644
--- a/test/files/run/treePrint.scala
+++ b/test/files/run/treePrint.scala
@@ -4,7 +4,7 @@ object Test {
import scala.tools.nsc._
import interpreter._
import java.io.{ OutputStream, BufferedReader, StringReader, PrintWriter, Writer, OutputStreamWriter}
-
+
val code = """
def foo = {
var q: Boolean = false
@@ -22,11 +22,11 @@ object Test {
else 20
}
else 30
-
+
(x == 5) || !q || true
}
- """
-
+ """
+
class NullOutputStream extends OutputStream { def write(b: Int) { } }
def main(args: Array[String]) {
@@ -35,7 +35,8 @@ object Test {
settings.Ycompacttrees.value = true
val intp = new IMain(settings, new PrintWriter(new NullOutputStream))
- val power = new Power(intp, new ReplVals { })
+ val vals = new ReplVals { }
+ val power = new Power(intp, vals)
intp.interpret("""def initialize = "Have to interpret something or we get errors." """)
power trees code foreach println
}
diff --git a/test/files/run/typetags_core.check b/test/files/run/typetags_core.check
new file mode 100644
index 0000000000..62fcb481ae
--- /dev/null
+++ b/test/files/run/typetags_core.check
@@ -0,0 +1,30 @@
+true
+ConcreteTypeTag[Byte]
+true
+ConcreteTypeTag[Short]
+true
+ConcreteTypeTag[Char]
+true
+ConcreteTypeTag[Int]
+true
+ConcreteTypeTag[Long]
+true
+ConcreteTypeTag[Float]
+true
+ConcreteTypeTag[Double]
+true
+ConcreteTypeTag[Boolean]
+true
+ConcreteTypeTag[Unit]
+true
+ConcreteTypeTag[Any]
+true
+ConcreteTypeTag[Object]
+true
+ConcreteTypeTag[AnyVal]
+true
+ConcreteTypeTag[AnyRef]
+true
+ConcreteTypeTag[Null]
+true
+ConcreteTypeTag[Nothing]
diff --git a/test/files/run/typetags_core.scala b/test/files/run/typetags_core.scala
new file mode 100644
index 0000000000..883c54b9a8
--- /dev/null
+++ b/test/files/run/typetags_core.scala
@@ -0,0 +1,32 @@
+object Test extends App {
+ println(implicitly[TypeTag[Byte]] eq TypeTag.Byte)
+ println(implicitly[TypeTag[Byte]])
+ println(implicitly[TypeTag[Short]] eq TypeTag.Short)
+ println(implicitly[TypeTag[Short]])
+ println(implicitly[TypeTag[Char]] eq TypeTag.Char)
+ println(implicitly[TypeTag[Char]])
+ println(implicitly[TypeTag[Int]] eq TypeTag.Int)
+ println(implicitly[TypeTag[Int]])
+ println(implicitly[TypeTag[Long]] eq TypeTag.Long)
+ println(implicitly[TypeTag[Long]])
+ println(implicitly[TypeTag[Float]] eq TypeTag.Float)
+ println(implicitly[TypeTag[Float]])
+ println(implicitly[TypeTag[Double]] eq TypeTag.Double)
+ println(implicitly[TypeTag[Double]])
+ println(implicitly[TypeTag[Boolean]] eq TypeTag.Boolean)
+ println(implicitly[TypeTag[Boolean]])
+ println(implicitly[TypeTag[Unit]] eq TypeTag.Unit)
+ println(implicitly[TypeTag[Unit]])
+ println(implicitly[TypeTag[Any]] eq TypeTag.Any)
+ println(implicitly[TypeTag[Any]])
+ println(implicitly[TypeTag[Object]] eq TypeTag.Object)
+ println(implicitly[TypeTag[Object]])
+ println(implicitly[TypeTag[AnyVal]] eq TypeTag.AnyVal)
+ println(implicitly[TypeTag[AnyVal]])
+ println(implicitly[TypeTag[AnyRef]] eq TypeTag.AnyRef)
+ println(implicitly[TypeTag[AnyRef]])
+ println(implicitly[TypeTag[Null]] eq TypeTag.Null)
+ println(implicitly[TypeTag[Null]])
+ println(implicitly[TypeTag[Nothing]] eq TypeTag.Nothing)
+ println(implicitly[TypeTag[Nothing]])
+} \ No newline at end of file
diff --git a/test/files/run/virtpatmat_alts.flags b/test/files/run/virtpatmat_alts.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/run/virtpatmat_alts.flags
+++ b/test/files/run/virtpatmat_alts.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/run/virtpatmat_apply.flags b/test/files/run/virtpatmat_apply.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/run/virtpatmat_apply.flags
+++ b/test/files/run/virtpatmat_apply.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/run/virtpatmat_casting.flags b/test/files/run/virtpatmat_casting.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/run/virtpatmat_casting.flags
+++ b/test/files/run/virtpatmat_casting.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/run/virtpatmat_extends_product.flags b/test/files/run/virtpatmat_extends_product.flags
index ac6b805bd0..8b13789179 100644
--- a/test/files/run/virtpatmat_extends_product.flags
+++ b/test/files/run/virtpatmat_extends_product.flags
@@ -1 +1 @@
--Yvirtpatmat
+
diff --git a/test/files/run/virtpatmat_literal.flags b/test/files/run/virtpatmat_literal.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/run/virtpatmat_literal.flags
+++ b/test/files/run/virtpatmat_literal.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/run/virtpatmat_nested_lists.flags b/test/files/run/virtpatmat_nested_lists.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/run/virtpatmat_nested_lists.flags
+++ b/test/files/run/virtpatmat_nested_lists.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/run/virtpatmat_npe.flags b/test/files/run/virtpatmat_npe.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/run/virtpatmat_npe.flags
+++ b/test/files/run/virtpatmat_npe.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/run/virtpatmat_opt_sharing.flags b/test/files/run/virtpatmat_opt_sharing.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/run/virtpatmat_opt_sharing.flags
+++ b/test/files/run/virtpatmat_opt_sharing.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/run/virtpatmat_partial.flags b/test/files/run/virtpatmat_partial.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/run/virtpatmat_partial.flags
+++ b/test/files/run/virtpatmat_partial.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/run/virtpatmat_staging.flags b/test/files/run/virtpatmat_staging.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/run/virtpatmat_staging.flags
+++ b/test/files/run/virtpatmat_staging.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/run/virtpatmat_stringinterp.check b/test/files/run/virtpatmat_stringinterp.check
new file mode 100644
index 0000000000..7927f4f2d9
--- /dev/null
+++ b/test/files/run/virtpatmat_stringinterp.check
@@ -0,0 +1 @@
+Node(1)
diff --git a/test/files/run/virtpatmat_stringinterp.flags b/test/files/run/virtpatmat_stringinterp.flags
new file mode 100644
index 0000000000..e1b37447c9
--- /dev/null
+++ b/test/files/run/virtpatmat_stringinterp.flags
@@ -0,0 +1 @@
+-Xexperimental \ No newline at end of file
diff --git a/test/files/run/virtpatmat_stringinterp.scala b/test/files/run/virtpatmat_stringinterp.scala
new file mode 100644
index 0000000000..213712f17a
--- /dev/null
+++ b/test/files/run/virtpatmat_stringinterp.scala
@@ -0,0 +1,13 @@
+object Test extends App {
+ case class Node(x: Int)
+
+ implicit def sc2xml(sc: StringContext): XMLContext = new XMLContext(sc)
+ class XMLContext(sc: StringContext) {
+ object xml {
+ def unapplySeq(xml: Node): Option[Seq[Node]] = Some(List(Node(1)))
+ }
+ }
+
+ val x: Node = Node(0)
+ x match { case xml"""<foo arg=$a/>""" => println(a) }
+} \ No newline at end of file
diff --git a/test/files/run/virtpatmat_switch.flags b/test/files/run/virtpatmat_switch.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/run/virtpatmat_switch.flags
+++ b/test/files/run/virtpatmat_switch.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/run/virtpatmat_tailcalls_verifyerror.flags b/test/files/run/virtpatmat_tailcalls_verifyerror.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/run/virtpatmat_tailcalls_verifyerror.flags
+++ b/test/files/run/virtpatmat_tailcalls_verifyerror.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/run/virtpatmat_try.flags b/test/files/run/virtpatmat_try.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/run/virtpatmat_try.flags
+++ b/test/files/run/virtpatmat_try.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/run/virtpatmat_typed.flags b/test/files/run/virtpatmat_typed.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/run/virtpatmat_typed.flags
+++ b/test/files/run/virtpatmat_typed.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/run/virtpatmat_unapply.flags b/test/files/run/virtpatmat_unapply.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/run/virtpatmat_unapply.flags
+++ b/test/files/run/virtpatmat_unapply.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/run/virtpatmat_unapplyprod.flags b/test/files/run/virtpatmat_unapplyprod.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/run/virtpatmat_unapplyprod.flags
+++ b/test/files/run/virtpatmat_unapplyprod.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/run/virtpatmat_unapplyseq.flags b/test/files/run/virtpatmat_unapplyseq.flags
index 9769db9257..3f5a3100e4 100644
--- a/test/files/run/virtpatmat_unapplyseq.flags
+++ b/test/files/run/virtpatmat_unapplyseq.flags
@@ -1 +1 @@
- -Yvirtpatmat -Xexperimental
+ -Xexperimental
diff --git a/test/files/specialized/spec-patmatch.check b/test/files/specialized/spec-patmatch.check
index 33306ab5d9..a2746c0f48 100644
--- a/test/files/specialized/spec-patmatch.check
+++ b/test/files/specialized/spec-patmatch.check
@@ -17,4 +17,4 @@ long
double
float
default
-2 \ No newline at end of file
+10
diff --git a/test/pending/neg/reify_packed.check b/test/pending/neg/reify_packed.check
new file mode 100644
index 0000000000..adba330d56
--- /dev/null
+++ b/test/pending/neg/reify_packed.check
@@ -0,0 +1,4 @@
+reify_packed.scala:6: error: implementation restriction: cannot reify block of type List[_$1] that involves a type declared inside the block being reified. consider casting the return value to a suitable type.
+ reify {
+ ^
+one error found
diff --git a/test/pending/neg/reify_packed.scala b/test/pending/neg/reify_packed.scala
new file mode 100644
index 0000000000..0240f2a4b5
--- /dev/null
+++ b/test/pending/neg/reify_packed.scala
@@ -0,0 +1,10 @@
+object Test extends App {
+ reify {
+ class C { override def toString() = "C" }
+ val ret = List((new C, new C))
+ ret.asInstanceOf[List[_]]
+ };
+
+ val toolbox = mkToolBox()
+ println(toolbox.runExpr(code.tree))
+}
diff --git a/test/files/pos/macros.flags b/test/pending/run/macro-expand-default.flags
index 7fea2ff901..7fea2ff901 100644
--- a/test/files/pos/macros.flags
+++ b/test/pending/run/macro-expand-default.flags
diff --git a/test/pending/run/macro-expand-default/Impls_1.scala b/test/pending/run/macro-expand-default/Impls_1.scala
new file mode 100644
index 0000000000..fefe8fc4e2
--- /dev/null
+++ b/test/pending/run/macro-expand-default/Impls_1.scala
@@ -0,0 +1,10 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int], y: c.Expr[Int]) = {
+ import c.mirror._
+ val sum = Apply(Select(x.tree, newTermName("$minus")), List(y.tree))
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(sum))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/pending/run/macro-expand-default/Macros_Test_2.scala b/test/pending/run/macro-expand-default/Macros_Test_2.scala
new file mode 100644
index 0000000000..92fe84d04a
--- /dev/null
+++ b/test/pending/run/macro-expand-default/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Test extends App {
+ def foo(x: Int = 2, y: Int = -40) = macro Impls.foo
+ foo(y = -40, x = 2)
+ foo(x = 2, y = -40)
+ foo(x = 100)
+ foo(y = 100)
+ foo()
+} \ No newline at end of file
diff --git a/test/pending/run/macro-expand-implicit-macro-has-context-bound.check b/test/pending/run/macro-expand-implicit-macro-has-context-bound.check
new file mode 100644
index 0000000000..ac4213d6e9
--- /dev/null
+++ b/test/pending/run/macro-expand-implicit-macro-has-context-bound.check
@@ -0,0 +1 @@
+43 \ No newline at end of file
diff --git a/test/pending/run/macro-overload.flags b/test/pending/run/macro-expand-implicit-macro-has-context-bound.flags
index 7fea2ff901..7fea2ff901 100644
--- a/test/pending/run/macro-overload.flags
+++ b/test/pending/run/macro-expand-implicit-macro-has-context-bound.flags
diff --git a/test/pending/run/macro-expand-implicit-macro-has-context-bound/Impls_1.scala b/test/pending/run/macro-expand-implicit-macro-has-context-bound/Impls_1.scala
new file mode 100644
index 0000000000..5c50576281
--- /dev/null
+++ b/test/pending/run/macro-expand-implicit-macro-has-context-bound/Impls_1.scala
@@ -0,0 +1,10 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[U](c: Ctx)(x: c.Expr[U])(evidence: c.Expr[Numeric[U]]) = {
+ import c.mirror._
+ val plusOne = Apply(Select(evidence.tree, newTermName("plus")), List(x.tree, Literal(Constant(1))))
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(plusOne))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/pending/run/macro-expand-implicit-macro-has-context-bound/Macros_Test_2.scala b/test/pending/run/macro-expand-implicit-macro-has-context-bound/Macros_Test_2.scala
new file mode 100644
index 0000000000..7d16b773a6
--- /dev/null
+++ b/test/pending/run/macro-expand-implicit-macro-has-context-bound/Macros_Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ def foo[U: Numeric](x: U) = macro Impls.foo[U]
+ foo(42)
+} \ No newline at end of file
diff --git a/test/pending/run/macro-expand-named.flags b/test/pending/run/macro-expand-named.flags
new file mode 100644
index 0000000000..7fea2ff901
--- /dev/null
+++ b/test/pending/run/macro-expand-named.flags
@@ -0,0 +1 @@
+-Xmacros \ No newline at end of file
diff --git a/test/pending/run/macro-expand-named/Impls_1.scala b/test/pending/run/macro-expand-named/Impls_1.scala
new file mode 100644
index 0000000000..fefe8fc4e2
--- /dev/null
+++ b/test/pending/run/macro-expand-named/Impls_1.scala
@@ -0,0 +1,10 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int], y: c.Expr[Int]) = {
+ import c.mirror._
+ val sum = Apply(Select(x.tree, newTermName("$minus")), List(y.tree))
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(sum))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/pending/run/macro-expand-named/Macros_Test_2.scala b/test/pending/run/macro-expand-named/Macros_Test_2.scala
new file mode 100644
index 0000000000..abebcf8448
--- /dev/null
+++ b/test/pending/run/macro-expand-named/Macros_Test_2.scala
@@ -0,0 +1,5 @@
+object Test extends App {
+ def foo(x: Int, y: Int) = macro Impls.foo
+ foo(y = -40, x = 2)
+ foo(x = 2, y = -40)
+} \ No newline at end of file
diff --git a/test/pending/run/macro-expand-tparams-prefix-e1.check b/test/pending/run/macro-expand-tparams-prefix-e1.check
new file mode 100644
index 0000000000..4fa05a7678
--- /dev/null
+++ b/test/pending/run/macro-expand-tparams-prefix-e1.check
@@ -0,0 +1,3 @@
+TypeTag(List[Int])
+TypeTag(String)
+TypeTag(Boolean)
diff --git a/test/pending/run/macro-expand-tparams-prefix-e1.flags b/test/pending/run/macro-expand-tparams-prefix-e1.flags
new file mode 100644
index 0000000000..7fea2ff901
--- /dev/null
+++ b/test/pending/run/macro-expand-tparams-prefix-e1.flags
@@ -0,0 +1 @@
+-Xmacros \ No newline at end of file
diff --git a/test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala b/test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala
new file mode 100644
index 0000000000..bc880fdf77
--- /dev/null
+++ b/test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala
@@ -0,0 +1,12 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[T, U: c.TypeTag, V](c: Ctx)(implicit T: c.TypeTag[T], V: c.TypeTag[V]): c.Expr[Unit] = {
+ import c.mirror._
+ Block(List(
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))),
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.TypeTag[U]].toString)))),
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))),
+ Literal(Constant(())))
+ }
+}
diff --git a/test/pending/run/macro-expand-tparams-prefix-e1/Macros_Test_2.scala b/test/pending/run/macro-expand-tparams-prefix-e1/Macros_Test_2.scala
new file mode 100644
index 0000000000..5c863804d0
--- /dev/null
+++ b/test/pending/run/macro-expand-tparams-prefix-e1/Macros_Test_2.scala
@@ -0,0 +1,13 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ class D[T: TypeTag] {
+ class C[U: TypeTag] {
+ def foo[V] = macro Impls.foo[List[T], U, V]
+ foo[Boolean]
+ }
+ }
+
+ val outer1 = new D[Int]
+ new outer1.C[String]
+} \ No newline at end of file
diff --git a/test/pending/run/macro-expand-tparams-prefix-f1.check b/test/pending/run/macro-expand-tparams-prefix-f1.check
new file mode 100644
index 0000000000..d15226143a
--- /dev/null
+++ b/test/pending/run/macro-expand-tparams-prefix-f1.check
@@ -0,0 +1,3 @@
+TypeTag(List[T])
+TypeTag(U)
+TypeTag(Boolean)
diff --git a/test/pending/run/macro-expand-tparams-prefix-f1.flags b/test/pending/run/macro-expand-tparams-prefix-f1.flags
new file mode 100644
index 0000000000..7fea2ff901
--- /dev/null
+++ b/test/pending/run/macro-expand-tparams-prefix-f1.flags
@@ -0,0 +1 @@
+-Xmacros \ No newline at end of file
diff --git a/test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala b/test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala
new file mode 100644
index 0000000000..bc880fdf77
--- /dev/null
+++ b/test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala
@@ -0,0 +1,12 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo[T, U: c.TypeTag, V](c: Ctx)(implicit T: c.TypeTag[T], V: c.TypeTag[V]): c.Expr[Unit] = {
+ import c.mirror._
+ Block(List(
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))),
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.TypeTag[U]].toString)))),
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))),
+ Literal(Constant(())))
+ }
+}
diff --git a/test/pending/run/macro-expand-tparams-prefix-f1/Macros_Test_2.scala b/test/pending/run/macro-expand-tparams-prefix-f1/Macros_Test_2.scala
new file mode 100644
index 0000000000..bc8e7ac75c
--- /dev/null
+++ b/test/pending/run/macro-expand-tparams-prefix-f1/Macros_Test_2.scala
@@ -0,0 +1,13 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ class D[T] {
+ class C[U] {
+ def foo[V] = macro Impls.foo[List[T], U, V]
+ foo[Boolean]
+ }
+ }
+
+ val outer1 = new D[Int]
+ new outer1.C[String]
+} \ No newline at end of file
diff --git a/test/pending/run/macro-overload.check b/test/pending/run/macro-overload.check
deleted file mode 100644
index 764f914e48..0000000000
--- a/test/pending/run/macro-overload.check
+++ /dev/null
@@ -1,4 +0,0 @@
-object-Int
-object-String
-class-Int
-class-String \ No newline at end of file
diff --git a/test/pending/run/macro-overload/Macros_1.scala b/test/pending/run/macro-overload/Macros_1.scala
deleted file mode 100644
index f24c69ea7b..0000000000
--- a/test/pending/run/macro-overload/Macros_1.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-object Macros {
- def macro bar(x: Int): Int = Apply(Select(Select(Ident("scala"), newTermName("Predef")), newTermName("println")), List(Literal(Constant("object-Int"))))
- def macro bar(x: String): String = Apply(Select(Select(Ident("scala"), newTermName("Predef")), newTermName("println")), List(Literal(Constant("object-String"))))
-}
-
-class Macros {
- def macro bar(x: Int): Int = Apply(Select(Select(Ident("scala"), newTermName("Predef")), newTermName("println")), List(Literal(Constant("class-Int"))))
- def macro bar(x: String): String = Apply(Select(Select(Ident("scala"), newTermName("Predef")), newTermName("println")), List(Literal(Constant("class-String"))))
-} \ No newline at end of file
diff --git a/test/pending/run/macro-overload/Test_2.scala b/test/pending/run/macro-overload/Test_2.scala
deleted file mode 100644
index 75f6572e03..0000000000
--- a/test/pending/run/macro-overload/Test_2.scala
+++ /dev/null
@@ -1,6 +0,0 @@
-object Test extends App {
- Macros.bar(2)
- Macros.bar("2")
- new Macros.bar(2)
- new Macros.bar("2")
-} \ No newline at end of file
diff --git a/test/pending/run/macro-quasiinvalidbody-a.check b/test/pending/run/macro-quasiinvalidbody-a.check
new file mode 100644
index 0000000000..f70d7bba4a
--- /dev/null
+++ b/test/pending/run/macro-quasiinvalidbody-a.check
@@ -0,0 +1 @@
+42 \ No newline at end of file
diff --git a/test/pending/run/macro-quasiinvalidbody-a.flags b/test/pending/run/macro-quasiinvalidbody-a.flags
new file mode 100644
index 0000000000..7fea2ff901
--- /dev/null
+++ b/test/pending/run/macro-quasiinvalidbody-a.flags
@@ -0,0 +1 @@
+-Xmacros \ No newline at end of file
diff --git a/test/pending/run/macro-quasiinvalidbody-a/Impls_1.scala b/test/pending/run/macro-quasiinvalidbody-a/Impls_1.scala
new file mode 100644
index 0000000000..0da37cd5c0
--- /dev/null
+++ b/test/pending/run/macro-quasiinvalidbody-a/Impls_1.scala
@@ -0,0 +1,5 @@
+import scala.reflect.makro.{Context => Ctx}
+
+trait Impls {
+ def impl(c: Ctx)(x: c.Expr[Any]) = x
+} \ No newline at end of file
diff --git a/test/pending/run/macro-quasiinvalidbody-a/Macros_Test_2.scala b/test/pending/run/macro-quasiinvalidbody-a/Macros_Test_2.scala
new file mode 100644
index 0000000000..04a43080bd
--- /dev/null
+++ b/test/pending/run/macro-quasiinvalidbody-a/Macros_Test_2.scala
@@ -0,0 +1,10 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Macros extends Impls {
+ def foo(x: Any) = macro impl
+}
+
+object Test extends App {
+ import Macros._
+ println(foo(42))
+} \ No newline at end of file
diff --git a/test/pending/run/macro-quasiinvalidbody-b.check b/test/pending/run/macro-quasiinvalidbody-b.check
new file mode 100644
index 0000000000..f70d7bba4a
--- /dev/null
+++ b/test/pending/run/macro-quasiinvalidbody-b.check
@@ -0,0 +1 @@
+42 \ No newline at end of file
diff --git a/test/pending/run/macro-quasiinvalidbody-b.flags b/test/pending/run/macro-quasiinvalidbody-b.flags
new file mode 100644
index 0000000000..7fea2ff901
--- /dev/null
+++ b/test/pending/run/macro-quasiinvalidbody-b.flags
@@ -0,0 +1 @@
+-Xmacros \ No newline at end of file
diff --git a/test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala b/test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala
new file mode 100644
index 0000000000..d84d04974f
--- /dev/null
+++ b/test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala
@@ -0,0 +1,7 @@
+import scala.reflect.makro.{Context => Ctx}
+
+trait ImplContainer {
+ object Impls {
+ def foo(c: Ctx)(x: c.Expr[Any]) = x
+ }
+} \ No newline at end of file
diff --git a/test/pending/run/macro-quasiinvalidbody-b/Macros_Test_2.scala b/test/pending/run/macro-quasiinvalidbody-b/Macros_Test_2.scala
new file mode 100644
index 0000000000..82f88b62e4
--- /dev/null
+++ b/test/pending/run/macro-quasiinvalidbody-b/Macros_Test_2.scala
@@ -0,0 +1,10 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Macros extends ImplContainer {
+ def foo(x: Any) = macro Impls.foo
+}
+
+object Test extends App {
+ import Macros._
+ println(foo(42))
+} \ No newline at end of file
diff --git a/test/pending/run/macro-reify-array.flags b/test/pending/run/macro-reify-array.flags
new file mode 100644
index 0000000000..7fea2ff901
--- /dev/null
+++ b/test/pending/run/macro-reify-array.flags
@@ -0,0 +1 @@
+-Xmacros \ No newline at end of file
diff --git a/test/pending/run/macro-reify-array/Macros_1.scala b/test/pending/run/macro-reify-array/Macros_1.scala
new file mode 100644
index 0000000000..af42321484
--- /dev/null
+++ b/test/pending/run/macro-reify-array/Macros_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Macros {
+ def foo[T](s: String) = macro Impls.foo[T]
+
+ object Impls {
+ def foo[T: c.TypeTag](c: Ctx)(s: c.Expr[T]) = c.reify {
+ Array(s.eval)
+ }
+ }
+} \ No newline at end of file
diff --git a/test/pending/run/macro-reify-array/Test_2.scala b/test/pending/run/macro-reify-array/Test_2.scala
new file mode 100644
index 0000000000..e40d5b40e0
--- /dev/null
+++ b/test/pending/run/macro-reify-array/Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ val arr = Macros.foo("hello", "world")
+ println(arr.getClass)
+} \ No newline at end of file
diff --git a/test/pending/run/macro-reify-eval-vs-value.flags b/test/pending/run/macro-reify-eval-vs-value.flags
new file mode 100644
index 0000000000..7fea2ff901
--- /dev/null
+++ b/test/pending/run/macro-reify-eval-vs-value.flags
@@ -0,0 +1 @@
+-Xmacros \ No newline at end of file
diff --git a/test/pending/run/macro-reify-eval-vs-value/Macros_1.scala b/test/pending/run/macro-reify-eval-vs-value/Macros_1.scala
new file mode 100644
index 0000000000..98dd93b0f8
--- /dev/null
+++ b/test/pending/run/macro-reify-eval-vs-value/Macros_1.scala
@@ -0,0 +1,25 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Macros {
+ def fooEval(s: String) = macro Impls.fooEval
+ def fooValue(s: String) = macro Impls.fooValue
+
+ object Impls {
+ def fooEval(c: Ctx)(s: c.Expr[String]) = c.reify {
+ println("hello " + s.eval)
+ println("hello " + s.eval)
+ }
+
+ def fooValue(c: Ctx)(s: c.Expr[String]) = c.reify {
+ {
+ println("hello " + s.value)
+ def sayHello = println(s.value)
+ sayHello
+ }
+ println("hello " + s.eval);
+ {
+ println("hello " + s.eval)
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/test/pending/run/macro-reify-eval-vs-value/Test_2.scala b/test/pending/run/macro-reify-eval-vs-value/Test_2.scala
new file mode 100644
index 0000000000..8e62e6e0e7
--- /dev/null
+++ b/test/pending/run/macro-reify-eval-vs-value/Test_2.scala
@@ -0,0 +1,5 @@
+object Test extends App {
+ Macros.fooEval({ println("in ur logz"); "world"})
+ println("======================")
+ Macros.fooValue({ println("i can has cheezburger?"); "world"})
+} \ No newline at end of file
diff --git a/test/pending/run/macro-reify-groundtypetag-hktypeparams-tags.check b/test/pending/run/macro-reify-groundtypetag-hktypeparams-tags.check
new file mode 100644
index 0000000000..7e4b000c52
--- /dev/null
+++ b/test/pending/run/macro-reify-groundtypetag-hktypeparams-tags.check
@@ -0,0 +1,2 @@
+TypeTag(List[Int])
+TypeTag(List[List[Int]])
diff --git a/test/pending/run/macro-reify-groundtypetag-hktypeparams-tags/Test.scala b/test/pending/run/macro-reify-groundtypetag-hktypeparams-tags/Test.scala
new file mode 100644
index 0000000000..ef70a66f1a
--- /dev/null
+++ b/test/pending/run/macro-reify-groundtypetag-hktypeparams-tags/Test.scala
@@ -0,0 +1,9 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ def fooTypeTagHK[C[_]: ConcreteTypeTag, T: ConcreteTypeTag] = {
+ println(implicitly[ConcreteTypeTag[C[T]]])
+ println(implicitly[ConcreteTypeTag[List[C[T]]]])
+ }
+ fooTypeTagHK[List, Int]
+} \ No newline at end of file
diff --git a/test/pending/run/macro-reify-tagful-b.check b/test/pending/run/macro-reify-tagful-b.check
new file mode 100644
index 0000000000..5bd9fe2156
--- /dev/null
+++ b/test/pending/run/macro-reify-tagful-b.check
@@ -0,0 +1 @@
+List(List(hello world))
diff --git a/test/pending/run/macro-reify-tagful-b.flags b/test/pending/run/macro-reify-tagful-b.flags
new file mode 100644
index 0000000000..7fea2ff901
--- /dev/null
+++ b/test/pending/run/macro-reify-tagful-b.flags
@@ -0,0 +1 @@
+-Xmacros \ No newline at end of file
diff --git a/test/pending/run/macro-reify-tagful-b/Macros_1.scala b/test/pending/run/macro-reify-tagful-b/Macros_1.scala
new file mode 100644
index 0000000000..38b839330b
--- /dev/null
+++ b/test/pending/run/macro-reify-tagful-b/Macros_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Macros {
+ def foo[T](s: T) = macro Impls.foo[List[T]]
+
+ object Impls {
+ def foo[T: c.TypeTag](c: Ctx)(s: c.Expr[T]) = c.reify {
+ List(s.eval)
+ }
+ }
+} \ No newline at end of file
diff --git a/test/pending/run/macro-reify-tagful-b/Test_2.scala b/test/pending/run/macro-reify-tagful-b/Test_2.scala
new file mode 100644
index 0000000000..142234901f
--- /dev/null
+++ b/test/pending/run/macro-reify-tagful-b/Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ val list: List[List[String]] = Macros.foo(List("hello world"))
+ println(list)
+} \ No newline at end of file
diff --git a/test/pending/run/macro-reify-tagless-b.check b/test/pending/run/macro-reify-tagless-b.check
new file mode 100644
index 0000000000..49acd94ad6
--- /dev/null
+++ b/test/pending/run/macro-reify-tagless-b.check
@@ -0,0 +1,3 @@
+error: macro must not return an expr that contains free type variables (namely: T). have you forgot to use c.TypeTag annotations for type parameters external to a reifee?
+
+java.lang.Error: reflective compilation has failed
diff --git a/test/pending/run/macro-reify-tagless-b.flags b/test/pending/run/macro-reify-tagless-b.flags
new file mode 100644
index 0000000000..7fea2ff901
--- /dev/null
+++ b/test/pending/run/macro-reify-tagless-b.flags
@@ -0,0 +1 @@
+-Xmacros \ No newline at end of file
diff --git a/test/pending/run/macro-reify-tagless-b/Impls_Macros_1.scala b/test/pending/run/macro-reify-tagless-b/Impls_Macros_1.scala
new file mode 100644
index 0000000000..fac7ba5b98
--- /dev/null
+++ b/test/pending/run/macro-reify-tagless-b/Impls_Macros_1.scala
@@ -0,0 +1,11 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Macros {
+ def foo[T](s: T) = macro Impls.foo[List[T]]
+
+ object Impls {
+ def foo[T](c: Ctx)(s: c.Expr[T]) = c.reify {
+ List(s.eval)
+ }
+ }
+} \ No newline at end of file
diff --git a/test/pending/run/macro-reify-tagless-b/Test_2.scala b/test/pending/run/macro-reify-tagless-b/Test_2.scala
new file mode 100644
index 0000000000..419ee42101
--- /dev/null
+++ b/test/pending/run/macro-reify-tagless-b/Test_2.scala
@@ -0,0 +1,11 @@
+object Test extends App {
+ //val list: List[String] = Macros.foo("hello world")
+ //println(list)
+
+ import scala.reflect.mirror._
+ val tpt = AppliedTypeTree(Ident(definitions.ListClass), List(Ident(definitions.StringClass)))
+ val rhs = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant("hello world"))))
+ val list = ValDef(NoMods, newTermName("list"), tpt, rhs)
+ val tree = Block(list, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Ident(list.name))))
+ println(tree.eval)
+}
diff --git a/test/pending/run/macro-reify-typetag-hktypeparams-notags.check b/test/pending/run/macro-reify-typetag-hktypeparams-notags.check
new file mode 100644
index 0000000000..db8a19d5f7
--- /dev/null
+++ b/test/pending/run/macro-reify-typetag-hktypeparams-notags.check
@@ -0,0 +1,2 @@
+TypeTag(C[T])
+TypeTag(List[C[T]])
diff --git a/test/pending/run/macro-reify-typetag-hktypeparams-notags/Test.scala b/test/pending/run/macro-reify-typetag-hktypeparams-notags/Test.scala
new file mode 100644
index 0000000000..9a370189a7
--- /dev/null
+++ b/test/pending/run/macro-reify-typetag-hktypeparams-notags/Test.scala
@@ -0,0 +1,9 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ def fooNoTypeTagHK[C[_], T] = {
+ println(implicitly[TypeTag[C[T]]])
+ println(implicitly[TypeTag[List[C[T]]]])
+ }
+ fooNoTypeTagHK[List, Int]
+} \ No newline at end of file
diff --git a/test/pending/run/macro-reify-typetag-hktypeparams-tags.check b/test/pending/run/macro-reify-typetag-hktypeparams-tags.check
new file mode 100644
index 0000000000..7e4b000c52
--- /dev/null
+++ b/test/pending/run/macro-reify-typetag-hktypeparams-tags.check
@@ -0,0 +1,2 @@
+TypeTag(List[Int])
+TypeTag(List[List[Int]])
diff --git a/test/pending/run/macro-reify-typetag-hktypeparams-tags/Test.scala b/test/pending/run/macro-reify-typetag-hktypeparams-tags/Test.scala
new file mode 100644
index 0000000000..0358da9b0d
--- /dev/null
+++ b/test/pending/run/macro-reify-typetag-hktypeparams-tags/Test.scala
@@ -0,0 +1,9 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ def fooTypeTagHK[C[_]: TypeTag, T: TypeTag] = {
+ println(implicitly[TypeTag[C[T]]])
+ println(implicitly[TypeTag[List[C[T]]]])
+ }
+ fooTypeTagHK[List, Int]
+} \ No newline at end of file
diff --git a/test/pending/run/reify_addressbook.scala b/test/pending/run/reify_addressbook.scala
index 54dd5545bd..7cb6dc08fd 100644
--- a/test/pending/run/reify_addressbook.scala
+++ b/test/pending/run/reify_addressbook.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
case class Person(name: String, age: Int)
/** An AddressBook takes a variable number of arguments
@@ -62,9 +60,5 @@ object Test extends App {
</html>;
println(page)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/pending/run/reify_brainf_ck.scala b/test/pending/run/reify_brainf_ck.scala
index 0034644b81..e4bcb257bd 100644
--- a/test/pending/run/reify_brainf_ck.scala
+++ b/test/pending/run/reify_brainf_ck.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
import scala.annotation._
trait Func[T] {
@@ -76,9 +74,5 @@ object Test extends App {
<.#>+++++++++++[<+++++>-]<.>++++++++[<++
+>-]<.+++.------.--------.[-]>++++++++[<++++>
-]<+.[-]++++++++++.""")
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/pending/run/reify_callccinterpreter.scala b/test/pending/run/reify_callccinterpreter.scala
index 96ae9c5c17..0e23f75dcc 100644
--- a/test/pending/run/reify_callccinterpreter.scala
+++ b/test/pending/run/reify_callccinterpreter.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
type Answer = Value;
/**
@@ -85,9 +83,5 @@ object Test extends App {
println(test(term0))
println(test(term1))
println(test(term2))
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/pending/run/reify_closure2b.scala b/test/pending/run/reify_closure2b.scala
index b9c0063290..f9ed16d309 100644
--- a/test/pending/run/reify_closure2b.scala
+++ b/test/pending/run/reify_closure2b.scala
@@ -1,17 +1,12 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
-
object Test extends App {
def foo(y: Int): Int => Int = {
class Foo(y: Int) {
- val fun = reflect.Code.lift{(x: Int) => {
+ val fun = reflect.mirror.reify{(x: Int) => {
x + y
}}
}
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val dyn = toolbox.runExpr(new Foo(y).fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/pending/run/reify_closure3b.scala b/test/pending/run/reify_closure3b.scala
index 8f161dbff3..8ef0a60c66 100644
--- a/test/pending/run/reify_closure3b.scala
+++ b/test/pending/run/reify_closure3b.scala
@@ -1,19 +1,14 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
-
object Test extends App {
def foo(y: Int): Int => Int = {
class Foo(y: Int) {
def y1 = y
- val fun = reflect.Code.lift{(x: Int) => {
+ val fun = reflect.mirror.reify{(x: Int) => {
x + y1
}}
}
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val dyn = toolbox.runExpr(new Foo(y).fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/pending/run/reify_closure4b.scala b/test/pending/run/reify_closure4b.scala
index 238795d4dd..9eeb01b459 100644
--- a/test/pending/run/reify_closure4b.scala
+++ b/test/pending/run/reify_closure4b.scala
@@ -1,19 +1,14 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
-
object Test extends App {
def foo(y: Int): Int => Int = {
class Foo(y: Int) {
val y1 = y
- val fun = reflect.Code.lift{(x: Int) => {
+ val fun = reflect.mirror.reify{(x: Int) => {
x + y1
}}
}
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val dyn = toolbox.runExpr(new Foo(y).fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/pending/run/reify_closure5b.scala b/test/pending/run/reify_closure5b.scala
index bdb2583e8a..51f1ec318d 100644
--- a/test/pending/run/reify_closure5b.scala
+++ b/test/pending/run/reify_closure5b.scala
@@ -1,17 +1,12 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
-
object Test extends App {
def foo[T](ys: List[T]): Int => Int = {
class Foo[T](ys: List[T]) {
- val fun = reflect.Code.lift{(x: Int) => {
+ val fun = reflect.mirror.reify{(x: Int) => {
x + ys.length
}}
}
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val dyn = toolbox.runExpr(new Foo(ys).fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/pending/run/reify_closure8b.check b/test/pending/run/reify_closure8b.check
deleted file mode 100644
index 9a037142aa..0000000000
--- a/test/pending/run/reify_closure8b.check
+++ /dev/null
@@ -1 +0,0 @@
-10 \ No newline at end of file
diff --git a/test/pending/run/reify_closure8b.scala b/test/pending/run/reify_closure8b.scala
deleted file mode 100644
index 38031c217b..0000000000
--- a/test/pending/run/reify_closure8b.scala
+++ /dev/null
@@ -1,16 +0,0 @@
-import scala.reflect.Code._
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
-
-object Test extends App {
- class Foo(y: Int) {
- def fun = lift{y}
- }
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- val dyn = toolbox.runExpr(new Foo(10).fun.tree)
- val foo = dyn.asInstanceOf[Int]
- println(foo)
-}
diff --git a/test/pending/run/reify_closure9a.scala b/test/pending/run/reify_closure9a.scala
index 185f4ffca1..1fc18cfa13 100644
--- a/test/pending/run/reify_closure9a.scala
+++ b/test/pending/run/reify_closure9a.scala
@@ -1,16 +1,11 @@
-import scala.reflect.Code._
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
-
+import scala.reflect.mirror._
object Test extends App {
def foo(y: Int) = {
class Foo(val y: Int) {
- def fun = lift{y}
+ def fun = reify{y}
}
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val dyn = toolbox.runExpr(new Foo(y).fun.tree)
dyn.asInstanceOf[Int]
}
diff --git a/test/pending/run/reify_closure9b.scala b/test/pending/run/reify_closure9b.scala
index ad279fac6d..32b05d00ee 100644
--- a/test/pending/run/reify_closure9b.scala
+++ b/test/pending/run/reify_closure9b.scala
@@ -1,16 +1,11 @@
-import scala.reflect.Code._
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
-
+import scala.reflect.mirror._
object Test extends App {
def foo(y: Int) = {
class Foo(y: Int) {
- def fun = lift{y}
+ def fun = reify{y}
}
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val dyn = toolbox.runExpr(new Foo(y).fun.tree)
dyn.asInstanceOf[Int]
}
diff --git a/test/pending/run/reify_closures11.scala b/test/pending/run/reify_closures11.scala
index 2c4177b8f2..ceb224c6d6 100644
--- a/test/pending/run/reify_closures11.scala
+++ b/test/pending/run/reify_closures11.scala
@@ -1,16 +1,11 @@
-import scala.reflect.Code._
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
-
+import scala.reflect.mirror._
object Test extends App {
def fun() = {
def z() = 2
- lift{z}
+ reify{z}
}
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
+ val toolbox = mkToolBox()
val dyn = toolbox.runExpr(fun().tree)
val foo = dyn.asInstanceOf[Int]
println(foo)
diff --git a/test/pending/run/reify_csv.scala b/test/pending/run/reify_csv.scala
index a6a616fab0..966521575c 100644
--- a/test/pending/run/reify_csv.scala
+++ b/test/pending/run/reify_csv.scala
@@ -1,6 +1,4 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
val csv = """
@@ -18,7 +16,7 @@ object Test extends App {
val fields = csv.head.split(";").map{_.trim()}.toList
println(fields)
- val code = scala.reflect.Code.lift({
+ reify({
object Csv {
case class record(`phase name`: String, id: String, description: String)
@@ -33,9 +31,5 @@ object Test extends App {
}
Csv.record.parse(csv) foreach println
- })
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }).eval
}
diff --git a/test/pending/run/reify_gadts.scala b/test/pending/run/reify_gadts.scala
index 9feb7a5726..652a7d99d8 100644
--- a/test/pending/run/reify_gadts.scala
+++ b/test/pending/run/reify_gadts.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
/* The syntax tree of a toy language */
abstract class Term[T]
@@ -36,9 +34,5 @@ object Test extends App {
}
println(
eval(If(IsZero(Lit(1)), Lit(41), Succ(Lit(41)))))
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/pending/run/reify_lazyevaluation.scala b/test/pending/run/reify_lazyevaluation.scala
index 0720a7c979..1a0c858914 100644
--- a/test/pending/run/reify_lazyevaluation.scala
+++ b/test/pending/run/reify_lazyevaluation.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
object lazyLib {
/** Delay the evaluation of an expression until it is needed. */
@@ -56,9 +54,5 @@ object Test extends App {
println("sl2 = " + sl2)
println("sl2() = " + sl2())
println("sl2 = " + sl2)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/pending/run/reify_newimpl_07.scala b/test/pending/run/reify_newimpl_07.scala
new file mode 100644
index 0000000000..13ca6bda8b
--- /dev/null
+++ b/test/pending/run/reify_newimpl_07.scala
@@ -0,0 +1,13 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ class C(val y: Int) {
+ val code = reify {
+ reify{y}.eval
+ }
+ }
+
+ println(new C(2).code.eval)
+ }
+} \ No newline at end of file
diff --git a/test/pending/run/reify_newimpl_08.scala b/test/pending/run/reify_newimpl_08.scala
new file mode 100644
index 0000000000..e2faa3c9af
--- /dev/null
+++ b/test/pending/run/reify_newimpl_08.scala
@@ -0,0 +1,15 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ val code = reify {
+ class C(val y: Int) {
+ val code = reify {
+ reify{y}.eval
+ }
+ }
+
+ new C(2).code.eval
+ }
+
+ println(code.eval)
+} \ No newline at end of file
diff --git a/test/pending/run/reify_newimpl_35.scala b/test/pending/run/reify_newimpl_35.scala
new file mode 100644
index 0000000000..5e1d163e9e
--- /dev/null
+++ b/test/pending/run/reify_newimpl_35.scala
@@ -0,0 +1,10 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ override def extraSettings = "-Xlog-free-types"
+ def code = """
+import scala.reflect.mirror._
+def foo[T: TypeTag] = reify{List[T]()}
+println(foo)
+ """
+}
diff --git a/test/pending/run/reify_newimpl_46.scala b/test/pending/run/reify_newimpl_46.scala
new file mode 100644
index 0000000000..840d695e83
--- /dev/null
+++ b/test/pending/run/reify_newimpl_46.scala
@@ -0,0 +1,12 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ class C[T[_] >: Null] {
+ val code = reify{val x: T[String] = null; println("ima worx"); x}
+ println(freeTypes(code))
+ val T = freeTypes(code)(0)
+ mkToolBox().runExpr(code, Map(T -> definitions.ListClass.asType))
+ }
+
+ new C[List]
+} \ No newline at end of file
diff --git a/test/pending/run/reify_newimpl_53.scala b/test/pending/run/reify_newimpl_53.scala
new file mode 100644
index 0000000000..26645dea6a
--- /dev/null
+++ b/test/pending/run/reify_newimpl_53.scala
@@ -0,0 +1,15 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ class C[T >: Null] {
+ val code = reify{
+ val tt = implicitly[TypeTag[T]]
+ println("mah typetag is: %s".format(tt))
+ }
+ println(freeTypes(code))
+ val T = freeTypes(code)(0)
+ mkToolBox().runExpr(code, Map(T -> definitions.StringClass.asType))
+ }
+
+ new C[String]
+} \ No newline at end of file
diff --git a/test/pending/run/reify_properties.scala b/test/pending/run/reify_properties.scala
index 265c344b8e..5cacc262ac 100644
--- a/test/pending/run/reify_properties.scala
+++ b/test/pending/run/reify_properties.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
/** A mutable property whose getter and setter may be customized. */
case class Property[T](init: T) {
private var value: T = init
@@ -54,9 +52,5 @@ object Test extends App {
println("user1: " + user1)
println("user2: " + user2)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/pending/run/reify_simpleinterpreter.scala b/test/pending/run/reify_simpleinterpreter.scala
index 4762afb3cc..2193edeea7 100644
--- a/test/pending/run/reify_simpleinterpreter.scala
+++ b/test/pending/run/reify_simpleinterpreter.scala
@@ -1,9 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
case class M[A](value: A) {
def bind[B](k: A => M[B]): M[B] = k(value)
def map[B](f: A => B): M[B] = bind(x => unitM(f(x)))
@@ -73,9 +71,5 @@ object Test extends App {
println(test(term0))
println(test(term1))
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/files/run/t5258a.check b/test/pending/run/t5258a.check
index 4e0b2da04c..4e0b2da04c 100644
--- a/test/files/run/t5258a.check
+++ b/test/pending/run/t5258a.check
diff --git a/test/pending/run/t5258a.scala b/test/pending/run/t5258a.scala
new file mode 100644
index 0000000000..755d135468
--- /dev/null
+++ b/test/pending/run/t5258a.scala
@@ -0,0 +1,5 @@
+object Test extends App {
+ reify {
+ println(classOf[Int])
+ }.eval
+} \ No newline at end of file
diff --git a/test/pending/run/t5258b.scala b/test/pending/run/t5258b.scala
index 3a603095b3..8ad1ff114e 100644
--- a/test/pending/run/t5258b.scala
+++ b/test/pending/run/t5258b.scala
@@ -1,14 +1,6 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
-
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
class C
println(classOf[C])
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
} \ No newline at end of file
diff --git a/test/pending/run/t5258c.scala b/test/pending/run/t5258c.scala
index b0d16ba0b1..1f76391162 100644
--- a/test/pending/run/t5258c.scala
+++ b/test/pending/run/t5258c.scala
@@ -1,14 +1,6 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
-
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
object E extends Enumeration { val foo, bar = Value }
println(E.foo)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
} \ No newline at end of file
diff --git a/test/pending/run/t5271_1.scala b/test/pending/run/t5271_1.scala
index afbd8fe465..fae64350e3 100644
--- a/test/pending/run/t5271_1.scala
+++ b/test/pending/run/t5271_1.scala
@@ -1,13 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
case class C(foo: Int, bar: Int)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/pending/run/t5271_2.scala b/test/pending/run/t5271_2.scala
index d85d945973..d25e1fe804 100644
--- a/test/pending/run/t5271_2.scala
+++ b/test/pending/run/t5271_2.scala
@@ -1,15 +1,9 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
case class C(foo: Int, bar: Int)
val c = C(2, 2)
println(c.foo * c.bar)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/pending/run/t5271_3.scala b/test/pending/run/t5271_3.scala
index 5a624de903..65a03ae323 100644
--- a/test/pending/run/t5271_3.scala
+++ b/test/pending/run/t5271_3.scala
@@ -1,16 +1,10 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
object C { def qwe = 4 }
case class C(foo: Int, bar: Int)
val c = C(2, 2)
println(c.foo * c.bar == C.qwe)
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
}
diff --git a/test/pending/run/t5418.scala b/test/pending/run/t5418.scala
index fe813cf5ae..9b0a954e47 100644
--- a/test/pending/run/t5418.scala
+++ b/test/pending/run/t5418.scala
@@ -1,13 +1,7 @@
-import scala.tools.nsc.reporters._
-import scala.tools.nsc.Settings
-import reflect.runtime.Mirror.ToolBox
+import scala.reflect.mirror._
object Test extends App {
- val code = scala.reflect.Code.lift{
+ reify {
new Object().getClass
- };
-
- val reporter = new ConsoleReporter(new Settings)
- val toolbox = new ToolBox(reporter)
- toolbox.runExpr(code.tree)
+ }.eval
} \ No newline at end of file
diff --git a/test/scaladoc/resources/implicits-base-res.scala b/test/scaladoc/resources/implicits-base-res.scala
new file mode 100644
index 0000000000..3e3d0f01a6
--- /dev/null
+++ b/test/scaladoc/resources/implicits-base-res.scala
@@ -0,0 +1,147 @@
+/**
+ * Test scaladoc implicits - the bread and butter of the testsuite :)
+ */
+package scala.test.scaladoc.implicits.base
+
+class Foo[T]
+class Bar[T]
+trait MyNumeric[R]
+
+/** Class A
+ * - tests the complete type inference
+ * - the following inherited methods should appear:
+ * {{{
+ * def convToGtColonDoubleA(x: Double) // pimpA3: with a constraint that T <: Double
+ * def convToIntA(x: Int) // pimpA2: with a constraint that T = Int
+ * def convToManifestA(x: T) // pimpA7: with 2 constraints: T: Manifest and T <: Double
+ * def convToMyNumericA(x: T) // pimpA6: with a constraint that there is x: MyNumeric[T] implicit in scope
+ * def convToNumericA(x: T) // pimpA1: with a constraint that there is x: Numeric[T] implicit in scope
+ * def convToPimpedA(x: Bar[Foo[T]]) // pimpA5: no constraints
+ * def convToPimpedA(x: S) // pimpA4: with 3 constraints: T = Foo[Bar[S]], S: Foo and S: Bar
+ * def convToTraversableOps(x: T) // pimpA7: with 2 constraints: T: Manifest and T <: Double
+ * // should not be abstract!
+ * }}}
+ */
+class A[T] {
+ /** This should prevent the implicitly inherited `def convToPimpedA: T` from `pimpA0` from showing up */
+ def convToPimpedA(x: T): T = sys.error("Let's check it out!")
+ /** This should check implicit member elimination in the case of subtyping */
+ def foo(a: T, b: AnyRef): T
+}
+/** Companion object with implicit transformations */
+object A {
+ import language.implicitConversions // according to SIP18
+
+ implicit def pimpA0[V](a: A[V]) = new PimpedA(a)
+ implicit def pimpA1[ZBUR: Numeric](a: A[ZBUR]) = new NumericA[ZBUR](a)
+ implicit def pimpA2(a: A[Int]) = new IntA(a)
+ implicit def pimpA3(a: A[T] forSome { type T <: Double }) = new GtColonDoubleA(a)
+ implicit def pimpA4[S](a: A[Foo[Bar[S]]])(implicit foo: Foo[S], bar: Bar[S]): PimpedA[S] = sys.error("not implemented")
+ implicit def pimpA5[Z](a: A[Z]): PimpedA[Bar[Foo[Z]]] = sys.error("not implemented")
+ implicit def pimpA6[Z: MyNumeric](a: A[Z]) = new MyNumericA[Z](a)
+ // TODO: Add H <: Double and see why it crashes for C and D -- context bounds, need to check!
+ implicit def pimpA7[H <: Double : Manifest](a: A[H]) = new ManifestA[H](a) with MyTraversableOps[H] { def convToTraversableOps(x: H): H = sys.error("no") }
+}
+
+
+/** Class B
+ * - tests the existential type solving
+ * - the following inherited methods should appear:
+ * {{{
+ * def convToGtColonDoubleA(x: Double) // pimpA3: no constraints
+ * def convToManifestA(x: Double) // pimpA7: no constraints
+ * def convToMyNumericA(x: Double) // pimpA6: (if showAll is set) with a constraint that there is x: MyNumeric[Double] implicit in scope
+ * def convToNumericA(x: Double) // pimpA1: no constraintsd
+ * def convToPimpedA(x: Bar[Foo[Double]]) // pimpA5: no constraints
+ * def convToTraversableOps(x: Double) // pimpA7: no constraints
+ * // should not be abstract!
+ * }}}
+ */
+class B extends A[Double]
+object B extends A
+
+
+/** Class C
+ * - tests asSeenFrom
+ * - the following inherited methods should appear:
+ * {{{
+ * def convToIntA(x: Int) // pimpA2: no constraints
+ * def convToMyNumericA(x: Int) // pimpA6: (if showAll is set) with a constraint that there is x: MyNumeric[Int] implicit in scope
+ * def convToNumericA(x: Int) // pimpA1: no constraints
+ * def convToPimpedA(x: Bar[Foo[Int]]) // pimpA5: no constraints
+ * }}}
+ */
+class C extends A[Int]
+object C extends A
+
+
+/** Class D
+ * - tests implicit elimination
+ * - the following inherited methods should appear:
+ * {{{
+ * def convToMyNumericA(x: String) // pimpA6: (if showAll is set) with a constraint that there is x: MyNumeric[String] implicit in scope
+ * def convToNumericA(x: String) // pimpA1: (if showAll is set) with a constraint that there is x: Numeric[String] implicit in scope
+ * def convToPimpedA(x: Bar[Foo[String]]) // pimpA5: no constraints
+ * }}}
+ */
+class D extends A[String]
+/** Companion object with implicit transformations */
+object D extends A
+
+
+/** PimpedA class <br/>
+ * - tests simple inheritance and asSeenFrom
+ * - A, B and C should be implicitly converted to this */
+class PimpedA[V](a: A[V]) {
+ /** The convToPimpedA: V documentation... */
+ def convToPimpedA(x: V): V = sys.error("Not implemented")
+}
+
+/** NumericA class <br/>
+ * - tests the implicit conversion between parametric and fixed types
+ * - A, B and C should be implicitly converted to this */
+class NumericA[U: Numeric](a: A[U]) {
+ /** The convToNumericA: U documentation... */
+ def convToNumericA(x: U): U = implicitly[Numeric[U]].zero
+}
+
+/** IntA class <br/>
+ * - tests the interaction between implicit conversion and specific types
+ * - A and C should be implicitly converted to this */
+class IntA(a: A[Int]) {
+ /** The convToIntA: Int documentation... */
+ def convToIntA(x: Int): Int = 0
+}
+
+/** GtColonDoubleA class <br/>
+ * - tests the interaction between implicit conversion and existential types
+ * - A and B should be implicitly converted to this */
+class GtColonDoubleA(a: A[T] forSome { type T <: Double }) {
+ /** The convToGtColonDoubleA: Double documentation... */
+ def convToGtColonDoubleA(x: Double): Double = 0
+}
+
+/** MyNumericA class <br/>
+ * - tests the implicit conversion between parametric and fixed types
+ * - A should be implicitly converted to this */
+class MyNumericA[U: MyNumeric](a: A[U]) {
+ /** The convToMyNumericA: U documentation... */
+ def convToMyNumericA(x: U): U = sys.error("dunno")
+}
+
+/** ManifestA class <br/>
+ * - tests the manifest recognition
+ * - A, B, C, D should be implicitly converted to this */
+class ManifestA[W: Manifest](a: A[W]) {
+ /** The convToManifestA: W documentation... */
+ def convToManifestA(x: W): W = sys.error("dunno")
+}
+
+/** MyTraversableOps class <br/>
+ * - checks if any abstract members are added - should not happen!
+ */
+trait MyTraversableOps[S] {
+ /** The convToTraversableOps: S documentation... */
+ def convToTraversableOps(x: S): S
+}
+
diff --git a/test/scaladoc/resources/implicits-chaining-res.scala b/test/scaladoc/resources/implicits-chaining-res.scala
new file mode 100644
index 0000000000..c005d5fe09
--- /dev/null
+++ b/test/scaladoc/resources/implicits-chaining-res.scala
@@ -0,0 +1,50 @@
+/**
+ * Testing scaladoc implicits chaining
+ */
+package scala.test.scaladoc.implicits {
+
+ import language.implicitConversions // according to SIP18
+
+ // the classes involved
+ case class Z[U](a: U)
+ case class Intermediate[T, U](t: T, u: U)
+ class Implicit1[T](b: Implicit2[T])
+ class Implicit2[T](c: Implicit3[T])
+ class Implicit3[T](/* and so on */)
+
+ object chaining {
+
+ // the base conversion
+ implicit def convertToZ[T](a: A[T])(implicit b: Implicit1[T]): Z[A[T]] = Z(a)
+
+ // and the implicit chaining, don't you just love it? :D
+ // implicit1, with one alternative
+ implicit def implicit1[T <: Intermediate[_, _]](implicit b: Implicit2[T]) = new Implicit1[T](b)
+ // implicit2, with two alternatives
+ implicit def implicit2alt1[T <: Intermediate[_ <: String, _]](implicit c: Implicit3[T]) = new Implicit2[T](c)
+ implicit def implicit2alt2[T <: Intermediate[_ <: Double, _]](implicit c: Implicit3[T]) = new Implicit2[T](c)
+ // implicit3, with two alternatives
+ implicit def implicit3alt1[T <: Intermediate[_, _ <: Int]] = new Implicit3[T]()
+ implicit def implicit3alt2[T <: Intermediate[_ <: Double, _ <: AnyRef],X] = new Implicit3[T]()
+
+ // and our targets
+ /** conversion here, with constraints */
+ class A[T]()
+ /** conversion here, no constraints */
+ class B extends A[Intermediate[String, Int]]
+ /** no conversion */
+ class C extends A[Intermediate[String, String]]
+ /** conversion here, no constraints */
+ class D extends A[Intermediate[Double, Int]]
+ /** conversion here, no constraints */
+ class E extends A[Intermediate[Double, String]]
+ /** no conversion */
+ class F extends A[Intermediate[String, Double]]
+
+ object scalacTest {
+ (new B).a
+ (new D).a
+ (new E).a
+ }
+ }
+}
diff --git a/test/scaladoc/resources/implicits-elimination-res.scala b/test/scaladoc/resources/implicits-elimination-res.scala
new file mode 100644
index 0000000000..b23667440c
--- /dev/null
+++ b/test/scaladoc/resources/implicits-elimination-res.scala
@@ -0,0 +1,14 @@
+/**
+ * Testing scaladoc implicits elimination
+ */
+package scala.test.scaladoc.implicits.elimination {
+
+ import language.implicitConversions // according to SIP18
+
+ /** No conversion, as B doesn't bring any member */
+ class A
+ class B { class C; trait V; type T; }
+ object A {
+ implicit def toB(a: A): B = null
+ }
+}
diff --git a/test/scaladoc/resources/implicits-scopes-res.scala b/test/scaladoc/resources/implicits-scopes-res.scala
new file mode 100644
index 0000000000..aaeb43f95b
--- /dev/null
+++ b/test/scaladoc/resources/implicits-scopes-res.scala
@@ -0,0 +1,52 @@
+/**
+ * Testing scaladoc implicit scopes - looking for implicits in the right places
+ */
+package scala.test.scaladoc.implicits.scopes
+import language.implicitConversions // according to SIP18
+
+// TEST1 - In package object
+package object test1 {
+ implicit def toB(a: A): B = null
+}
+package test1 {
+ class A
+ class B { def b = "" }
+}
+
+// TEST2 - In enclosing package - doesn't seem to work even in scalac
+package object test2 {
+ import classes._
+ implicit def toB(a: A): B = null
+}
+package test2 {
+ package classes {
+ class A
+ class B { def b = "" }
+ object test { /* (new A).b won't compile */ }
+ }
+}
+
+// TEST3 - In companion object
+package test3 {
+ class A
+ object A { implicit def toB(a: A): B = null }
+ class B { def b = "" }
+}
+
+// TEST4 - Nested type's companion object
+package test4 {
+ class U[V]
+ class S
+ object S { implicit def toB(a: A): B = null }
+ class A extends U[S]
+ class B { def b = "" }
+}
+
+// TEST5 - In scope
+package test5 {
+ object scope {
+ class A
+ class B { def b = "" }
+ implicit def toB(a: A): B = null
+ }
+}
diff --git a/test/scaladoc/resources/implicits-shadowing-res.scala b/test/scaladoc/resources/implicits-shadowing-res.scala
new file mode 100644
index 0000000000..c5e9493bf3
--- /dev/null
+++ b/test/scaladoc/resources/implicits-shadowing-res.scala
@@ -0,0 +1,64 @@
+/**
+ * Test scaladoc implicits distinguishing -- supress all members by implicit conversion that are shadowed by the
+ * class' own members
+ *
+ * {{{
+ * scala> class A { def foo(t: String) = 4 }
+ * defined class A
+ *
+ * scala> class B { def foo(t: Any) = 5 }
+ * defined class B
+ *
+ * scala> implicit def AtoB(a:A) = new B
+ * AtoB: (a: A)B
+ *
+ * scala> val a = new A
+ * a: A = A@28f553e3
+ *
+ * scala> a.foo("T")
+ * res1: Int = 4
+ *
+ * scala> a.foo(4)
+ * res2: Int = 5
+ * }}}
+ */
+package scala.test.scaladoc.implicits.shadowing
+import language.implicitConversions // according to SIP18
+
+/** conv5, conv8, conv9, conv10, conv11 should be visible */
+class A[T] {
+ def conv1: AnyRef = ???
+ def conv2: T = ???
+ def conv3(l: Int): AnyRef = ???
+ def conv4(l: AnyRef): AnyRef = ???
+ def conv5(l: String): AnyRef = ???
+ def conv6(l: AnyRef): AnyRef = ???
+ def conv7(l: AnyRef): String = ???
+ def conv8(l: String)(m: String): AnyRef = ???
+ def conv9(l: AnyRef)(m: AnyRef): AnyRef = ???
+ def conv10(l: T): T = ???
+ def conv11(l: T): T = ???
+}
+/** conv5, conv8, conv9, conv11 should be visible */
+class B extends A[Int]
+/** conv5, conv8, conv9, conv10, conv11 should be visible */
+class C extends A[Double]
+/** conv5, conv8, conv9, conv10 should be visible */
+class D extends A[AnyRef]
+
+class Z[T] {
+ def conv1: AnyRef = ???
+ def conv2: T = ???
+ def conv3(p: Int): AnyRef = ???
+ def conv4(p: String): AnyRef = ???
+ def conv5(p: AnyRef): AnyRef = ???
+ def conv6(p: AnyRef): String = ???
+ def conv7(p: AnyRef): AnyRef = ???
+ def conv8(p: String, q: String): AnyRef = ???
+ def conv9(p: AnyRef, q: AnyRef): AnyRef = ???
+ def conv10(p: Int): T = ???
+ def conv11(p: String): T = ???
+}
+object A {
+ implicit def AtoZ[T](a: A[T]) = new Z[T]
+}
diff --git a/test/scaladoc/run/SI-5373.check b/test/scaladoc/run/SI-5373.check
index c55eb001cf..619c56180b 100644
--- a/test/scaladoc/run/SI-5373.check
+++ b/test/scaladoc/run/SI-5373.check
@@ -1 +1 @@
-model contains 6 documentable templates
+Done.
diff --git a/test/scaladoc/run/SI-5373.scala b/test/scaladoc/run/SI-5373.scala
index af433a1844..0062abbb2a 100644
--- a/test/scaladoc/run/SI-5373.scala
+++ b/test/scaladoc/run/SI-5373.scala
@@ -1,9 +1,9 @@
import scala.tools.nsc.doc.model._
import scala.tools.partest.ScaladocModelTest
-object Test extends ScaladocModelTest {
+object Test extends ScaladocModelTest {
- def code = """
+ override def code = """
import scala.annotation.bridge
package scala.test {
@@ -23,7 +23,7 @@ object Test extends ScaladocModelTest {
// no need for special settings
def scaladocSettings = ""
-
+
def testModel(rootPackage: Package) = {
// get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s))
import access._
diff --git a/test/scaladoc/run/implicits-base.check b/test/scaladoc/run/implicits-base.check
new file mode 100644
index 0000000000..619c56180b
--- /dev/null
+++ b/test/scaladoc/run/implicits-base.check
@@ -0,0 +1 @@
+Done.
diff --git a/test/scaladoc/run/implicits-base.scala b/test/scaladoc/run/implicits-base.scala
new file mode 100644
index 0000000000..06d017ed70
--- /dev/null
+++ b/test/scaladoc/run/implicits-base.scala
@@ -0,0 +1,180 @@
+import scala.tools.nsc.doc.model._
+import scala.tools.partest.ScaladocModelTest
+import language._
+
+object Test extends ScaladocModelTest {
+
+ // test a file instead of a piece of code
+ override def resourceFile = "implicits-base-res.scala"
+
+ // start implicits
+ def scaladocSettings = "-implicits -implicits-show-all"
+
+ def testModel(root: Package) = {
+ // get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s))
+ import access._
+
+ // SEE THE test/resources/implicits-base-res.scala FOR THE EXPLANATION OF WHAT'S CHECKED HERE:
+ val base = root._package("scala")._package("test")._package("scaladoc")._package("implicits")._package("base")
+ var conv: ImplicitConversion = null
+
+//// class A ///////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ val A = base._class("A")
+
+ // the method pimped on by pimpA0 should be shadowed by the method in class A
+ assert(A._conversions(A.qualifiedName + ".pimpA0").isEmpty)
+
+ // def convToNumericA: T // pimpA1: with a constraint that there is x: Numeric[T] implicit in scope
+ conv = A._conversion(A.qualifiedName + ".pimpA1")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 1)
+ assert(conv._member("convToNumericA").resultType.name == "T")
+
+ // def convToIntA: Int // pimpA2: with a constraint that T = Int
+ conv = A._conversion(A.qualifiedName + ".pimpA2")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 1)
+ assert(conv._member("convToIntA").resultType.name == "Int")
+
+ // def convToGtColonDoubleA: Double // pimpA3: with a constraint that T <: Double
+ conv = A._conversion(A.qualifiedName + ".pimpA3")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 1)
+ assert(conv._member("convToGtColonDoubleA").resultType.name == "Double")
+
+ // def convToPimpedA: S // pimpA4: with 3 constraints: T = Foo[Bar[S]], S: Foo and S: Bar
+ conv = A._conversion(A.qualifiedName + ".pimpA4")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 3)
+ assert(conv._member("convToPimpedA").resultType.name == "S")
+
+ // def convToPimpedA: Bar[Foo[T]] // pimpA5: no constraints
+ conv = A._conversion(A.qualifiedName + ".pimpA5")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 0)
+ assert(conv._member("convToPimpedA").resultType.name == "Bar[Foo[T]]")
+
+ // def convToMyNumericA: T // pimpA6: with a constraint that there is x: MyNumeric[T] implicit in scope
+ conv = A._conversion(A.qualifiedName + ".pimpA6")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 1)
+ assert(conv._member("convToMyNumericA").resultType.name == "T")
+
+ // def convToManifestA: T // pimpA7: with 2 constraints: T: Manifest and T <: Double
+ // def convToTraversableOps: T // pimpA7: with 2 constraints: T: Manifest and T <: Double
+ // should not be abstract!
+ conv = A._conversion(A.qualifiedName + ".pimpA7")
+ assert(conv.members.length == 2)
+ assert(conv.constraints.length == 2)
+ assert(conv._member("convToManifestA").resultType.name == "T")
+ assert(conv._member("convToTraversableOps").resultType.name == "T")
+ assert(conv._member("convToTraversableOps").flags.toString.indexOf("abstract") == -1)
+
+//// class B ///////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ val B = base._class("B")
+
+ // these conversions should not affect B
+ assert(B._conversions(A.qualifiedName + ".pimpA0").isEmpty)
+ assert(B._conversions(A.qualifiedName + ".pimpA2").isEmpty)
+ assert(B._conversions(A.qualifiedName + ".pimpA4").isEmpty)
+
+ // def convToNumericA: Double // pimpA1: no constraintsd
+ conv = B._conversion(A.qualifiedName + ".pimpA1")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 0)
+ assert(conv._member("convToNumericA").resultType.name == "Double")
+
+ // def convToGtColonDoubleA: Double // pimpA3: no constraints
+ conv = B._conversion(A.qualifiedName + ".pimpA3")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 0)
+ assert(conv._member("convToGtColonDoubleA").resultType.name == "Double")
+
+ // def convToPimpedA: Bar[Foo[Double]] // pimpA5: no constraints
+ conv = B._conversion(A.qualifiedName + ".pimpA5")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 0)
+ assert(conv._member("convToPimpedA").resultType.name == "Bar[Foo[Double]]")
+
+ // def convToMyNumericA: Double // pimpA6: (if showAll is set) with a constraint that there is x: MyNumeric[Double] implicit in scope
+ conv = B._conversion(A.qualifiedName + ".pimpA6")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 1)
+ assert(conv._member("convToMyNumericA").resultType.name == "Double")
+
+ // def convToManifestA: Double // pimpA7: no constraints
+ // def convToTraversableOps: Double // pimpA7: no constraints
+ // // should not be abstract!
+ conv = B._conversion(A.qualifiedName + ".pimpA7")
+ assert(conv.members.length == 2)
+ assert(conv.constraints.length == 0)
+ assert(conv._member("convToManifestA").resultType.name == "Double")
+ assert(conv._member("convToTraversableOps").resultType.name == "Double")
+ assert(conv._member("convToTraversableOps").flags.toString.indexOf("abstract") == -1)
+
+//// class C ///////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ val C = base._class("C")
+
+ // these conversions should not affect C
+ assert(C._conversions(A.qualifiedName + ".pimpA0").isEmpty)
+ assert(C._conversions(A.qualifiedName + ".pimpA3").isEmpty)
+ assert(C._conversions(A.qualifiedName + ".pimpA4").isEmpty)
+ assert(C._conversions(A.qualifiedName + ".pimpA7").isEmpty)
+
+ // def convToNumericA: Int // pimpA1: no constraints
+ conv = C._conversion(A.qualifiedName + ".pimpA1")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 0)
+ assert(conv._member("convToNumericA").resultType.name == "Int")
+
+ // def convToIntA: Int // pimpA2: no constraints
+ conv = C._conversion(A.qualifiedName + ".pimpA2")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 0)
+ assert(conv._member("convToIntA").resultType.name == "Int")
+
+ // def convToPimpedA: Bar[Foo[Int]] // pimpA5: no constraints
+ conv = C._conversion(A.qualifiedName + ".pimpA5")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 0)
+ assert(conv._member("convToPimpedA").resultType.name == "Bar[Foo[Int]]")
+
+ // def convToMyNumericA: Int // pimpA6: (if showAll is set) with a constraint that there is x: MyNumeric[Int] implicit in scope
+ conv = C._conversion(A.qualifiedName + ".pimpA6")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 1)
+ assert(conv._member("convToMyNumericA").resultType.name == "Int")
+
+//// class D ///////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ val D = base._class("D")
+
+ // these conversions should not affect D
+ assert(D._conversions(A.qualifiedName + ".pimpA0").isEmpty)
+ assert(D._conversions(A.qualifiedName + ".pimpA2").isEmpty)
+ assert(D._conversions(A.qualifiedName + ".pimpA3").isEmpty)
+ assert(D._conversions(A.qualifiedName + ".pimpA4").isEmpty)
+ assert(D._conversions(A.qualifiedName + ".pimpA7").isEmpty)
+
+ // def convToNumericA: String // pimpA1: (if showAll is set) with a constraint that there is x: Numeric[String] implicit in scope
+ conv = D._conversion(A.qualifiedName + ".pimpA1")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 1)
+ assert(conv._member("convToNumericA").resultType.name == "String")
+
+ // def convToPimpedA: Bar[Foo[String]] // pimpA5: no constraints
+ conv = D._conversion(A.qualifiedName + ".pimpA5")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 0)
+ assert(conv._member("convToPimpedA").resultType.name == "Bar[Foo[String]]")
+
+ // def convToMyNumericA: String // pimpA6: (if showAll is set) with a constraint that there is x: MyNumeric[String] implicit in scope
+ conv = D._conversion(A.qualifiedName + ".pimpA6")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 1)
+ assert(conv._member("convToMyNumericA").resultType.name == "String")
+ }
+}
diff --git a/test/scaladoc/run/implicits-chaining.check b/test/scaladoc/run/implicits-chaining.check
new file mode 100644
index 0000000000..619c56180b
--- /dev/null
+++ b/test/scaladoc/run/implicits-chaining.check
@@ -0,0 +1 @@
+Done.
diff --git a/test/scaladoc/run/implicits-chaining.scala b/test/scaladoc/run/implicits-chaining.scala
new file mode 100644
index 0000000000..858ca9ce61
--- /dev/null
+++ b/test/scaladoc/run/implicits-chaining.scala
@@ -0,0 +1,65 @@
+import scala.tools.nsc.doc.model._
+import scala.tools.partest.ScaladocModelTest
+import language._
+
+object Test extends ScaladocModelTest {
+
+ // test a file instead of a piece of code
+ override def resourceFile = "implicits-chaining-res.scala"
+
+ // start implicits
+ def scaladocSettings = "-implicits"
+
+ def testModel(root: Package) = {
+ // get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s))
+ import access._
+
+ // SEE THE test/resources/implicits-chaining-res.scala FOR THE EXPLANATION OF WHAT'S CHECKED HERE:
+ val base = root._package("scala")._package("test")._package("scaladoc")._package("implicits")._object("chaining")
+ var conv: ImplicitConversion = null
+
+//// class A ///////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ val A = base._class("A")
+
+ conv = A._conversion(base.qualifiedName + ".convertToZ")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 1)
+
+//// class B ///////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ val B = base._class("B")
+
+ conv = B._conversion(base.qualifiedName + ".convertToZ")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 0)
+
+//// class C ///////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ val C = base._class("C")
+
+ assert(C._conversions(base.qualifiedName + ".convertToZ").isEmpty)
+
+//// class D ///////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ val D = base._class("D")
+
+ conv = D._conversion(base.qualifiedName + ".convertToZ")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 0)
+
+//// class E ///////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ val E = base._class("E")
+
+ conv = E._conversion(base.qualifiedName + ".convertToZ")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 0)
+
+//// class F ///////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ val F = base._class("F")
+
+ assert(F._conversions(base.qualifiedName + ".convertToZ").isEmpty)
+ }
+}
diff --git a/test/scaladoc/run/implicits-elimination.check b/test/scaladoc/run/implicits-elimination.check
new file mode 100644
index 0000000000..619c56180b
--- /dev/null
+++ b/test/scaladoc/run/implicits-elimination.check
@@ -0,0 +1 @@
+Done.
diff --git a/test/scaladoc/run/implicits-elimination.scala b/test/scaladoc/run/implicits-elimination.scala
new file mode 100644
index 0000000000..ed37b9cd90
--- /dev/null
+++ b/test/scaladoc/run/implicits-elimination.scala
@@ -0,0 +1,23 @@
+import scala.tools.nsc.doc.model._
+import scala.tools.partest.ScaladocModelTest
+import language._
+
+object Test extends ScaladocModelTest {
+
+ // test a file instead of a piece of code
+ override def resourceFile = "implicits-elimination-res.scala"
+
+ // start implicits
+ def scaladocSettings = "-implicits"
+
+ def testModel(root: Package) = {
+ // get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s))
+ import access._
+
+ // SEE THE test/resources/implicits-elimination-res.scala FOR THE EXPLANATION OF WHAT'S CHECKED HERE:
+ val base = root._package("scala")._package("test")._package("scaladoc")._package("implicits")._package("elimination")
+ val A = base._class("A")
+
+ assert(A._conversions(A.qualifiedName + ".toB").isEmpty)
+ }
+}
diff --git a/test/scaladoc/run/implicits-scopes.check b/test/scaladoc/run/implicits-scopes.check
new file mode 100644
index 0000000000..619c56180b
--- /dev/null
+++ b/test/scaladoc/run/implicits-scopes.check
@@ -0,0 +1 @@
+Done.
diff --git a/test/scaladoc/run/implicits-scopes.scala b/test/scaladoc/run/implicits-scopes.scala
new file mode 100644
index 0000000000..7b9e80e148
--- /dev/null
+++ b/test/scaladoc/run/implicits-scopes.scala
@@ -0,0 +1,77 @@
+import scala.tools.nsc.doc.model._
+import scala.tools.partest.ScaladocModelTest
+import language._
+
+object Test extends ScaladocModelTest {
+
+ // test a file instead of a piece of code
+ override def resourceFile = "implicits-scopes-res.scala"
+
+ // start implicits
+ def scaladocSettings = "-implicits"
+
+ def testModel(root: Package) = {
+ // get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s))
+ import access._
+ var conv: ImplicitConversion = null
+
+ // SEE THE test/resources/implicits-chaining-res.scala FOR THE EXPLANATION OF WHAT'S CHECKED HERE:
+ val base = root._package("scala")._package("test")._package("scaladoc")._package("implicits")._package("scopes")
+
+//// test1 /////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ val doTest1 = {
+ val test1 = base._package("test1")
+ val A = test1._class("A")
+
+ conv = A._conversion(test1.qualifiedName + ".package.toB") // the .package means it's the package object
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 0)
+ }
+
+//// test2 /////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ val doTest2 = {
+ val test2 = base._package("test2")
+ val classes = test2._package("classes")
+ val A = classes._class("A")
+
+ assert(A._conversions(test2.qualifiedName + ".toB").isEmpty)
+ }
+
+//// test3 /////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ val doTest3 = {
+ val test3 = base._package("test3")
+ val A = test3._class("A")
+
+ conv = A._conversion(A.qualifiedName + ".toB")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 0)
+ }
+
+//// test4 /////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ val doTest4 = {
+ val test4 = base._package("test4")
+ val A = test4._class("A")
+ val S = test4._object("S")
+
+ conv = A._conversion(S.qualifiedName + ".toB")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 0)
+ }
+
+//// test5 /////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ val doTest5 = {
+ val test5 = base._package("test5")
+ val scope = test5._object("scope")
+ val A = scope._class("A")
+
+ conv = A._conversion(scope.qualifiedName + ".toB")
+ assert(conv.members.length == 1)
+ assert(conv.constraints.length == 0)
+ }
+ }
+}
diff --git a/test/scaladoc/run/implicits-shadowing.check b/test/scaladoc/run/implicits-shadowing.check
new file mode 100644
index 0000000000..619c56180b
--- /dev/null
+++ b/test/scaladoc/run/implicits-shadowing.check
@@ -0,0 +1 @@
+Done.
diff --git a/test/scaladoc/run/implicits-shadowing.scala b/test/scaladoc/run/implicits-shadowing.scala
new file mode 100644
index 0000000000..7835223d21
--- /dev/null
+++ b/test/scaladoc/run/implicits-shadowing.scala
@@ -0,0 +1,70 @@
+import scala.tools.nsc.doc.model._
+import scala.tools.partest.ScaladocModelTest
+
+object Test extends ScaladocModelTest {
+
+ // test a file instead of a piece of code
+ override def resourceFile = "implicits-shadowing-res.scala"
+
+ // start implicits
+ def scaladocSettings = "-implicits"
+
+ def testModel(root: Package) = {
+ // get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s))
+ import access._
+
+ // SEE THE test/resources/implicits-chaining-res.scala FOR THE EXPLANATION OF WHAT'S CHECKED HERE:
+ val base = root._package("scala")._package("test")._package("scaladoc")._package("implicits")._object("shadowing")
+ var conv: ImplicitConversion = null
+
+//// class A ///////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ val A = base._class("A")
+
+ conv = A._conversion(base._object("A").qualifiedName + ".AtoZ")
+ assert(conv.members.length == 5)
+ conv._member("conv5")
+ conv._member("conv8")
+ conv._member("conv9")
+ conv._member("conv10")
+ conv._member("conv11")
+ assert(conv.constraints.length == 0)
+
+//// class B ///////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ val B = base._class("B")
+
+ conv = B._conversion(base._object("A").qualifiedName + ".AtoZ")
+ assert(conv.members.length == 4)
+ conv._member("conv5")
+ conv._member("conv8")
+ conv._member("conv9")
+ conv._member("conv11")
+ assert(conv.constraints.length == 0)
+
+//// class C ///////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ val C = base._class("C")
+
+ conv = C._conversion(base._object("A").qualifiedName + ".AtoZ")
+ assert(conv.members.length == 5)
+ conv._member("conv5")
+ conv._member("conv8")
+ conv._member("conv9")
+ conv._member("conv10")
+ conv._member("conv11")
+ assert(conv.constraints.length == 0)
+
+//// class D ///////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ val D = base._class("D")
+
+ conv = D._conversion(base._object("A").qualifiedName + ".AtoZ")
+ assert(conv.members.length == 4)
+ conv._member("conv5")
+ conv._member("conv8")
+ conv._member("conv9")
+ conv._member("conv10")
+ assert(conv.constraints.length == 0)
+ }
+} \ No newline at end of file
diff --git a/test/scaladoc/scalacheck/CommentFactoryTest.scala b/test/scaladoc/scalacheck/CommentFactoryTest.scala
index 69c314a64c..68ca68efdd 100644
--- a/test/scaladoc/scalacheck/CommentFactoryTest.scala
+++ b/test/scaladoc/scalacheck/CommentFactoryTest.scala
@@ -3,11 +3,12 @@ import org.scalacheck.Prop._
import scala.tools.nsc.Global
import scala.tools.nsc.doc
+import scala.tools.nsc.doc.model._
import scala.tools.nsc.doc.model.comment._
class Factory(val g: Global, val s: doc.Settings)
extends doc.model.ModelFactory(g, s) {
- thisFactory: Factory with CommentFactory with doc.model.TreeFactory =>
+ thisFactory: Factory with ModelFactoryImplicitSupport with CommentFactory with doc.model.TreeFactory =>
def strip(c: Comment): Option[Inline] = {
c.body match {
@@ -28,7 +29,7 @@ object Test extends Properties("CommentFactory") {
val settings = new doc.Settings((str: String) => {})
val reporter = new scala.tools.nsc.reporters.ConsoleReporter(settings)
val g = new Global(settings, reporter)
- (new Factory(g, settings) with CommentFactory with doc.model.TreeFactory)
+ (new Factory(g, settings) with ModelFactoryImplicitSupport with CommentFactory with doc.model.TreeFactory)
}
def parse(src: String, dst: Inline) = {