summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/Course-2002-07.scala2
-rw-r--r--test/files/run/Course-2002-08.scala20
-rw-r--r--test/files/run/SD-235.scala39
-rw-r--r--test/files/run/SD-290.scala39
-rw-r--r--test/files/run/SymbolsTest.scala18
-rw-r--r--test/files/run/analyzerPlugins.check94
-rw-r--r--test/files/run/array-charSeq.check1
-rw-r--r--test/files/run/bcodeInlinerMixed.flags2
-rw-r--r--test/files/run/bcodeInlinerMixed/B_1.scala14
-rw-r--r--test/files/run/bcodeInlinerMixed/Test.scala16
-rw-r--r--test/files/run/bcodeInlinerMixed/Test_2.scala30
-rw-r--r--test/files/run/bitsets.check2
-rw-r--r--test/files/run/blame_eye_triple_eee-double.flags1
-rw-r--r--test/files/run/blame_eye_triple_eee-float.flags1
-rw-r--r--test/files/run/caseclasses.scala2
-rw-r--r--test/files/run/classfile-format-51.scala5
-rw-r--r--test/files/run/classfile-format-52.scala3
-rw-r--r--test/files/run/collection-stacks.check4
-rw-r--r--test/files/run/colltest.check2
-rw-r--r--test/files/run/compiler-asSeenFrom.check20
-rw-r--r--test/files/run/concurrent-map-conversions.scala15
-rw-r--r--test/files/run/concurrent-stream.check3
-rw-r--r--test/files/run/concurrent-stream.scala37
-rw-r--r--test/files/run/constant-optimization.flags1
-rw-r--r--test/files/run/constrained-types.check8
-rw-r--r--test/files/run/contrib674.check5
-rw-r--r--test/files/run/contrib674.scala2
-rw-r--r--test/files/run/dead-code-elimination.flags1
-rw-r--r--test/files/run/delambdafy-specialized.check1
-rw-r--r--test/files/run/delambdafy-specialized.flags1
-rw-r--r--test/files/run/delambdafy-specialized.scala6
-rw-r--r--test/files/run/delambdafyLambdaClassNames.check1
-rw-r--r--test/files/run/delambdafyLambdaClassNames.flags1
-rw-r--r--test/files/run/delambdafyLambdaClassNames/A_1.scala5
-rw-r--r--test/files/run/delambdafyLambdaClassNames/Test.scala4
-rw-r--r--test/files/run/delambdafy_t6028.check53
-rw-r--r--test/files/run/delambdafy_t6555.check4
-rw-r--r--test/files/run/delambdafy_uncurry_byname_method.check4
-rw-r--r--test/files/run/delambdafy_uncurry_method.check4
-rw-r--r--test/files/run/delay-bad.check6
-rw-r--r--test/files/run/delay-good.check4
-rw-r--r--test/files/run/duration-coarsest.scala5
-rw-r--r--test/files/run/elidable-opt.check2
-rw-r--r--test/files/run/elidable-opt.flags2
-rw-r--r--test/files/run/elidable-opt.scala1
-rw-r--r--test/files/run/elidable.check2
-rw-r--r--test/files/run/elidable.flags2
-rw-r--r--test/files/run/elidable.scala58
-rw-r--r--test/files/run/equality.scala2
-rw-r--r--test/files/run/eta-expand-star2.check2
-rw-r--r--test/files/run/eta-expand-star2.flags1
-rw-r--r--test/files/run/eta-expand-star2.scala8
-rw-r--r--test/files/run/exceptions-2.check2
-rw-r--r--test/files/run/existential-rangepos.check2
-rw-r--r--test/files/run/finalvar.flags2
-rw-r--r--test/files/run/future-flatmap-exec-count.check1
-rw-r--r--test/files/run/hashCodeStatics.scala (renamed from test/files/run/hashCodeBoxesRunTime.scala)10
-rw-r--r--test/files/run/icode-reader-dead-code.scala2
-rw-r--r--test/files/run/idempotency-case-classes.check12
-rw-r--r--test/files/run/idempotency-lazy-vals.check14
-rw-r--r--test/files/run/indy-via-macro-with-dynamic-args/Bootstrap.java17
-rw-r--r--test/files/run/indy-via-macro-with-dynamic-args/Test_2.scala6
-rw-r--r--test/files/run/indy-via-macro-with-dynamic-args/macro_1.scala33
-rw-r--r--test/files/run/indy-via-macro/Bootstrap.java16
-rw-r--r--test/files/run/indy-via-macro/Test_2.scala5
-rw-r--r--test/files/run/indy-via-macro/macro_1.scala32
-rw-r--r--test/files/run/indylambda-boxing/test.scala7
-rw-r--r--test/files/run/infix.scala1
-rw-r--r--test/files/run/inline-ex-handlers.check492
-rw-r--r--test/files/run/inline-ex-handlers.scala329
-rw-r--r--test/files/run/inlineAddDeserializeLambda.scala20
-rw-r--r--test/files/run/inlineHandlers.scala7
-rw-r--r--test/files/run/iq.scala8
-rw-r--r--test/files/run/iterator-from.scala2
-rw-r--r--test/files/run/junitForwarders/C_1.scala15
-rw-r--r--test/files/run/junitForwarders/Test.java10
-rw-r--r--test/files/run/lambda-serialization-security.scala47
-rw-r--r--test/files/run/lambda-serialization.scala65
-rw-r--r--test/files/run/large_class.check4
-rw-r--r--test/files/run/large_code.check4
-rw-r--r--test/files/run/lazy-locals-2.scala322
-rw-r--r--test/files/run/lazy-locals.check5
-rw-r--r--test/files/run/lazy_local_labels.check9
-rw-r--r--test/files/run/lazy_local_labels.scala28
-rw-r--r--test/files/run/lisp.check26
-rw-r--r--test/files/run/lisp.scala518
-rw-r--r--test/files/run/literals.scala15
-rw-r--r--test/files/run/local_obj.scala9
-rw-r--r--test/files/run/lub-visibility.check2
-rw-r--r--test/files/run/macro-duplicate.check2
-rw-r--r--test/files/run/macro-typecheck-implicitsdisabled.check2
-rw-r--r--test/files/run/macroPlugins-enterStats.check12
-rw-r--r--test/files/run/macroPlugins-namerHooks.check12
-rw-r--r--test/files/run/mapConserve.scala2
-rw-r--r--test/files/run/map_java_conversions.scala11
-rw-r--r--test/files/run/misc.check16
-rw-r--r--test/files/run/mixin-signatures.check26
-rw-r--r--test/files/run/mixin-signatures.scala4
-rw-r--r--test/files/run/names-defaults.check5
-rw-r--r--test/files/run/noInlineUnknownIndy.check13
-rw-r--r--test/files/run/noInlineUnknownIndy/A_1.java9
-rw-r--r--test/files/run/noInlineUnknownIndy/Test.scala33
-rw-r--r--test/files/run/nothingTypeDce.flags2
-rw-r--r--test/files/run/nothingTypeDce.scala3
-rw-r--r--test/files/run/nothingTypeNoFramesNoDce.check1
-rw-r--r--test/files/run/nothingTypeNoFramesNoDce.flags1
-rw-r--r--test/files/run/nothingTypeNoFramesNoDce.scala61
-rw-r--r--test/files/run/nothingTypeNoOpt.flags2
-rw-r--r--test/files/run/nothingTypeNoOpt.scala2
-rw-r--r--test/files/run/number-parsing.scala4
-rw-r--r--test/files/run/numbereq.scala3
-rw-r--r--test/files/run/optimizer-array-load.flags1
-rw-r--r--test/files/run/origins.check6
-rw-r--r--test/files/run/origins.flags1
-rw-r--r--test/files/run/origins.scala21
-rw-r--r--test/files/run/patmat-exprs.scala4
-rw-r--r--test/files/run/patmatnew.check12
-rw-r--r--test/files/run/patmatnew.scala4
-rw-r--r--test/files/run/private-inline.check13
-rw-r--r--test/files/run/private-inline.flags1
-rw-r--r--test/files/run/private-inline.scala52
-rw-r--r--test/files/run/programmatic-main.check17
-rw-r--r--test/files/run/reflection-attachments.check0
-rw-r--r--test/files/run/reflection-fieldsymbol-navigation.check6
-rw-r--r--test/files/run/reflection-implClass.scala40
-rw-r--r--test/files/run/reflection-java-annotations.check5
-rw-r--r--test/files/run/reflection-java-annotations/Test_2.scala4
-rw-r--r--test/files/run/reflection-magicsymbols-repl.check2
-rw-r--r--test/files/run/reflection-scala-annotations.check2
-rw-r--r--test/files/run/reify-aliases.check2
-rw-r--r--test/files/run/reify_lazyunit.check2
-rw-r--r--test/files/run/reify_printf.scala1
-rw-r--r--test/files/run/repl-bare-expr.check12
-rw-r--r--test/files/run/repl-colon-type.check2
-rw-r--r--test/files/run/repl-implicits-nopredef.check5
-rw-r--r--test/files/run/repl-implicits-nopredef.scala10
-rw-r--r--test/files/run/repl-implicits.check5
-rw-r--r--test/files/run/repl-implicits.scala5
-rw-r--r--test/files/run/repl-inline.check11
-rw-r--r--test/files/run/repl-inline.scala27
-rw-r--r--test/files/run/repl-javap-app.check0
-rw-r--r--test/files/run/repl-javap-app.scala18
-rw-r--r--test/files/run/repl-javap-def.scala2
-rw-r--r--test/files/run/repl-javap-fun.scala16
-rw-r--r--test/files/run/repl-javap-lambdas.scala23
-rw-r--r--test/files/run/repl-javap-memfun.scala22
-rw-r--r--test/files/run/repl-javap-more-fun.scala17
-rw-r--r--test/files/run/repl-javap-outdir-funs.flags1
-rw-r--r--test/files/run/repl-javap-outdir-funs/foo_1.scala6
-rw-r--r--test/files/run/repl-javap-outdir-funs/run-repl_7.scala20
-rw-r--r--test/files/run/repl-javap.scala3
-rw-r--r--test/files/run/repl-no-imports-no-predef-classbased.check23
-rw-r--r--test/files/run/repl-no-imports-no-predef-classbased.scala19
-rw-r--r--test/files/run/repl-no-imports-no-predef-power.check29
-rw-r--r--test/files/run/repl-no-imports-no-predef-power.scala21
-rw-r--r--test/files/run/repl-no-imports-no-predef.check360
-rw-r--r--test/files/run/repl-no-imports-no-predef.scala108
-rw-r--r--test/files/run/repl-parens.check12
-rw-r--r--test/files/run/repl-parens.scala3
-rw-r--r--test/files/run/repl-paste-b.check14
-rw-r--r--test/files/run/repl-paste-b.scala13
-rw-r--r--test/files/run/repl-paste-raw-b.pastie8
-rw-r--r--test/files/run/repl-paste-raw-b.scala18
-rw-r--r--test/files/run/repl-paste-raw-c.pastie5
-rw-r--r--test/files/run/repl-paste-raw-c.scala16
-rw-r--r--test/files/run/repl-paste-raw.pastie4
-rw-r--r--test/files/run/repl-paste-raw.scala2
-rw-r--r--test/files/run/repl-power.check4
-rw-r--r--test/files/run/repl-serialization.scala2
-rw-r--r--test/files/run/richs.check2
-rw-r--r--test/files/run/run-bug4840.flags1
-rw-r--r--test/files/run/runtime.scala2
-rw-r--r--test/files/run/sammy_after_implicit_view.scala28
-rw-r--r--test/files/run/sammy_cbn.scala9
-rw-r--r--test/files/run/sammy_erasure_cce.scala22
-rw-r--r--test/files/run/sammy_repeated.flags1
-rw-r--r--test/files/run/sammy_repeated.scala8
-rw-r--r--test/files/run/sammy_restrictions_LMF.check2
-rw-r--r--test/files/run/sammy_restrictions_LMF.scala57
-rw-r--r--test/files/run/sammy_return.scala14
-rw-r--r--test/files/run/sammy_seriazable.scala47
-rw-r--r--test/files/run/sammy_vararg_cbn.check (renamed from test/files/run/sammy_repeated.check)0
-rw-r--r--test/files/run/sammy_vararg_cbn.scala12
-rw-r--r--test/files/run/sbt-icode-interface.check1
-rw-r--r--test/files/run/sbt-icode-interface.scala48
-rw-r--r--test/files/run/sd167.check1
-rw-r--r--test/files/run/sd167.scala8
-rw-r--r--test/files/run/sd242.scala13
-rw-r--r--test/files/run/sd275-java/A.java5
-rw-r--r--test/files/run/sd275-java/DeleteMe.java4
-rw-r--r--test/files/run/sd275-java/LeaveMe.java3
-rw-r--r--test/files/run/sd275-java/Test.scala39
-rw-r--r--test/files/run/sd275.scala60
-rw-r--r--test/files/run/sd329.scala76
-rw-r--r--test/files/run/showdecl.check2
-rw-r--r--test/files/run/showdecl/Macros_1.scala2
-rw-r--r--test/files/run/showraw_mods.check2
-rw-r--r--test/files/run/showraw_tree_types_ids.check8
-rw-r--r--test/files/run/showraw_tree_types_typed.check8
-rw-r--r--test/files/run/showraw_tree_ultimate.check8
-rw-r--r--test/files/run/stringinterpolation_macro-run.check71
-rw-r--r--test/files/run/stringinterpolation_macro-run.scala122
-rw-r--r--test/files/run/synchronized.check128
-rw-r--r--test/files/run/synchronized.flags2
-rw-r--r--test/files/run/synchronized.scala76
-rw-r--r--test/files/run/t10009.scala28
-rw-r--r--test/files/run/t10026.check1
-rw-r--r--test/files/run/t10026.scala11
-rw-r--r--test/files/run/t10032.check82
-rw-r--r--test/files/run/t10032.scala164
-rw-r--r--test/files/run/t10037.check2
-rw-r--r--test/files/run/t10037.flags1
-rw-r--r--test/files/run/t10037/shifter_2.scala8
-rw-r--r--test/files/run/t10037/shifty_1.scala7
-rw-r--r--test/files/run/t10059/A.java3
-rw-r--r--test/files/run/t10059/Test.scala9
-rw-r--r--test/files/run/t10067.flags1
-rw-r--r--test/files/run/t10067/OuterClass.java7
-rw-r--r--test/files/run/t10067/Test.scala19
-rw-r--r--test/files/run/t10069.scala34
-rw-r--r--test/files/run/t10069b.scala13
-rw-r--r--test/files/run/t10072.scala18
-rw-r--r--test/files/run/t10075.scala35
-rw-r--r--test/files/run/t10075b.check60
-rw-r--r--test/files/run/t10075b/RetainedAnnotation_1.java4
-rw-r--r--test/files/run/t10075b/Test_2.scala56
-rw-r--r--test/files/run/t10097.check3
-rw-r--r--test/files/run/t10097.flags1
-rw-r--r--test/files/run/t10097.scala6
-rw-r--r--test/files/run/t10171/Test.scala59
-rw-r--r--test/files/run/t10231/A_1.java11
-rw-r--r--test/files/run/t10231/Test_2.scala5
-rw-r--r--test/files/run/t10261.flags1
-rw-r--r--test/files/run/t1459generic.check2
-rw-r--r--test/files/run/t1459generic/VarargGeneric.java3
-rw-r--r--test/files/run/t1500.scala2
-rw-r--r--test/files/run/t2106.check10
-rw-r--r--test/files/run/t2106.flags2
-rw-r--r--test/files/run/t2212.check2
-rw-r--r--test/files/run/t2250.scala2
-rw-r--r--test/files/run/t2251b.check4
-rw-r--r--test/files/run/t2813.2.scala2
-rw-r--r--test/files/run/t2946/MyResponseCommon_2.scala7
-rw-r--r--test/files/run/t2946/ResponseCommon_1.scala13
-rw-r--r--test/files/run/t3126.scala2
-rw-r--r--test/files/run/t3158.scala2
-rw-r--r--test/files/run/t3235-minimal.check8
-rw-r--r--test/files/run/t3326.scala2
-rw-r--r--test/files/run/t3361.check2
-rw-r--r--test/files/run/t3368-c.check24
-rw-r--r--test/files/run/t3452b-bcode.check2
-rw-r--r--test/files/run/t3452b-bcode.flags1
-rw-r--r--test/files/run/t3452b-bcode/J_2.java6
-rw-r--r--test/files/run/t3452b-bcode/S_1.scala17
-rw-r--r--test/files/run/t3488.check10
-rw-r--r--test/files/run/t3509.flags2
-rw-r--r--test/files/run/t3569.check2
-rw-r--r--test/files/run/t3569.flags2
-rw-r--r--test/files/run/t3569.scala8
-rw-r--r--test/files/run/t3647.check2
-rw-r--r--test/files/run/t3822.scala19
-rw-r--r--test/files/run/t3888.check1
-rw-r--r--test/files/run/t3888.scala5
-rw-r--r--test/files/run/t3970.check2
-rw-r--r--test/files/run/t3996.check2
-rw-r--r--test/files/run/t4047.check8
-rw-r--r--test/files/run/t4080.check2
-rw-r--r--test/files/run/t4124.scala8
-rw-r--r--test/files/run/t4172.check2
-rw-r--r--test/files/run/t4285.flags2
-rw-r--r--test/files/run/t4287inferredMethodTypes.check30
-rw-r--r--test/files/run/t4287inferredMethodTypes.scala25
-rw-r--r--test/files/run/t4332.scala2
-rw-r--r--test/files/run/t4396.check2
-rw-r--r--test/files/run/t4461.check2
-rw-r--r--test/files/run/t4542.check2
-rw-r--r--test/files/run/t4594-repl-settings.scala4
-rw-r--r--test/files/run/t4680.check6
-rw-r--r--test/files/run/t4700.check44
-rw-r--r--test/files/run/t4700.scala22
-rw-r--r--test/files/run/t4710.check2
-rw-r--r--test/files/run/t4788-separate-compilation.check4
-rw-r--r--test/files/run/t4788.check4
-rw-r--r--test/files/run/t4813.check2
-rw-r--r--test/files/run/t4891.check4
-rw-r--r--test/files/run/t4935.flags2
-rw-r--r--test/files/run/t5064.check45
-rw-r--r--test/files/run/t5293-map.scala88
-rw-r--r--test/files/run/t5293.scala83
-rw-r--r--test/files/run/t5294.scala22
-rw-r--r--test/files/run/t5313.check12
-rw-r--r--test/files/run/t5313.scala54
-rw-r--r--test/files/run/t5375.check1
-rw-r--r--test/files/run/t5375.scala16
-rw-r--r--test/files/run/t5380.check4
-rw-r--r--test/files/run/t5428.check2
-rw-r--r--test/files/run/t5463.scala21
-rw-r--r--test/files/run/t5535.scala7
-rw-r--r--test/files/run/t5552.check4
-rw-r--r--test/files/run/t5552.scala10
-rw-r--r--test/files/run/t5652.check11
-rw-r--r--test/files/run/t5652/t5652_2.scala2
-rw-r--r--test/files/run/t5652b.check4
-rw-r--r--test/files/run/t5652c.check4
-rw-r--r--test/files/run/t5676.flags2
-rw-r--r--test/files/run/t5699.check4
-rw-r--r--test/files/run/t5717.check1
-rw-r--r--test/files/run/t5717.scala2
-rw-r--r--test/files/run/t576.check2
-rw-r--r--test/files/run/t5789.scala9
-rw-r--r--test/files/run/t5880.scala5
-rw-r--r--test/files/run/t5907.scala2
-rw-r--r--test/files/run/t5943a1.check2
-rw-r--r--test/files/run/t6023.check4
-rw-r--r--test/files/run/t6028.check26
-rw-r--r--test/files/run/t6089.scala2
-rw-r--r--test/files/run/t6102.check36
-rw-r--r--test/files/run/t6102.flags2
-rw-r--r--test/files/run/t6111.check2
-rw-r--r--test/files/run/t6188.flags2
-rw-r--r--test/files/run/t6198.scala7
-rw-r--r--test/files/run/t6240-universe-code-gen.scala2
-rw-r--r--test/files/run/t6240a/StepOne.java2
-rw-r--r--test/files/run/t6240b/StepOne.java2
-rw-r--r--test/files/run/t6260-delambdafy.check2
-rw-r--r--test/files/run/t6260-delambdafy.flags1
-rw-r--r--test/files/run/t6260c.check6
-rw-r--r--test/files/run/t6288.check20
-rw-r--r--test/files/run/t6288b-jump-position.check76
-rw-r--r--test/files/run/t6288b-jump-position.scala19
-rw-r--r--test/files/run/t6292.check2
-rw-r--r--test/files/run/t6329_repl.check8
-rw-r--r--test/files/run/t6329_repl_bug.check2
-rw-r--r--test/files/run/t6329_vanilla_bug.check2
-rw-r--r--test/files/run/t6331b.check6
-rw-r--r--test/files/run/t6434.scala7
-rw-r--r--test/files/run/t6481.check2
-rw-r--r--test/files/run/t6502.scala39
-rw-r--r--test/files/run/t6546.flags1
-rw-r--r--test/files/run/t6546/A_1.scala6
-rw-r--r--test/files/run/t6546/B_2.scala8
-rw-r--r--test/files/run/t6554.scala12
-rw-r--r--test/files/run/t6634.check6
-rw-r--r--test/files/run/t6634.scala21
-rw-r--r--test/files/run/t6690.check2
-rw-r--r--test/files/run/t6733.check15
-rw-r--r--test/files/run/t6827.check12
-rw-r--r--test/files/run/t6827.scala20
-rw-r--r--test/files/run/t6863.check2
-rw-r--r--test/files/run/t6935.check2
-rw-r--r--test/files/run/t6955.scala34
-rw-r--r--test/files/run/t6956.scala31
-rw-r--r--test/files/run/t7008-scala-defined.flags1
-rw-r--r--test/files/run/t7047.check2
-rw-r--r--test/files/run/t7139.check11
-rw-r--r--test/files/run/t7139/A_1.scala8
-rw-r--r--test/files/run/t7139/Test_2.scala9
-rw-r--r--test/files/run/t7171.check3
-rw-r--r--test/files/run/t7269.scala2
-rw-r--r--test/files/run/t7319.check6
-rw-r--r--test/files/run/t7375b.check8
-rw-r--r--test/files/run/t7407.flags2
-rw-r--r--test/files/run/t7407b.flags1
-rw-r--r--test/files/run/t7445.scala6
-rw-r--r--test/files/run/t7459b-optimize.flags2
-rw-r--r--test/files/run/t7459f.scala2
-rw-r--r--test/files/run/t7521/Test.scala (renamed from test/files/run/t3452b-bcode/S_3.scala)2
-rw-r--r--test/files/run/t7521/Wrapper.scala1
-rw-r--r--test/files/run/t7521b.check7
-rw-r--r--test/files/run/t7521b.scala20
-rw-r--r--test/files/run/t7533.check51
-rw-r--r--test/files/run/t7533.scala34
-rw-r--r--test/files/run/t7582.check5
-rw-r--r--test/files/run/t7582.flags2
-rw-r--r--test/files/run/t7582/InlineHolder_2.scala (renamed from test/files/run/t7582/InlineHolder.scala)5
-rw-r--r--test/files/run/t7582/PackageProtectedJava_1.java (renamed from test/files/run/t7582/PackageProtectedJava.java)2
-rw-r--r--test/files/run/t7582b.check5
-rw-r--r--test/files/run/t7582b.flags2
-rw-r--r--test/files/run/t7582b/InlineHolder_2.scala (renamed from test/files/run/t7582b/InlineHolder.scala)5
-rw-r--r--test/files/run/t7582b/PackageProtectedJava_1.java (renamed from test/files/run/t7582b/PackageProtectedJava.java)2
-rw-r--r--test/files/run/t7700.check6
-rw-r--r--test/files/run/t7700.scala16
-rw-r--r--test/files/run/t7747-repl.check30
-rw-r--r--test/files/run/t7747-repl.scala5
-rw-r--r--test/files/run/t7775.scala43
-rw-r--r--test/files/run/t7807.check3
-rw-r--r--test/files/run/t7807.scala21
-rw-r--r--test/files/run/t7817-tree-gen.check28
-rw-r--r--test/files/run/t7817-tree-gen.flags1
-rw-r--r--test/files/run/t7852.flags2
-rw-r--r--test/files/run/t7899-regression.check1
-rw-r--r--test/files/run/t7899-regression.flags1
-rw-r--r--test/files/run/t7899-regression.scala24
-rw-r--r--test/files/run/t7932.check9
-rw-r--r--test/files/run/t7932.scala29
-rw-r--r--test/files/run/t7974.check47
-rw-r--r--test/files/run/t7974/Test.scala2
-rw-r--r--test/files/run/t8196.check2
-rw-r--r--test/files/run/t8199.scala40
-rw-r--r--test/files/run/t8233-bcode.flags1
-rw-r--r--test/files/run/t8233-bcode.scala31
-rw-r--r--test/files/run/t8334.scala17
-rw-r--r--test/files/run/t8433.check2
-rw-r--r--test/files/run/t8433.scala46
-rw-r--r--test/files/run/t8549.check2
-rw-r--r--test/files/run/t8549.scala46
-rw-r--r--test/files/run/t8575.scala32
-rw-r--r--test/files/run/t8575b.scala17
-rw-r--r--test/files/run/t8575c.scala23
-rw-r--r--test/files/run/t8601-closure-elim.flags2
-rw-r--r--test/files/run/t8601-closure-elim.scala4
-rw-r--r--test/files/run/t8601.flags2
-rw-r--r--test/files/run/t8601b.flags2
-rw-r--r--test/files/run/t8601c.flags2
-rw-r--r--test/files/run/t8601d.flags2
-rw-r--r--test/files/run/t8601e.flags2
-rw-r--r--test/files/run/t8601e/StaticInit.classbin417 -> 0 bytes
-rw-r--r--test/files/run/t8710.scala17
-rw-r--r--test/files/run/t8756.check9
-rw-r--r--test/files/run/t8756.scala22
-rw-r--r--test/files/run/t8764.check5
-rw-r--r--test/files/run/t8764.scala16
-rw-r--r--test/files/run/t8845.flags1
-rw-r--r--test/files/run/t8918-unary-ids.check7
-rw-r--r--test/files/run/t8918-unary-ids.scala49
-rw-r--r--test/files/run/t8925.flags2
-rw-r--r--test/files/run/t8944/A_1.scala1
-rw-r--r--test/files/run/t8944/A_2.scala6
-rw-r--r--test/files/run/t8944/Test_1.scala3
-rw-r--r--test/files/run/t8944b.scala9
-rw-r--r--test/files/run/t8944c.check5
-rw-r--r--test/files/run/t8944c.scala8
-rw-r--r--test/files/run/t8955.scala12
-rw-r--r--test/files/run/t8960.scala80
-rw-r--r--test/files/run/t9003.flags2
-rw-r--r--test/files/run/t9097.scala3
-rw-r--r--test/files/run/t9110.scala27
-rw-r--r--test/files/run/t9174.check17
-rw-r--r--test/files/run/t9174.scala11
-rw-r--r--test/files/run/t9178a.flags (renamed from test/files/run/sammy_java8.flags)0
-rw-r--r--test/files/run/t9178a.scala15
-rw-r--r--test/files/run/t9200/Test.java6
-rw-r--r--test/files/run/t9200/test.scala12
-rw-r--r--test/files/run/t9349/data.scala1
-rw-r--r--test/files/run/t9349/test.scala21
-rw-r--r--test/files/run/t9375.check8
-rw-r--r--test/files/run/t9375.scala5
-rw-r--r--test/files/run/t9388-bin-compat.scala16
-rw-r--r--test/files/run/t9390.scala67
-rw-r--r--test/files/run/t9390b.scala31
-rw-r--r--test/files/run/t9390c.scala21
-rw-r--r--test/files/run/t9390d.scala12
-rw-r--r--test/files/run/t9403.flags2
-rw-r--r--test/files/run/t9408.scala61
-rw-r--r--test/files/run/t9437a.check10
-rw-r--r--test/files/run/t9437a/Test.scala20
-rw-r--r--test/files/run/t9437b.check10
-rw-r--r--test/files/run/t9437b/Foo_1.scala3
-rw-r--r--test/files/run/t9437b/Test_2.scala16
-rw-r--r--test/files/run/t9437c.check10
-rw-r--r--test/files/run/t9437c/Test.scala92
-rw-r--r--test/files/run/t9489.flags (renamed from test/files/run/t8764.flags)0
-rw-r--r--test/files/run/t9489/A.java3
-rw-r--r--test/files/run/t9489/B.java3
-rw-r--r--test/files/run/t9489/test.scala10
-rw-r--r--test/files/run/t9516.scala52
-rw-r--r--test/files/run/t9535.scala22
-rw-r--r--test/files/run/t9656.check14
-rw-r--r--test/files/run/t9656.scala43
-rw-r--r--test/files/run/t9689.check14
-rw-r--r--test/files/run/t9689/Test_2.scala12
-rw-r--r--test/files/run/t9689/bug_1.scala8
-rw-r--r--test/files/run/t9697.check1
-rw-r--r--test/files/run/t9697.scala204
-rw-r--r--test/files/run/t9749-repl-dot.check8
-rw-r--r--test/files/run/t9749-repl-dot.scala10
-rw-r--r--test/files/run/t9806.scala18
-rw-r--r--test/files/run/t9814.scala28
-rw-r--r--test/files/run/t9841.scala16
-rw-r--r--test/files/run/t9880-9881.check36
-rw-r--r--test/files/run/t9880-9881.scala29
-rw-r--r--test/files/run/t9915/C_1.java20
-rw-r--r--test/files/run/t9915/Test_2.scala12
-rw-r--r--test/files/run/t9920.scala17
-rw-r--r--test/files/run/t9920b.scala17
-rw-r--r--test/files/run/t9920c.scala21
-rw-r--r--test/files/run/t9920d.scala14
-rwxr-xr-xtest/files/run/t9944.check12
-rw-r--r--test/files/run/t9944.scala7
-rw-r--r--test/files/run/t9946a.scala14
-rw-r--r--test/files/run/t9946b.scala12
-rw-r--r--test/files/run/t9946c.scala10
-rw-r--r--test/files/run/test-cpp.check81
-rw-r--r--test/files/run/test-cpp.scala104
-rw-r--r--test/files/run/toolbox_console_reporter.check4
-rw-r--r--test/files/run/toolbox_silent_reporter.check2
-rw-r--r--test/files/run/trailing-commas.check9
-rw-r--r--test/files/run/trailing-commas.scala7
-rw-r--r--test/files/run/trait-clonable.scala11
-rw-r--r--test/files/run/trait-default-specialize.check3
-rw-r--r--test/files/run/trait-default-specialize.scala14
-rw-r--r--test/files/run/trait-defaults-modules.scala20
-rw-r--r--test/files/run/trait-defaults-modules2/T_1.scala4
-rw-r--r--test/files/run/trait-defaults-modules2/Test_2.scala5
-rw-r--r--test/files/run/trait-defaults-modules3.scala8
-rw-r--r--test/files/run/trait-fields-override-lazy.check2
-rw-r--r--test/files/run/trait-fields-override-lazy.scala13
-rw-r--r--test/files/run/trait-renaming.check2
-rw-r--r--test/files/run/trait-renaming/A_1.scala15
-rw-r--r--test/files/run/trait-renaming/B_2.scala5
-rw-r--r--test/files/run/trait-static-clash.scala10
-rw-r--r--test/files/run/trait-static-forwarder.check1
-rw-r--r--test/files/run/trait-static-forwarder/Test.java5
-rw-r--r--test/files/run/trait-static-forwarder/forwarders.scala5
-rw-r--r--test/files/run/trait-super-calls.scala127
-rw-r--r--test/files/run/trait_fields_bytecode.scala23
-rw-r--r--test/files/run/trait_fields_final.scala21
-rw-r--r--test/files/run/trait_fields_init.check21
-rw-r--r--test/files/run/trait_fields_init.scala55
-rw-r--r--test/files/run/trait_fields_repl.check11
-rw-r--r--test/files/run/trait_fields_repl.scala10
-rw-r--r--test/files/run/trait_fields_three_layer_overrides.check2
-rw-r--r--test/files/run/trait_fields_three_layer_overrides.scala25
-rw-r--r--test/files/run/trait_fields_volatile.scala13
-rw-r--r--test/files/run/try-2.check2
-rw-r--r--test/files/run/try.check2
-rw-r--r--test/files/run/tuple-zipped.scala41
-rw-r--r--test/files/run/unittest_collection.check2
-rw-r--r--test/files/run/various-flat-classpath-types.scala9
-rw-r--r--test/files/run/virtpatmat_staging.flags2
-rw-r--r--test/files/run/xMigration.check20
531 files changed, 6242 insertions, 3374 deletions
diff --git a/test/files/run/Course-2002-07.scala b/test/files/run/Course-2002-07.scala
index 2d9457653f..db6e1d8e04 100644
--- a/test/files/run/Course-2002-07.scala
+++ b/test/files/run/Course-2002-07.scala
@@ -485,7 +485,7 @@ object MB {
import Utils._;
- trait Expr {
+ sealed trait Expr {
private def count: Int = this match {
case Lit(n) => n
diff --git a/test/files/run/Course-2002-08.scala b/test/files/run/Course-2002-08.scala
index 5e21edaba3..1d0e02262d 100644
--- a/test/files/run/Course-2002-08.scala
+++ b/test/files/run/Course-2002-08.scala
@@ -205,7 +205,7 @@ object M5 {
val inputSig = input.getSignal;
afterDelay(InverterDelay) {() => output.setSignal(!inputSig) };
}
- input addAction invertAction
+ input addAction invertAction _
}
def andGate(a1: Wire, a2: Wire, output: Wire): Unit = {
@@ -214,8 +214,8 @@ object M5 {
val a2Sig = a2.getSignal;
afterDelay(AndGateDelay) {() => output.setSignal(a1Sig & a2Sig) };
}
- a1 addAction andAction;
- a2 addAction andAction;
+ a1 addAction andAction _
+ a2 addAction andAction _
}
def orGate(o1: Wire, o2: Wire, output: Wire): Unit = {
@@ -224,8 +224,8 @@ object M5 {
val o2Sig = o2.getSignal;
afterDelay(OrGateDelay) {() => output.setSignal(o1Sig | o2Sig) };
}
- o1 addAction orAction;
- o2 addAction orAction;
+ o1 addAction orAction _
+ o2 addAction orAction _
}
def probe(name: String, wire: Wire): Unit = {
@@ -479,7 +479,7 @@ abstract class BasicCircuitSimulator() extends Simulator() {
val inputSig = input.getSignal;
afterDelay(InverterDelay) {() => output.setSignal(!inputSig) };
}
- input addAction invertAction
+ input addAction invertAction _
}
def andGate(a1: Wire, a2: Wire, output: Wire) = {
@@ -488,8 +488,8 @@ abstract class BasicCircuitSimulator() extends Simulator() {
val a2Sig = a2.getSignal;
afterDelay(AndGateDelay) {() => output.setSignal(a1Sig & a2Sig) };
}
- a1 addAction andAction;
- a2 addAction andAction
+ a1 addAction andAction _
+ a2 addAction andAction _
}
def orGate(a1: Wire, a2: Wire, output: Wire) = {
@@ -498,8 +498,8 @@ abstract class BasicCircuitSimulator() extends Simulator() {
val a2Sig = a2.getSignal;
afterDelay(OrGateDelay) {() => output.setSignal(a1Sig | a2Sig) };
}
- a1 addAction orAction;
- a2 addAction orAction
+ a1 addAction orAction _
+ a2 addAction orAction _
}
def orGate2(a1: Wire, a2: Wire, output: Wire) = {
diff --git a/test/files/run/SD-235.scala b/test/files/run/SD-235.scala
new file mode 100644
index 0000000000..eb79c6fe71
--- /dev/null
+++ b/test/files/run/SD-235.scala
@@ -0,0 +1,39 @@
+class C {
+ var ORef: Object = null
+ def test = {
+ object O {
+ assert(!Thread.holdsLock(C.this))
+ assert(Thread.holdsLock(ORef))
+ }
+ val captor = new { def oh = O }
+ val refField = captor.getClass.getDeclaredFields.last
+ refField.setAccessible(true)
+ assert(refField.getType.toString.contains("LazyRef"), refField)
+ ORef = refField.get(captor)
+ O
+ }
+}
+
+class D {
+ var ORef: Object = null
+ def test = {
+ lazy val O = {
+ assert(!Thread.holdsLock(D.this))
+ assert(Thread.holdsLock(ORef))
+ "O"
+ }
+ val captor = new { def oh = O }
+ val refField = captor.getClass.getDeclaredFields.last
+ refField.setAccessible(true)
+ assert(refField.getType.toString.contains("LazyRef"), refField)
+ ORef = refField.get(captor)
+ O
+ }
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ new C().test
+ new D().test
+ }
+}
diff --git a/test/files/run/SD-290.scala b/test/files/run/SD-290.scala
new file mode 100644
index 0000000000..0af9cb7cfa
--- /dev/null
+++ b/test/files/run/SD-290.scala
@@ -0,0 +1,39 @@
+object p1 {
+ class B
+ object B
+
+ class C extends java.io.Serializable
+ object C
+
+ type D = DD
+ object D
+}
+package object p2 {
+ class B
+ object B
+
+ class C extends java.io.Serializable
+ object C
+
+ type D = DD
+ object D
+
+}
+class DD extends java.io.Serializable
+
+object Test {
+ def main(args: Array[String]): Unit = {
+
+ // This is the behaviour that was intended and was unchanged by this commmit.
+ assert(!(p1.B : Object).isInstanceOf[scala.Serializable])
+ assert(p1.C.isInstanceOf[scala.Serializable])
+ assert(!(p1.D: Object).isInstanceOf[scala.Serializable])
+
+ assert(!(p2.B : Object).isInstanceOf[scala.Serializable])
+ assert(p2.C.isInstanceOf[scala.Serializable])
+
+ // this behaviour was different in 2.12.1 and earlier due to a bug
+ // in companionSymbolOf
+ assert(!(p2.D: Object).isInstanceOf[scala.Serializable])
+ }
+}
diff --git a/test/files/run/SymbolsTest.scala b/test/files/run/SymbolsTest.scala
index d5948ea168..7c185b0e09 100644
--- a/test/files/run/SymbolsTest.scala
+++ b/test/files/run/SymbolsTest.scala
@@ -137,16 +137,16 @@ object Test {
// }
// val an2 = () => {
// object nested {
- // val m = 'mfsa
+ // val m = 'mfsa
// }
// nested.m
// }
// val an3 = () => {
// object nested {
- // val f = () => {
- // 'layered
- // }
- // def gets = f()
+ // val f = () => {
+ // 'layered
+ // }
+ // def gets = f()
// }
// nested.gets
// }
@@ -204,8 +204,8 @@ object Test {
val s1 = 's1
def s2 = 's2
object inner {
- val s3 = 's3
- val s4 = 's4
+ val s3 = 's3
+ val s4 = 's4
}
}
@@ -223,8 +223,8 @@ object Test {
val s5 = 's5
def s6 = 's6
object inner2 {
- val s7 = 's7
- def s8 = 's8
+ val s7 = 's7
+ def s8 = 's8
}
}
assert(Local.s5 == 's5)
diff --git a/test/files/run/analyzerPlugins.check b/test/files/run/analyzerPlugins.check
index 9803465ddc..64b68db242 100644
--- a/test/files/run/analyzerPlugins.check
+++ b/test/files/run/analyzerPlugins.check
@@ -1,4 +1,5 @@
adaptBoundsToAnnots(List( <: Int), List(type T), List(Int @testAnn)) [2]
+annotationsConform(Boolean @testAnn, Boolean @testAnn) [2]
annotationsConform(Boolean @testAnn, Boolean) [1]
annotationsConform(Boolean(false), Boolean @testAnn) [1]
annotationsConform(Int @testAnn, ?A) [1]
@@ -13,33 +14,32 @@ canAdaptAnnotations(Trees$Select, ?) [1]
canAdaptAnnotations(Trees$Select, Boolean @testAnn) [1]
canAdaptAnnotations(Trees$Select, Boolean) [1]
canAdaptAnnotations(Trees$Select, String @testAnn) [1]
-canAdaptAnnotations(Trees$TypeTree, ?) [10]
+canAdaptAnnotations(Trees$TypeTree, ?) [8]
canAdaptAnnotations(Trees$Typed, ?) [3]
canAdaptAnnotations(Trees$Typed, Any) [1]
canAdaptAnnotations(Trees$Typed, Int) [1]
lub(List(Int @testAnn, Int)) [1]
pluginsPt(?, Trees$Annotated) [7]
-pluginsPt(?, Trees$Apply) [8]
+pluginsPt(?, Trees$Apply) [11]
pluginsPt(?, Trees$ApplyImplicitView) [2]
-pluginsPt(?, Trees$Assign) [7]
pluginsPt(?, Trees$Block) [4]
pluginsPt(?, Trees$ClassDef) [2]
pluginsPt(?, Trees$DefDef) [14]
-pluginsPt(?, Trees$Ident) [50]
+pluginsPt(?, Trees$Ident) [51]
pluginsPt(?, Trees$If) [2]
pluginsPt(?, Trees$Literal) [16]
-pluginsPt(?, Trees$New) [5]
+pluginsPt(?, Trees$New) [6]
pluginsPt(?, Trees$PackageDef) [1]
pluginsPt(?, Trees$Return) [1]
-pluginsPt(?, Trees$Select) [47]
+pluginsPt(?, Trees$Select) [45]
pluginsPt(?, Trees$Super) [2]
-pluginsPt(?, Trees$This) [20]
+pluginsPt(?, Trees$This) [13]
pluginsPt(?, Trees$TypeApply) [3]
pluginsPt(?, Trees$TypeBoundsTree) [2]
pluginsPt(?, Trees$TypeDef) [1]
-pluginsPt(?, Trees$TypeTree) [38]
+pluginsPt(?, Trees$TypeTree) [32]
pluginsPt(?, Trees$Typed) [1]
-pluginsPt(?, Trees$ValDef) [21]
+pluginsPt(?, Trees$ValDef) [13]
pluginsPt(Any, Trees$Literal) [2]
pluginsPt(Any, Trees$Typed) [1]
pluginsPt(Array[Any], Trees$ArrayValue) [1]
@@ -47,25 +47,21 @@ pluginsPt(Boolean @testAnn, Trees$Literal) [1]
pluginsPt(Boolean @testAnn, Trees$Select) [1]
pluginsPt(Boolean, Trees$Apply) [1]
pluginsPt(Boolean, Trees$Ident) [1]
-pluginsPt(Boolean, Trees$Literal) [1]
pluginsPt(Double, Trees$Select) [1]
pluginsPt(Int @testAnn, Trees$Literal) [1]
pluginsPt(Int, Trees$Apply) [1]
-pluginsPt(Int, Trees$Ident) [2]
-pluginsPt(Int, Trees$If) [1]
-pluginsPt(Int, Trees$Literal) [5]
+pluginsPt(Int, Trees$Ident) [1]
+pluginsPt(Int, Trees$Literal) [4]
pluginsPt(Int, Trees$Select) [3]
-pluginsPt(List, Trees$Apply) [1]
pluginsPt(List[Any], Trees$Select) [1]
pluginsPt(String @testAnn, Trees$Select) [1]
pluginsPt(String, Trees$Apply) [1]
pluginsPt(String, Trees$Block) [2]
-pluginsPt(String, Trees$Ident) [4]
+pluginsPt(String, Trees$Ident) [3]
pluginsPt(String, Trees$Literal) [1]
pluginsPt(String, Trees$Select) [1]
-pluginsPt(String, Trees$Typed) [1]
pluginsPt(Unit, Trees$Assign) [1]
-pluginsPt(testAnn, Trees$Apply) [5]
+pluginsPt(testAnn, Trees$Apply) [6]
pluginsTypeSig(<none>, Trees$Template) [2]
pluginsTypeSig(class A, Trees$ClassDef) [1]
pluginsTypeSig(class testAnn, Trees$ClassDef) [1]
@@ -75,16 +71,18 @@ pluginsTypeSig(method foo, Trees$DefDef) [1]
pluginsTypeSig(method method, Trees$DefDef) [1]
pluginsTypeSig(method nested, Trees$DefDef) [1]
pluginsTypeSig(type T, Trees$TypeDef) [2]
-pluginsTypeSig(value annotField, Trees$ValDef) [2]
+pluginsTypeSig(value annotField, Trees$ValDef) [1]
+pluginsTypeSig(value count_=, Trees$ValDef) [1]
pluginsTypeSig(value f, Trees$ValDef) [1]
-pluginsTypeSig(value inferField, Trees$ValDef) [2]
-pluginsTypeSig(value lub1, Trees$ValDef) [2]
-pluginsTypeSig(value lub2, Trees$ValDef) [2]
+pluginsTypeSig(value inferField, Trees$ValDef) [1]
+pluginsTypeSig(value lub1, Trees$ValDef) [1]
+pluginsTypeSig(value lub2, Trees$ValDef) [1]
pluginsTypeSig(value param, Trees$ValDef) [2]
pluginsTypeSig(value str, Trees$ValDef) [1]
-pluginsTypeSig(value x, Trees$ValDef) [4]
-pluginsTypeSig(value y, Trees$ValDef) [4]
-pluginsTypeSig(variable count, Trees$ValDef) [3]
+pluginsTypeSig(value x, Trees$ValDef) [3]
+pluginsTypeSig(value y, Trees$ValDef) [3]
+pluginsTypeSig(variable count, Trees$DefDef) [1]
+pluginsTypeSig(variable count, Trees$ValDef) [1]
pluginsTypeSigAccessor(value annotField) [1]
pluginsTypeSigAccessor(value inferField) [1]
pluginsTypeSigAccessor(value lub1) [1]
@@ -93,11 +91,12 @@ pluginsTypeSigAccessor(value x) [1]
pluginsTypeSigAccessor(value y) [1]
pluginsTypeSigAccessor(variable count) [2]
pluginsTyped( <: Int, Trees$TypeBoundsTree) [2]
+pluginsTyped(()Double, Trees$Select) [6]
pluginsTyped(()Object, Trees$Select) [1]
pluginsTyped(()String, Trees$Ident) [1]
pluginsTyped(()String, Trees$TypeApply) [1]
pluginsTyped(()scala.annotation.Annotation, Trees$Select) [1]
-pluginsTyped(()testAnn, Trees$Select) [10]
+pluginsTyped(()testAnn, Trees$Select) [12]
pluginsTyped((str: String)A <and> (param: Double)A, Trees$Select) [1]
pluginsTyped((x$1: Any)Boolean <and> (x: Double)Boolean <and> (x: Float)Boolean <and> (x: Long)Boolean <and> (x: Int)Boolean <and> (x: Char)Boolean <and> (x: Short)Boolean <and> (x: Byte)Boolean, Trees$Select) [1]
pluginsTyped((x$1: Int)Unit, Trees$Select) [1]
@@ -110,15 +109,15 @@ pluginsTyped(<notype>, Trees$ClassDef) [2]
pluginsTyped(<notype>, Trees$DefDef) [14]
pluginsTyped(<notype>, Trees$PackageDef) [1]
pluginsTyped(<notype>, Trees$TypeDef) [1]
-pluginsTyped(<notype>, Trees$ValDef) [21]
+pluginsTyped(<notype>, Trees$ValDef) [13]
pluginsTyped(=> Boolean @testAnn, Trees$Select) [1]
-pluginsTyped(=> Double, Trees$Select) [4]
+pluginsTyped(=> Double, Trees$Select) [1]
pluginsTyped(=> Int, Trees$Select) [5]
pluginsTyped(=> Int, Trees$TypeApply) [1]
pluginsTyped(=> String @testAnn, Trees$Select) [1]
pluginsTyped(A, Trees$Apply) [1]
pluginsTyped(A, Trees$Ident) [2]
-pluginsTyped(A, Trees$This) [8]
+pluginsTyped(A, Trees$This) [1]
pluginsTyped(A, Trees$TypeTree) [4]
pluginsTyped(A.super.type, Trees$Super) [1]
pluginsTyped(A.this.type, Trees$This) [11]
@@ -126,50 +125,47 @@ pluginsTyped(Any, Trees$TypeTree) [1]
pluginsTyped(AnyRef, Trees$Select) [4]
pluginsTyped(Array[Any], Trees$ArrayValue) [1]
pluginsTyped(Boolean @testAnn, Trees$Select) [1]
-pluginsTyped(Boolean @testAnn, Trees$TypeTree) [4]
-pluginsTyped(Boolean(false), Trees$Literal) [2]
+pluginsTyped(Boolean @testAnn, Trees$TypeTree) [3]
+pluginsTyped(Boolean(false), Trees$Literal) [1]
pluginsTyped(Boolean, Trees$Apply) [1]
-pluginsTyped(Boolean, Trees$Select) [4]
+pluginsTyped(Boolean, Trees$Select) [3]
pluginsTyped(Char('c'), Trees$Literal) [2]
+pluginsTyped(Double, Trees$Apply) [3]
pluginsTyped(Double, Trees$Select) [6]
pluginsTyped(Int @testAnn, Trees$TypeTree) [2]
pluginsTyped(Int @testAnn, Trees$Typed) [2]
-pluginsTyped(Int(0), Trees$Literal) [3]
+pluginsTyped(Int(0), Trees$Literal) [2]
pluginsTyped(Int(1) @testAnn, Trees$Typed) [1]
pluginsTyped(Int(1), Trees$Literal) [8]
pluginsTyped(Int(2), Trees$Literal) [1]
pluginsTyped(Int, Trees$Apply) [1]
-pluginsTyped(Int, Trees$Ident) [2]
-pluginsTyped(Int, Trees$If) [2]
-pluginsTyped(Int, Trees$Select) [15]
-pluginsTyped(Int, Trees$TypeTree) [13]
-pluginsTyped(List, Trees$Apply) [1]
-pluginsTyped(List, Trees$Select) [1]
+pluginsTyped(Int, Trees$Ident) [1]
+pluginsTyped(Int, Trees$If) [1]
+pluginsTyped(Int, Trees$Select) [12]
+pluginsTyped(Int, Trees$TypeTree) [10]
pluginsTyped(List[Any], Trees$Apply) [1]
pluginsTyped(List[Any], Trees$Select) [1]
-pluginsTyped(List[Any], Trees$TypeTree) [3]
+pluginsTyped(List[Any], Trees$TypeTree) [2]
pluginsTyped(Nothing, Trees$Return) [1]
pluginsTyped(Object, Trees$Apply) [1]
pluginsTyped(String @testAnn, Trees$Ident) [1]
pluginsTyped(String @testAnn, Trees$Select) [1]
-pluginsTyped(String @testAnn, Trees$TypeTree) [4]
+pluginsTyped(String @testAnn, Trees$TypeTree) [3]
pluginsTyped(String(""), Trees$Literal) [2]
pluginsTyped(String("huhu"), Trees$Literal) [1]
pluginsTyped(String("str") @testAnn, Trees$Typed) [1]
pluginsTyped(String("str"), Trees$Literal) [1]
-pluginsTyped(String("str"), Trees$Typed) [1]
pluginsTyped(String("two"), Trees$Literal) [2]
pluginsTyped(String, Trees$Apply) [2]
pluginsTyped(String, Trees$Block) [2]
-pluginsTyped(String, Trees$Ident) [1]
-pluginsTyped(String, Trees$Select) [9]
-pluginsTyped(String, Trees$TypeTree) [7]
+pluginsTyped(String, Trees$Select) [7]
+pluginsTyped(String, Trees$TypeTree) [6]
pluginsTyped(Unit, Trees$Apply) [2]
-pluginsTyped(Unit, Trees$Assign) [8]
+pluginsTyped(Unit, Trees$Assign) [1]
pluginsTyped(Unit, Trees$Block) [4]
pluginsTyped(Unit, Trees$If) [1]
pluginsTyped(Unit, Trees$Literal) [5]
-pluginsTyped(Unit, Trees$TypeTree) [1]
+pluginsTyped(Unit, Trees$TypeTree) [2]
pluginsTyped([A](xs: A*)List[A], Trees$Select) [1]
pluginsTyped([T <: Int]=> Int, Trees$Select) [1]
pluginsTyped([T0]()T0, Trees$Select) [1]
@@ -183,9 +179,9 @@ pluginsTyped(scala.collection.immutable.List.type, Trees$Select) [2]
pluginsTyped(scala.collection.immutable.StringOps, Trees$ApplyImplicitView) [2]
pluginsTyped(scala.collection.mutable.WrappedArray[Any], Trees$Apply) [1]
pluginsTyped(str.type, Trees$Ident) [3]
-pluginsTyped(testAnn, Trees$Apply) [5]
-pluginsTyped(testAnn, Trees$Ident) [5]
-pluginsTyped(testAnn, Trees$New) [5]
+pluginsTyped(testAnn, Trees$Apply) [6]
+pluginsTyped(testAnn, Trees$Ident) [6]
+pluginsTyped(testAnn, Trees$New) [6]
pluginsTyped(testAnn, Trees$This) [1]
pluginsTyped(testAnn, Trees$TypeTree) [2]
pluginsTyped(testAnn.super.type, Trees$Super) [1]
diff --git a/test/files/run/array-charSeq.check b/test/files/run/array-charSeq.check
index f1f374f63e..3ccf493cee 100644
--- a/test/files/run/array-charSeq.check
+++ b/test/files/run/array-charSeq.check
@@ -1,3 +1,4 @@
+warning: there were two deprecation warnings (since 2.12.0); re-run with -deprecation for details
[check 'abcdefghi'] len = 9
sub(0, 9) == 'abcdefghi'
diff --git a/test/files/run/bcodeInlinerMixed.flags b/test/files/run/bcodeInlinerMixed.flags
index 63b5558cfd..768ca4f13b 100644
--- a/test/files/run/bcodeInlinerMixed.flags
+++ b/test/files/run/bcodeInlinerMixed.flags
@@ -1 +1 @@
--Ybackend:GenBCode -Yopt:l:classpath \ No newline at end of file
+-opt:l:classpath \ No newline at end of file
diff --git a/test/files/run/bcodeInlinerMixed/B_1.scala b/test/files/run/bcodeInlinerMixed/B_1.scala
index 2aadeccb82..b26f2f1dd5 100644
--- a/test/files/run/bcodeInlinerMixed/B_1.scala
+++ b/test/files/run/bcodeInlinerMixed/B_1.scala
@@ -1,15 +1,13 @@
-// Partest does proper mixed compilation:
+// Since 1.0.18, partest does mixed compilation only in two stages
// 1. scalac *.scala *.java
// 2. javac *.java
-// 3. scalc *.scala
-//
-// In the second scalc round, the classfile for A_1 is on the classpath.
-// Therefore the inliner has access to the bytecode of `bar`, which means
-// it can verify that the invocation to `bar` can be safely inlined.
//
-// So both callsites of `flop` are inlined.
+// Before it used to do a third stage
+// 3. scalc *.scala
//
-// In a single mixed compilation, `flop` cannot be inlined, see JUnit InlinerTest.scala, def mixedCompilationNoInline.
+// Because he inliner doesn't has access to the bytecode of `bar`, it cannot verify whether the
+// invocation of `bar` can be safely copied to a differnet place, so `flop` is not inlined to `B.g`
+// or `C.h`.
class B {
@inline final def flop = A_1.bar
diff --git a/test/files/run/bcodeInlinerMixed/Test.scala b/test/files/run/bcodeInlinerMixed/Test.scala
deleted file mode 100644
index c8c7a9fe2a..0000000000
--- a/test/files/run/bcodeInlinerMixed/Test.scala
+++ /dev/null
@@ -1,16 +0,0 @@
-import scala.tools.partest.{BytecodeTest, ASMConverters}
-import ASMConverters._
-
-object Test extends BytecodeTest {
- def show: Unit = {
- val gIns = instructionsFromMethod(getMethod(loadClassNode("B"), "g"))
- val hIns = instructionsFromMethod(getMethod(loadClassNode("C"), "h"))
- // val invocation = Invoke(INVOKESTATIC, A_1, bar, ()I, false)
- for (i <- List(gIns, hIns)) {
- assert(i exists {
- case Invoke(_, _, "bar", "()I", _) => true
- case _ => false
- }, i mkString "\n")
- }
- }
-}
diff --git a/test/files/run/bcodeInlinerMixed/Test_2.scala b/test/files/run/bcodeInlinerMixed/Test_2.scala
new file mode 100644
index 0000000000..db1ea14a8f
--- /dev/null
+++ b/test/files/run/bcodeInlinerMixed/Test_2.scala
@@ -0,0 +1,30 @@
+import scala.tools.partest.{BytecodeTest, ASMConverters}
+import ASMConverters._
+
+class D {
+ // This is compiled with `A_1.class` on the classpath. When inlining `flop` (which invokes
+ // `A_1.bar`), the inliner can check that the call to `A_1.bar` can be safely inlined into a
+ // different classfile (D). See also comment in B_1.scala.
+ def m(b: B) = b.flop
+}
+
+object Test extends BytecodeTest {
+ def show: Unit = {
+ val gIns = instructionsFromMethod(getMethod(loadClassNode("B"), "g"))
+ val hIns = instructionsFromMethod(getMethod(loadClassNode("C"), "h"))
+ for (i <- List(gIns, hIns)) {
+ assert(i exists {
+ // `flop` is not inlined
+ case Invoke(_, _, "flop", "()I", _) => true
+ case _ => false
+ }, i mkString "\n")
+ }
+
+ val mIns = instructionsFromMethod(getMethod(loadClassNode("D"), "m"))
+ assert(mIns exists {
+ // `flop` is inlined, we get a call to `bar`
+ case Invoke(_, _, "bar", "()I", _) => true
+ case _ => false
+ }, mIns mkString "\n")
+ }
+}
diff --git a/test/files/run/bitsets.check b/test/files/run/bitsets.check
index c24fd6238f..89e51f9a78 100644
--- a/test/files/run/bitsets.check
+++ b/test/files/run/bitsets.check
@@ -1,4 +1,4 @@
-warning: there were three deprecation warnings; re-run with -deprecation for details
+warning: there were three deprecation warnings (since 2.12.0); re-run with -deprecation for details
ms0 = BitSet(2)
ms1 = BitSet(2)
ms2 = BitSet(2)
diff --git a/test/files/run/blame_eye_triple_eee-double.flags b/test/files/run/blame_eye_triple_eee-double.flags
deleted file mode 100644
index c9b68d70dc..0000000000
--- a/test/files/run/blame_eye_triple_eee-double.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimise
diff --git a/test/files/run/blame_eye_triple_eee-float.flags b/test/files/run/blame_eye_triple_eee-float.flags
deleted file mode 100644
index c9b68d70dc..0000000000
--- a/test/files/run/blame_eye_triple_eee-float.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimise
diff --git a/test/files/run/caseclasses.scala b/test/files/run/caseclasses.scala
index 668c984f3d..10c0916dc0 100644
--- a/test/files/run/caseclasses.scala
+++ b/test/files/run/caseclasses.scala
@@ -18,7 +18,7 @@ object M {
object Test extends App {
def Abs(x: Int) = new Abs(x * 2){}
- Abs(2) match {
+ (Abs(2): @unchecked) match {
case Abs(4) => ;
}
diff --git a/test/files/run/classfile-format-51.scala b/test/files/run/classfile-format-51.scala
index 81df2f08d9..40eebee198 100644
--- a/test/files/run/classfile-format-51.scala
+++ b/test/files/run/classfile-format-51.scala
@@ -1,6 +1,5 @@
import java.io.{File, FileOutputStream}
-import scala.tools.nsc.settings.ScalaVersion
import scala.tools.partest._
import scala.tools.asm
import asm.{AnnotationVisitor, ClassWriter, FieldVisitor, Handle, MethodVisitor, Opcodes}
@@ -17,7 +16,7 @@ import Opcodes._
// verify. So the test includes a version check that short-circuits the whole test
// on JDK 6
object Test extends DirectTest {
- override def extraSettings: String = "-optimise -usejavacp -d " + testOutput.path + " -cp " + testOutput.path
+ override def extraSettings: String = "-opt:l:classpath -usejavacp -d " + testOutput.path + " -cp " + testOutput.path
def generateClass() {
val invokerClassName = "DynamicInvoker"
@@ -81,7 +80,7 @@ object Test extends DirectTest {
val test = cw.visitMethod(ACC_PUBLIC + ACC_FINAL, "test", s"()Ljava/lang/String;", null, null)
test.visitCode()
- val bootstrapHandle = new Handle(H_INVOKESTATIC, invokerClassName, bootstrapMethodName, bootStrapMethodType)
+ val bootstrapHandle = new Handle(H_INVOKESTATIC, invokerClassName, bootstrapMethodName, bootStrapMethodType, /* itf = */ false)
test.visitInvokeDynamicInsn("invoke", targetMethodType, bootstrapHandle)
test.visitInsn(ARETURN)
test.visitMaxs(1, 1)
diff --git a/test/files/run/classfile-format-52.scala b/test/files/run/classfile-format-52.scala
index 453f61ac84..03ceeb074f 100644
--- a/test/files/run/classfile-format-52.scala
+++ b/test/files/run/classfile-format-52.scala
@@ -1,6 +1,5 @@
import java.io.{File, FileOutputStream}
-import scala.tools.nsc.settings.ScalaVersion
import scala.tools.partest._
import scala.tools.asm
import asm.{AnnotationVisitor, ClassWriter, FieldVisitor, Handle, MethodVisitor, Opcodes}
@@ -14,7 +13,7 @@ import Opcodes._
// By its nature the test can only work on JDK 8+ because under JDK 7- the
// interface won't verify.
object Test extends DirectTest {
- override def extraSettings: String = "-optimise -usejavacp -d " + testOutput.path + " -cp " + testOutput.path
+ override def extraSettings: String = "-opt:l:classpath -usejavacp -d " + testOutput.path + " -cp " + testOutput.path
def generateInterface() {
val interfaceName = "HasDefaultMethod"
diff --git a/test/files/run/collection-stacks.check b/test/files/run/collection-stacks.check
index 3a366bfcdf..cd87cc61e4 100644
--- a/test/files/run/collection-stacks.check
+++ b/test/files/run/collection-stacks.check
@@ -1,4 +1,6 @@
-warning: there was one deprecation warning; re-run with -deprecation for details
+warning: there was one deprecation warning (since 2.11.0)
+warning: there were two deprecation warnings (since 2.12.0)
+warning: there were three deprecation warnings in total; re-run with -deprecation for details
3-2-1: true
3-2-1: true
apply
diff --git a/test/files/run/colltest.check b/test/files/run/colltest.check
index 9579d781aa..f362f23547 100644
--- a/test/files/run/colltest.check
+++ b/test/files/run/colltest.check
@@ -1,4 +1,4 @@
-warning: there were two deprecation warnings; re-run with -deprecation for details
+warning: there were two deprecation warnings (since 2.11.0); re-run with -deprecation for details
true
false
true
diff --git a/test/files/run/compiler-asSeenFrom.check b/test/files/run/compiler-asSeenFrom.check
index 7305504115..46ea4d3685 100644
--- a/test/files/run/compiler-asSeenFrom.check
+++ b/test/files/run/compiler-asSeenFrom.check
@@ -332,11 +332,6 @@ value dZ { // after parser
val cD: ll.C[List[T3]]
}
-value dZ { // after parser
- private[this] val cD: ll.C[List[T3]]
- val cD: ll.C[List[T3]]
-}
-
value dZ { // after uncurry
private[this] val cD: ll.C[List[T3]]
val cD(): ll.C[List[T3]]
@@ -347,11 +342,9 @@ value dZ { // after erasure
val cD(): ll.C
}
-value jZ { // after parser
- def thisI(): I.this.type
- def thisC(): C.this.type
- def t2(): T2
- def t1(): T1
+value dZ { // after parser
+ private[this] val cD: ll.C[List[T3]]
+ val cD: ll.C[List[T3]]
}
value jZ { // after parser
@@ -393,6 +386,13 @@ value jZ { // after flatten
def t1(): Object
}
+value jZ { // after parser
+ def thisI(): I.this.type
+ def thisC(): C.this.type
+ def t2(): T2
+ def t1(): T1
+}
+
method kz { // after parser
def thisI(): I.this.type
def thisC(): C.this.type
diff --git a/test/files/run/concurrent-map-conversions.scala b/test/files/run/concurrent-map-conversions.scala
index d23d5bbbe4..1179764e37 100644
--- a/test/files/run/concurrent-map-conversions.scala
+++ b/test/files/run/concurrent-map-conversions.scala
@@ -1,14 +1,5 @@
-
-
-
-
-object Test {
-
- def main(args: Array[String]) {
- testConversions()
- testConverters()
- }
+object Test extends App {
def needPackageConcurrentMap(map: collection.concurrent.Map[Int, Int]) {
}
@@ -16,7 +7,7 @@ object Test {
}
def testConversions() {
- import collection.JavaConversions._
+ import collection.convert.ImplicitConversions._
val skiplist = new java.util.concurrent.ConcurrentSkipListMap[Int, Int]
val ctrie = new collection.concurrent.TrieMap[Int, Int]
@@ -33,4 +24,6 @@ object Test {
needJavaConcurrent(ctrie.asJava)
}
+ testConversions()
+ testConverters()
}
diff --git a/test/files/run/concurrent-stream.check b/test/files/run/concurrent-stream.check
deleted file mode 100644
index d4adf84490..0000000000
--- a/test/files/run/concurrent-stream.check
+++ /dev/null
@@ -1,3 +0,0 @@
-Testing standard cons.
-Evaluation 0: List(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
-Evaluation 1: List(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
diff --git a/test/files/run/concurrent-stream.scala b/test/files/run/concurrent-stream.scala
deleted file mode 100644
index 9d5ba0428e..0000000000
--- a/test/files/run/concurrent-stream.scala
+++ /dev/null
@@ -1,37 +0,0 @@
-// test concurrent calls to Stream.tail
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-
- def slowRange(from: Int, until: Int, cons: (Int, => Stream[Int]) => Stream[Int]): Stream[Int] = {
- var current = from
- def next: Stream[Int] = {
- Thread.sleep(100)
- if (current >= until) Stream.empty
- else {
- val stream = cons(current, next)
- current += 1
- stream
- }
- }
- next
- }
-
- def testCons(cons: (Int, => Stream[Int]) => Stream[Int]): Unit = {
- import scala.actors.Actor._
-
- val stream = slowRange(0, 10, cons)
- val main = self
- actor { main ! stream.toList }
- actor { main ! stream.toList }
- val eval0 = receive { case list: List[Int @unchecked] => list }
- val eval1 = receive { case list: List[Int @unchecked] => list }
- println("Evaluation 0: " + eval0)
- println("Evaluation 1: " + eval1)
- }
-
- def main(args: Array[String]) {
- println("Testing standard cons.")
- testCons(Stream.cons.apply(_, _))
- }
-}
-
diff --git a/test/files/run/constant-optimization.flags b/test/files/run/constant-optimization.flags
deleted file mode 100644
index c9b68d70dc..0000000000
--- a/test/files/run/constant-optimization.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimise
diff --git a/test/files/run/constrained-types.check b/test/files/run/constrained-types.check
index 5444cf2088..4acd9d16ae 100644
--- a/test/files/run/constrained-types.check
+++ b/test/files/run/constrained-types.check
@@ -69,11 +69,11 @@ scala> var four = "four"
four: String = four
scala> val four2 = m(four) // should have an existential bound
-warning: there was one feature warning; re-run with -feature for details
+warning: there was one feature warning; for details, enable `:setting -feature' or `:replay -feature'
four2: String @Annot(x) forSome { val x: String } = four
scala> val four3 = four2 // should have the same type as four2
-warning: there was one feature warning; re-run with -feature for details
+warning: there was one feature warning; for details, enable `:setting -feature' or `:replay -feature'
four3: String @Annot(x) forSome { val x: String } = four
scala> val stuff = m("stuff") // should not crash
@@ -96,7 +96,7 @@ scala> def m = {
val y : String @Annot(x) = x
y
} // x should not escape the local scope with a narrow type
-warning: there was one feature warning; re-run with -feature for details
+warning: there was one feature warning; for details, enable `:setting -feature' or `:replay -feature'
m: String @Annot(x) forSome { val x: String }
scala>
@@ -110,7 +110,7 @@ scala> def n(y: String) = {
}
m("stuff".stripMargin)
} // x should be existentially bound
-warning: there was one feature warning; re-run with -feature for details
+warning: there was one feature warning; for details, enable `:setting -feature' or `:replay -feature'
n: (y: String)String @Annot(x) forSome { val x: String }
scala>
diff --git a/test/files/run/contrib674.check b/test/files/run/contrib674.check
index 78325c1810..98c72f34dd 100644
--- a/test/files/run/contrib674.check
+++ b/test/files/run/contrib674.check
@@ -1,3 +1,6 @@
-contrib674.scala:15: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+contrib674.scala:15: warning: a pure expression does nothing in statement position
+ 1
+ ^
+contrib674.scala:15: warning: multiline expressions might require enclosing parentheses; a value can be silently discarded when Unit is expected
1
^
diff --git a/test/files/run/contrib674.scala b/test/files/run/contrib674.scala
index 45c9871fc4..bb9dad3686 100644
--- a/test/files/run/contrib674.scala
+++ b/test/files/run/contrib674.scala
@@ -1,7 +1,7 @@
// causes VerifyError with scala-2.5.1
object Test extends App {
- def bad() {
+ def bad(): Unit = {
try {
1
} catch {
diff --git a/test/files/run/dead-code-elimination.flags b/test/files/run/dead-code-elimination.flags
deleted file mode 100644
index 49d036a887..0000000000
--- a/test/files/run/dead-code-elimination.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimize
diff --git a/test/files/run/delambdafy-specialized.check b/test/files/run/delambdafy-specialized.check
deleted file mode 100644
index c6903b9e29..0000000000
--- a/test/files/run/delambdafy-specialized.check
+++ /dev/null
@@ -1 +0,0 @@
-scala.runtime.AbstractFunction1$mcII$sp
diff --git a/test/files/run/delambdafy-specialized.flags b/test/files/run/delambdafy-specialized.flags
deleted file mode 100644
index 48b438ddf8..0000000000
--- a/test/files/run/delambdafy-specialized.flags
+++ /dev/null
@@ -1 +0,0 @@
--Ydelambdafy:method
diff --git a/test/files/run/delambdafy-specialized.scala b/test/files/run/delambdafy-specialized.scala
deleted file mode 100644
index 634d4e490b..0000000000
--- a/test/files/run/delambdafy-specialized.scala
+++ /dev/null
@@ -1,6 +0,0 @@
-object Test {
- def main(args: Array[String]): Unit = {
- val f = (x: Int) => -x
- println(f.getClass.getSuperclass.getName)
- }
-}
diff --git a/test/files/run/delambdafyLambdaClassNames.check b/test/files/run/delambdafyLambdaClassNames.check
deleted file mode 100644
index d425d15dd0..0000000000
--- a/test/files/run/delambdafyLambdaClassNames.check
+++ /dev/null
@@ -1 +0,0 @@
-A$$nestedInAnon$1$lambda$$run$1
diff --git a/test/files/run/delambdafyLambdaClassNames.flags b/test/files/run/delambdafyLambdaClassNames.flags
deleted file mode 100644
index b10233d322..0000000000
--- a/test/files/run/delambdafyLambdaClassNames.flags
+++ /dev/null
@@ -1 +0,0 @@
--Ybackend:GenBCode -Ydelambdafy:method \ No newline at end of file
diff --git a/test/files/run/delambdafyLambdaClassNames/A_1.scala b/test/files/run/delambdafyLambdaClassNames/A_1.scala
deleted file mode 100644
index 10489414b7..0000000000
--- a/test/files/run/delambdafyLambdaClassNames/A_1.scala
+++ /dev/null
@@ -1,5 +0,0 @@
-class A {
- def f = new Runnable {
- def run(): Unit = List(1,2).foreach(println)
- }
-}
diff --git a/test/files/run/delambdafyLambdaClassNames/Test.scala b/test/files/run/delambdafyLambdaClassNames/Test.scala
deleted file mode 100644
index 49a397d1d2..0000000000
--- a/test/files/run/delambdafyLambdaClassNames/Test.scala
+++ /dev/null
@@ -1,4 +0,0 @@
-object Test extends App {
- val c = Class.forName("A$$nestedInAnon$1$lambda$$run$1")
- println(c.getName)
-}
diff --git a/test/files/run/delambdafy_t6028.check b/test/files/run/delambdafy_t6028.check
index 419e7043a3..86cb1d5e97 100644
--- a/test/files/run/delambdafy_t6028.check
+++ b/test/files/run/delambdafy_t6028.check
@@ -11,61 +11,48 @@ package <empty> {
def foo(methodParam: String): Function0 = {
val methodLocal: String = "";
{
- (() => T.this.$anonfun$1(methodParam, methodLocal)).$asInstanceOf[Function0]()
+ (() => T.this.$anonfun$foo$1(methodParam, methodLocal))
}
};
def bar(barParam: String): Object = {
- @volatile var MethodLocalObject$module: runtime.VolatileObjectRef = scala.runtime.VolatileObjectRef.zero();
+ lazy <artifact> val MethodLocalObject$module: scala.runtime.LazyRef = new scala.runtime.LazyRef();
T.this.MethodLocalObject$1(barParam, MethodLocalObject$module)
};
def tryy(tryyParam: String): Function0 = {
var tryyLocal: runtime.ObjectRef = scala.runtime.ObjectRef.create("");
{
- (new <$anon: Function0>(T.this, tryyParam, tryyLocal): Function0)
+ (() => T.this.$anonfun$tryy$1(tryyParam, tryyLocal))
}
};
- final <artifact> private[this] def $anonfun$1(methodParam$1: String, methodLocal$1: String): String = T.this.classParam.+(T.this.field()).+(methodParam$1).+(methodLocal$1);
+ final <artifact> private[this] def $anonfun$foo$1(methodParam$1: String, methodLocal$1: String): String = T.this.classParam.+(T.this.field()).+(methodParam$1).+(methodLocal$1);
abstract trait MethodLocalTrait$1 extends Object {
+ def /*MethodLocalTrait$1*/$init$(barParam$1: String): Unit = {
+ ()
+ };
+ scala.Predef.print(barParam$1);
<synthetic> <stable> <artifact> def $outer(): T
};
object MethodLocalObject$2 extends Object with T#MethodLocalTrait$1 {
def <init>($outer: T, barParam$1: String): T#MethodLocalObject$2.type = {
MethodLocalObject$2.super.<init>();
- MethodLocalObject$2.this.$asInstanceOf[T#MethodLocalTrait$1$class]()./*MethodLocalTrait$1$class*/$init$(barParam$1);
+ MethodLocalObject$2.super./*MethodLocalTrait$1*/$init$(barParam$1);
()
};
<synthetic> <paramaccessor> <artifact> private[this] val $outer: T = _;
<synthetic> <stable> <artifact> def $outer(): T = MethodLocalObject$2.this.$outer;
<synthetic> <stable> <artifact> def $outer(): T = MethodLocalObject$2.this.$outer
};
- final <stable> private[this] def MethodLocalObject$1(barParam$1: String, MethodLocalObject$module$1: runtime.VolatileObjectRef): T#MethodLocalObject$2.type = {
- MethodLocalObject$module$1.elem = new T#MethodLocalObject$2.type(T.this, barParam$1);
- MethodLocalObject$module$1.elem.$asInstanceOf[T#MethodLocalObject$2.type]()
- };
- abstract trait MethodLocalTrait$1$class extends Object with T#MethodLocalTrait$1 {
- def /*MethodLocalTrait$1$class*/$init$(barParam$1: String): Unit = {
- ()
- };
- scala.this.Predef.print(barParam$1)
- };
- @SerialVersionUID(value = 0) final <synthetic> class $anonfun$tryy$1 extends scala.runtime.AbstractFunction0$mcV$sp with Serializable {
- def <init>($outer: T, tryyParam$1: String, tryyLocal$1: runtime.ObjectRef): <$anon: Function0> = {
- $anonfun$tryy$1.super.<init>();
- ()
- };
- final def apply(): Unit = $anonfun$tryy$1.this.apply$mcV$sp();
- <specialized> def apply$mcV$sp(): Unit = try {
- $anonfun$tryy$1.this.tryyLocal$1.elem = $anonfun$tryy$1.this.tryyParam$1
- } finally ();
- <synthetic> <paramaccessor> <artifact> private[this] val $outer: T = _;
- <synthetic> <stable> <artifact> def $outer(): T = $anonfun$tryy$1.this.$outer;
- final <bridge> <artifact> def apply(): Object = {
- $anonfun$tryy$1.this.apply();
- scala.runtime.BoxedUnit.UNIT
- };
- <synthetic> <paramaccessor> private[this] val tryyParam$1: String = _;
- <synthetic> <paramaccessor> private[this] val tryyLocal$1: runtime.ObjectRef = _
- }
+ final <artifact> private[this] def MethodLocalObject$lzycompute$1(barParam$1: String, MethodLocalObject$module$1: scala.runtime.LazyRef): T#MethodLocalObject$2.type = MethodLocalObject$module$1.synchronized[T#MethodLocalObject$2.type](if (MethodLocalObject$module$1.initialized())
+ MethodLocalObject$module$1.value().$asInstanceOf[T#MethodLocalObject$2.type]()
+ else
+ MethodLocalObject$module$1.initialize(new T#MethodLocalObject$2.type(T.this, barParam$1)).$asInstanceOf[T#MethodLocalObject$2.type]());
+ final private[this] def MethodLocalObject$1(barParam$1: String, MethodLocalObject$module$1: scala.runtime.LazyRef): T#MethodLocalObject$2.type = if (MethodLocalObject$module$1.initialized())
+ MethodLocalObject$module$1.value().$asInstanceOf[T#MethodLocalObject$2.type]()
+ else
+ T.this.MethodLocalObject$lzycompute$1(barParam$1, MethodLocalObject$module$1);
+ final <artifact> private[this] def $anonfun$tryy$1(tryyParam$1: String, tryyLocal$1: runtime.ObjectRef): Unit = try {
+ tryyLocal$1.elem = tryyParam$1
+ } finally ()
}
}
diff --git a/test/files/run/delambdafy_t6555.check b/test/files/run/delambdafy_t6555.check
index b6ccebde78..d8b834edc7 100644
--- a/test/files/run/delambdafy_t6555.check
+++ b/test/files/run/delambdafy_t6555.check
@@ -6,8 +6,8 @@ package <empty> {
()
};
private[this] val f: String => String = {
- final <artifact> def $anonfun(param: String): String = param;
- ((param: String) => $anonfun(param))
+ final <artifact> def $anonfun$f(param: String): String = param;
+ ((param: String) => $anonfun$f(param))
};
<stable> <accessor> def f(): String => String = Foo.this.f
}
diff --git a/test/files/run/delambdafy_uncurry_byname_method.check b/test/files/run/delambdafy_uncurry_byname_method.check
index e0f281b1cd..71e404ce64 100644
--- a/test/files/run/delambdafy_uncurry_byname_method.check
+++ b/test/files/run/delambdafy_uncurry_byname_method.check
@@ -7,8 +7,8 @@ package <empty> {
};
def bar(x: () => String): String = x.apply();
def foo(): String = Foo.this.bar({
- final <artifact> def $anonfun(): String = "";
- (() => $anonfun())
+ final <artifact> def $anonfun$foo(): String = "";
+ (() => $anonfun$foo())
})
}
}
diff --git a/test/files/run/delambdafy_uncurry_method.check b/test/files/run/delambdafy_uncurry_method.check
index 5ee3d174b3..8aa0b92054 100644
--- a/test/files/run/delambdafy_uncurry_method.check
+++ b/test/files/run/delambdafy_uncurry_method.check
@@ -7,8 +7,8 @@ package <empty> {
};
def bar(): Unit = {
val f: Int => Int = {
- final <artifact> def $anonfun(x: Int): Int = x.+(1);
- ((x: Int) => $anonfun(x))
+ final <artifact> def $anonfun|(x: Int): Int = x.+(1);
+ ((x: Int) => $anonfun|(x))
};
()
}
diff --git a/test/files/run/delay-bad.check b/test/files/run/delay-bad.check
index cb6e329f7a..bf41c79a3a 100644
--- a/test/files/run/delay-bad.check
+++ b/test/files/run/delay-bad.check
@@ -1,10 +1,10 @@
-delay-bad.scala:53: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+delay-bad.scala:53: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
f(new C { 5 })
^
-delay-bad.scala:73: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+delay-bad.scala:73: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
f(new { val x = 5 } with E() { 5 })
^
-warning: there was one deprecation warning; re-run with -deprecation for details
+warning: there was one deprecation warning (since 2.11.0); re-run with -deprecation for details
// new C { }
diff --git a/test/files/run/delay-good.check b/test/files/run/delay-good.check
index b4f6b04af7..ed35b9225f 100644
--- a/test/files/run/delay-good.check
+++ b/test/files/run/delay-good.check
@@ -1,7 +1,7 @@
-delay-good.scala:53: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+delay-good.scala:53: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
f(new C { 5 })
^
-delay-good.scala:73: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+delay-good.scala:73: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
f(new { val x = 5 } with E() { 5 })
^
diff --git a/test/files/run/duration-coarsest.scala b/test/files/run/duration-coarsest.scala
index 51cb79287a..81fbb3cc84 100644
--- a/test/files/run/duration-coarsest.scala
+++ b/test/files/run/duration-coarsest.scala
@@ -25,4 +25,7 @@ object Test extends App {
23 hours,
40 days
) foreach (x => assert(x == x.toCoarsest, x))
-} \ No newline at end of file
+
+ // toCoarsest on a FiniteDuration should return a FiniteDuration
+ val finite: FiniteDuration = 1.second.toCoarsest
+}
diff --git a/test/files/run/elidable-opt.check b/test/files/run/elidable-opt.check
index 88cf98e0d1..969b9a420a 100644
--- a/test/files/run/elidable-opt.check
+++ b/test/files/run/elidable-opt.check
@@ -11,4 +11,4 @@ false
0
0.0
0.0
-null
+
diff --git a/test/files/run/elidable-opt.flags b/test/files/run/elidable-opt.flags
index 62897ff218..93fd3d5317 100644
--- a/test/files/run/elidable-opt.flags
+++ b/test/files/run/elidable-opt.flags
@@ -1 +1 @@
--optimise -Xelide-below 900
+-Xelide-below 900
diff --git a/test/files/run/elidable-opt.scala b/test/files/run/elidable-opt.scala
index a2f29d2caf..6a603084b7 100644
--- a/test/files/run/elidable-opt.scala
+++ b/test/files/run/elidable-opt.scala
@@ -80,6 +80,5 @@ object Test {
Class.forName(className).getMethod(methodName)
}
}
- Class.forName("T$class").getMethod("f3", classOf[T])
}
}
diff --git a/test/files/run/elidable.check b/test/files/run/elidable.check
index 88cf98e0d1..969b9a420a 100644
--- a/test/files/run/elidable.check
+++ b/test/files/run/elidable.check
@@ -11,4 +11,4 @@ false
0
0.0
0.0
-null
+
diff --git a/test/files/run/elidable.flags b/test/files/run/elidable.flags
index 93fd3d5317..4bebebdc41 100644
--- a/test/files/run/elidable.flags
+++ b/test/files/run/elidable.flags
@@ -1 +1 @@
--Xelide-below 900
+-Xelide-below WARNING
diff --git a/test/files/run/elidable.scala b/test/files/run/elidable.scala
index a2f29d2caf..fed1c7b392 100644
--- a/test/files/run/elidable.scala
+++ b/test/files/run/elidable.scala
@@ -1,31 +1,38 @@
import annotation._
import elidable._
+// runs -Xelide-below WARNING or 900
+
+object Fail {
+ def fail(msg: String): Unit = throw new IllegalStateException(s"Expected failure: $msg")
+}
+import Fail.fail
+
trait T {
@elidable(FINEST) def f1()
@elidable(SEVERE) def f2()
- @elidable(FINEST) def f3() = assert(false, "Should have been elided.")
+ @elidable(FINEST) def f3() = fail("Should have been elided.")
def f4()
}
class C extends T {
def f1() = println("Good for me, I was not elided. C.f1")
def f2() = println("Good for me, I was not elided. C.f2")
- @elidable(FINEST) def f4() = assert(false, "Should have been elided.")
+ @elidable(FINEST) def f4() = fail("Should have been elided.")
}
object O {
- @elidable(FINEST) def f1() = assert(false, "Should have been elided.")
- @elidable(INFO) def f2() = assert(false, "Should have been elided.")
+ @elidable(FINEST) def f1() = fail("Should have been elided.")
+ @elidable(INFO) def f2() = fail("Should have been elided.")
@elidable(SEVERE) def f3() = println("Good for me, I was not elided. O.f3")
- @elidable(INFO) def f4 = assert(false, "Should have been elided (no parens).")
+ @elidable(INFO) def f4 = fail("Should have been elided (no parens).")
}
object Test {
- @elidable(FINEST) def f1() = assert(false, "Should have been elided.")
- @elidable(INFO) def f2() = assert(false, "Should have been elided.")
+ @elidable(FINEST) def f1() = fail("Should have been elided.")
+ @elidable(INFO) def f2() = fail("Should have been elided.")
@elidable(SEVERE) def f3() = println("Good for me, I was not elided. Test.f3")
- @elidable(INFO) def f4 = assert(false, "Should have been elided (no parens).")
+ @elidable(INFO) def f4 = fail("Should have been elided (no parens).")
@elidable(FINEST) def f5() = {}
@elidable(FINEST) def f6() = true
@@ -36,7 +43,14 @@ object Test {
@elidable(FINEST) def fb() = 1l
@elidable(FINEST) def fc() = 1.0f
@elidable(FINEST) def fd() = 1.0
- @elidable(FINEST) def fe() = "s"
+ @elidable(FINEST) def fe() = { fail("Should have been elided to empty string.") ; "hello, world" }
+
+ /* variable elisions? see test/files/neg/t10068.scala
+ @elidable(INFO) val goner1: Int = { fail("Should have been elided.") ; 42 }
+ @elidable(INFO) lazy val goner2: Int = { fail("Should have been elided.") ; 42 }
+ @elidable(INFO) var goner3: Int = { fail("Should have been elided.") ; 42 }
+ @elidable(INFO) var goner4: Nothing = _
+ */
def main(args: Array[String]): Unit = {
f1()
@@ -65,6 +79,19 @@ object Test {
println(fc())
println(fd())
println(fe())
+ if (!fe().isEmpty) fail(s"Not empty: [${fe()}]")
+/*
+()
+false
+0
+0
+0
+0
+0
+0.0
+0.0
+ // was: null
+*/
// this one won't show up in the output because a call to f1 is elidable when accessed through T
(c:T).f1()
@@ -80,6 +107,17 @@ object Test {
Class.forName(className).getMethod(methodName)
}
}
- Class.forName("T$class").getMethod("f3", classOf[T])
+
+ // variable elisions?
+ /*
+ assert(goner1 == 0)
+ assert(goner2 == 0)
+ assert(goner3 == 0)
+ try assert(goner4 == null)
+ catch {
+ case _: NullPointerException => println("NPE")
+ case _: NotImplementedError => println("NIE")
+ }
+ */
}
}
diff --git a/test/files/run/equality.scala b/test/files/run/equality.scala
index ff59898821..2af73691d8 100644
--- a/test/files/run/equality.scala
+++ b/test/files/run/equality.scala
@@ -1,7 +1,7 @@
// a quickly assembled test of equality. Needs work.
object Test
{
- import scala.runtime.ScalaRunTime.hash
+ def hash(x: Any): Int = x.## // forces upcast to Any
def makeFromInt(x: Int) = List(
x.toByte, x.toShort, x.toInt, x.toLong, x.toFloat, x.toDouble, BigInt(x), BigDecimal(x)
diff --git a/test/files/run/eta-expand-star2.check b/test/files/run/eta-expand-star2.check
deleted file mode 100644
index d6929e4969..0000000000
--- a/test/files/run/eta-expand-star2.check
+++ /dev/null
@@ -1,2 +0,0 @@
-warning: there was one deprecation warning; re-run with -deprecation for details
-hello
diff --git a/test/files/run/eta-expand-star2.flags b/test/files/run/eta-expand-star2.flags
deleted file mode 100644
index 0402fe55a4..0000000000
--- a/test/files/run/eta-expand-star2.flags
+++ /dev/null
@@ -1 +0,0 @@
--Yeta-expand-keeps-star \ No newline at end of file
diff --git a/test/files/run/eta-expand-star2.scala b/test/files/run/eta-expand-star2.scala
deleted file mode 100644
index eb650788d0..0000000000
--- a/test/files/run/eta-expand-star2.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-object Test {
- def f[T](xs: T*): T = xs.head
- def g[T] = f[T] _
-
- def main(args: Array[String]): Unit = {
- println(g("hello"))
- }
-}
diff --git a/test/files/run/exceptions-2.check b/test/files/run/exceptions-2.check
index 4f8244800a..5cf5e71f41 100644
--- a/test/files/run/exceptions-2.check
+++ b/test/files/run/exceptions-2.check
@@ -1,4 +1,4 @@
-exceptions-2.scala:267: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+exceptions-2.scala:267: warning: a pure expression does nothing in statement position
try { 1 } catch { case e: java.io.IOException => () }
^
nested1:
diff --git a/test/files/run/existential-rangepos.check b/test/files/run/existential-rangepos.check
index 1212b60bae..984baeaaf8 100644
--- a/test/files/run/existential-rangepos.check
+++ b/test/files/run/existential-rangepos.check
@@ -7,7 +7,7 @@
};
[24:51]private[this] val foo: [28]Set[_ <: T] = [47:51]null;
[28]<stable> <accessor> def foo: [28]Set[_ <: T] = [28][28]A.this.foo;
- [54:74]<stable> <accessor> def bar: [58]Set[_ <: T]
+ [54:74]<stable> <accessor> val bar: [58]Set[_ <: T]
}
}
diff --git a/test/files/run/finalvar.flags b/test/files/run/finalvar.flags
index aee3039bec..c74d0cd327 100644
--- a/test/files/run/finalvar.flags
+++ b/test/files/run/finalvar.flags
@@ -1 +1 @@
--Yoverride-vars -Yinline \ No newline at end of file
+-Yoverride-vars -opt:l:project \ No newline at end of file
diff --git a/test/files/run/future-flatmap-exec-count.check b/test/files/run/future-flatmap-exec-count.check
index dd9dce64ed..7c68bd76b5 100644
--- a/test/files/run/future-flatmap-exec-count.check
+++ b/test/files/run/future-flatmap-exec-count.check
@@ -1,3 +1,4 @@
+warning: there was one deprecation warning (since 2.12.0); re-run with -deprecation for details
mapping
execute()
flatmapping
diff --git a/test/files/run/hashCodeBoxesRunTime.scala b/test/files/run/hashCodeStatics.scala
index ba1a30f5fb..bff62cce18 100644
--- a/test/files/run/hashCodeBoxesRunTime.scala
+++ b/test/files/run/hashCodeStatics.scala
@@ -1,23 +1,23 @@
-// This only tests direct access to the methods in BoxesRunTime,
+// This only tests direct access to the methods in Statics,
// not the whole scheme.
object Test
{
import java.{ lang => jl }
- import scala.runtime.BoxesRunTime.{ hashFromNumber, hashFromObject }
+ import scala.runtime.Statics.anyHash
def allSame[T](xs: List[T]) = assert(xs.distinct.size == 1, "failed: " + xs)
def mkNumbers(x: Int): List[Number] =
List(x.toByte, x.toShort, x, x.toLong, x.toFloat, x.toDouble)
- def testLDF(x: Long) = allSame(List[Number](x, x.toDouble, x.toFloat) map hashFromNumber)
+ def testLDF(x: Long) = allSame(List[Number](x, x.toDouble, x.toFloat) map anyHash)
def main(args: Array[String]): Unit = {
List(Byte.MinValue, -1, 0, 1, Byte.MaxValue) foreach { n =>
- val hashes = mkNumbers(n) map hashFromNumber
+ val hashes = mkNumbers(n) map anyHash
allSame(hashes)
if (n >= 0) {
- val charCode = hashFromObject(n.toChar: Character)
+ val charCode = anyHash(n.toChar: Character)
assert(charCode == hashes.head)
}
}
diff --git a/test/files/run/icode-reader-dead-code.scala b/test/files/run/icode-reader-dead-code.scala
index 00ba58829f..f646455c89 100644
--- a/test/files/run/icode-reader-dead-code.scala
+++ b/test/files/run/icode-reader-dead-code.scala
@@ -36,7 +36,7 @@ object Test extends DirectTest {
// If inlining fails, the compiler will issue an inliner warning that is not present in the
// check file
- compileString(newCompiler("-usejavacp", "-optimise"))(bCode)
+ compileString(newCompiler("-usejavacp", "-opt:l:classpath"))(bCode)
}
def readClass(file: String) = {
diff --git a/test/files/run/idempotency-case-classes.check b/test/files/run/idempotency-case-classes.check
index ea698cec59..38c2fb9326 100644
--- a/test/files/run/idempotency-case-classes.check
+++ b/test/files/run/idempotency-case-classes.check
@@ -20,15 +20,15 @@ C(2,3)
case 1 => C.this.y
case _ => throw new IndexOutOfBoundsException(x$1.toString())
};
- override <synthetic> def productIterator: Iterator[Any] = runtime.this.ScalaRunTime.typedProductIterator[Any](C.this);
+ override <synthetic> def productIterator: Iterator[Any] = scala.runtime.ScalaRunTime.typedProductIterator[Any](C.this);
<synthetic> def canEqual(x$1: Any): Boolean = x$1.$isInstanceOf[C]();
override <synthetic> def hashCode(): Int = {
<synthetic> var acc: Int = -889275714;
- acc = Statics.this.mix(acc, x);
- acc = Statics.this.mix(acc, y);
- Statics.this.finalizeHash(acc, 2)
+ acc = scala.runtime.Statics.mix(acc, x);
+ acc = scala.runtime.Statics.mix(acc, y);
+ scala.runtime.Statics.finalizeHash(acc, 2)
};
- override <synthetic> def toString(): String = ScalaRunTime.this._toString(C.this);
+ override <synthetic> def toString(): String = scala.runtime.ScalaRunTime._toString(C.this);
override <synthetic> def equals(x$1: Any): Boolean = C.this.eq(x$1.asInstanceOf[Object]).||(x$1 match {
case (_: C) => true
case _ => false
@@ -45,7 +45,7 @@ C(2,3)
final override <synthetic> def toString(): String = "C";
case <synthetic> def apply(x: Int, y: Int): C = new C(x, y);
case <synthetic> def unapply(x$0: C): Option[(Int, Int)] = if (x$0.==(null))
- scala.this.None
+ scala.None
else
Some.apply[(Int, Int)](scala.Tuple2.apply[Int, Int](x$0.x, x$0.y))
};
diff --git a/test/files/run/idempotency-lazy-vals.check b/test/files/run/idempotency-lazy-vals.check
index 15afa5303c..3a6f1a7ef0 100644
--- a/test/files/run/idempotency-lazy-vals.check
+++ b/test/files/run/idempotency-lazy-vals.check
@@ -5,19 +5,11 @@
C.super.<init>();
()
};
- lazy private[this] val x: Int = _;
- <stable> <accessor> lazy def x: Int = {
- C.this.x = 2;
- C.this.x
- };
- lazy private[this] val y: Int = _;
- implicit <stable> <accessor> lazy def y: Int = {
- C.this.y = 3;
- C.this.y
- }
+ <stable> <accessor> lazy val x: Int = 2;
+ implicit <stable> <accessor> lazy val y: Int = 3
};
val c: C = new C();
import c._;
c.x.*(Predef.implicitly[Int](c.y))
}
-error!
+6
diff --git a/test/files/run/indy-via-macro-with-dynamic-args/Bootstrap.java b/test/files/run/indy-via-macro-with-dynamic-args/Bootstrap.java
new file mode 100644
index 0000000000..5c9ce01cf4
--- /dev/null
+++ b/test/files/run/indy-via-macro-with-dynamic-args/Bootstrap.java
@@ -0,0 +1,17 @@
+package test;
+
+import java.lang.invoke.*;
+import java.util.regex.Pattern;
+
+public final class Bootstrap {
+ private Bootstrap() {
+ }
+
+ /** Pre-compile a regex */
+ public static CallSite bootstrap(MethodHandles.Lookup lookup, String invokedName,
+ MethodType invokedType,
+ String value) throws Throwable {
+ MethodHandle Pattern_matcher = MethodHandles.lookup().findVirtual(java.util.regex.Pattern.class, "matcher", MethodType.fromMethodDescriptorString("(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;", lookup.lookupClass().getClassLoader()));
+ return new ConstantCallSite(Pattern_matcher.bindTo(Pattern.compile(value)));
+ }
+}
diff --git a/test/files/run/indy-via-macro-with-dynamic-args/Test_2.scala b/test/files/run/indy-via-macro-with-dynamic-args/Test_2.scala
new file mode 100644
index 0000000000..77c2b522c7
--- /dev/null
+++ b/test/files/run/indy-via-macro-with-dynamic-args/Test_2.scala
@@ -0,0 +1,6 @@
+object Test {
+ def main(args: Array[String]) {
+ val s = "foo!bar"
+ assert(Macro.matcher("foo.bar", s).matches == true)
+ }
+}
diff --git a/test/files/run/indy-via-macro-with-dynamic-args/macro_1.scala b/test/files/run/indy-via-macro-with-dynamic-args/macro_1.scala
new file mode 100644
index 0000000000..eaafbf08e1
--- /dev/null
+++ b/test/files/run/indy-via-macro-with-dynamic-args/macro_1.scala
@@ -0,0 +1,33 @@
+import java.util.regex._
+
+import scala.reflect.internal.SymbolTable
+import scala.reflect.macros.blackbox._
+import language.experimental.macros
+
+object Macro {
+ /**
+ * Equivalent to Pattern.compile(pat).matcher(text), but caches the compiled regex (using invokedynamic) if
+ * `pat` is a literal.
+ */
+ def matcher(pat: String, text: CharSequence): Matcher = macro Macro.impl
+ def impl(c: Context)(pat: c.Tree, text: c.Tree): c.Tree = {
+ def Indy(bootstrapMethod: c.Symbol, bootstrapArgs: List[c.universe.Literal], dynArgs: List[c.Tree]): c.Tree = {
+ val symtab = c.universe.asInstanceOf[SymbolTable]
+ import symtab._
+ val paramSym = NoSymbol.newTermSymbol(TermName("x")).setInfo(typeOf[CharSequence])
+ val dummySymbol = NoSymbol.newTermSymbol(TermName("matcher")).setInfo(internal.methodType(paramSym :: Nil, typeOf[java.util.regex.Matcher]))
+ val bootstrapArgTrees: List[Tree] = Literal(Constant(bootstrapMethod)).setType(NoType) :: bootstrapArgs.asInstanceOf[List[Tree]]
+ val result = ApplyDynamic(Ident(dummySymbol).setType(dummySymbol.info), bootstrapArgTrees ::: dynArgs.asInstanceOf[List[Tree]])
+ result.setType(dummySymbol.info.resultType)
+ result.asInstanceOf[c.Tree]
+ }
+ import c.universe._
+ pat match {
+ case l @ Literal(Constant(pat: String)) =>
+ val bootstrapSym = typeOf[test.Bootstrap].companion.member(TermName("bootstrap"))
+ Indy(bootstrapSym, l :: Nil, text :: Nil)
+ case _ =>
+ q"_root_.java.util.regex.Pattern.compile($pat).matcher($text)"
+ }
+ }
+}
diff --git a/test/files/run/indy-via-macro/Bootstrap.java b/test/files/run/indy-via-macro/Bootstrap.java
new file mode 100644
index 0000000000..af4f5dfd4f
--- /dev/null
+++ b/test/files/run/indy-via-macro/Bootstrap.java
@@ -0,0 +1,16 @@
+package test;
+
+import java.lang.invoke.*;
+import java.util.regex.Pattern;
+
+public final class Bootstrap {
+ private Bootstrap() {
+ }
+
+ /** Pre-compile a regex */
+ public static CallSite bootstrap(MethodHandles.Lookup lookup, String invokedName,
+ MethodType invokedType,
+ String value) throws Throwable {
+ return new ConstantCallSite(MethodHandles.constant(Pattern.class, Pattern.compile(value)));
+ }
+}
diff --git a/test/files/run/indy-via-macro/Test_2.scala b/test/files/run/indy-via-macro/Test_2.scala
new file mode 100644
index 0000000000..830947a46b
--- /dev/null
+++ b/test/files/run/indy-via-macro/Test_2.scala
@@ -0,0 +1,5 @@
+object Test {
+ def main(args: Array[String]) {
+ assert(Macro.compilePattern("foo.bar").matcher("foo!bar").matches)
+ }
+} \ No newline at end of file
diff --git a/test/files/run/indy-via-macro/macro_1.scala b/test/files/run/indy-via-macro/macro_1.scala
new file mode 100644
index 0000000000..26daad7deb
--- /dev/null
+++ b/test/files/run/indy-via-macro/macro_1.scala
@@ -0,0 +1,32 @@
+import java.util.regex.Pattern
+
+import scala.reflect.internal.SymbolTable
+import scala.reflect.macros.blackbox._
+import language.experimental.macros
+
+object Macro {
+ /**
+ * Equivalent to Pattern.compile(s), but caches the compiled regex (using invokedynamic) if
+ * `s` is a literal.
+ */
+ def compilePattern(s: String): Pattern = macro Macro.impl
+ def impl(c: Context)(s: c.Tree): c.Tree = {
+ def Indy(bootstrapMethod: c.Symbol, bootstrapArgs: List[c.universe.Literal]): c.Tree = {
+ val symtab = c.universe.asInstanceOf[SymbolTable]
+ import symtab._
+ val dummySymbol = NoSymbol.newTermSymbol(TermName("compile")).setInfo(NullaryMethodType(typeOf[Pattern]))
+ val args: List[Tree] = Literal(Constant(bootstrapMethod)).setType(NoType) :: bootstrapArgs.asInstanceOf[List[Tree]]
+ val result = ApplyDynamic(Ident(dummySymbol).setType(dummySymbol.info), args)
+ result.setType(dummySymbol.info.resultType)
+ result.asInstanceOf[c.Tree]
+ }
+ import c.universe._
+ s match {
+ case l @ Literal(Constant(s: String)) =>
+ val bootstrapSym = typeOf[test.Bootstrap].companion.member(TermName("bootstrap"))
+ Indy(bootstrapSym, l :: Nil)
+ case _ =>
+ q"_root_.java.util.regex.Pattern.compile($s)"
+ }
+ }
+}
diff --git a/test/files/run/indylambda-boxing/test.scala b/test/files/run/indylambda-boxing/test.scala
index cc0a460640..82f8d2f497 100644
--- a/test/files/run/indylambda-boxing/test.scala
+++ b/test/files/run/indylambda-boxing/test.scala
@@ -2,15 +2,16 @@ class Capture
class Test {
def test1 = (i: Int) => ""
def test2 = (i: VC) => i
- def test3 = (i: Int) => i
+ def test3 = (i: Int) => i // not adapted, specialized
- def test4 = {val c = new Capture; (i: Int) => {(c, Test.this.toString); 42} }
+ def test4 = {val c = new Capture; (i: Int) => {(c, Test.this.toString); 42} } // not adapted, specialized
def test5 = {val c = new Capture; (i: VC) => (c, Test.this.toString) }
def test6 = {val c = new Capture; (i: Int) => (c, Test.this.toString) }
def test7 = {val vc = new Capture; (i: Int) => vc }
- def test8 = {val c = 42; (s: String) => (s, c)}
+ def test8 = {val c = 42; (s: String) => (s, c)} // not adapted
def test9 = {val c = 42; (s: String) => ()}
+ def test10 = {(s: List[String]) => ()}
}
object Test {
diff --git a/test/files/run/infix.scala b/test/files/run/infix.scala
index a867d03ce8..1d39003644 100644
--- a/test/files/run/infix.scala
+++ b/test/files/run/infix.scala
@@ -7,5 +7,6 @@ object Test extends App {
Console.println(xs)
xs match {
case null op (0, 0) op (1, 1) op (2, 2) => Console.println("OK")
+ case _ =>
}
}
diff --git a/test/files/run/inline-ex-handlers.check b/test/files/run/inline-ex-handlers.check
deleted file mode 100644
index 7c885d2cc9..0000000000
--- a/test/files/run/inline-ex-handlers.check
+++ /dev/null
@@ -1,492 +0,0 @@
---- a
-+++ b
-@@ -171,5 +171,5 @@
- def productElement(x$1: Int (INT)): Object {
-- locals: value x$1, value x1
-+ locals: value x$1, value x1, variable boxed1
- startBlock: 1
-- blocks: [1,2,3,4]
-+ blocks: [1,3,4]
-
-@@ -186,2 +186,4 @@
- 92 LOAD_LOCAL(value x$1)
-+ 92 STORE_LOCAL(variable boxed1)
-+ 92 LOAD_LOCAL(variable boxed1)
- 92 BOX INT
-@@ -194,5 +196,2 @@
- 92 CALL_METHOD MyException.message (dynamic)
-- 92 JUMP 2
--
-- 2:
- 92 RETURN(REF(class Object))
-@@ -246,3 +245,3 @@
- startBlock: 1
-- blocks: [1,2,3,4,5,6,7,8,11,12,13,14,15,16,17,18]
-+ blocks: [1,2,3,4,5,6,8,11,12,13,14,15,16,17,18]
-
-@@ -257,5 +256,2 @@
- 92 SCOPE_ENTER value x1
-- 92 JUMP 7
--
-- 7:
- 92 LOAD_LOCAL(value x1)
-@@ -390,5 +386,5 @@
- def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
-- locals: value args, variable result, value ex6, value x4, value x5, value message, value x
-+ locals: value args, variable result, value ex6, value x4, value x5, value x
- startBlock: 1
-- blocks: [1,2,3,4,5,8,10,11,13]
-+ blocks: [1,2,3,5,8,10,11,13,14]
-
-@@ -416,4 +412,13 @@
- 103 CALL_METHOD MyException.<init> (static-instance)
-- 103 THROW(MyException)
-+ ? STORE_LOCAL(value ex6)
-+ ? JUMP 14
-
-+ 14:
-+ 101 LOAD_LOCAL(value ex6)
-+ 101 STORE_LOCAL(value x4)
-+ 101 SCOPE_ENTER value x4
-+ 106 LOAD_LOCAL(value x4)
-+ 106 IS_INSTANCE REF(class MyException)
-+ 106 CZJUMP (BOOL)NE ? 5 : 8
-+
- 13:
-@@ -429,5 +434,2 @@
- 101 SCOPE_ENTER value x4
-- 101 JUMP 4
--
-- 4:
- 106 LOAD_LOCAL(value x4)
-@@ -441,8 +443,5 @@
- 106 SCOPE_ENTER value x5
-- 106 LOAD_LOCAL(value x5)
-- 106 CALL_METHOD MyException.message (dynamic)
-- 106 STORE_LOCAL(value message)
-- 106 SCOPE_ENTER value message
- 106 LOAD_MODULE object Predef
-- 106 LOAD_LOCAL(value message)
-+ ? LOAD_LOCAL(value x5)
-+ 106 CALL_METHOD MyException.message (dynamic)
- 106 CALL_METHOD scala.Predef.println (dynamic)
-@@ -518,3 +517,3 @@
- startBlock: 1
-- blocks: [1,2,3,4,6,7,9,10]
-+ blocks: [1,3,4,6,7,9,10,11,12,13]
-
-@@ -547,4 +546,9 @@
- 306 CALL_METHOD MyException.<init> (static-instance)
-- 306 THROW(MyException)
-+ ? JUMP 11
-
-+ 11:
-+ ? LOAD_LOCAL(variable monitor4)
-+ 305 MONITOR_EXIT
-+ ? JUMP 12
-+
- 9:
-@@ -553,3 +557,3 @@
- 305 MONITOR_EXIT
-- ? THROW(Throwable)
-+ ? JUMP 12
-
-@@ -559,4 +563,11 @@
- 304 MONITOR_EXIT
-- ? THROW(Throwable)
-+ ? STORE_LOCAL(value t)
-+ ? JUMP 13
-
-+ 12:
-+ ? LOAD_LOCAL(variable monitor3)
-+ 304 MONITOR_EXIT
-+ ? STORE_LOCAL(value t)
-+ ? JUMP 13
-+
- 3:
-@@ -573,5 +584,14 @@
- 310 CALL_METHOD scala.Predef.println (dynamic)
-- 310 JUMP 2
-+ 300 RETURN(UNIT)
-
-- 2:
-+ 13:
-+ 310 LOAD_MODULE object Predef
-+ 310 CALL_PRIMITIVE(StartConcat)
-+ 310 CONSTANT("Caught crash: ")
-+ 310 CALL_PRIMITIVE(StringConcat(REF(class String)))
-+ 310 LOAD_LOCAL(value t)
-+ 310 CALL_METHOD java.lang.Throwable.toString (dynamic)
-+ 310 CALL_PRIMITIVE(StringConcat(REF(class String)))
-+ 310 CALL_PRIMITIVE(EndConcat)
-+ 310 CALL_METHOD scala.Predef.println (dynamic)
- 300 RETURN(UNIT)
-@@ -583,6 +603,6 @@
- with finalizer: null
-- catch (Throwable) in ArrayBuffer(7, 9, 10) starting at: 6
-+ catch (Throwable) in ArrayBuffer(7, 9, 10, 11) starting at: 6
- consisting of blocks: List(6)
- with finalizer: null
-- catch (Throwable) in ArrayBuffer(4, 6, 7, 9, 10) starting at: 3
-+ catch (Throwable) in ArrayBuffer(4, 6, 7, 9, 10, 11, 12) starting at: 3
- consisting of blocks: List(3)
-@@ -618,3 +638,3 @@
- startBlock: 1
-- blocks: [1,3,4,5,6,8,9]
-+ blocks: [1,3,4,5,6,8,9,10,11]
-
-@@ -642,4 +662,10 @@
- 78 CALL_METHOD java.lang.IllegalArgumentException.<init> (static-instance)
-- 78 THROW(IllegalArgumentException)
-+ ? STORE_LOCAL(value e)
-+ ? JUMP 10
-
-+ 10:
-+ 81 LOAD_LOCAL(value e)
-+ ? STORE_LOCAL(variable exc1)
-+ ? JUMP 11
-+
- 8:
-@@ -668,3 +694,4 @@
- 81 LOAD_LOCAL(value e)
-- 81 THROW(Exception)
-+ ? STORE_LOCAL(variable exc1)
-+ ? JUMP 11
-
-@@ -685,2 +712,15 @@
-
-+ 11:
-+ 83 LOAD_MODULE object Predef
-+ 83 CONSTANT("finally")
-+ 83 CALL_METHOD scala.Predef.println (dynamic)
-+ 84 LOAD_LOCAL(variable result)
-+ 84 CONSTANT(1)
-+ 84 CALL_PRIMITIVE(Arithmetic(SUB,INT))
-+ 84 CONSTANT(2)
-+ 84 CALL_PRIMITIVE(Arithmetic(DIV,INT))
-+ 84 STORE_LOCAL(variable result)
-+ 84 LOAD_LOCAL(variable exc1)
-+ 84 THROW(Throwable)
-+
- }
-@@ -690,3 +730,3 @@
- with finalizer: null
-- catch (<none>) in ArrayBuffer(4, 5, 6, 8) starting at: 3
-+ catch (<none>) in ArrayBuffer(4, 5, 6, 8, 10) starting at: 3
- consisting of blocks: List(3)
-@@ -714,5 +754,5 @@
- def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
-- locals: value args, variable result, value ex6, variable exc2, value x4, value x5, value message, value x, value ex6, value x4, value x5, value message, value x
-+ locals: value args, variable result, value ex6, variable exc2, value x4, value x5, value x, value ex6, value x4, value x5, value x
- startBlock: 1
-- blocks: [1,3,4,5,6,9,13,14,15,18,20,21,23,24]
-+ blocks: [1,3,4,5,6,9,13,14,15,18,20,21,23,24,25,26,27]
-
-@@ -740,4 +780,11 @@
- 172 CALL_METHOD MyException.<init> (static-instance)
-- 172 THROW(MyException)
-+ ? STORE_LOCAL(value ex6)
-+ ? JUMP 25
-
-+ 25:
-+ 170 LOAD_LOCAL(value ex6)
-+ 170 STORE_LOCAL(value x4)
-+ 170 SCOPE_ENTER value x4
-+ 170 JUMP 14
-+
- 23:
-@@ -780,8 +827,5 @@
- 175 SCOPE_ENTER value x5
-- 175 LOAD_LOCAL(value x5)
-- 175 CALL_METHOD MyException.message (dynamic)
-- 175 STORE_LOCAL(value message)
-- 175 SCOPE_ENTER value message
- 176 LOAD_MODULE object Predef
-- 176 LOAD_LOCAL(value message)
-+ ? LOAD_LOCAL(value x5)
-+ 176 CALL_METHOD MyException.message (dynamic)
- 176 CALL_METHOD scala.Predef.println (dynamic)
-@@ -789,5 +833,7 @@
- 177 DUP(REF(class MyException))
-- 177 LOAD_LOCAL(value message)
-+ ? LOAD_LOCAL(value x5)
-+ 177 CALL_METHOD MyException.message (dynamic)
- 177 CALL_METHOD MyException.<init> (static-instance)
-- 177 THROW(MyException)
-+ ? STORE_LOCAL(value ex6)
-+ ? JUMP 26
-
-@@ -795,3 +841,4 @@
- 170 LOAD_LOCAL(value ex6)
-- 170 THROW(Throwable)
-+ ? STORE_LOCAL(value ex6)
-+ ? JUMP 26
-
-@@ -805,2 +852,8 @@
-
-+ 26:
-+ 169 LOAD_LOCAL(value ex6)
-+ 169 STORE_LOCAL(value x4)
-+ 169 SCOPE_ENTER value x4
-+ 169 JUMP 5
-+
- 5:
-@@ -815,8 +868,5 @@
- 180 SCOPE_ENTER value x5
-- 180 LOAD_LOCAL(value x5)
-- 180 CALL_METHOD MyException.message (dynamic)
-- 180 STORE_LOCAL(value message)
-- 180 SCOPE_ENTER value message
- 181 LOAD_MODULE object Predef
-- 181 LOAD_LOCAL(value message)
-+ ? LOAD_LOCAL(value x5)
-+ 181 CALL_METHOD MyException.message (dynamic)
- 181 CALL_METHOD scala.Predef.println (dynamic)
-@@ -824,5 +874,7 @@
- 182 DUP(REF(class MyException))
-- 182 LOAD_LOCAL(value message)
-+ ? LOAD_LOCAL(value x5)
-+ 182 CALL_METHOD MyException.message (dynamic)
- 182 CALL_METHOD MyException.<init> (static-instance)
-- 182 THROW(MyException)
-+ ? STORE_LOCAL(variable exc2)
-+ ? JUMP 27
-
-@@ -830,3 +882,4 @@
- 169 LOAD_LOCAL(value ex6)
-- 169 THROW(Throwable)
-+ ? STORE_LOCAL(variable exc2)
-+ ? JUMP 27
-
-@@ -847,2 +900,15 @@
-
-+ 27:
-+ 184 LOAD_MODULE object Predef
-+ 184 CONSTANT("finally")
-+ 184 CALL_METHOD scala.Predef.println (dynamic)
-+ 185 LOAD_LOCAL(variable result)
-+ 185 CONSTANT(1)
-+ 185 CALL_PRIMITIVE(Arithmetic(SUB,INT))
-+ 185 CONSTANT(2)
-+ 185 CALL_PRIMITIVE(Arithmetic(DIV,INT))
-+ 185 STORE_LOCAL(variable result)
-+ 185 LOAD_LOCAL(variable exc2)
-+ 185 THROW(Throwable)
-+
- }
-@@ -852,6 +918,6 @@
- with finalizer: null
-- catch (Throwable) in ArrayBuffer(13, 14, 15, 18, 20, 21, 23) starting at: 4
-+ catch (Throwable) in ArrayBuffer(13, 14, 15, 18, 20, 21, 23, 25) starting at: 4
- consisting of blocks: List(9, 8, 6, 5, 4)
- with finalizer: null
-- catch (<none>) in ArrayBuffer(4, 5, 6, 9, 13, 14, 15, 18, 20, 21, 23) starting at: 3
-+ catch (<none>) in ArrayBuffer(4, 5, 6, 9, 13, 14, 15, 18, 20, 21, 23, 25, 26) starting at: 3
- consisting of blocks: List(3)
-@@ -879,5 +945,5 @@
- def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
-- locals: value args, variable result, value e, value ex6, value x4, value x5, value message, value x
-+ locals: value args, variable result, value e, value ex6, value x4, value x5, value x
- startBlock: 1
-- blocks: [1,2,3,6,7,8,11,13,14,16]
-+ blocks: [1,2,3,6,7,8,11,13,14,16,17]
-
-@@ -905,4 +971,11 @@
- 124 CALL_METHOD MyException.<init> (static-instance)
-- 124 THROW(MyException)
-+ ? STORE_LOCAL(value ex6)
-+ ? JUMP 17
-
-+ 17:
-+ 122 LOAD_LOCAL(value ex6)
-+ 122 STORE_LOCAL(value x4)
-+ 122 SCOPE_ENTER value x4
-+ 122 JUMP 7
-+
- 16:
-@@ -930,8 +1003,5 @@
- 127 SCOPE_ENTER value x5
-- 127 LOAD_LOCAL(value x5)
-- 127 CALL_METHOD MyException.message (dynamic)
-- 127 STORE_LOCAL(value message)
-- 127 SCOPE_ENTER value message
- 127 LOAD_MODULE object Predef
-- 127 LOAD_LOCAL(value message)
-+ ? LOAD_LOCAL(value x5)
-+ 127 CALL_METHOD MyException.message (dynamic)
- 127 CALL_METHOD scala.Predef.println (dynamic)
-@@ -964,3 +1034,3 @@
- with finalizer: null
-- catch (IllegalArgumentException) in ArrayBuffer(6, 7, 8, 11, 13, 14, 16) starting at: 3
-+ catch (IllegalArgumentException) in ArrayBuffer(6, 7, 8, 11, 13, 14, 16, 17) starting at: 3
- consisting of blocks: List(3)
-@@ -988,5 +1058,5 @@
- def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
-- locals: value args, variable result, value ex6, value x4, value x5, value message, value x, value e
-+ locals: value args, variable result, value ex6, value x4, value x5, value x, value e
- startBlock: 1
-- blocks: [1,2,3,4,5,8,12,13,14,16]
-+ blocks: [1,2,3,5,8,12,13,14,16,17]
-
-@@ -1014,4 +1084,13 @@
- 148 CALL_METHOD MyException.<init> (static-instance)
-- 148 THROW(MyException)
-+ ? STORE_LOCAL(value ex6)
-+ ? JUMP 17
-
-+ 17:
-+ 145 LOAD_LOCAL(value ex6)
-+ 145 STORE_LOCAL(value x4)
-+ 145 SCOPE_ENTER value x4
-+ 154 LOAD_LOCAL(value x4)
-+ 154 IS_INSTANCE REF(class MyException)
-+ 154 CZJUMP (BOOL)NE ? 5 : 8
-+
- 16:
-@@ -1035,5 +1114,2 @@
- 145 SCOPE_ENTER value x4
-- 145 JUMP 4
--
-- 4:
- 154 LOAD_LOCAL(value x4)
-@@ -1047,8 +1123,5 @@
- 154 SCOPE_ENTER value x5
-- 154 LOAD_LOCAL(value x5)
-- 154 CALL_METHOD MyException.message (dynamic)
-- 154 STORE_LOCAL(value message)
-- 154 SCOPE_ENTER value message
- 154 LOAD_MODULE object Predef
-- 154 LOAD_LOCAL(value message)
-+ ? LOAD_LOCAL(value x5)
-+ 154 CALL_METHOD MyException.message (dynamic)
- 154 CALL_METHOD scala.Predef.println (dynamic)
-@@ -1269,3 +1342,3 @@
- startBlock: 1
-- blocks: [1,2,3,4,5,7]
-+ blocks: [1,2,3,4,5,7,8]
-
-@@ -1293,4 +1366,11 @@
- 38 CALL_METHOD java.lang.IllegalArgumentException.<init> (static-instance)
-- 38 THROW(IllegalArgumentException)
-+ ? STORE_LOCAL(value e)
-+ ? JUMP 8
-
-+ 8:
-+ 42 LOAD_MODULE object Predef
-+ 42 CONSTANT("IllegalArgumentException")
-+ 42 CALL_METHOD scala.Predef.println (dynamic)
-+ 42 JUMP 2
-+
- 7:
-@@ -1340,5 +1420,5 @@
- def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
-- locals: value args, variable result, value ex6, value x4, value x5, value message, value x
-+ locals: value args, variable result, value ex6, value x4, value x5, value x
- startBlock: 1
-- blocks: [1,2,3,4,5,8,10,11,13,14,16]
-+ blocks: [1,2,3,5,8,10,11,13,14,16,17]
-
-@@ -1366,3 +1446,4 @@
- 203 CALL_METHOD MyException.<init> (static-instance)
-- 203 THROW(MyException)
-+ ? STORE_LOCAL(value ex6)
-+ ? JUMP 17
-
-@@ -1386,4 +1467,13 @@
- 209 CALL_METHOD MyException.<init> (static-instance)
-- 209 THROW(MyException)
-+ ? STORE_LOCAL(value ex6)
-+ ? JUMP 17
-
-+ 17:
-+ 200 LOAD_LOCAL(value ex6)
-+ 200 STORE_LOCAL(value x4)
-+ 200 SCOPE_ENTER value x4
-+ 212 LOAD_LOCAL(value x4)
-+ 212 IS_INSTANCE REF(class MyException)
-+ 212 CZJUMP (BOOL)NE ? 5 : 8
-+
- 16:
-@@ -1399,5 +1489,2 @@
- 200 SCOPE_ENTER value x4
-- 200 JUMP 4
--
-- 4:
- 212 LOAD_LOCAL(value x4)
-@@ -1411,8 +1498,5 @@
- 212 SCOPE_ENTER value x5
-- 212 LOAD_LOCAL(value x5)
-- 212 CALL_METHOD MyException.message (dynamic)
-- 212 STORE_LOCAL(value message)
-- 212 SCOPE_ENTER value message
- 213 LOAD_MODULE object Predef
-- 213 LOAD_LOCAL(value message)
-+ ? LOAD_LOCAL(value x5)
-+ 213 CALL_METHOD MyException.message (dynamic)
- 213 CALL_METHOD scala.Predef.println (dynamic)
-@@ -1460,3 +1544,3 @@
- startBlock: 1
-- blocks: [1,2,3,4,5,7]
-+ blocks: [1,2,3,4,5,7,8]
-
-@@ -1484,4 +1568,11 @@
- 58 CALL_METHOD java.lang.IllegalArgumentException.<init> (static-instance)
-- 58 THROW(IllegalArgumentException)
-+ ? STORE_LOCAL(value e)
-+ ? JUMP 8
-
-+ 8:
-+ 62 LOAD_MODULE object Predef
-+ 62 CONSTANT("RuntimeException")
-+ 62 CALL_METHOD scala.Predef.println (dynamic)
-+ 62 JUMP 2
-+
- 7:
-@@ -1533,3 +1624,3 @@
- startBlock: 1
-- blocks: [1,3,4]
-+ blocks: [1,3,4,5]
-
-@@ -1553,4 +1644,9 @@
- 229 CALL_METHOD MyException.<init> (static-instance)
-- 229 THROW(MyException)
-+ ? JUMP 5
-
-+ 5:
-+ ? LOAD_LOCAL(variable monitor1)
-+ 228 MONITOR_EXIT
-+ 228 THROW(Throwable)
-+
- 3:
-@@ -1559,3 +1655,3 @@
- 228 MONITOR_EXIT
-- ? THROW(Throwable)
-+ 228 THROW(Throwable)
-
-@@ -1587,5 +1683,5 @@
- def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
-- locals: value args, variable result, variable monitor2, variable monitorResult1
-+ locals: value exception$1, value args, variable result, variable monitor2, variable monitorResult1
- startBlock: 1
-- blocks: [1,3,4]
-+ blocks: [1,3,4,5]
-
-@@ -1612,4 +1708,12 @@
- 245 CALL_METHOD MyException.<init> (static-instance)
-- 245 THROW(MyException)
-+ ? STORE_LOCAL(value exception$1)
-+ ? DROP ConcatClass
-+ ? LOAD_LOCAL(value exception$1)
-+ ? JUMP 5
-
-+ 5:
-+ ? LOAD_LOCAL(variable monitor2)
-+ 244 MONITOR_EXIT
-+ 244 THROW(Throwable)
-+
- 3:
-@@ -1618,3 +1722,3 @@
- 244 MONITOR_EXIT
-- ? THROW(Throwable)
-+ 244 THROW(Throwable)
-
diff --git a/test/files/run/inline-ex-handlers.scala b/test/files/run/inline-ex-handlers.scala
deleted file mode 100644
index 964594d258..0000000000
--- a/test/files/run/inline-ex-handlers.scala
+++ /dev/null
@@ -1,329 +0,0 @@
-import scala.tools.partest.IcodeComparison
-
-object Test extends IcodeComparison {
- override def printIcodeAfterPhase = "inlinehandlers"
-}
-
-import scala.util.Random._
-
-/** There should be no inlining taking place in this class */
-object TestInlineHandlersNoInline {
-
- def main(args: Array[String]): Unit = {
- println("TestInlineHandlersNoInline")
- var result = -1
-
- try {
- if (nextInt % 2 == 0)
- throw new IllegalArgumentException("something")
- result = 1
- } catch {
- case e: StackOverflowError =>
- println("Stack overflow")
- }
-
- result
- }
-}
-
-/** Just a simple inlining should take place in this class */
-object TestInlineHandlersSimpleInline {
-
- def main(args: Array[String]): Unit = {
- println("TestInlineHandlersSimpleInline")
- var result = -1
-
- try {
- if (nextInt % 2 == 0)
- throw new IllegalArgumentException("something")
- result = 1
- } catch {
- case e: IllegalArgumentException =>
- println("IllegalArgumentException")
- }
-
- result
- }
-}
-
-/** Inlining should take place because the handler is taking a superclass of the exception thrown */
-object TestInlineHandlersSubclassInline {
-
- def main(args: Array[String]): Unit = {
- println("TestInlineHandlersSubclassInline")
- var result = -1
-
- try {
- if (nextInt % 2 == 0)
- throw new IllegalArgumentException("something")
- result = 1
- } catch {
- case e: RuntimeException =>
- println("RuntimeException")
- }
-
- result
- }
-}
-
-/** For this class, the finally handler should be inlined */
-object TestInlineHandlersFinallyInline {
-
- def main(args: Array[String]): Unit = {
- println("TestInlineHandlersFinallyInline")
- var result = -1
-
- try {
- if (nextInt % 2 == 0)
- throw new IllegalArgumentException("something")
- result = 1
- } catch {
- case e: Exception => throw e
- } finally {
- println("finally")
- result = (result - 1) / 2
- }
-
- result
- }
-}
-
-
-case class MyException(message: String) extends RuntimeException(message)
-
-/** For this class, we test inlining for a case class error */
-object TestInlineHandlersCaseClassExceptionInline {
-
- def main(args: Array[String]): Unit = {
- println("TestInlineHandlersCaseClassExceptionInline")
- var result = -1
-
- try {
- if (nextInt % 2 == 0)
- throw new MyException("something")
- result = 1
- } catch {
- case MyException(message) => println(message)
- }
-
- result
- }
-}
-
-
-/** For this class, inline should take place in the inner handler */
-object TestInlineHandlersNestedHandlerInnerInline {
-
- def main(args: Array[String]): Unit = {
- println("TestInlineHandlersNestedHandlersInnerInline")
- var result = -1
-
- try {
- try {
- if (nextInt % 2 == 0)
- throw new MyException("something")
- result = 1
- } catch {
- case MyException(message) => println(message)
- }
- } catch {
- case e: IllegalArgumentException => println("IllegalArgumentException")
- }
-
- result
- }
-}
-
-
-/** For this class, inline should take place in the outer handler */
-object TestInlineHandlersNestedHandlerOuterInline {
-
- def main(args: Array[String]): Unit = {
- println("TestInlineHandlersNestedHandlersOuterInline")
- var result = -1
-
- try {
- try {
- if (nextInt % 2 == 0)
- throw new MyException("something")
- result = 1
- } catch {
- case e: IllegalArgumentException => println("IllegalArgumentException")
- }
- } catch {
- case MyException(message) => println(message)
- }
-
- result
- }
-}
-
-
-/** For this class, inline should take place in the all handlers (inner, outer and finally) */
-object TestInlineHandlersNestedHandlerAllInline {
-
- def main(args: Array[String]): Unit = {
- println("TestInlineHandlersNestedHandlersOuterInline")
- var result = -1
-
- try {
- try {
- if (nextInt % 2 == 0)
- throw new MyException("something")
- result = 1
- } catch {
- case MyException(message) =>
- println(message)
- throw MyException(message)
- }
- } catch {
- case MyException(message) =>
- println(message)
- throw MyException(message)
- } finally {
- println("finally")
- result = (result - 1) / 2
- }
-
- result
- }
-}
-
-
-/** This class is meant to test whether the inline handler is copied only once for multiple inlines */
-object TestInlineHandlersSingleCopy {
-
- def main(args: Array[String]): Unit = {
- println("TestInlineHandlersSingleCopy")
- var result = -1
-
- try {
-
- if (nextInt % 2 == 0)
- throw new MyException("something")
-
- println("A side effect in the middle")
- result = 3 // another one
-
- if (nextInt % 3 == 2)
- throw new MyException("something else")
- result = 1
- } catch {
- case MyException(message) =>
- println(message)
- }
-
- result
- }
-}
-
-/** This should test the special exception handler for synchronized blocks */
-object TestInlineHandlersSynchronized {
-
- def main(args: Array[String]): Unit = {
- println("TestInlineHandlersSynchronized")
- var result = "hello"
-
- // any exception thrown here will be caught by a default handler that does MONTIOR_EXIT on result :)
- result.synchronized {
- throw MyException(result)
- }
-
- result.length
- }
-}
-
-/** This should test the special exception handler for synchronized blocks with stack */
-object TestInlineHandlersSynchronizedWithStack {
-
- def main(args: Array[String]): Unit = {
- println("TestInlineHandlersSynchronizedWithStack")
- var result = "hello"
-
- // any exception thrown here will be caught by a default handler that does MONTIOR_EXIT on result :)
- result = "abc" + result.synchronized {
- throw MyException(result)
- }
-
- result.length
- }
-}
-
-/** This test should trigger a bug in the dead code elimination phase - it actually crashes ICodeCheckers
-object TestInlineHandlersSynchronizedWithStackDoubleThrow {
-
- def main(args: Array[String]): Unit = {
- println("TestInlineHandlersSynchronizedWithStackDoubleThrow")
- var result = "a"
-
- // any exception thrown here will be caught by a default handler that does MONTIOR_EXIT on result :)
- result += result.synchronized { throw MyException(result) }
- result += result.synchronized { throw MyException(result) }
-
- result.length
- }
-}
-*/
-
-/** This test should check the preciseness of the inliner: it should not do any inlining here
-* as it is not able to discern between the different exceptions
-*/
-object TestInlineHandlersPreciseness {
-
- def main(args: Array[String]): Unit = {
- println("TestInlineHandlersCorrectHandler")
-
- try {
- val exception: Throwable =
- if (scala.util.Random.nextInt % 2 == 0)
- new IllegalArgumentException("even")
- else
- new StackOverflowError("odd")
- throw exception
- } catch {
- case e: IllegalArgumentException =>
- println("Correct, IllegalArgumentException")
- case e: StackOverflowError =>
- println("Correct, StackOverflowException")
- case t: Throwable =>
- println("WROOOONG, not Throwable!")
- }
- }
-}
-
-/** This check should verify that the double no-local exception handler is duplicated correctly */
-object TestInlineHandlersDoubleNoLocal {
-
- val a1: String = "a"
- val a2: String = "b"
-
- def main(args: Array[String]): Unit = {
- println("TestInlineHandlersDoubleNoLocal")
-
- try {
- a1.synchronized {
- a2. synchronized {
- throw new MyException("crash")
- }
- }
- } catch {
- case t: Throwable => println("Caught crash: " + t.toString)
- }
-
- /* try {
- val exception: Throwable =
- if (scala.util.Random.nextInt % 2 == 0)
- new IllegalArgumentException("even")
- else
- new StackOverflowError("odd")
- throw exception
- } catch {
- case e: IllegalArgumentException =>
- println("Correct, IllegalArgumentException")
- case e: StackOverflowError =>
- println("Correct, StackOverflowException")
- case t: Throwable =>
- println("WROOOONG, not Throwable!")
- }*/
- }
-}
diff --git a/test/files/run/inlineAddDeserializeLambda.scala b/test/files/run/inlineAddDeserializeLambda.scala
new file mode 100644
index 0000000000..a6bafd0f49
--- /dev/null
+++ b/test/files/run/inlineAddDeserializeLambda.scala
@@ -0,0 +1,20 @@
+class C { @inline final def f: Int => Int = (x: Int) => x + 1 }
+
+object Test extends App {
+ import java.io._
+
+ def serialize(obj: AnyRef): Array[Byte] = {
+ val buffer = new ByteArrayOutputStream
+ val out = new ObjectOutputStream(buffer)
+ out.writeObject(obj)
+ buffer.toByteArray
+ }
+ def deserialize(a: Array[Byte]): AnyRef = {
+ val in = new ObjectInputStream(new ByteArrayInputStream(a))
+ in.readObject
+ }
+
+ def serializeDeserialize[T <: AnyRef](obj: T) = deserialize(serialize(obj)).asInstanceOf[T]
+
+ assert(serializeDeserialize((new C).f).isInstanceOf[Function1[_, _]])
+}
diff --git a/test/files/run/inlineHandlers.scala b/test/files/run/inlineHandlers.scala
new file mode 100644
index 0000000000..8c672a07b9
--- /dev/null
+++ b/test/files/run/inlineHandlers.scala
@@ -0,0 +1,7 @@
+object Test {
+ @noinline def ham: String = throw null
+ @inline def inner: String = try { ham } catch { case _: NullPointerException => "npe" }
+ def foo = try inner catch { case e: Throwable => throw e }
+
+ def main(args: Array[String]): Unit = assert(foo == "npe")
+}
diff --git a/test/files/run/iq.scala b/test/files/run/iq.scala
index 0ccf67a2e9..9929f0e1a0 100644
--- a/test/files/run/iq.scala
+++ b/test/files/run/iq.scala
@@ -25,12 +25,18 @@ object iq {
assert(q2 == qb)
val qc = 42 +: q :+ 0
assert(q2 == qc)
+ assert(q ++ qa == qa)
+ val qdr = 1 +: 2 +: 3 +: 4 +: q
+ val qcon1 = 1 +: 2 +: q
+ val qcon2 = q :+ 3 :+ 4
+ val qd = qcon1 ++ qcon2
+ assert(qd == qdr)
Console.println("q2: " + q2)
Console.println("qa: " + qa)
Console.println("qb: " + qb)
Console.println("qc: " + qc)
-
+
/* Test is empty and dequeue.
* Expected: Head: 42
*/
diff --git a/test/files/run/iterator-from.scala b/test/files/run/iterator-from.scala
index e7ba1aeb28..01006ffc21 100644
--- a/test/files/run/iterator-from.scala
+++ b/test/files/run/iterator-from.scala
@@ -1,5 +1,5 @@
/* This file tests iteratorFrom, keysIteratorFrom, and valueIteratorFrom on various sorted sets and maps
- * filter: inliner warnings; re-run with
+ * filter: inliner warnings
*/
import scala.util.{Random => R}
diff --git a/test/files/run/junitForwarders/C_1.scala b/test/files/run/junitForwarders/C_1.scala
new file mode 100644
index 0000000000..0361ef42ef
--- /dev/null
+++ b/test/files/run/junitForwarders/C_1.scala
@@ -0,0 +1,15 @@
+trait T {
+ @org.junit.Test def foo = 0
+}
+
+class C extends T
+
+object Test extends App {
+ def check(c: Class[_], e: String) = {
+ val s = c.getDeclaredMethods.sortBy(_.getName).map(m => s"${m.getName} - ${m.getDeclaredAnnotations.mkString(", ")}").mkString(";")
+ assert(s == e, s"found: $s\nexpected: $e")
+ }
+ check(classOf[C], "foo - @org.junit.Test()")
+ // scala/scala-dev#213, scala/scala#5570: `foo$` should not have the @Test annotation
+ check(classOf[T], "$init$ - ;foo - @org.junit.Test();foo$ - ")
+}
diff --git a/test/files/run/junitForwarders/Test.java b/test/files/run/junitForwarders/Test.java
new file mode 100644
index 0000000000..57c4d5b544
--- /dev/null
+++ b/test/files/run/junitForwarders/Test.java
@@ -0,0 +1,10 @@
+package org.junit;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD})
+public @interface Test { }
diff --git a/test/files/run/lambda-serialization-security.scala b/test/files/run/lambda-serialization-security.scala
new file mode 100644
index 0000000000..08e235b1cb
--- /dev/null
+++ b/test/files/run/lambda-serialization-security.scala
@@ -0,0 +1,47 @@
+import java.io.{ByteArrayInputStream, ObjectInputStream, ObjectOutputStream, ByteArrayOutputStream}
+
+trait IntToString extends java.io.Serializable { def apply(i: Int): String }
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ roundTrip()
+ roundTripIndySam()
+ }
+
+ def roundTrip(): Unit = {
+ val c = new Capture("Capture")
+ val lambda = (p: Param) => ("a", p, c)
+ val reconstituted1 = serializeDeserialize(lambda).asInstanceOf[Object => Any]
+ val p = new Param
+ assert(reconstituted1.apply(p) == ("a", p, c))
+ val reconstituted2 = serializeDeserialize(lambda).asInstanceOf[Object => Any]
+ assert(reconstituted1.getClass == reconstituted2.getClass)
+
+ val reconstituted3 = serializeDeserialize(reconstituted1)
+ assert(reconstituted3.apply(p) == ("a", p, c))
+
+ val specializedLambda = (p: Int) => List(p, c).length
+ assert(serializeDeserialize(specializedLambda).apply(42) == 2)
+ assert(serializeDeserialize(serializeDeserialize(specializedLambda)).apply(42) == 2)
+ }
+
+ // lambda targeting a SAM, not a FunctionN (should behave the same way)
+ def roundTripIndySam(): Unit = {
+ val lambda: IntToString = (x: Int) => "yo!" * x
+ val reconstituted1 = serializeDeserialize(lambda).asInstanceOf[IntToString]
+ val reconstituted2 = serializeDeserialize(reconstituted1).asInstanceOf[IntToString]
+ assert(reconstituted1.apply(2) == "yo!yo!")
+ assert(reconstituted1.getClass == reconstituted2.getClass)
+ }
+
+ def serializeDeserialize[T <: AnyRef](obj: T) = {
+ val buffer = new ByteArrayOutputStream
+ val out = new ObjectOutputStream(buffer)
+ out.writeObject(obj)
+ val in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray))
+ in.readObject.asInstanceOf[T]
+ }
+}
+
+case class Capture(s: String) extends Serializable
+class Param
diff --git a/test/files/run/lambda-serialization.scala b/test/files/run/lambda-serialization.scala
index 46b26d7c5e..78b4c5d58b 100644
--- a/test/files/run/lambda-serialization.scala
+++ b/test/files/run/lambda-serialization.scala
@@ -1,25 +1,54 @@
-import java.io.{ByteArrayInputStream, ObjectInputStream, ObjectOutputStream, ByteArrayOutputStream}
+import java.io.{ByteArrayInputStream, ByteArrayOutputStream, ObjectInputStream, ObjectOutputStream}
+import java.lang.invoke.{MethodHandleInfo, SerializedLambda}
+
+import scala.tools.nsc.util
+
+class C extends java.io.Serializable {
+ val fs = List(
+ () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => () ,() => (), () => (), () => (), () => (), () => (),
+ () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => () ,() => (), () => (), () => (), () => (), () => (),
+ () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => () ,() => (), () => (), () => (), () => (), () => (),
+ () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => () ,() => (), () => (), () => (), () => (), () => (),
+ () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => () ,() => (), () => (), () => (), () => (), () => (),
+ () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => () ,() => (), () => (), () => (), () => (), () => (),
+ () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => () ,() => (), () => (), () => (), () => (), () => (),
+ () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => () ,() => (), () => (), () => (), () => (), () => (),
+ () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => () ,() => (), () => (), () => (), () => (), () => (),
+ () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => () ,() => (), () => (), () => (), () => (), () => (),
+ () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => () ,() => (), () => (), () => (), () => (), () => (),
+ () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => () ,() => (), () => (), () => (), () => (), () => (),
+ () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => () ,() => (), () => (), () => (), () => (), () => (),
+ () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => () ,() => (), () => (), () => (), () => (), () => (),
+ () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => (), () => () ,() => (), () => (), () => (), () => (), () => ()
+ )
+ private def foo(): Unit = {
+ assert(false, "should not be called!!!")
+ }
+}
+
+trait FakeSam { def apply(): Unit }
object Test {
def main(args: Array[String]): Unit = {
- roundTrip
+ allRealLambdasRoundTrip()
+ fakeLambdaFailsToDeserialize()
+ }
+
+ def allRealLambdasRoundTrip(): Unit = {
+ new C().fs.map(x => serializeDeserialize(x).apply())
}
- def roundTrip(): Unit = {
- val c = new Capture("Capture")
- val lambda = (p: Param) => ("a", p, c)
- val reconstituted1 = serializeDeserialize(lambda).asInstanceOf[Object => Any]
- val p = new Param
- assert(reconstituted1.apply(p) == ("a", p, c))
- val reconstituted2 = serializeDeserialize(lambda).asInstanceOf[Object => Any]
- assert(reconstituted1.getClass == reconstituted2.getClass)
-
- val reconstituted3 = serializeDeserialize(reconstituted1)
- assert(reconstituted3.apply(p) == ("a", p, c))
-
- val specializedLambda = (p: Int) => List(p, c).length
- assert(serializeDeserialize(specializedLambda).apply(42) == 2)
- assert(serializeDeserialize(serializeDeserialize(specializedLambda)).apply(42) == 2)
+ def fakeLambdaFailsToDeserialize(): Unit = {
+ val fake = new SerializedLambda(classOf[C], classOf[FakeSam].getName, "apply", "()V",
+ MethodHandleInfo.REF_invokeVirtual, classOf[C].getName, "foo", "()V", "()V", Array(new C))
+ try {
+ serializeDeserialize(fake).asInstanceOf[FakeSam].apply()
+ assert(false)
+ } catch {
+ case ex: Exception =>
+ val stackTrace = util.stackTraceString(ex)
+ assert(stackTrace.contains("Illegal lambda deserialization"), stackTrace)
+ }
}
def serializeDeserialize[T <: AnyRef](obj: T) = {
@@ -31,5 +60,3 @@ object Test {
}
}
-case class Capture(s: String) extends Serializable
-class Param
diff --git a/test/files/run/large_class.check b/test/files/run/large_class.check
index 0585c267ac..babe24db94 100644
--- a/test/files/run/large_class.check
+++ b/test/files/run/large_class.check
@@ -1,3 +1 @@
-newSource1.scala:1: error: Could not write class BigEnoughToFail because it exceeds JVM code size limits. Class file too large!
-class BigEnoughToFail {
- ^
+error: Could not write class BigEnoughToFail because it exceeds JVM code size limits. Class file too large!
diff --git a/test/files/run/large_code.check b/test/files/run/large_code.check
index 6ad50967bc..42bf490942 100644
--- a/test/files/run/large_code.check
+++ b/test/files/run/large_code.check
@@ -1,3 +1 @@
-newSource1.scala:1: error: Could not write class BigEnoughToFail because it exceeds JVM code size limits. Method tooLong's code too large!
-class BigEnoughToFail {
- ^
+error: Could not write class BigEnoughToFail because it exceeds JVM code size limits. Method tooLong's code too large!
diff --git a/test/files/run/lazy-locals-2.scala b/test/files/run/lazy-locals-2.scala
new file mode 100644
index 0000000000..d6c33cffcb
--- /dev/null
+++ b/test/files/run/lazy-locals-2.scala
@@ -0,0 +1,322 @@
+object Logs {
+ val logBuf = new collection.mutable.StringBuilder()
+ def log(m: Any): Unit = { if (logBuf.nonEmpty) logBuf.append(":"); logBuf.append(m) }
+ def checkLog(expected: String): Unit = {
+ val res = logBuf.toString
+ assert(res == expected, s"expected:\n$expected\nfound:\n$res")
+ logBuf.clear()
+ }
+}
+
+import Logs._
+
+class C {
+ def getInt : Int = { log("getInt"); 1 }
+ def getString: String = { log("getString"); "s" }
+ def getUnit : Unit = { log("getUnit") }
+
+ lazy val t1 = getInt
+ lazy val t2 = getString
+ lazy val t3 = getUnit
+ checkLog("")
+
+ def m1 = {
+ lazy val t1 = getInt
+ t1 + t1
+ }
+ def m2 = {
+ lazy val t1 = getString
+ t1 + t1
+ }
+ def m3 = {
+ lazy val t1 = getUnit
+ log(t1); log(t1)
+ }
+ checkLog("")
+
+
+ val vl1 = {
+ lazy val t1 = getInt
+ t1 + t1
+ }
+ val vl2 = {
+ lazy val t1 = getString
+ t1 + t1
+ }
+ val vl3 = {
+ lazy val t1 = getUnit
+ log(t1); log(t1)
+ }
+ checkLog("getInt:getString:getUnit:():()")
+
+
+ var vr1 = {
+ lazy val t1 = getInt
+ t1 + t1
+ }
+ var vr2 = {
+ lazy val t1 = getString
+ t1 + t1
+ }
+ var vr3 = {
+ lazy val t1 = getUnit
+ log(t1); log(t1)
+ }
+ checkLog("getInt:getString:getUnit:():()")
+
+
+ lazy val lvl1 = {
+ lazy val t1 = getInt
+ t1 + t1
+ }
+ lazy val lvl2 = {
+ lazy val t1 = getString
+ t1 + t1
+ }
+ lazy val lvl3 = {
+ lazy val t1 = getUnit
+ log(t1); log(t1)
+ }
+ checkLog("")
+
+
+ {
+ lazy val t1 = getInt
+ lazy val t2 = getString
+ lazy val t3 = getUnit
+
+ log(t1 + t1)
+ log(t2 + t2)
+ log(t3); log(t3)
+ }
+ checkLog("getInt:2:getString:ss:getUnit:():()")
+
+
+ def run(): Unit = {
+ log(t1); log(t1);
+ log(t2); log(t2);
+ log(t3); log(t3);
+ checkLog("getInt:1:1:getString:s:s:getUnit:():()")
+
+ log(m1); log(m1)
+ log(m2); log(m2)
+ log(m3); log(m3)
+ checkLog("getInt:2:getInt:2:getString:ss:getString:ss:getUnit:():():():getUnit:():():()")
+
+ log(vl1); log(vl1)
+ log(vl2); log(vl2)
+ log(vl3); log(vl3)
+ checkLog("2:2:ss:ss:():()")
+
+ log(vr1); log(vr1); vr1 = 393; log(vr1)
+ log(vr2); log(vr2); vr2 = "h"; log(vr2)
+ log(vr3); log(vr3); vr3 = () ; log(vr3)
+ checkLog("2:2:393:ss:ss:h:():():()")
+
+ log(lvl1); log(lvl1)
+ log(lvl2); log(lvl2)
+ log(lvl3); log(lvl3)
+ checkLog("getInt:2:2:getString:ss:ss:getUnit:():():():()")
+ }
+}
+
+trait T {
+ def getInt : Int = { log("getInt"); 1 }
+ def getString: String = { log("getString"); "s" }
+ def getUnit : Unit = { log("getUnit") }
+
+ lazy val t1 = getInt
+ lazy val t2 = getString
+ lazy val t3 = getUnit
+ checkLog("")
+
+ def m1 = {
+ lazy val t1 = getInt
+ t1 + t1
+ }
+ def m2 = {
+ lazy val t1 = getString
+ t1 + t1
+ }
+ def m3 = {
+ lazy val t1 = getUnit
+ log(t1); log(t1)
+ }
+ checkLog("")
+
+
+ val vl1 = {
+ lazy val t1 = getInt
+ t1 + t1
+ }
+ val vl2 = {
+ lazy val t1 = getString
+ t1 + t1
+ }
+ val vl3 = {
+ lazy val t1 = getUnit
+ log(t1); log(t1)
+ }
+ checkLog("getInt:getString:getUnit:():()")
+
+
+ var vr1 = {
+ lazy val t1 = getInt
+ t1 + t1
+ }
+ var vr2 = {
+ lazy val t1 = getString
+ t1 + t1
+ }
+ var vr3 = {
+ lazy val t1 = getUnit
+ log(t1); log(t1)
+ }
+ checkLog("getInt:getString:getUnit:():()")
+
+
+ lazy val lvl1 = {
+ lazy val t1 = getInt
+ t1 + t1
+ }
+ lazy val lvl2 = {
+ lazy val t1 = getString
+ t1 + t1
+ }
+ lazy val lvl3 = {
+ lazy val t1 = getUnit
+ log(t1); log(t1)
+ }
+ checkLog("")
+
+
+ {
+ lazy val t1 = getInt
+ lazy val t2 = getString
+ lazy val t3 = getUnit
+
+ log(t1 + t1)
+ log(t2 + t2)
+ log(t3); log(t3)
+ }
+ checkLog("getInt:2:getString:ss:getUnit:():()")
+
+
+ def run(): Unit = {
+ log(t1); log(t1);
+ log(t2); log(t2);
+ log(t3); log(t3);
+ checkLog("getInt:1:1:getString:s:s:getUnit:():()")
+
+ log(m1); log(m1)
+ log(m2); log(m2)
+ log(m3); log(m3)
+ checkLog("getInt:2:getInt:2:getString:ss:getString:ss:getUnit:():():():getUnit:():():()")
+
+ log(vl1); log(vl1)
+ log(vl2); log(vl2)
+ log(vl3); log(vl3)
+ checkLog("2:2:ss:ss:():()")
+
+ log(vr1); log(vr1); vr1 = 393; log(vr1)
+ log(vr2); log(vr2); vr2 = "h"; log(vr2)
+ log(vr3); log(vr3); vr3 = () ; log(vr3)
+ checkLog("2:2:393:ss:ss:h:():():()")
+
+ log(lvl1); log(lvl1)
+ log(lvl2); log(lvl2)
+ log(lvl3); log(lvl3)
+ checkLog("getInt:2:2:getString:ss:ss:getUnit:():():():()")
+ }
+}
+
+class D extends T
+
+class D1 extends T {
+ override lazy val t1 = { log("o-t1"); -1 }
+ checkLog("")
+
+ override def m1 = { log("o-m1"); -2 }
+ override val m2 = { log("o-m2"); "n" }
+ override lazy val m3 = { log("o-m3") }
+ checkLog("o-m2")
+
+ override val vl1 = { log("o-vl1"); -3 }
+ checkLog("o-vl1")
+
+ override lazy val lvl1 = { log("o-lvl1"); -4 }
+ checkLog("")
+
+ override def run(): Unit = {
+ log(t1); log(t1)
+ checkLog("o-t1:-1:-1")
+
+ log(m1); log(m1)
+ log(m2); log(m2)
+ log(m3); log(m3)
+ checkLog("o-m1:-2:o-m1:-2:n:n:o-m3:():()")
+
+ log(vl1); log(vl1)
+ checkLog("-3:-3")
+
+ log(lvl1); log(lvl1)
+ checkLog("o-lvl1:-4:-4")
+ }
+}
+
+class E {
+ object T { log("init T"); override def toString = "T" }
+ def m = { object T { log("init T"); val x = 1 }; T.x }
+ checkLog("")
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val c = new C
+ c.run()
+
+ val lzyComputeMethods = c.getClass.getDeclaredMethods.filter(_.getName contains "lzycompute").map(_.getName).toList.sorted
+ val expComputeMethods = List("lvl1$lzycompute", "lvl2$lzycompute", "lvl3$lzycompute", "t1$lzycompute", "t1$lzycompute$1", "t1$lzycompute$10", "t1$lzycompute$11", "t1$lzycompute$12", "t1$lzycompute$13", "t1$lzycompute$2", "t1$lzycompute$3", "t1$lzycompute$4", "t1$lzycompute$5", "t1$lzycompute$6", "t1$lzycompute$7", "t1$lzycompute$8", "t1$lzycompute$9", "t2$lzycompute", "t2$lzycompute$1", "t3$lzycompute", "t3$lzycompute$1")
+ assert(
+ lzyComputeMethods == expComputeMethods,
+ s"wrong lzycompute methods. expected:\n$expComputeMethods\nfound:\n$lzyComputeMethods")
+
+ val fields = c.getClass.getDeclaredFields.toList.sortBy(_.getName).map(_.toString)
+ val expFields = List(
+ "private volatile byte C.bitmap$0",
+ "private int C.lvl1",
+ "private java.lang.String C.lvl2",
+ "private scala.runtime.BoxedUnit C.lvl3",
+ "private int C.t1",
+ "private java.lang.String C.t2",
+ "private scala.runtime.BoxedUnit C.t3",
+ "private final int C.vl1",
+ "private final java.lang.String C.vl2",
+ "private final scala.runtime.BoxedUnit C.vl3",
+ "private int C.vr1",
+ "private java.lang.String C.vr2",
+ "private scala.runtime.BoxedUnit C.vr3")
+ assert(
+ fields == expFields,
+ s"wrong fields. expected:\n$expFields\nfound:\n$fields")
+
+
+ val d = new D
+ d.run()
+
+ val dFields = d.getClass.getDeclaredFields.toList.sortBy(_.getName).map(_.toString)
+ assert(
+ dFields == expFields.map(_.replaceAll(" C.", " D.")),
+ s"wrong fields. expected:\n$expFields\nfound:\n$fields")
+
+
+ val d1 = new D1
+ d1.run()
+
+ val e = new E
+ log(e.T); log(e.T)
+ checkLog("init T:T:T")
+ log(e.m); log(e.m)
+ checkLog("init T:1:init T:1")
+ }
+}
diff --git a/test/files/run/lazy-locals.check b/test/files/run/lazy-locals.check
index 9e88a55d18..0a3a85ead6 100644
--- a/test/files/run/lazy-locals.check
+++ b/test/files/run/lazy-locals.check
@@ -1,9 +1,6 @@
-lazy-locals.scala:153: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+lazy-locals.scala:153: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
{
^
-lazy-locals.scala:159: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
- {
- ^
forced lazy val q
q = 10
forced lazy val t
diff --git a/test/files/run/lazy_local_labels.check b/test/files/run/lazy_local_labels.check
new file mode 100644
index 0000000000..e42c8fb8ce
--- /dev/null
+++ b/test/files/run/lazy_local_labels.check
@@ -0,0 +1,9 @@
+HI
+HI
+HI
+HI
+HI
+HI
+HI
+HI
+HI
diff --git a/test/files/run/lazy_local_labels.scala b/test/files/run/lazy_local_labels.scala
new file mode 100644
index 0000000000..f4a1cdf689
--- /dev/null
+++ b/test/files/run/lazy_local_labels.scala
@@ -0,0 +1,28 @@
+// should print HI nine times to indicate the lazy val has been re-initialized on every iteration
+object Test extends App {
+ def fooDo: Unit = {
+ var i = 3
+ do {
+ lazy val x = { println("HI"); 1 }
+ i -= x
+ } while(i > 0)
+ }
+
+ def fooWhile: Unit = {
+ var i = 3
+ while(i > 0) {
+ lazy val x = { println("HI"); 1 }
+ i -= x
+ }
+ }
+
+ @annotation.tailrec def fooTail(i: Int): Unit = {
+ lazy val x = { println("HI"); 1 }
+ if (i > 0) fooTail(i - x)
+ }
+
+
+ fooWhile
+ fooDo
+ fooTail(3)
+}
diff --git a/test/files/run/lisp.check b/test/files/run/lisp.check
new file mode 100644
index 0000000000..64053f26d0
--- /dev/null
+++ b/test/files/run/lisp.check
@@ -0,0 +1,26 @@
+(lambda (x) (+ (* x x) 1))
+(lambda (x) (+ (* x x) 1))
+
+( '(1 2 3)) = (1 2 3)
+(car '(1 2 3)) = 1
+(cdr '(1 2 3)) = (2 3)
+(null? '(2 3)) = 0
+(null? '()) = 1
+
+faculty(10) = 3628800
+faculty(10) = 3628800
+foobar = ("a" "bc" "def" "z")
+
+List('lambda, List('x), List('+, List('*, 'x, 'x), 1))
+(lambda (x) (+ (* x x) 1))
+
+( '(1 2 3)) = (1 2 3)
+(car '(1 2 3)) = 1
+(cdr '(1 2 3)) = (2 3)
+(null? '(2 3)) = 0
+(null? '()) = 1
+
+faculty(10) = 3628800
+faculty(10) = 3628800
+foobar = ("a" "bc" "def" "z")
+
diff --git a/test/files/run/lisp.scala b/test/files/run/lisp.scala
new file mode 100644
index 0000000000..162c7d2599
--- /dev/null
+++ b/test/files/run/lisp.scala
@@ -0,0 +1,518 @@
+//############################################################################
+// Lisp interpreter
+//############################################################################
+
+//############################################################################
+// Lisp Scanner
+
+class LispTokenizer(s: String) extends Iterator[String] {
+ private var i = 0;
+ private def isDelimiter(ch: Char) = ch <= ' ' || ch == '(' || ch == ')'
+ def hasNext: Boolean = {
+ while (i < s.length() && s.charAt(i) <= ' ') i += 1
+ i < s.length()
+ }
+ def next: String =
+ if (hasNext) {
+ val start = i
+ if (isDelimiter(s charAt i)) i += 1
+ else
+ do i = i + 1
+ while (!isDelimiter(s charAt i))
+ s.substring(start, i)
+ } else sys.error("premature end of string")
+}
+
+//############################################################################
+// Lisp Interface
+
+trait Lisp {
+ type Data
+
+ def string2lisp(s: String): Data
+ def lisp2string(s: Data): String
+
+ def evaluate(d: Data): Data
+ // !!! def evaluate(s: String): Data = evaluate(string2lisp(s))
+ def evaluate(s: String): Data
+}
+
+//############################################################################
+// Lisp Implementation Using Case Classes
+
+object LispCaseClasses extends Lisp {
+
+ import List.range
+
+ trait Data {
+ def elemsToString(): String = toString();
+ }
+ case class CONS(car: Data, cdr: Data) extends Data {
+ override def toString() = "(" + elemsToString() + ")";
+ override def elemsToString() = car.toString() + (cdr match {
+ case NIL() => ""
+ case _ => " " + cdr.elemsToString();
+ })
+ }
+ case class NIL() extends Data { // !!! use case object
+ override def toString() = "()";
+ }
+ case class SYM(name: String) extends Data {
+ override def toString() = name;
+ }
+ case class NUM(x: Int) extends Data {
+ override def toString() = x.toString();
+ }
+ case class STR(x: String) extends Data {
+ override def toString() = "\"" + x + "\"";
+ }
+ case class FUN(f: List[Data] => Data) extends Data {
+ override def toString() = "<fn>";
+ }
+
+ def list(): Data =
+ NIL();
+ def list(x0: Data): Data =
+ CONS(x0, NIL());
+ def list(x0: Data, x1: Data): Data =
+ CONS(x0, list(x1));
+ def list(x0: Data, x1: Data, x2: Data): Data =
+ CONS(x0, list(x1, x2));
+ def list(x0: Data, x1: Data, x2: Data, x3: Data): Data =
+ CONS(x0, list(x1, x2, x3));
+ def list(x0: Data, x1: Data, x2: Data, x3: Data, x4: Data): Data =
+ CONS(x0, list(x1, x2, x3, x4));
+ def list(x0: Data, x1: Data, x2: Data, x3: Data, x4: Data, x5: Data): Data =
+ CONS(x0, list(x1, x2, x3, x4, x5));
+ def list(x0: Data, x1: Data, x2: Data, x3: Data, x4: Data, x5: Data,
+ x6: Data): Data =
+ CONS(x0, list(x1, x2, x3, x4, x5, x6));
+ def list(x0: Data, x1: Data, x2: Data, x3: Data, x4: Data, x5: Data,
+ x6: Data, x7: Data): Data =
+ CONS(x0, list(x1, x2, x3, x4, x5, x6, x7));
+ def list(x0: Data, x1: Data, x2: Data, x3: Data, x4: Data, x5: Data,
+ x6: Data, x7: Data, x8: Data): Data =
+ CONS(x0, list(x1, x2, x3, x4, x5, x6, x7, x8));
+ def list(x0: Data, x1: Data, x2: Data, x3: Data, x4: Data, x5: Data,
+ x6: Data, x7: Data, x8: Data, x9: Data): Data =
+ CONS(x0, list(x1, x2, x3, x4, x5, x6, x7, x8, x9));
+
+ var curexp: Data = null
+ var trace: Boolean = false
+ var indent: Int = 0
+
+ def lispError[a](msg: String): a =
+ sys.error("error: " + msg + "\n" + curexp);
+
+ trait Environment {
+ def lookup(n: String): Data;
+ def extendRec(name: String, expr: Environment => Data) =
+ new Environment {
+ def lookup(n: String): Data =
+ if (n == name) expr(this) else Environment.this.lookup(n);
+ }
+ def extend(name: String, v: Data) = extendRec(name, (env1 => v));
+ }
+ val EmptyEnvironment = new Environment {
+ def lookup(n: String): Data = lispError("undefined: " + n);
+ }
+
+ def toList(x: Data): List[Data] = x match {
+ case NIL() => List()
+ case CONS(y, ys) => y :: toList(ys)
+ case _ => lispError("malformed list: " + x);
+ }
+
+ def toBoolean(x: Data) = x match {
+ case NUM(0) => false
+ case _ => true
+ }
+
+ def normalize(x: Data): Data = x match {
+ case CONS(SYM("def"),
+ CONS(CONS(SYM(name), args), CONS(body, CONS(expr, NIL())))) =>
+ normalize(list(SYM("def"),
+ SYM(name), list(SYM("lambda"), args, body), expr))
+ case CONS(SYM("cond"), CONS(CONS(SYM("else"), CONS(expr, NIL())),NIL())) =>
+ normalize(expr)
+ case CONS(SYM("cond"), CONS(CONS(test, CONS(expr, NIL())), rest)) =>
+ normalize(list(SYM("if"), test, expr, CONS(SYM("cond"), rest)))
+ case CONS(h, t) => CONS(normalize(h), normalize(t))
+ case _ => x
+ }
+
+ def eval(x: Data, env: Environment): Data = {
+ val prevexp = curexp;
+ curexp = x;
+ if (trace) {
+ for (x <- range(1, indent)) Console.print(" ");
+ Console.println("===> " + x);
+ indent = indent + 1;
+ }
+ val result = eval1(x, env);
+ if (trace) {
+ indent = indent - 1;
+ for (x <- range(1, indent)) Console.print(" ");
+ Console.println("<=== " + result);
+ }
+ curexp = prevexp;
+ result
+ }
+
+ def eval1(x: Data, env: Environment): Data = x match {
+ case SYM(name) =>
+ env lookup name
+ case CONS(SYM("def"), CONS(SYM(name), CONS(y, CONS(z, NIL())))) =>
+ eval(z, env.extendRec(name, (env1 => eval(y, env1))))
+ case CONS(SYM("val"), CONS(SYM(name), CONS(y, CONS(z, NIL())))) =>
+ eval(z, env.extend(name, eval(y, env)))
+ case CONS(SYM("lambda"), CONS(params, CONS(y, NIL()))) =>
+ mkLambda(params, y, env)
+ case CONS(SYM("if"), CONS(c, CONS(t, CONS(e, NIL())))) =>
+ if (toBoolean(eval(c, env))) eval(t, env) else eval(e, env)
+ case CONS(SYM("quote"), CONS(x, NIL())) =>
+ x
+ case CONS(y, xs) =>
+ apply(eval(y, env), toList(xs) map (x => eval(x, env)))
+ case NUM(_) => x
+ case STR(_) => x
+ case FUN(_) => x
+ case _ =>
+ lispError("illegal term")
+ }
+
+ def apply(fn: Data, args: List[Data]): Data = fn match {
+ case FUN(f) => f(args);
+ case _ => lispError("application of non-function: " + fn);
+ }
+
+ def mkLambda(params: Data, expr: Data, env: Environment): Data = {
+
+ def extendEnv(env: Environment,
+ ps: List[String], args: List[Data]): Environment =
+ (ps, args) match {
+ case (List(), List()) =>
+ env
+ case (p :: ps1, arg :: args1) =>
+ extendEnv(env.extend(p, arg), ps1, args1)
+ case _ =>
+ lispError("wrong number of arguments")
+ }
+
+ val ps: List[String] = toList(params) map {
+ case SYM(name) => name
+ case _ => sys.error("illegal parameter list");
+ }
+
+ FUN(args => eval(expr, extendEnv(env, ps, args)))
+ }
+
+ val globalEnv = EmptyEnvironment
+ .extend("=", FUN({
+ case List(NUM(arg1),NUM(arg2)) => NUM(if (arg1 == arg2) 1 else 0)
+ case List(STR(arg1),STR(arg2)) => NUM(if (arg1 == arg2) 1 else 0)}))
+ .extend("+", FUN({
+ case List(NUM(arg1),NUM(arg2)) => NUM(arg1 + arg2)
+ case List(STR(arg1),STR(arg2)) => STR(arg1 + arg2)}))
+ .extend("-", FUN({
+ case List(NUM(arg1),NUM(arg2)) => NUM(arg1 - arg2)}))
+ .extend("*", FUN({
+ case List(NUM(arg1),NUM(arg2)) => NUM(arg1 * arg2)}))
+ .extend("/", FUN({
+ case List(NUM(arg1),NUM(arg2)) => NUM(arg1 / arg2)}))
+ .extend("car", FUN({
+ case List(CONS(x, xs)) => x}))
+ .extend("cdr", FUN({
+ case List(CONS(x, xs)) => xs}))
+ .extend("null?", FUN({
+ case List(NIL()) => NUM(1)
+ case _ => NUM(0)}))
+ .extend("cons", FUN({
+ case List(x, y) => CONS(x, y)}));
+
+ def evaluate(x: Data): Data = eval(normalize(x), globalEnv);
+ def evaluate(s: String): Data = evaluate(string2lisp(s));
+
+ def string2lisp(s: String): Data = {
+ val it = new LispTokenizer(s);
+ def parse(token: String): Data = {
+ if (token == "(") parseList
+ else if (token == ")") sys.error("unbalanced parentheses")
+ else if ('0' <= token.charAt(0) && token.charAt(0) <= '9')
+ NUM(token.toInt)
+ else if (token.charAt(0) == '\"' && token.charAt(token.length()-1)=='\"')
+ STR(token.substring(1,token.length() - 1))
+ else SYM(token)
+ }
+ def parseList: Data = {
+ val token = it.next;
+ if (token == ")") NIL() else CONS(parse(token), parseList)
+ }
+ parse(it.next)
+ }
+
+ def lisp2string(d: Data): String = d.toString();
+}
+
+//############################################################################
+// Lisp Implementation Using Any
+
+object LispAny extends Lisp {
+
+ import List._;
+
+ type Data = Any;
+
+ case class Lambda(f: List[Data] => Data);
+
+ var curexp: Data = null;
+ var trace: Boolean = false;
+ var indent: Int = 0;
+
+ def lispError[a](msg: String): a =
+ sys.error("error: " + msg + "\n" + curexp);
+
+ trait Environment {
+ def lookup(n: String): Data;
+ def extendRec(name: String, expr: Environment => Data) =
+ new Environment {
+ def lookup(n: String): Data =
+ if (n == name) expr(this) else Environment.this.lookup(n);
+ }
+ def extend(name: String, v: Data) = extendRec(name, (env1 => v));
+ }
+ val EmptyEnvironment = new Environment {
+ def lookup(n: String): Data = lispError("undefined: " + n);
+ }
+
+ def asList(x: Data): List[Data] = x match {
+ case y: List[_] => y
+ case _ => lispError("malformed list: " + x)
+ }
+
+ def asInt(x: Data): Int = x match {
+ case y: Int => y
+ case _ => lispError("not an integer: " + x)
+ }
+
+ def asString(x: Data): String = x match {
+ case y: String => y
+ case _ => lispError("not a string: " + x)
+ }
+
+ def asBoolean(x: Data): Boolean = x != 0
+
+ def normalize(x: Data): Data = x match {
+ case 'and :: x :: y :: Nil =>
+ normalize('if :: x :: y :: 0 :: Nil)
+ case 'or :: x :: y :: Nil =>
+ normalize('if :: x :: 1 :: y :: Nil)
+ case 'def :: (name :: args) :: body :: expr :: Nil =>
+ normalize('def :: name :: ('lambda :: args :: body :: Nil) :: expr :: Nil)
+ case 'cond :: ('else :: expr :: Nil) :: rest =>
+ normalize(expr);
+ case 'cond :: (test :: expr :: Nil) :: rest =>
+ normalize('if :: test :: expr :: ('cond :: rest) :: Nil)
+ case 'cond :: 'else :: expr :: Nil =>
+ normalize(expr)
+ case h :: t =>
+ normalize(h) :: asList(normalize(t))
+ case _ =>
+ x
+ }
+
+ def eval(x: Data, env: Environment): Data = {
+ val prevexp = curexp;
+ curexp = x;
+ if (trace) {
+ for (x <- range(1, indent)) Console.print(" ");
+ Console.println("===> " + x);
+ indent += 1;
+ }
+ val result = eval1(x, env);
+ if (trace) {
+ indent -= 1;
+ for (x <- range(1, indent)) Console.print(" ");
+ Console.println("<=== " + result);
+ }
+ curexp = prevexp;
+ result
+ }
+
+ def eval1(x: Data, env: Environment): Data = x match {
+ case Symbol(name) =>
+ env lookup name
+ case 'def :: Symbol(name) :: y :: z :: Nil =>
+ eval(z, env.extendRec(name, (env1 => eval(y, env1))))
+ case 'val :: Symbol(name) :: y :: z :: Nil =>
+ eval(z, env.extend(name, eval(y, env)))
+ case 'lambda :: params :: y :: Nil =>
+ mkLambda(params, y, env)
+ case 'if :: c :: y :: z :: Nil =>
+ if (asBoolean(eval(c, env))) eval(y, env) else eval(z, env)
+ case 'quote :: y :: Nil =>
+ y
+ case y :: z =>
+ apply(eval(y, env), z map (x => eval(x, env)))
+ case Lambda(_) => x
+ case y: String => x
+ case y: Int => x
+ case y => lispError("illegal term")
+ }
+
+ def lisp2string(x: Data): String = x match {
+ case Symbol(name) => name
+ case Nil => "()"
+ case y :: ys =>
+ def list2string(xs: List[Data]): String = xs match {
+ case List() => ""
+ case y :: ys => " " + lisp2string(y) + list2string(ys)
+ }
+ "(" + lisp2string(y) + list2string(ys) + ")"
+ case _ => if (x.isInstanceOf[String]) "\"" + x + "\""; else x.toString()
+ }
+
+ def apply(fn: Data, args: List[Data]): Data = fn match {
+ case Lambda(f) => f(args);
+ case _ => lispError("application of non-function: " + fn + " to " + args);
+ }
+
+ def mkLambda(params: Data, expr: Data, env: Environment): Data = {
+
+ def extendEnv(env: Environment,
+ ps: List[String], args: List[Data]): Environment =
+ (ps, args) match {
+ case (List(), List()) =>
+ env
+ case (p :: ps1, arg :: args1) =>
+ extendEnv(env.extend(p, arg), ps1, args1)
+ case _ =>
+ lispError("wrong number of arguments")
+ }
+
+ val ps: List[String] = asList(params) map {
+ case Symbol(name) => name
+ case _ => sys.error("illegal parameter list");
+ }
+
+ Lambda(args => eval(expr, extendEnv(env, ps, args)))
+ }
+
+ val globalEnv = EmptyEnvironment
+ .extend("=", Lambda{
+ case List(arg1, arg2) => if(arg1 == arg2) 1 else 0})
+ .extend("+", Lambda{
+ case List(arg1: Int, arg2: Int) => arg1 + arg2
+ case List(arg1: String, arg2: String) => arg1 + arg2})
+ .extend("-", Lambda{
+ case List(arg1: Int, arg2: Int) => arg1 - arg2})
+ .extend("*", Lambda{
+ case List(arg1: Int, arg2: Int) => arg1 * arg2})
+ .extend("/", Lambda{
+ case List(arg1: Int, arg2: Int) => arg1 / arg2})
+ .extend("nil", Nil)
+ .extend("cons", Lambda{
+ case List(arg1, arg2) => arg1 :: asList(arg2)})
+ .extend("car", Lambda{
+ case List(x :: xs) => x})
+ .extend("cdr", Lambda{
+ case List(x :: xs) => xs})
+ .extend("null?", Lambda{
+ case List(Nil) => 1
+ case _ => 0});
+
+ def evaluate(x: Data): Data = eval(normalize(x), globalEnv);
+ def evaluate(s: String): Data = evaluate(string2lisp(s));
+
+ def string2lisp(s: String): Data = {
+ val it = new LispTokenizer(s);
+ def parse(token: String): Data = {
+ if (token == "(") parseList
+ else if (token == ")") sys.error("unbalanced parentheses")
+ //else if (Character.isDigit(token.charAt(0)))
+ else if (token.charAt(0).isDigit)
+ token.toInt
+ else if (token.charAt(0) == '\"' && token.charAt(token.length()-1)=='\"')
+ token.substring(1,token.length() - 1)
+ else Symbol(token)
+ }
+ def parseList: List[Data] = {
+ val token = it.next;
+ if (token == ")") Nil else parse(token) :: parseList
+ }
+ parse(it.next)
+ }
+}
+
+//############################################################################
+// List User
+
+class LispUser(lisp: Lisp) {
+
+ import lisp._;
+
+ def evaluate(s: String) = lisp2string(lisp.evaluate(s));
+
+ def run = {
+
+ Console.println(string2lisp("(lambda (x) (+ (* x x) 1))").asInstanceOf[AnyRef]);
+ Console.println(lisp2string(string2lisp("(lambda (x) (+ (* x x) 1))")));
+ Console.println;
+
+ Console.println("( '(1 2 3)) = " + evaluate(" (quote(1 2 3))"));
+ Console.println("(car '(1 2 3)) = " + evaluate("(car (quote(1 2 3)))"));
+ Console.println("(cdr '(1 2 3)) = " + evaluate("(cdr (quote(1 2 3)))"));
+ Console.println("(null? '(2 3)) = " + evaluate("(null? (quote(2 3)))"));
+ Console.println("(null? '()) = " + evaluate("(null? (quote()))"));
+ Console.println;
+
+ Console.println("faculty(10) = " + evaluate(
+ "(def (faculty n) " +
+ "(if (= n 0) " +
+ "1 " +
+ "(* n (faculty (- n 1)))) " +
+ "(faculty 10))"));
+ Console.println("faculty(10) = " + evaluate(
+ "(def (faculty n) " +
+ "(cond " +
+ "((= n 0) 1) " +
+ "(else (* n (faculty (- n 1))))) " +
+ "(faculty 10))"));
+ Console.println("foobar = " + evaluate(
+ "(def (foo n) " +
+ "(cond " +
+ "((= n 0) \"a\")" +
+ "((= n 1) \"b\")" +
+ "((= (/ n 2) 1) " +
+ "(cond " +
+ "((= n 2) \"c\")" +
+ "(else \"d\")))" +
+ "(else " +
+ "(def (bar m) " +
+ "(cond " +
+ "((= m 0) \"e\")" +
+ "((= m 1) \"f\")" +
+ "(else \"z\"))" +
+ "(bar (- n 4)))))" +
+ "(val nil (quote ())" +
+ "(val v1 (foo 0) " +
+ "(val v2 (+ (foo 1) (foo 2)) " +
+ "(val v3 (+ (+ (foo 3) (foo 4)) (foo 5)) " +
+ "(val v4 (foo 6) " +
+ "(cons v1 (cons v2 (cons v3 (cons v4 nil))))))))))"));
+ Console.println;
+ }
+}
+
+//############################################################################
+// Main
+
+object Test {
+ def main(args: Array[String]) {
+ new LispUser(LispCaseClasses).run;
+ new LispUser(LispAny).run;
+ ()
+ }
+}
+
+//############################################################################
diff --git a/test/files/run/literals.scala b/test/files/run/literals.scala
index 13fda05876..a7962e5cd9 100644
--- a/test/files/run/literals.scala
+++ b/test/files/run/literals.scala
@@ -6,7 +6,7 @@
object Test {
- /* I add a couple of Unicode identifier tests here temporarily */
+ /* I add a couple of Unicode identifier tests here "temporarily" */
def \u03b1\u03c1\u03b5\u03c4\u03b7 = "alpha rho epsilon tau eta"
@@ -80,10 +80,17 @@ object Test {
check_success("1e1f == 10.0f", 1e1f, 10.0f)
check_success(".3f == 0.3f", .3f, 0.3f)
check_success("0f == 0.0f", 0f, 0.0f)
+ check_success("0f == -0.000000000000000000e+00f", 0f, -0.000000000000000000e+00f)
+ check_success("0f == -0.000000000000000000e+00F", 0f, -0.000000000000000000e+00F)
+ check_success("0f == -0.0000000000000000e14f", 0f, -0.0000000000000000e14f)
check_success("01.23f == 1.23f", 01.23f, 1.23f)
check_success("3.14f == 3.14f", 3.14f, 3.14f)
check_success("6.022e23f == 6.022e23f", 6.022e23f, 6.022e23f)
check_success("09f == 9.0f", 09f, 9.0f)
+ check_success("1.00000017881393421514957253748434595763683319091796875001f == 1.0000001f",
+ 1.00000017881393421514957253748434595763683319091796875001f,
+ 1.0000001f)
+ check_success("3.4028235E38f == Float.MaxValue", 3.4028235E38f, Float.MaxValue)
check_success("1.asInstanceOf[Float] == 1.0", 1.asInstanceOf[Float], 1.0f)
check_success("1l.asInstanceOf[Float] == 1.0", 1l.asInstanceOf[Float], 1.0f)
@@ -92,11 +99,17 @@ object Test {
check_success(".3 == 0.3", .3, 0.3)
check_success("0.0 == 0.0", 0.0, 0.0)
check_success("0d == 0.0", 0d, 0.0)
+ check_success("0d == 0.000000000000000000e+00d", 0d, 0.000000000000000000e+00d)
+ check_success("0d == -0.000000000000000000e+00d", 0d, -0.000000000000000000e+00d)
+ check_success("0d == -0.000000000000000000e+00D", 0d, -0.000000000000000000e+00D)
+ check_success("0.0 == 0.000000000000000000e+00", 0.0, 0.000000000000000000e+00)
+ check_success("0.0 == -0.000000000000000000e+00", 0.0, -0.000000000000000000e+00)
check_success("01.23 == 1.23", 01.23, 1.23)
check_success("01.23d == 1.23d", 01.23d, 1.23d)
check_success("3.14 == 3.14", 3.14, 3.14)
check_success("1e-9d == 1.0e-9", 1e-9d, 1.0e-9)
check_success("1e137 == 1.0e137", 1e137, 1.0e137)
+ check_success("1.7976931348623157e308d == Double.MaxValue", 1.7976931348623157e308d, Double.MaxValue)
check_success("1.asInstanceOf[Double] == 1.0", 1.asInstanceOf[Double], 1.0)
check_success("1l.asInstanceOf[Double] == 1.0", 1l.asInstanceOf[Double], 1.0)
diff --git a/test/files/run/local_obj.scala b/test/files/run/local_obj.scala
new file mode 100644
index 0000000000..25123f7078
--- /dev/null
+++ b/test/files/run/local_obj.scala
@@ -0,0 +1,9 @@
+class C {
+ val z = 2
+ def mod = { object x { val y = z } ; x.y }
+}
+
+object Test extends App {
+ val c = new C
+ assert(c.mod == c.z, s"${c.mod} != ${c.z}")
+}
diff --git a/test/files/run/lub-visibility.check b/test/files/run/lub-visibility.check
index 757f0f5917..61dca979a1 100644
--- a/test/files/run/lub-visibility.check
+++ b/test/files/run/lub-visibility.check
@@ -4,6 +4,6 @@ scala> // should infer List[scala.collection.immutable.Seq[Nothing]]
scala> // but reverted that for SI-5534.
scala> val x = List(List(), Vector())
-x: List[scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing] with java.io.Serializable] = List(List(), Vector())
+x: List[scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing] with Serializable] = List(List(), Vector())
scala> :quit
diff --git a/test/files/run/macro-duplicate.check b/test/files/run/macro-duplicate.check
index 58781b719a..7006b16611 100644
--- a/test/files/run/macro-duplicate.check
+++ b/test/files/run/macro-duplicate.check
@@ -1,3 +1,3 @@
-Test_2.scala:5: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+Test_2.scala:5: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
Macros.foo
^
diff --git a/test/files/run/macro-typecheck-implicitsdisabled.check b/test/files/run/macro-typecheck-implicitsdisabled.check
index 91d8fabd72..07404cf3fb 100644
--- a/test/files/run/macro-typecheck-implicitsdisabled.check
+++ b/test/files/run/macro-typecheck-implicitsdisabled.check
@@ -1,2 +1,2 @@
-scala.this.Predef.ArrowAssoc[Int](1).->[Int](2)
+scala.Predef.ArrowAssoc[Int](1).->[Int](2)
scala.reflect.macros.TypecheckException: value -> is not a member of Int
diff --git a/test/files/run/macroPlugins-enterStats.check b/test/files/run/macroPlugins-enterStats.check
index 133b1ae1af..182d54ca34 100644
--- a/test/files/run/macroPlugins-enterStats.check
+++ b/test/files/run/macroPlugins-enterStats.check
@@ -6,13 +6,13 @@ package <empty> {
()
};
def x: Int = 2;
- def xmacroPlugin1: Nothing = scala.this.Predef.???;
- def xmacroPlugin2: Nothing = scala.this.Predef.???;
- def xmacroPlugin2macroPlugin1: Nothing = scala.this.Predef.???;
+ def xmacroPlugin1: Nothing = scala.Predef.???;
+ def xmacroPlugin2: Nothing = scala.Predef.???;
+ def xmacroPlugin2macroPlugin1: Nothing = scala.Predef.???;
def y: Int = 3;
- def ymacroPlugin1: Nothing = scala.this.Predef.???;
- def ymacroPlugin2: Nothing = scala.this.Predef.???;
- def ymacroPlugin2macroPlugin1: Nothing = scala.this.Predef.???
+ def ymacroPlugin1: Nothing = scala.Predef.???;
+ def ymacroPlugin2: Nothing = scala.Predef.???;
+ def ymacroPlugin2macroPlugin1: Nothing = scala.Predef.???
}
}
diff --git a/test/files/run/macroPlugins-namerHooks.check b/test/files/run/macroPlugins-namerHooks.check
index c2db5935d4..4409f196f0 100644
--- a/test/files/run/macroPlugins-namerHooks.check
+++ b/test/files/run/macroPlugins-namerHooks.check
@@ -1,7 +1,7 @@
enterSym(package <empty> { case class C extends scala.Product with scala.Serializable { <caseaccessor> <paramaccessor> val x: Int = _; <caseaccessor> <paramaccessor> val y: Int = _; def <init>(x: Int, y: Int) = { super.<init>(); () } } })
enterSym(case class C extends scala.Product with scala.Serializable { <caseaccessor> <paramaccessor> val x: Int = _; <caseaccessor> <paramaccessor> val y: Int = _; def <init>(x: Int, y: Int) = { super.<init>(); () } })
ensureCompanionObject(case class C extends scala.Product with scala.Serializable { <caseaccessor> <paramaccessor> val x: Int = _; <caseaccessor> <paramaccessor> val y: Int = _; def <init>(x: Int, y: Int) = { super.<init>(); () } }, ...)
-enterSym(<synthetic> object C extends runtime.this.AbstractFunction2[Int, Int, C] { def <init>() = { super.<init>(); () }; final override <synthetic> def toString() = "C" })
+enterSym(<synthetic> object C extends scala.runtime.AbstractFunction2[Int, Int, C] { def <init>() = { super.<init>(); () }; final override <synthetic> def toString() = "C" })
enterStat(case class C extends scala.Product with scala.Serializable { <caseaccessor> <paramaccessor> val x: Int = _; <caseaccessor> <paramaccessor> val y: Int = _; def <init>(x: Int, y: Int) = { super.<init>(); () } })
enterSym(<caseaccessor> <paramaccessor> val x: Int = _)
enterSym(<caseaccessor> <paramaccessor> val y: Int = _)
@@ -18,17 +18,17 @@ enterStat(super.<init>())
enterSym(<synthetic> def copy$default$1 = x)
enterSym(<synthetic> def copy$default$2 = y)
enterSym(<synthetic> var acc: Int = -889275714)
-enterSym(acc = Statics.this.mix(acc, x))
-enterSym(acc = Statics.this.mix(acc, y))
+enterSym(acc = scala.runtime.Statics.mix(acc, x))
+enterSym(acc = scala.runtime.Statics.mix(acc, y))
enterStat(<synthetic> var acc: Int = -889275714)
-enterStat(acc = Statics.this.mix(acc, x))
-enterStat(acc = Statics.this.mix(acc, y))
+enterStat(acc = scala.runtime.Statics.mix(acc, x))
+enterStat(acc = scala.runtime.Statics.mix(acc, y))
enterSym(<synthetic> val C$1: C = x$1.asInstanceOf[C])
enterStat(<synthetic> val C$1: C = x$1.asInstanceOf[C])
enterSym(def <init>() = { super.<init>(); () })
enterSym(final override <synthetic> def toString() = "C")
enterSym(case <synthetic> def apply(x: Int, y: Int): C = new C(x, y))
-enterSym(case <synthetic> def unapply(x$0: C) = if (x$0.==(null)) scala.this.None else Some(scala.Tuple2(x$0.x, x$0.y)))
+enterSym(case <synthetic> def unapply(x$0: C): _root_.scala.Option[scala.Tuple2[Int, Int]] = if (x$0.==(null)) scala.None else Some(scala.Tuple2(x$0.x, x$0.y)))
enterStat(def <init>() = { super.<init>(); () })
enterStat(final override <synthetic> def toString() = "C")
enterSym(def <init>() = { super.<init>(); () })
diff --git a/test/files/run/mapConserve.scala b/test/files/run/mapConserve.scala
index c17754283a..95cad69954 100644
--- a/test/files/run/mapConserve.scala
+++ b/test/files/run/mapConserve.scala
@@ -1,5 +1,5 @@
/*
- * filter: inliner warnings; re-run with
+ * filter: inliner warning
*/
import scala.annotation.tailrec
import scala.collection.mutable.ListBuffer
diff --git a/test/files/run/map_java_conversions.scala b/test/files/run/map_java_conversions.scala
index c007b3e0eb..e287b0eb09 100644
--- a/test/files/run/map_java_conversions.scala
+++ b/test/files/run/map_java_conversions.scala
@@ -1,20 +1,16 @@
-
-
-
-
+import collection.convert.ImplicitConversionsToScala._
+import collection.JavaConverters._
object Test {
def main(args: Array[String]) {
- import collection.JavaConversions._
-
test(new java.util.HashMap[String, String])
test(new java.util.Properties)
testConcMap
}
def testConcMap {
- import collection.JavaConversions._
+ import collection.convert.ImplicitConversionsToScala._
val concMap = new java.util.concurrent.ConcurrentHashMap[String, String]
@@ -50,7 +46,6 @@ object Test {
for (i <- 0 until 10) m += (("key" + i, "value" + i))
for ((k, v) <- m) assert(k.startsWith("key"))
}
-
}
diff --git a/test/files/run/misc.check b/test/files/run/misc.check
index 56116f8104..075dfeff2f 100644
--- a/test/files/run/misc.check
+++ b/test/files/run/misc.check
@@ -1,25 +1,25 @@
-misc.scala:46: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+misc.scala:46: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
42;
^
-misc.scala:47: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+misc.scala:47: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
42l;
^
-misc.scala:48: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+misc.scala:48: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
23.5f;
^
-misc.scala:49: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+misc.scala:49: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
23.5;
^
-misc.scala:50: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+misc.scala:50: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
"Hello";
^
-misc.scala:51: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+misc.scala:51: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
32 + 45;
^
-misc.scala:62: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+misc.scala:62: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
x;
^
-misc.scala:74: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+misc.scala:74: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
1 < 2;
^
### Hello
diff --git a/test/files/run/mixin-signatures.check b/test/files/run/mixin-signatures.check
index 3031fe75af..77bff79ac8 100644
--- a/test/files/run/mixin-signatures.check
+++ b/test/files/run/mixin-signatures.check
@@ -48,12 +48,30 @@ class Test$bar5$ {
public java.lang.Object Test$bar5$.h(java.lang.Object)
}
-class Foo1$class {
- public static java.lang.String Foo1$class.f(Foo1,java.lang.Object)
+interface Foo1 {
+ public abstract java.lang.Object Base.f(java.lang.Object)
+ generic: public abstract R Base.f(T)
+ public default java.lang.String Foo1.f(java.lang.Object)
+ generic: public default java.lang.String Foo1.f(T)
+ public abstract java.lang.Object Base.g(java.lang.Object)
+ generic: public abstract R Base.g(T)
+ public abstract java.lang.String Foo1.g(java.lang.Object)
+ generic: public abstract java.lang.String Foo1.g(T)
+ public default java.lang.Object Base.h(java.lang.Object)
+ generic: public default R Base.h(T)
}
-class Foo2$class {
- public static java.lang.Object Foo2$class.f(Foo2,java.lang.String)
+interface Foo2 {
+ public abstract java.lang.Object Base.f(java.lang.Object)
+ generic: public abstract R Base.f(T)
+ public default java.lang.Object Foo2.f(java.lang.String)
+ generic: public default R Foo2.f(java.lang.String)
+ public abstract java.lang.Object Base.g(java.lang.Object)
+ generic: public abstract R Base.g(T)
+ public abstract java.lang.Object Foo2.g(java.lang.String)
+ generic: public abstract R Foo2.g(java.lang.String)
+ public default java.lang.Object Base.h(java.lang.Object)
+ generic: public default R Base.h(T)
}
000000000000000000000000000000000000
diff --git a/test/files/run/mixin-signatures.scala b/test/files/run/mixin-signatures.scala
index afd3fad877..0f6d0844d8 100644
--- a/test/files/run/mixin-signatures.scala
+++ b/test/files/run/mixin-signatures.scala
@@ -99,7 +99,7 @@ object Test {
def main(args: Array[String]): Unit = {
List(bar1, bar2, bar3, bar4, bar5) foreach show
- List("Foo1$class", "Foo2$class") foreach show
+ List("Foo1", "Foo2") foreach show
println(go)
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/names-defaults.check b/test/files/run/names-defaults.check
index c358dc5849..722d28dd11 100644
--- a/test/files/run/names-defaults.check
+++ b/test/files/run/names-defaults.check
@@ -1,4 +1,7 @@
-names-defaults.scala:269: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+names-defaults.scala:269: warning: a pure expression does nothing in statement position
+ spawn(b = { val ttt = 1; ttt }, a = 0)
+ ^
+names-defaults.scala:269: warning: multiline expressions might require enclosing parentheses; a value can be silently discarded when Unit is expected
spawn(b = { val ttt = 1; ttt }, a = 0)
^
warning: there were four deprecation warnings; re-run with -deprecation for details
diff --git a/test/files/run/noInlineUnknownIndy.check b/test/files/run/noInlineUnknownIndy.check
new file mode 100644
index 0000000000..7cc6d1b675
--- /dev/null
+++ b/test/files/run/noInlineUnknownIndy.check
@@ -0,0 +1,13 @@
+newSource1.scala:1: warning: A_1::test()Ljava/lang/String; could not be inlined:
+Failed to check if A_1::test()Ljava/lang/String; can be safely inlined to T without causing an IllegalAccessError. Checking instruction INVOKEDYNAMIC m()LA_1$Fun; [
+ // handle kind 0x6 : INVOKESTATIC
+ not/java/lang/SomeLambdaMetafactory.notAMetaFactoryMethod(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;
+ // arguments:
+ (Ljava/lang/String;)Ljava/lang/String;,
+ // handle kind 0x6 : INVOKESTATIC
+ A_1.lambda$test$0(Ljava/lang/String;)Ljava/lang/String;,
+ (Ljava/lang/String;)Ljava/lang/String;
+ ] failed:
+The callee contains an InvokeDynamic instruction with an unknown bootstrap method (not a LambdaMetaFactory).
+class T { def foo = A_1.test }
+ ^
diff --git a/test/files/run/noInlineUnknownIndy/A_1.java b/test/files/run/noInlineUnknownIndy/A_1.java
new file mode 100644
index 0000000000..a9144a9fa6
--- /dev/null
+++ b/test/files/run/noInlineUnknownIndy/A_1.java
@@ -0,0 +1,9 @@
+public class A_1 {
+ interface Fun {
+ String m(String s);
+ }
+ public static final String test() {
+ Fun f = s -> s.trim();
+ return f.m(" eh ");
+ }
+}
diff --git a/test/files/run/noInlineUnknownIndy/Test.scala b/test/files/run/noInlineUnknownIndy/Test.scala
new file mode 100644
index 0000000000..a666146f15
--- /dev/null
+++ b/test/files/run/noInlineUnknownIndy/Test.scala
@@ -0,0 +1,33 @@
+import java.io.File
+
+import scala.collection.JavaConverters._
+import scala.tools.asm.tree.{ClassNode, InvokeDynamicInsnNode}
+import scala.tools.asm.{Handle, Opcodes}
+import scala.tools.partest.BytecodeTest.modifyClassFile
+import scala.tools.partest._
+
+object Test extends DirectTest {
+ def code = ???
+
+ def compileCode(code: String) = {
+ val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator")
+ compileString(newCompiler("-cp", classpath, "-d", testOutput.path, "-opt:l:classpath", "-Yopt-inline-heuristics:everything", "-opt-warnings:_"))(code)
+ }
+
+ def show(): Unit = {
+ val unknownBootstrapMethod = new Handle(
+ Opcodes.H_INVOKESTATIC,
+ "not/java/lang/SomeLambdaMetafactory",
+ "notAMetaFactoryMethod",
+ "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;",
+ /* itf = */ false)
+ modifyClassFile(new File(testOutput.toFile, "A_1.class"))((cn: ClassNode) => {
+ val testMethod = cn.methods.iterator.asScala.find(_.name == "test").head
+ val indy = testMethod.instructions.iterator.asScala.collect({ case i: InvokeDynamicInsnNode => i }).next()
+ indy.bsm = unknownBootstrapMethod
+ cn
+ })
+
+ compileCode("class T { def foo = A_1.test }")
+ }
+}
diff --git a/test/files/run/nothingTypeDce.flags b/test/files/run/nothingTypeDce.flags
index d85321ca0e..475f6db67c 100644
--- a/test/files/run/nothingTypeDce.flags
+++ b/test/files/run/nothingTypeDce.flags
@@ -1 +1 @@
--target:jvm-1.6 -Ybackend:GenBCode -Yopt:unreachable-code
+-opt:unreachable-code
diff --git a/test/files/run/nothingTypeDce.scala b/test/files/run/nothingTypeDce.scala
index 5f3692fd33..cb1e59e45c 100644
--- a/test/files/run/nothingTypeDce.scala
+++ b/test/files/run/nothingTypeDce.scala
@@ -1,7 +1,6 @@
// See comment in BCodeBodyBuilder
-// -target:jvm-1.6 -Ybackend:GenBCode -Yopt:unreachable-code
-// target enables stack map frames generation
+// -opt:unreachable-code
class C {
// can't just emit a call to ???, that returns value of type Nothing$ (not Int).
diff --git a/test/files/run/nothingTypeNoFramesNoDce.check b/test/files/run/nothingTypeNoFramesNoDce.check
deleted file mode 100644
index b1d08b45ff..0000000000
--- a/test/files/run/nothingTypeNoFramesNoDce.check
+++ /dev/null
@@ -1 +0,0 @@
-warning: -target:jvm-1.5 is deprecated: use target for Java 1.6 or above.
diff --git a/test/files/run/nothingTypeNoFramesNoDce.flags b/test/files/run/nothingTypeNoFramesNoDce.flags
deleted file mode 100644
index a035c86179..0000000000
--- a/test/files/run/nothingTypeNoFramesNoDce.flags
+++ /dev/null
@@ -1 +0,0 @@
--target:jvm-1.5 -Ybackend:GenBCode -Yopt:l:none -deprecation
diff --git a/test/files/run/nothingTypeNoFramesNoDce.scala b/test/files/run/nothingTypeNoFramesNoDce.scala
deleted file mode 100644
index 7f63faeaa7..0000000000
--- a/test/files/run/nothingTypeNoFramesNoDce.scala
+++ /dev/null
@@ -1,61 +0,0 @@
-// See comment in BCodeBodyBuilder
-
-// -target:jvm-1.5 -Ybackend:GenBCode -Yopt:l:none
-// target disables stack map frame generation. in this mode, the ClssWriter just emits dead code as is.
-
-class C {
- // can't just emit a call to ???, that returns value of type Nothing$ (not Int).
- def f1: Int = ???
-
- def f2: Int = throw new Error("")
-
- def f3(x: Boolean) = {
- var y = 0
- // cannot assign an object of type Nothing$ to Int
- if (x) y = ???
- else y = 1
- y
- }
-
- def f4(x: Boolean) = {
- var y = 0
- // tests that whatever is emitted after the throw is valid (what? depends on opts, presence of stack map frames)
- if (x) y = throw new Error("")
- else y = 1
- y
- }
-
- def f5(x: Boolean) = {
- // stack heights need to be the same. ??? looks to the jvm like returning a value of
- // type Nothing$, need to drop or throw it.
- println(
- if (x) { ???; 10 }
- else 20
- )
- }
-
- def f6(x: Boolean) = {
- println(
- if (x) { throw new Error(""); 10 }
- else 20
- )
- }
-
- def f7(x: Boolean) = {
- println(
- if (x) throw new Error("")
- else 20
- )
- }
-
- def f8(x: Boolean) = {
- println(
- if (x) throw new Error("")
- else 20
- )
- }
-}
-
-object Test extends App {
- new C()
-}
diff --git a/test/files/run/nothingTypeNoOpt.flags b/test/files/run/nothingTypeNoOpt.flags
index b3b518051b..213d7425d1 100644
--- a/test/files/run/nothingTypeNoOpt.flags
+++ b/test/files/run/nothingTypeNoOpt.flags
@@ -1 +1 @@
--target:jvm-1.6 -Ybackend:GenBCode -Yopt:l:none
+-opt:l:none
diff --git a/test/files/run/nothingTypeNoOpt.scala b/test/files/run/nothingTypeNoOpt.scala
index 454539a4b1..cc68364bf9 100644
--- a/test/files/run/nothingTypeNoOpt.scala
+++ b/test/files/run/nothingTypeNoOpt.scala
@@ -1,6 +1,6 @@
// See comment in BCodeBodyBuilder
-// -target:jvm-1.6 -Ybackend:GenBCode -Yopt:l:none
+// -target:jvm-1.6 -opt:l:none
// target enables stack map frame generation
class C {
diff --git a/test/files/run/number-parsing.scala b/test/files/run/number-parsing.scala
index ad1481063e..5627ee9006 100644
--- a/test/files/run/number-parsing.scala
+++ b/test/files/run/number-parsing.scala
@@ -3,8 +3,8 @@ object Test {
val MinusZero = Float.box(-0.0f)
val PlusZero = Float.box(0.0f)
- assert(PlusZero match { case MinusZero => false ; case _ => true })
- assert(MinusZero match { case PlusZero => false ; case _ => true })
+ assert(PlusZero match { case MinusZero => true ; case _ => false })
+ assert(MinusZero match { case PlusZero => true ; case _ => false })
assert((MinusZero: scala.Float) == (PlusZero: scala.Float))
assert(!(MinusZero equals PlusZero))
diff --git a/test/files/run/numbereq.scala b/test/files/run/numbereq.scala
index 7ce4b23cf8..1f12d0643e 100644
--- a/test/files/run/numbereq.scala
+++ b/test/files/run/numbereq.scala
@@ -1,6 +1,7 @@
object Test {
def mkNumbers(x: Int): List[AnyRef] = {
- val base = List(
+ //Use explicit AnyRef to workaround known limitation of type inference with F-Bounds
+ val base = List[AnyRef](
BigDecimal(x),
BigInt(x),
new java.lang.Double(x.toDouble),
diff --git a/test/files/run/optimizer-array-load.flags b/test/files/run/optimizer-array-load.flags
deleted file mode 100644
index eb4d19bcb9..0000000000
--- a/test/files/run/optimizer-array-load.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimise \ No newline at end of file
diff --git a/test/files/run/origins.check b/test/files/run/origins.check
deleted file mode 100644
index b12cb6e38f..0000000000
--- a/test/files/run/origins.check
+++ /dev/null
@@ -1,6 +0,0 @@
-
->> Origins tag 'boop' logged 65 calls from 3 distinguished sources.
-
- 50 Test$$anonfun$f3$1.apply(origins.scala:16)
- 10 Test$$anonfun$f2$1.apply(origins.scala:15)
- 5 Test$$anonfun$f1$1.apply(origins.scala:14)
diff --git a/test/files/run/origins.flags b/test/files/run/origins.flags
deleted file mode 100644
index 690753d807..0000000000
--- a/test/files/run/origins.flags
+++ /dev/null
@@ -1 +0,0 @@
--no-specialization -Ydelambdafy:inline \ No newline at end of file
diff --git a/test/files/run/origins.scala b/test/files/run/origins.scala
deleted file mode 100644
index 6529351d3c..0000000000
--- a/test/files/run/origins.scala
+++ /dev/null
@@ -1,21 +0,0 @@
-import scala.reflect.internal.util.Origins
-
-package goxbox {
- object Socks {
- val origins = Origins("boop")
-
- def boop(x: Int): Int = origins { 5 }
- }
-}
-
-object Test {
- import goxbox.Socks.boop
-
- def f1() = 1 to 5 map boop
- def f2() = 1 to 10 map boop
- def f3() = 1 to 50 map boop
-
- def main(args: Array[String]): Unit = {
- f1() ; f2() ; f3()
- }
-}
diff --git a/test/files/run/patmat-exprs.scala b/test/files/run/patmat-exprs.scala
index 7ca5fd3063..d18df9c714 100644
--- a/test/files/run/patmat-exprs.scala
+++ b/test/files/run/patmat-exprs.scala
@@ -344,13 +344,13 @@ trait Pattern {
}
- case class Zero[T] (implicit num: NumericOps[T]) extends Leaf[T] {
+ case class Zero[T]()(implicit num: NumericOps[T]) extends Leaf[T] {
def derivative(variable: Var[T]) = Zero[T]
def eval(f: Any => Any) = num.zero
override def toString = "0"
}
- case class One[T] (implicit num: NumericOps[T]) extends Leaf[T] {
+ case class One[T]()(implicit num: NumericOps[T]) extends Leaf[T] {
def derivative(variable: Var[T]) = Zero[T]
def eval(f: Any => Any) = num.one
override def toString = "1"
diff --git a/test/files/run/patmatnew.check b/test/files/run/patmatnew.check
index 56b8ac2f4f..117bc28c2d 100644
--- a/test/files/run/patmatnew.check
+++ b/test/files/run/patmatnew.check
@@ -1,10 +1,16 @@
-patmatnew.scala:351: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+patmatnew.scala:351: warning: a pure expression does nothing in statement position
case 1 => "OK"
^
-patmatnew.scala:352: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+patmatnew.scala:352: warning: a pure expression does nothing in statement position
case 2 => assert(false); "KO"
^
-patmatnew.scala:353: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+patmatnew.scala:352: warning: multiline expressions might require enclosing parentheses; a value can be silently discarded when Unit is expected
+ case 2 => assert(false); "KO"
+ ^
+patmatnew.scala:353: warning: a pure expression does nothing in statement position
+ case 3 => assert(false); "KO"
+ ^
+patmatnew.scala:353: warning: multiline expressions might require enclosing parentheses; a value can be silently discarded when Unit is expected
case 3 => assert(false); "KO"
^
patmatnew.scala:670: warning: This catches all Throwables. If this is really intended, use `case e : Throwable` to clear this warning.
diff --git a/test/files/run/patmatnew.scala b/test/files/run/patmatnew.scala
index 3c0d00dc6c..2647d97836 100644
--- a/test/files/run/patmatnew.scala
+++ b/test/files/run/patmatnew.scala
@@ -539,7 +539,7 @@ object Test {
case class Operator(x: Int);
val EQ = new Operator(2);
- def analyze(x: Tuple2[Operator, Int]) = x match {
+ def analyze(x: Tuple2[Operator, Int]) = (x: @unchecked) match {
case (EQ, 0) => "0"
case (EQ, 1) => "1"
case (EQ, 2) => "2"
@@ -603,7 +603,7 @@ object Test {
object Bug1093 {
def run() {
- assert(Some(3) match {
+ assert((Some(3): @unchecked) match {
case Some(1 | 2) => false
case Some(3) => true
})
diff --git a/test/files/run/private-inline.check b/test/files/run/private-inline.check
deleted file mode 100644
index e71aec2fcf..0000000000
--- a/test/files/run/private-inline.check
+++ /dev/null
@@ -1,13 +0,0 @@
-private-inline.scala:24: warning: Could not inline required method wrapper1 because callee contains exception handlers / finally clause, and is invoked with non-empty operand stack.
- def f1b() = identity(wrapper1(5))
- ^
-private-inline.scala:24: warning: At the end of the day, could not inline @inline-marked method wrapper1
- def f1b() = identity(wrapper1(5))
- ^
-private-inline.scala:29: warning: Could not inline required method wrapper2 because callee contains exception handlers / finally clause, and is invoked with non-empty operand stack.
- def f2b() = identity(wrapper2(5))
- ^
-private-inline.scala:29: warning: At the end of the day, could not inline @inline-marked method wrapper2
- def f2b() = identity(wrapper2(5))
- ^
-20
diff --git a/test/files/run/private-inline.flags b/test/files/run/private-inline.flags
deleted file mode 100644
index c550fdce16..0000000000
--- a/test/files/run/private-inline.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimise -Yinline-warnings -Ybackend:GenASM
diff --git a/test/files/run/private-inline.scala b/test/files/run/private-inline.scala
deleted file mode 100644
index 60fef9efca..0000000000
--- a/test/files/run/private-inline.scala
+++ /dev/null
@@ -1,52 +0,0 @@
-
-final class A {
- private var x1 = false
- var x2 = false
-
- // manipulates private var
- @inline private def wrapper1[T](body: => T): T = {
- val saved = x1
- x1 = true
- try body
- finally x1 = saved
- }
- // manipulates public var
- @inline private def wrapper2[T](body: => T): T = {
- val saved = x2
- x2 = true
- try body
- finally x2 = saved
- }
-
- // not inlined
- def f1a() = wrapper1(5)
- // inlined!
- def f1b() = identity(wrapper1(5))
-
- // not inlined
- def f2a() = wrapper2(5)
- // inlined!
- def f2b() = identity(wrapper2(5))
-}
-
-object Test {
- def methodClasses = List("f1a", "f2a") map ("A$$anonfun$" + _ + "$1")
-
- def main(args: Array[String]): Unit = {
- val a = new A
- import a._
- println(f1a() + f1b() + f2a() + f2b())
-
- // Don't know how else to test this: all these should have been
- // inlined, so all should fail.
- methodClasses foreach { clazz =>
-
- val foundClass = (
- try Class.forName(clazz)
- catch { case _: Throwable => null }
- )
-
- assert(foundClass == null, foundClass)
- }
- }
-}
diff --git a/test/files/run/programmatic-main.check b/test/files/run/programmatic-main.check
index 1cd94ccb45..373f63e5b2 100644
--- a/test/files/run/programmatic-main.check
+++ b/test/files/run/programmatic-main.check
@@ -10,18 +10,17 @@ superaccessors 6 add super accessors in traits and nested classes
pickler 8 serialize symbol tables
refchecks 9 reference/override checking, translate nested objects
uncurry 10 uncurry, translate function values to anonymous classes
- tailcalls 11 replace tail calls by jumps
- specialize 12 @specialized-driven class and method specialization
- explicitouter 13 this refs to outer pointers
- erasure 14 erase types, add interfaces for traits
- posterasure 15 clean up erased inline classes
- lazyvals 16 allocate bitmaps, translate lazy vals into lazified defs
+ fields 11 synthesize accessors and fields, add bitmaps for lazy vals
+ tailcalls 12 replace tail calls by jumps
+ specialize 13 @specialized-driven class and method specialization
+ explicitouter 14 this refs to outer pointers
+ erasure 15 erase types, add interfaces for traits
+ posterasure 16 clean up erased inline classes
lambdalift 17 move nested functions to top level
constructors 18 move field definitions into constructors
flatten 19 eliminate inner classes
mixin 20 mixin composition
cleanup 21 platform-specific cleanups, generate reflective calls
delambdafy 22 remove lambdas
- icode 23 generate portable intermediate code
- jvm 24 generate JVM bytecode
- terminal 25 the last phase during a compilation run
+ jvm 23 generate JVM bytecode
+ terminal 24 the last phase during a compilation run
diff --git a/test/files/run/reflection-attachments.check b/test/files/run/reflection-attachments.check
deleted file mode 100644
index e69de29bb2..0000000000
--- a/test/files/run/reflection-attachments.check
+++ /dev/null
diff --git a/test/files/run/reflection-fieldsymbol-navigation.check b/test/files/run/reflection-fieldsymbol-navigation.check
index ae0597a045..fd06c78a18 100644
--- a/test/files/run/reflection-fieldsymbol-navigation.check
+++ b/test/files/run/reflection-fieldsymbol-navigation.check
@@ -1,6 +1,6 @@
-method x
+variable x
false
variable x
true
-method x
-method x_=
+variable x
+variable x
diff --git a/test/files/run/reflection-implClass.scala b/test/files/run/reflection-implClass.scala
deleted file mode 100644
index 4242530dd1..0000000000
--- a/test/files/run/reflection-implClass.scala
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Tries to load a symbol for the `Foo$class` using Scala reflection.
- * Since trait implementation classes do not get pickling information
- * symbol for them should be created using fallback mechanism
- * that exposes Java reflection information dressed up in
- * a Scala symbol.
- */
-object Test extends App with Outer {
- import scala.reflect.{ClassTag, classTag}
- import scala.reflect.runtime.universe._
- import scala.reflect.runtime.{currentMirror => cm}
-
- assert(cm.classSymbol(classTag[Foo].runtimeClass).info.decl(TermName("bar")).info ==
- cm.classSymbol(classTag[Bar].runtimeClass).info.decl(TermName("foo")).info)
-
- val s1 = implClass(classTag[Foo].runtimeClass)
- assert(s1 != NoSymbol)
- assert(s1.info != NoType)
- assert(s1.companion.info != NoType)
- assert(s1.companion.info.decl(TermName("bar")) != NoSymbol)
- val s2 = implClass(classTag[Bar].runtimeClass)
- assert(s2 != NoSymbol)
- assert(s2.info != NoType)
- assert(s2.companion.info != NoType)
- assert(s2.companion.info.decl(TermName("foo")) != NoSymbol)
- def implClass(clazz: Class[_]) = {
- val implClass = Class.forName(clazz.getName + "$class")
- cm.classSymbol(implClass)
- }
-}
-
-trait Foo {
- def bar = 1
-}
-
-trait Outer {
- trait Bar {
- def foo = 1
- }
-}
diff --git a/test/files/run/reflection-java-annotations.check b/test/files/run/reflection-java-annotations.check
index 842037254e..4c20727ea8 100644
--- a/test/files/run/reflection-java-annotations.check
+++ b/test/files/run/reflection-java-annotations.check
@@ -1,4 +1,3 @@
-warning: there was one deprecation warning; re-run with -deprecation for details
-List(JavaComplexAnnotation_1(v1 = 1, v10 = "hello", v101 = [101, 101], v102 = [102, 102], v103 = ['g', 'g'], v104 = [104, 104], v105 = [105L, 105L], v106 = [106.0, 106.0], v107 = [107.0, 107.0], v108 = [false, true], v11 = classOf[JavaAnnottee_1], v110 = ["hello", "world"], v111 = [classOf[JavaSimpleAnnotation_1], classOf[JavaComplexAnnotation_1]], v112 = [FOO, BAR], v113 = [JavaSimpleAnnotation_1(v1 = 21, v10 = "world2", v11 = classOf[JavaComplexAnnotation_1], v12 = BAR, v2 = 22, v3 = '\027', v4 = 24, v5 = 25L, v6 = 26.0, v7 = 27.0, v8 = false)], v12 = FOO, v13 = JavaSimpleAnnotation_1(v1 = 11, v10 = "world1", v11 = classOf[JavaSimpleAnnotation_1], v12 = FOO, v2 = 12, v3 = '\r', v4 = 14, v5 = 15L, v6 = 16.0, v7 = 17.0, v8 = false), v2 = 2, v3 = '\03', v4 = 4, v5 = 5L, v6 = 6.0, v7 = 7.0, v8 = false))
+List(JavaComplexAnnotation_1(v1 = 1, v10 = "hello", v101 = [101, 101], v102 = [102, 102], v103 = ['g', 'g'], v104 = [104, 104], v105 = [105L, 105L], v106 = [106.0, 106.0], v107 = [107.0, 107.0], v108 = [false, true], v11 = classOf[JavaAnnottee_1], v110 = ["hello", "world"], v111 = [classOf[JavaSimpleAnnotation_1], classOf[JavaComplexAnnotation_1]], v112 = [FOO, BAR], v113 = [JavaSimpleAnnotation_1(v1 = 21, v10 = "world2", v11 = classOf[JavaComplexAnnotation_1], v12 = BAR, v2 = 22, v3 = '\u0017', v4 = 24, v5 = 25L, v6 = 26.0, v7 = 27.0, v8 = false)], v12 = FOO, v13 = JavaSimpleAnnotation_1(v1 = 11, v10 = "world1", v11 = classOf[JavaSimpleAnnotation_1], v12 = FOO, v2 = 12, v3 = '\r', v4 = 14, v5 = 15L, v6 = 16.0, v7 = 17.0, v8 = false), v2 = 2, v3 = '\u0003', v4 = 4, v5 = 5L, v6 = 6.0, v7 = 7.0, v8 = false))
=======
-new JavaComplexAnnotation_1(v1 = 1, v10 = "hello", v101 = Array(101, 101), v102 = Array(102, 102), v103 = Array('g', 'g'), v104 = Array(104, 104), v105 = Array(105L, 105L), v106 = Array(106.0, 106.0), v107 = Array(107.0, 107.0), v108 = Array(false, true), v11 = classOf[JavaAnnottee_1], v110 = Array("hello", "world"), v111 = Array(classOf[JavaSimpleAnnotation_1], classOf[JavaComplexAnnotation_1]), v112 = Array(FOO, BAR), v113 = Array(new JavaSimpleAnnotation_1(v1 = 21, v10 = "world2", v11 = classOf[JavaComplexAnnotation_1], v12 = BAR, v2 = 22, v3 = '\027', v4 = 24, v5 = 25L, v6 = 26.0, v7 = 27.0, v8 = false)), v12 = FOO, v13 = new JavaSimpleAnnotation_1(v1 = 11, v10 = "world1", v11 = classOf[JavaSimpleAnnotation_1], v12 = FOO, v2 = 12, v3 = '\r', v4 = 14, v5 = 15L, v6 = 16.0, v7 = 17.0, v8 = false), v2 = 2, v3 = '\03', v4 = 4, v5 = 5L, v6 = 6.0, v7 = 7.0, v8 = false)
+new JavaComplexAnnotation_1(v1 = 1, v10 = "hello", v101 = Array(101, 101), v102 = Array(102, 102), v103 = Array('g', 'g'), v104 = Array(104, 104), v105 = Array(105L, 105L), v106 = Array(106.0, 106.0), v107 = Array(107.0, 107.0), v108 = Array(false, true), v11 = classOf[JavaAnnottee_1], v110 = Array("hello", "world"), v111 = Array(classOf[JavaSimpleAnnotation_1], classOf[JavaComplexAnnotation_1]), v112 = Array(FOO, BAR), v113 = Array(new JavaSimpleAnnotation_1(v1 = 21, v10 = "world2", v11 = classOf[JavaComplexAnnotation_1], v12 = BAR, v2 = 22, v3 = '\u0017', v4 = 24, v5 = 25L, v6 = 26.0, v7 = 27.0, v8 = false)), v12 = FOO, v13 = new JavaSimpleAnnotation_1(v1 = 11, v10 = "world1", v11 = classOf[JavaSimpleAnnotation_1], v12 = FOO, v2 = 12, v3 = '\r', v4 = 14, v5 = 15L, v6 = 16.0, v7 = 17.0, v8 = false), v2 = 2, v3 = '\u0003', v4 = 4, v5 = 5L, v6 = 6.0, v7 = 7.0, v8 = false)
diff --git a/test/files/run/reflection-java-annotations/Test_2.scala b/test/files/run/reflection-java-annotations/Test_2.scala
index dec5b45ca7..6d457ebe64 100644
--- a/test/files/run/reflection-java-annotations/Test_2.scala
+++ b/test/files/run/reflection-java-annotations/Test_2.scala
@@ -2,8 +2,8 @@ object Test extends App {
import scala.reflect.runtime.universe._
val sym = typeOf[JavaAnnottee_1].typeSymbol
sym.info
- sym.annotations foreach (_.javaArgs)
+ sym.annotations foreach (_.tree.children.tail)
println(sym.annotations)
println("=======")
sym.annotations.map(_.tree).map(println)
-} \ No newline at end of file
+}
diff --git a/test/files/run/reflection-magicsymbols-repl.check b/test/files/run/reflection-magicsymbols-repl.check
index dd26c08349..a33f41012e 100644
--- a/test/files/run/reflection-magicsymbols-repl.check
+++ b/test/files/run/reflection-magicsymbols-repl.check
@@ -19,7 +19,7 @@ scala> def test(n: Int): Unit = {
val x = sig.asInstanceOf[MethodType].params.head
println(x.info)
}
-warning: there was one feature warning; re-run with -feature for details
+warning: there was one feature warning; for details, enable `:setting -feature' or `:replay -feature'
test: (n: Int)Unit
scala> for (i <- 1 to 8) test(i)
diff --git a/test/files/run/reflection-scala-annotations.check b/test/files/run/reflection-scala-annotations.check
index 5bc2786161..44062d8c4a 100644
--- a/test/files/run/reflection-scala-annotations.check
+++ b/test/files/run/reflection-scala-annotations.check
@@ -3,5 +3,5 @@ make your annotation visible at runtime. If that is what
you want, you must write the annotation class in Java.
class jann(x: Int, y: Array[Int]) extends ClassfileAnnotation
^
-new sann(1, immutable.this.List.apply[Int](1, 2))
+new sann(1, scala.collection.immutable.List.apply[Int](1, 2))
new jann(y = Array(1, 2), x = 2)
diff --git a/test/files/run/reify-aliases.check b/test/files/run/reify-aliases.check
index da784227af..b6b5fb71b2 100644
--- a/test/files/run/reify-aliases.check
+++ b/test/files/run/reify-aliases.check
@@ -1 +1 @@
-TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List())
+TypeRef(SingleType(TypeRef(ThisType(<root>), scala, List()), scala.Predef), TypeName("String"), List())
diff --git a/test/files/run/reify_lazyunit.check b/test/files/run/reify_lazyunit.check
index 579ecfe8aa..e6acf5d17b 100644
--- a/test/files/run/reify_lazyunit.check
+++ b/test/files/run/reify_lazyunit.check
@@ -1,4 +1,4 @@
-reify_lazyunit.scala:6: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+reify_lazyunit.scala:6: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
lazy val x = { 0; println("12")}
^
12
diff --git a/test/files/run/reify_printf.scala b/test/files/run/reify_printf.scala
index c4ade79837..099a353e89 100644
--- a/test/files/run/reify_printf.scala
+++ b/test/files/run/reify_printf.scala
@@ -6,7 +6,6 @@ import scala.tools.reflect.ToolBox
import scala.reflect.api._
import scala.reflect.api.Trees
import scala.reflect.internal.Types
-import scala.util.matching.Regex
object Test extends App {
//val output = new ByteArrayOutputStream()
diff --git a/test/files/run/repl-bare-expr.check b/test/files/run/repl-bare-expr.check
index e0a1f4ecd6..bdf8842bb0 100644
--- a/test/files/run/repl-bare-expr.check
+++ b/test/files/run/repl-bare-expr.check
@@ -1,12 +1,12 @@
scala> 2 ; 3
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
2 ;;
^
res0: Int = 3
scala> { 2 ; 3 }
-<console>:12: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:12: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
{ 2 ; 3 }
^
res1: Int = 3
@@ -15,16 +15,16 @@ scala> 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Mooo
1 +
2 +
3 } ; bippy+88+11
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
^
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
^
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
^
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
^
defined object Cow
diff --git a/test/files/run/repl-colon-type.check b/test/files/run/repl-colon-type.check
index 21fbe34d96..1217e8d8c2 100644
--- a/test/files/run/repl-colon-type.check
+++ b/test/files/run/repl-colon-type.check
@@ -35,7 +35,7 @@ Int
scala> :type protected lazy val f = 5
<console>:5: error: lazy value f cannot be accessed in object $iw
- Access to protected value f not permitted because
+ Access to protected lazy value f not permitted because
enclosing object $eval in package $line13 is not a subclass of
object $iw where target is defined
lazy val $result = f
diff --git a/test/files/run/repl-implicits-nopredef.check b/test/files/run/repl-implicits-nopredef.check
new file mode 100644
index 0000000000..a849801bb4
--- /dev/null
+++ b/test/files/run/repl-implicits-nopredef.check
@@ -0,0 +1,5 @@
+
+scala> :implicits
+No implicits have been imported.
+
+scala> :quit \ No newline at end of file
diff --git a/test/files/run/repl-implicits-nopredef.scala b/test/files/run/repl-implicits-nopredef.scala
new file mode 100644
index 0000000000..8a451b0c52
--- /dev/null
+++ b/test/files/run/repl-implicits-nopredef.scala
@@ -0,0 +1,10 @@
+import scala.tools.partest.ReplTest
+import scala.tools.nsc.Settings
+
+object Test extends ReplTest {
+ override def transformSettings(settings: Settings): Settings = {
+ settings.nopredef.value = true
+ settings
+ }
+ def code = ":implicits"
+}
diff --git a/test/files/run/repl-implicits.check b/test/files/run/repl-implicits.check
new file mode 100644
index 0000000000..6e80cc8799
--- /dev/null
+++ b/test/files/run/repl-implicits.check
@@ -0,0 +1,5 @@
+
+scala> :implicits
+No implicits have been imported other than those in Predef.
+
+scala> :quit \ No newline at end of file
diff --git a/test/files/run/repl-implicits.scala b/test/files/run/repl-implicits.scala
new file mode 100644
index 0000000000..ca8e16e683
--- /dev/null
+++ b/test/files/run/repl-implicits.scala
@@ -0,0 +1,5 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ def code = ":implicits"
+}
diff --git a/test/files/run/repl-inline.check b/test/files/run/repl-inline.check
new file mode 100644
index 0000000000..db729a67dd
--- /dev/null
+++ b/test/files/run/repl-inline.check
@@ -0,0 +1,11 @@
+warning: there was one deprecation warning (since 2.11.0); re-run with -deprecation for details
+callerOfCaller: String
+g: String
+h: String
+g: String
+h: String
+callerOfCaller: String
+g: String
+h: String
+g: String
+h: String
diff --git a/test/files/run/repl-inline.scala b/test/files/run/repl-inline.scala
new file mode 100644
index 0000000000..260ed28a4f
--- /dev/null
+++ b/test/files/run/repl-inline.scala
@@ -0,0 +1,27 @@
+import scala.tools.nsc._
+
+object Test {
+ val testCode =
+ """
+def callerOfCaller = Thread.currentThread.getStackTrace.drop(2).head.getMethodName
+def g = callerOfCaller
+def h = g
+assert(h == "g", h)
+@inline def g = callerOfCaller
+def h = g
+assert(h == "h", h)
+ """
+
+ def main(args: Array[String]) {
+ def test(f: Settings => Unit): Unit = {
+ val settings = new Settings()
+ settings.processArgumentString("-opt:l:classpath")
+ f(settings)
+ settings.usejavacp.value = true
+ val repl = new interpreter.IMain(settings)
+ testCode.linesIterator.foreach(repl.interpret(_))
+ }
+ test(_ => ())
+ test(_.Yreplclassbased.value = true)
+ }
+}
diff --git a/test/files/run/repl-javap-app.check b/test/files/run/repl-javap-app.check
deleted file mode 100644
index e69de29bb2..0000000000
--- a/test/files/run/repl-javap-app.check
+++ /dev/null
diff --git a/test/files/run/repl-javap-app.scala b/test/files/run/repl-javap-app.scala
deleted file mode 100644
index f7e3baa2a1..0000000000
--- a/test/files/run/repl-javap-app.scala
+++ /dev/null
@@ -1,18 +0,0 @@
-
-import scala.tools.partest.ReplTest
-
-object MyApp extends App {
- Console println "Hello, delayed world."
-}
-
-object Test extends ReplTest {
- def code = ":javap -app MyApp$"
-
- override def show() = {
- val coded = "Code:"
- val strung = "String Hello, delayed world."
- val lines = eval().toList
- assert (lines.count(s => s.endsWith(coded)) == 1)
- assert (lines.count(s => s.endsWith(strung)) == 1)
- }
-}
diff --git a/test/files/run/repl-javap-def.scala b/test/files/run/repl-javap-def.scala
index dbd769613a..3994f06767 100644
--- a/test/files/run/repl-javap-def.scala
+++ b/test/files/run/repl-javap-def.scala
@@ -3,7 +3,7 @@ import scala.tools.partest.JavapTest
object Test extends JavapTest {
def code = """
|def f = 7
- |:javap -public -raw f
+ |:javap -public f
""".stripMargin
// it should find f wrapped in repl skins. replstiltskin.
diff --git a/test/files/run/repl-javap-fun.scala b/test/files/run/repl-javap-fun.scala
deleted file mode 100644
index 5c9a6b7691..0000000000
--- a/test/files/run/repl-javap-fun.scala
+++ /dev/null
@@ -1,16 +0,0 @@
-import scala.tools.partest.JavapTest
-
-object Test extends JavapTest {
- def code = """
- |object Betty {
- | List(1,2,3) filter (_ % 2 != 0) map (_ * 2)
- |}
- |:javap -fun Betty
- """.stripMargin
-
- // two anonfuns of Betty
- override def yah(res: Seq[String]) = {
- def filtered = res filter (_ contains "public final class Betty")
- 2 == filtered.size
- }
-}
diff --git a/test/files/run/repl-javap-lambdas.scala b/test/files/run/repl-javap-lambdas.scala
deleted file mode 100644
index 76a6ec8450..0000000000
--- a/test/files/run/repl-javap-lambdas.scala
+++ /dev/null
@@ -1,23 +0,0 @@
-import scala.tools.partest.JavapTest
-import scala.tools.nsc.Settings
-
-// see repl-javap-memfun.java for the complementary version
-object Test extends JavapTest {
- override def transformSettings(s: Settings) = { s.Ydelambdafy.value = "method" ; s }
- def code = """
- |object Betty {
- | List(1,2,3) count (_ % 2 != 0)
- | def f = List(1,2,3) filter ((x: Any) => true) map (x => "m1")
- | def g = List(1,2,3) filter ((x: Any) => true) map (x => "m1") map (x => "m2")
- |}
- |:javap -fun Betty#g
- """.stripMargin
-
- // three anonfuns of Betty#g
- override def yah(res: Seq[String]) = {
- import PartialFunction.{ cond => when }
- val r = """.*final .* .*\$anonfun\$\d+\(.*""".r
- def filtered = res filter (when(_) { case r(_*) => true })
- 3 == filtered.size
- }
-}
diff --git a/test/files/run/repl-javap-memfun.scala b/test/files/run/repl-javap-memfun.scala
deleted file mode 100644
index d10ebcb399..0000000000
--- a/test/files/run/repl-javap-memfun.scala
+++ /dev/null
@@ -1,22 +0,0 @@
-import scala.tools.partest.JavapTest
-import scala.tools.nsc.Settings
-
-// see repl-javap-lambdas.scala for the complementary version
-object Test extends JavapTest {
- // asserting the default
- override def transformSettings(s: Settings) = { s.Ydelambdafy.value = "inline" ; s }
- def code = """
- |object Betty {
- | List(1,2,3) count (_ % 2 != 0)
- | def f = List(1,2,3) filter (_ % 2 != 0) map (_ * 2)
- | def g = List(1,2,3) filter (_ % 2 == 0) map (_ * 3) map (_ + 1)
- |}
- |:javap -fun Betty#g
- """.stripMargin
-
- // three anonfuns of Betty#g
- override def yah(res: Seq[String]) = {
- def filtered = res filter (_ contains "public final class Betty")
- 3 == filtered.size
- }
-}
diff --git a/test/files/run/repl-javap-more-fun.scala b/test/files/run/repl-javap-more-fun.scala
deleted file mode 100644
index e603faf75a..0000000000
--- a/test/files/run/repl-javap-more-fun.scala
+++ /dev/null
@@ -1,17 +0,0 @@
-import scala.tools.partest.JavapTest
-
-object Test extends JavapTest {
- def code = """
- |object Betty {
- | val ds = List(1,2,3) filter (_ % 2 == 0) map (_ * 3)
- | def m(vs: List[Int]) = vs filter (_ % 2 != 0) map (_ * 2)
- |}
- |:javap -fun Betty
- """.stripMargin
-
- // two anonfuns of Betty
- override def yah(res: Seq[String]) = {
- def filtered = res filter (_ contains "public final class Betty")
- 4 == filtered.size
- }
-}
diff --git a/test/files/run/repl-javap-outdir-funs.flags b/test/files/run/repl-javap-outdir-funs.flags
deleted file mode 100644
index ac96850b69..0000000000
--- a/test/files/run/repl-javap-outdir-funs.flags
+++ /dev/null
@@ -1 +0,0 @@
--Ydelambdafy:inline \ No newline at end of file
diff --git a/test/files/run/repl-javap-outdir-funs/foo_1.scala b/test/files/run/repl-javap-outdir-funs/foo_1.scala
deleted file mode 100644
index 9b98e94733..0000000000
--- a/test/files/run/repl-javap-outdir-funs/foo_1.scala
+++ /dev/null
@@ -1,6 +0,0 @@
-
-package disktest
-
-class Foo {
- def m(vs: List[Int]) = vs map (_ + 1)
-}
diff --git a/test/files/run/repl-javap-outdir-funs/run-repl_7.scala b/test/files/run/repl-javap-outdir-funs/run-repl_7.scala
deleted file mode 100644
index af9651a8a3..0000000000
--- a/test/files/run/repl-javap-outdir-funs/run-repl_7.scala
+++ /dev/null
@@ -1,20 +0,0 @@
-import scala.tools.partest.JavapTest
-
-object Test extends JavapTest {
- // note the '-fun': it makes :javap search for some anonfun.
- // for that reason, this test has a flags file that forces delambdafy:inline (doesn't allow :method)
- def code = """
- |:javap -fun disktest/Foo.class
- """.stripMargin
-
- override def yah(res: Seq[String]) =
- // It's currently unknown why this test fails on Avian with
- // “Failed: No anonfuns found.”, skip it for now. See SI-7630.
- if (scala.tools.partest.utils.Properties.isAvian)
- true
- else {
- val r = "public final class disktest.Foo.*extends scala.runtime.AbstractFunction1".r
- def filtered = res filter (r.findFirstIn(_).nonEmpty)
- 1 == filtered.size
- }
-}
diff --git a/test/files/run/repl-javap.scala b/test/files/run/repl-javap.scala
index 7a19852d4e..25e72f3b13 100644
--- a/test/files/run/repl-javap.scala
+++ b/test/files/run/repl-javap.scala
@@ -7,7 +7,8 @@ object Test extends JavapTest {
""".stripMargin
override def yah(res: Seq[String]) = {
- def filtered = res filter (_ contains "public class Betty")
+ val r = """public class \S*Betty""".r.unanchored
+ def filtered = res filter { case r(_*) => true ; case _ => false }
1 == filtered.size
}
}
diff --git a/test/files/run/repl-no-imports-no-predef-classbased.check b/test/files/run/repl-no-imports-no-predef-classbased.check
new file mode 100644
index 0000000000..a796600061
--- /dev/null
+++ b/test/files/run/repl-no-imports-no-predef-classbased.check
@@ -0,0 +1,23 @@
+
+scala> case class K(s: java.lang.String)
+defined class K
+
+scala> class C { implicit val k: K = K("OK?"); override def toString = "C(" + k.toString + ")" }
+defined class C
+
+scala> val c = new C
+c: C = C(K(OK?))
+
+scala> import c.k
+import c.k
+
+scala> scala.Predef.implicitly[K]
+res0: K = K(OK?)
+
+scala> val k = 42
+k: Int = 42
+
+scala> k // was K(OK?)
+res1: Int = 42
+
+scala> :quit
diff --git a/test/files/run/repl-no-imports-no-predef-classbased.scala b/test/files/run/repl-no-imports-no-predef-classbased.scala
new file mode 100644
index 0000000000..86bd07b2f2
--- /dev/null
+++ b/test/files/run/repl-no-imports-no-predef-classbased.scala
@@ -0,0 +1,19 @@
+object Test extends scala.tools.partest.ReplTest {
+
+ override def transformSettings(settings: scala.tools.nsc.Settings) = {
+ settings.noimports.value = true
+ settings.nopredef.value = true
+ settings.Yreplclassbased.value = true
+ settings
+ }
+
+ def code = """
+case class K(s: java.lang.String)
+class C { implicit val k: K = K("OK?"); override def toString = "C(" + k.toString + ")" }
+val c = new C
+import c.k
+scala.Predef.implicitly[K]
+val k = 42
+k // was K(OK?)
+"""
+}
diff --git a/test/files/run/repl-no-imports-no-predef-power.check b/test/files/run/repl-no-imports-no-predef-power.check
new file mode 100644
index 0000000000..08f614eb60
--- /dev/null
+++ b/test/files/run/repl-no-imports-no-predef-power.check
@@ -0,0 +1,29 @@
+
+scala> :power
+Power mode enabled. :phase is at typer.
+import scala.tools.nsc._, intp.global._, definitions._
+Try :help or completions for vals._ and power._
+
+scala> // guarding against "error: reference to global is ambiguous"
+
+scala> global.emptyValDef // "it is imported twice in the same scope by ..."
+warning: there was one deprecation warning (since 2.11.0); for details, enable `:setting -deprecation' or `:replay -deprecation'
+res0: $r.global.noSelfType.type = private val _ = _
+
+scala> val tp = ArrayClass[scala.util.Random] // magic with tags
+warning: there was one feature warning; for details, enable `:setting -feature' or `:replay -feature'
+tp: $r.global.Type = Array[scala.util.Random]
+
+scala> tp.memberType(Array_apply) // evidence
+res1: $r.global.Type = (i: Int)scala.util.Random
+
+scala> val m = LIT(10) // treedsl
+m: $r.treedsl.global.Literal = 10
+
+scala> typed(m).tpe // typed is in scope
+res2: $r.treedsl.global.Type = Int(10)
+
+scala> """escaping is hard, m'kah"""
+res3: String = escaping is hard, m'kah
+
+scala> :quit
diff --git a/test/files/run/repl-no-imports-no-predef-power.scala b/test/files/run/repl-no-imports-no-predef-power.scala
new file mode 100644
index 0000000000..24d4dceef2
--- /dev/null
+++ b/test/files/run/repl-no-imports-no-predef-power.scala
@@ -0,0 +1,21 @@
+object Test extends scala.tools.partest.ReplTest {
+
+ override def transformSettings(settings: scala.tools.nsc.Settings) = {
+ settings.noimports.value = true
+ settings.nopredef.value = true
+ settings
+ }
+
+ def tripleQuote(s: String) = "\"\"\"" + s + "\"\"\""
+
+ def code = s"""
+:power
+// guarding against "error: reference to global is ambiguous"
+global.emptyValDef // "it is imported twice in the same scope by ..."
+val tp = ArrayClass[scala.util.Random] // magic with tags
+tp.memberType(Array_apply) // evidence
+val m = LIT(10) // treedsl
+typed(m).tpe // typed is in scope
+${tripleQuote("escaping is hard, m'kah")}
+ """.trim
+}
diff --git a/test/files/run/repl-no-imports-no-predef.check b/test/files/run/repl-no-imports-no-predef.check
new file mode 100644
index 0000000000..7c4ee82c78
--- /dev/null
+++ b/test/files/run/repl-no-imports-no-predef.check
@@ -0,0 +1,360 @@
+
+scala> 1
+res0: Int = 1
+
+scala> 1.0
+res1: Double = 1.0
+
+scala> ()
+
+scala> "abc"
+res3: String = abc
+
+scala> (1, 2)
+res4: (Int, Int) = (1,2)
+
+scala>
+
+scala> { import scala.Predef.ArrowAssoc; 1 -> 2 }
+res5: (Int, Int) = (1,2)
+
+scala> { import scala.Predef.ArrowAssoc; 1 → 2 }
+res6: (Int, Int) = (1,2)
+
+scala> 1 -> 2
+<console>:12: error: value -> is not a member of Int
+ 1 -> 2
+ ^
+
+scala> 1 → 2
+<console>:12: error: value → is not a member of Int
+ 1 → 2
+ ^
+
+scala>
+
+scala> val answer = 42
+answer: Int = 42
+
+scala> { import scala.StringContext; s"answer: $answer" }
+res9: String = answer: 42
+
+scala> s"answer: $answer"
+<console>:13: error: not found: value StringContext
+ s"answer: $answer"
+ ^
+
+scala>
+
+scala> "abc" + true
+res11: String = abctrue
+
+scala>
+
+scala> { import scala.Predef.any2stringadd; true + "abc" }
+res12: String = trueabc
+
+scala> true + "abc"
+<console>:12: error: value + is not a member of Boolean
+ true + "abc"
+ ^
+
+scala>
+
+scala> var x = 10
+x: Int = 10
+
+scala> var y = 11
+y: Int = 11
+
+scala> x = 12
+x: Int = 12
+
+scala> y = 13
+y: Int = 13
+
+scala>
+
+scala> 2 ; 3
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
+ 2 ;;
+ ^
+res14: Int = 3
+
+scala> { 2 ; 3 }
+<console>:12: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
+ { 2 ; 3 }
+ ^
+res15: Int = 3
+
+scala> 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def
+bippy = {
+ 1 +
+ 2 +
+ 3 } ; bippy+88+11
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
+ 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def
+ ^
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
+ 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def
+ ^
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
+ 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def
+ ^
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
+ 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def
+ ^
+defined object Cow
+defined class Moo
+bippy: Int
+res16: Int = 105
+
+scala>
+
+scala> object Bovine { var x: scala.List[_] = null } ; case class Ruminant(x: scala.Int) ; bippy * bippy * bippy
+defined object Bovine
+defined class Ruminant
+res17: Int = 216
+
+scala> Bovine.x = scala.List(Ruminant(5), Cow, new Moo)
+Bovine.x: List[Any] = List(Ruminant(5), Cow, Moooooo)
+
+scala> Bovine.x
+res18: List[Any] = List(Ruminant(5), Cow, Moooooo)
+
+scala>
+
+scala> (2)
+res19: Int = 2
+
+scala> (2 + 2)
+res20: Int = 4
+
+scala> ((2 + 2))
+res21: Int = 4
+
+scala> ((2 + 2))
+res22: Int = 4
+
+scala> ( (2 + 2))
+res23: Int = 4
+
+scala> ( (2 + 2 ) )
+res24: Int = 4
+
+scala> 5 ; ( (2 + 2 ) ) ; ((5))
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
+ 5 ; ( (2 + 2 ) ) ;;
+ ^
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
+ 5 ; ( (2 + 2 ) ) ;;
+ ^
+res25: Int = 5
+
+scala> (((2 + 2)), ((2 + 2)))
+res26: (Int, Int) = (4,4)
+
+scala> (((2 + 2)), ((2 + 2)), 2)
+res27: (Int, Int, Int) = (4,4,2)
+
+scala> (((((2 + 2)), ((2 + 2)), 2).productIterator ++ scala.Iterator(3)).mkString)
+res28: String = 4423
+
+scala>
+
+scala> 55 ; ((2 + 2)) ; (1, 2, 3)
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
+ 55 ; ((2 + 2)) ;;
+ ^
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
+ 55 ; ((2 + 2)) ;;
+ ^
+res29: (Int, Int, Int) = (1,2,3)
+
+scala> 55 ; (x: scala.Int) => x + 1 ; () => ((5))
+<console>:12: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
+ 55 ; (x: scala.Int) => x + 1 ;;
+ ^
+res30: () => Int = <function0>
+
+scala>
+
+scala> () => 5
+res31: () => Int = <function0>
+
+scala> 55 ; () => 5
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
+ 55 ;;
+ ^
+res32: () => Int = <function0>
+
+scala> () => { class X ; new X }
+res33: () => AnyRef = <function0>
+
+scala>
+
+scala> def foo(x: scala.Int)(y: scala.Int)(z: scala.Int) = x+y+z
+foo: (x: Int)(y: Int)(z: Int)Int
+
+scala> foo(5)(10)(15)+foo(5)(10)(15)
+res34: Int = 60
+
+scala>
+
+scala> scala.List(1) ++ scala.List('a')
+res35: List[AnyVal] = List(1, a)
+
+scala>
+
+scala> :paste < EOF
+// Entering paste mode (EOF to finish)
+
+class C { def c = 42 }
+EOF
+
+// Exiting paste mode, now interpreting.
+
+defined class C
+
+scala> new C().c
+res36: Int = 42
+
+scala> :paste <| EOF
+// Entering paste mode (EOF to finish)
+
+class D { def d = 42 }
+EOF
+
+// Exiting paste mode, now interpreting.
+
+defined class D
+
+scala> new D().d
+res37: Int = 42
+
+scala>
+
+scala> :paste < EOF
+// Entering paste mode (EOF to finish)
+
+class Dingus
+{
+ private val x = 5
+ def y = Dingus.x * 2
+}
+object Dingus
+{
+ private val x = 55
+}
+EOF
+
+// Exiting paste mode, now interpreting.
+
+defined class Dingus
+defined object Dingus
+
+scala> val x = (new Dingus).y
+x: Int = 110
+
+scala>
+
+scala> val x1 = 1
+x1: Int = 1
+
+scala> val x2 = 2
+x2: Int = 2
+
+scala> val x3 = 3
+x3: Int = 3
+
+scala> case class BippyBungus()
+defined class BippyBungus
+
+scala> x1 + x2 + x3
+res38: Int = 6
+
+scala> :reset
+Resetting interpreter state.
+Forgetting this session history:
+
+1
+1.0
+()
+"abc"
+(1, 2)
+{ import scala.Predef.ArrowAssoc; 1 -> 2 }
+{ import scala.Predef.ArrowAssoc; 1 → 2 }
+val answer = 42
+{ import scala.StringContext; s"answer: $answer" }
+"abc" + true
+{ import scala.Predef.any2stringadd; true + "abc" }
+var x = 10
+var y = 11
+x = 12
+y = 13
+2 ; 3
+{ 2 ; 3 }
+5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def
+bippy = {
+ 1 +
+ 2 +
+ 3 } ; bippy+88+11
+object Bovine { var x: scala.List[_] = null } ; case class Ruminant(x: scala.Int) ; bippy * bippy * bippy
+Bovine.x = scala.List(Ruminant(5), Cow, new Moo)
+Bovine.x
+(2)
+(2 + 2)
+((2 + 2))
+ ((2 + 2))
+ ( (2 + 2))
+ ( (2 + 2 ) )
+5 ; ( (2 + 2 ) ) ; ((5))
+(((2 + 2)), ((2 + 2)))
+(((2 + 2)), ((2 + 2)), 2)
+(((((2 + 2)), ((2 + 2)), 2).productIterator ++ scala.Iterator(3)).mkString)
+55 ; ((2 + 2)) ; (1, 2, 3)
+55 ; (x: scala.Int) => x + 1 ; () => ((5))
+() => 5
+55 ; () => 5
+() => { class X ; new X }
+def foo(x: scala.Int)(y: scala.Int)(z: scala.Int) = x+y+z
+foo(5)(10)(15)+foo(5)(10)(15)
+scala.List(1) ++ scala.List('a')
+new C().c
+new D().d
+val x = (new Dingus).y
+val x1 = 1
+val x2 = 2
+val x3 = 3
+case class BippyBungus()
+x1 + x2 + x3
+
+Forgetting all expression results and named terms: $intp, BippyBungus, Bovine, Cow, Dingus, Ruminant, answer, bippy, foo, x, x1, x2, x3, y
+Forgetting defined types: BippyBungus, C, D, Dingus, Moo, Ruminant
+
+scala> x1 + x2 + x3
+<console>:12: error: not found: value x1
+ x1 + x2 + x3
+ ^
+<console>:12: error: not found: value x2
+ x1 + x2 + x3
+ ^
+<console>:12: error: not found: value x3
+ x1 + x2 + x3
+ ^
+
+scala> val x1 = 4
+x1: Int = 4
+
+scala> new BippyBungus
+<console>:12: error: not found: type BippyBungus
+ new BippyBungus
+ ^
+
+scala> class BippyBungus() { def f = 5 }
+defined class BippyBungus
+
+scala> { new BippyBungus ; x1 }
+res2: Int = 4
+
+scala> :quit
diff --git a/test/files/run/repl-no-imports-no-predef.scala b/test/files/run/repl-no-imports-no-predef.scala
new file mode 100644
index 0000000000..39f43c534d
--- /dev/null
+++ b/test/files/run/repl-no-imports-no-predef.scala
@@ -0,0 +1,108 @@
+object Test extends scala.tools.partest.ReplTest {
+
+ override def transformSettings(settings: scala.tools.nsc.Settings) = {
+ settings.noimports.value = true
+ settings.nopredef.value = true
+ settings
+ }
+
+ // replace indylambda function names by <function0>
+ override def normalize(s: String) = """\$\$Lambda.*""".r.replaceAllIn(s, "<function0>")
+
+ def code = """
+1
+1.0
+()
+"abc"
+(1, 2)
+
+{ import scala.Predef.ArrowAssoc; 1 -> 2 }
+{ import scala.Predef.ArrowAssoc; 1 → 2 }
+1 -> 2
+1 → 2
+
+val answer = 42
+{ import scala.StringContext; s"answer: $answer" }
+s"answer: $answer"
+
+"abc" + true
+
+{ import scala.Predef.any2stringadd; true + "abc" }
+true + "abc"
+
+var x = 10
+var y = 11
+x = 12
+y = 13
+
+2 ; 3
+{ 2 ; 3 }
+5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def
+bippy = {
+ 1 +
+ 2 +
+ 3 } ; bippy+88+11
+
+object Bovine { var x: scala.List[_] = null } ; case class Ruminant(x: scala.Int) ; bippy * bippy * bippy
+Bovine.x = scala.List(Ruminant(5), Cow, new Moo)
+Bovine.x
+
+(2)
+(2 + 2)
+((2 + 2))
+ ((2 + 2))
+ ( (2 + 2))
+ ( (2 + 2 ) )
+5 ; ( (2 + 2 ) ) ; ((5))
+(((2 + 2)), ((2 + 2)))
+(((2 + 2)), ((2 + 2)), 2)
+(((((2 + 2)), ((2 + 2)), 2).productIterator ++ scala.Iterator(3)).mkString)
+
+55 ; ((2 + 2)) ; (1, 2, 3)
+55 ; (x: scala.Int) => x + 1 ; () => ((5))
+
+() => 5
+55 ; () => 5
+() => { class X ; new X }
+
+def foo(x: scala.Int)(y: scala.Int)(z: scala.Int) = x+y+z
+foo(5)(10)(15)+foo(5)(10)(15)
+
+scala.List(1) ++ scala.List('a')
+
+:paste < EOF
+class C { def c = 42 }
+EOF
+new C().c
+:paste <| EOF
+class D { def d = 42 }
+EOF
+new D().d
+
+:paste < EOF
+class Dingus
+{
+ private val x = 5
+ def y = Dingus.x * 2
+}
+object Dingus
+{
+ private val x = 55
+}
+EOF
+val x = (new Dingus).y
+
+val x1 = 1
+val x2 = 2
+val x3 = 3
+case class BippyBungus()
+x1 + x2 + x3
+:reset
+x1 + x2 + x3
+val x1 = 4
+new BippyBungus
+class BippyBungus() { def f = 5 }
+{ new BippyBungus ; x1 }
+
+"""
+}
diff --git a/test/files/run/repl-parens.check b/test/files/run/repl-parens.check
index 6516f4ea90..477d4d462f 100644
--- a/test/files/run/repl-parens.check
+++ b/test/files/run/repl-parens.check
@@ -18,10 +18,10 @@ scala> ( (2 + 2 ) )
res5: Int = 4
scala> 5 ; ( (2 + 2 ) ) ; ((5))
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
5 ; ( (2 + 2 ) ) ;;
^
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
5 ; ( (2 + 2 ) ) ;;
^
res6: Int = 5
@@ -38,16 +38,16 @@ res9: String = 4423
scala>
scala> 55 ; ((2 + 2)) ; (1, 2, 3)
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
55 ; ((2 + 2)) ;;
^
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
55 ; ((2 + 2)) ;;
^
res10: (Int, Int, Int) = (1,2,3)
scala> 55 ; (x: Int) => x + 1 ; () => ((5))
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
55 ; (x: Int) => x + 1 ;;
^
res11: () => Int = <function0>
@@ -58,7 +58,7 @@ scala> () => 5
res12: () => Int = <function0>
scala> 55 ; () => 5
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
55 ;;
^
res13: () => Int = <function0>
diff --git a/test/files/run/repl-parens.scala b/test/files/run/repl-parens.scala
index e25933b1a2..613bb6f6af 100644
--- a/test/files/run/repl-parens.scala
+++ b/test/files/run/repl-parens.scala
@@ -1,6 +1,9 @@
import scala.tools.partest.ReplTest
object Test extends ReplTest {
+ // replace indylambda function names by <function0>
+ override def normalize(s: String) = """\$\$Lambda.*""".r.replaceAllIn(s, "<function0>")
+
def code = """
(2)
(2 + 2)
diff --git a/test/files/run/repl-paste-b.check b/test/files/run/repl-paste-b.check
new file mode 100644
index 0000000000..2e205d48d6
--- /dev/null
+++ b/test/files/run/repl-paste-b.check
@@ -0,0 +1,14 @@
+
+scala> :paste < EOF
+// Entering paste mode (EOF to finish)
+
+object X
+EOF
+
+// Exiting paste mode, now interpreting.
+
+defined object X
+
+scala> assert(X.getClass.getName.contains("line"))
+
+scala> :quit
diff --git a/test/files/run/repl-paste-b.scala b/test/files/run/repl-paste-b.scala
new file mode 100644
index 0000000000..718f7d9e17
--- /dev/null
+++ b/test/files/run/repl-paste-b.scala
@@ -0,0 +1,13 @@
+import scala.tools.partest.ReplTest
+
+// confirm X not in empty package
+object Test extends ReplTest {
+ def code =
+ """
+:paste < EOF
+object X
+EOF
+assert(X.getClass.getName.contains("line"))
+"""
+
+}
diff --git a/test/files/run/repl-paste-raw-b.pastie b/test/files/run/repl-paste-raw-b.pastie
new file mode 100644
index 0000000000..f13b4bcf8b
--- /dev/null
+++ b/test/files/run/repl-paste-raw-b.pastie
@@ -0,0 +1,8 @@
+
+// a raw paste is not a script
+// hence it can be packaged
+
+package brown_paper
+
+// these are a few of my favorite things
+case class Gift (hasString: Boolean)
diff --git a/test/files/run/repl-paste-raw-b.scala b/test/files/run/repl-paste-raw-b.scala
new file mode 100644
index 0000000000..d1c7692f2f
--- /dev/null
+++ b/test/files/run/repl-paste-raw-b.scala
@@ -0,0 +1,18 @@
+
+import scala.tools.partest.SessionTest
+
+object Test extends SessionTest {
+ def session =
+s"""|
+ |scala> :paste $pastie
+ |Pasting file $pastie...
+ |
+ |scala> val favoriteThing = brown_paper.Gift(true)
+ |favoriteThing: brown_paper.Gift = Gift(true)
+ |
+ |scala> favoriteThing.hasString
+ |res0: Boolean = true
+ |
+ |scala> :quit"""
+ def pastie = testPath changeExtension "pastie"
+}
diff --git a/test/files/run/repl-paste-raw-c.pastie b/test/files/run/repl-paste-raw-c.pastie
new file mode 100644
index 0000000000..364d8cef4b
--- /dev/null
+++ b/test/files/run/repl-paste-raw-c.pastie
@@ -0,0 +1,5 @@
+
+// not actually a candidate for raw paste
+
+val nope = 42
+
diff --git a/test/files/run/repl-paste-raw-c.scala b/test/files/run/repl-paste-raw-c.scala
new file mode 100644
index 0000000000..600ac4d2f0
--- /dev/null
+++ b/test/files/run/repl-paste-raw-c.scala
@@ -0,0 +1,16 @@
+
+import scala.tools.partest.SessionTest
+
+object Test extends SessionTest {
+ def session =
+s"""|
+ |scala> :paste -raw $pastie
+ |Pasting file $pastie...
+ |$pastie:3: error: expected class or object definition
+ |val nope = 42
+ |^
+ |There were compilation errors!
+ |
+ |scala> :quit"""
+ def pastie = testPath changeExtension "pastie"
+}
diff --git a/test/files/run/repl-paste-raw.pastie b/test/files/run/repl-paste-raw.pastie
index f13b4bcf8b..a4a570aaa2 100644
--- a/test/files/run/repl-paste-raw.pastie
+++ b/test/files/run/repl-paste-raw.pastie
@@ -1,8 +1,8 @@
+package brown_paper
+
// a raw paste is not a script
// hence it can be packaged
-package brown_paper
-
// these are a few of my favorite things
case class Gift (hasString: Boolean)
diff --git a/test/files/run/repl-paste-raw.scala b/test/files/run/repl-paste-raw.scala
index 9bd5e8e63e..d1c7692f2f 100644
--- a/test/files/run/repl-paste-raw.scala
+++ b/test/files/run/repl-paste-raw.scala
@@ -4,7 +4,7 @@ import scala.tools.partest.SessionTest
object Test extends SessionTest {
def session =
s"""|
- |scala> :paste -raw $pastie
+ |scala> :paste $pastie
|Pasting file $pastie...
|
|scala> val favoriteThing = brown_paper.Gift(true)
diff --git a/test/files/run/repl-power.check b/test/files/run/repl-power.check
index 0d4a30b8e3..08f614eb60 100644
--- a/test/files/run/repl-power.check
+++ b/test/files/run/repl-power.check
@@ -7,11 +7,11 @@ Try :help or completions for vals._ and power._
scala> // guarding against "error: reference to global is ambiguous"
scala> global.emptyValDef // "it is imported twice in the same scope by ..."
-warning: there was one deprecation warning; re-run with -deprecation for details
+warning: there was one deprecation warning (since 2.11.0); for details, enable `:setting -deprecation' or `:replay -deprecation'
res0: $r.global.noSelfType.type = private val _ = _
scala> val tp = ArrayClass[scala.util.Random] // magic with tags
-warning: there was one feature warning; re-run with -feature for details
+warning: there was one feature warning; for details, enable `:setting -feature' or `:replay -feature'
tp: $r.global.Type = Array[scala.util.Random]
scala> tp.memberType(Array_apply) // evidence
diff --git a/test/files/run/repl-serialization.scala b/test/files/run/repl-serialization.scala
index 55b7519631..8bc0dd3a8b 100644
--- a/test/files/run/repl-serialization.scala
+++ b/test/files/run/repl-serialization.scala
@@ -36,7 +36,7 @@ object Test {
|extract(() => new AA(x + getX() + y + z + zz + O.apply + u.x))
""".stripMargin
- imain = new IMain(settings)
+ imain = IMain(settings)
println("== evaluating lines")
imain.directBind("extract", "(AnyRef => Unit)", extract)
code.lines.foreach(imain.interpret)
diff --git a/test/files/run/richs.check b/test/files/run/richs.check
index cf265ae007..97b032393c 100644
--- a/test/files/run/richs.check
+++ b/test/files/run/richs.check
@@ -1,4 +1,4 @@
-warning: there were two deprecation warnings; re-run with -deprecation for details
+warning: there were two deprecation warnings (since 2.11.0); re-run with -deprecation for details
RichCharTest1:
true
diff --git a/test/files/run/run-bug4840.flags b/test/files/run/run-bug4840.flags
deleted file mode 100644
index eb4d19bcb9..0000000000
--- a/test/files/run/run-bug4840.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimise \ No newline at end of file
diff --git a/test/files/run/runtime.scala b/test/files/run/runtime.scala
index 89348b294d..468a80fc0c 100644
--- a/test/files/run/runtime.scala
+++ b/test/files/run/runtime.scala
@@ -73,7 +73,7 @@ object Test1Test {
// {System.out.print(22); test1.bar}.System.out.println();
{Console.print(23); test1.bar.System}.out.println();
{Console.print(24); test1.bar.System.out}.println();
- {Console.print(25); test1.bar.System.out.println:(() => Unit)} apply ();
+ {Console.print(25); test1.bar.System.out.println _ : (() => Unit)} apply ();
{Console.print(26); test1.bar.System.out.println()};
}
diff --git a/test/files/run/sammy_after_implicit_view.scala b/test/files/run/sammy_after_implicit_view.scala
new file mode 100644
index 0000000000..a13a71e562
--- /dev/null
+++ b/test/files/run/sammy_after_implicit_view.scala
@@ -0,0 +1,28 @@
+trait MySam { def apply(x: Int): String }
+
+// check that SAM conversion happens after implicit view application
+object Test extends App {
+ final val AnonFunClass = "$anon$"
+ final val LMFClass = "$$Lambda$" // LambdaMetaFactory names classes like this
+
+ // if there's an implicit conversion, it does not takes precedence (because that's what dotty does)
+ def implicitSam() = {
+ import language.implicitConversions
+ var ok = true
+ implicit def fun2sam(fun: Int => String): MySam = { ok = false; new MySam { def apply(x: Int) = fun(x) } }
+ val className = (((x: Int) => x.toString): MySam).getClass.toString
+ assert(ok, "implicit conversion not called")
+ assert(!(className contains AnonFunClass), className)
+ assert(className contains LMFClass, className)
+ }
+
+ // indirectly check that this sam type instance was created from a class spun up by LambdaMetaFactory
+ def justSammy() = {
+ val className = (((x: Int) => x.toString): MySam).getClass.toString
+ assert(!(className contains AnonFunClass), className)
+ assert(className contains LMFClass, className)
+ }
+
+ implicitSam()
+ justSammy()
+}
diff --git a/test/files/run/sammy_cbn.scala b/test/files/run/sammy_cbn.scala
new file mode 100644
index 0000000000..b84b2fd8e5
--- /dev/null
+++ b/test/files/run/sammy_cbn.scala
@@ -0,0 +1,9 @@
+trait F0[T] { def apply(): T }
+
+object Test extends App {
+ def delay[T](v: => T) = (v _): F0[T]
+
+ // should not fail with ClassCastException: $$Lambda$6279/897871870 cannot be cast to F0
+ // (also, should not say boe!)
+ delay(println("boe!"))
+}
diff --git a/test/files/run/sammy_erasure_cce.scala b/test/files/run/sammy_erasure_cce.scala
new file mode 100644
index 0000000000..fb973befe4
--- /dev/null
+++ b/test/files/run/sammy_erasure_cce.scala
@@ -0,0 +1,22 @@
+trait F1 {
+ def apply(a: List[String]): String
+ def f1 = "f1"
+}
+
+object Test extends App {
+ // Wrap the sam-targeting function in a context where the expected type is erased (identity's argument type erases to Object),
+ // so that Erasure can't tell that the types actually conform by looking only
+ // at an un-adorned Function tree and the expected type
+ // (because a function type needs no cast it the expected type is a SAM type),
+ //
+ // A correct implementation of Typers/Erasure tracks a Function's SAM target type directly
+ // (currently using an attachment for backwards compat),
+ // and not in the expected type (which was the case in my first attempt),
+ // as the expected type may lose its SAM status due to erasure.
+ // (In a sense, this need not be so, but erasure drops type parameters,
+ // so that identity's F1 type argument cannot be propagated to its argument type.)
+ def foo = identity[F1]((as: List[String]) => as.head)
+
+ // check that this doesn't CCE's
+ foo.f1
+}
diff --git a/test/files/run/sammy_repeated.flags b/test/files/run/sammy_repeated.flags
deleted file mode 100644
index e1b37447c9..0000000000
--- a/test/files/run/sammy_repeated.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xexperimental \ No newline at end of file
diff --git a/test/files/run/sammy_repeated.scala b/test/files/run/sammy_repeated.scala
deleted file mode 100644
index c24dc41909..0000000000
--- a/test/files/run/sammy_repeated.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-trait RepeatedSink { def accept(a: Any*): Unit }
-
-object Test {
- def main(args: Array[String]): Unit = {
- val f: RepeatedSink = (a) => println(a)
- f.accept(1)
- }
-} \ No newline at end of file
diff --git a/test/files/run/sammy_restrictions_LMF.check b/test/files/run/sammy_restrictions_LMF.check
new file mode 100644
index 0000000000..6ed281c757
--- /dev/null
+++ b/test/files/run/sammy_restrictions_LMF.check
@@ -0,0 +1,2 @@
+1
+1
diff --git a/test/files/run/sammy_restrictions_LMF.scala b/test/files/run/sammy_restrictions_LMF.scala
new file mode 100644
index 0000000000..aa49e14113
--- /dev/null
+++ b/test/files/run/sammy_restrictions_LMF.scala
@@ -0,0 +1,57 @@
+trait T[@specialized A] { def apply(a: A): A }
+trait TInt extends T[Int]
+
+trait TWithVal { val x: Any = 1; def apply(x: Int): String }
+
+trait TImpure { def apply(x: Int): String ; println(1) }
+
+trait Println { println(1) }
+trait TImpureSuper extends Println { def apply(x: Int): String }
+
+class C
+trait A extends C
+trait B extends A
+trait TClassParent extends B { def apply(x: Int): String }
+
+object Test extends App {
+ final val AnonFunClass = "$anonfun$"
+ final val LMFClass = "$$Lambda$" // LambdaMetaFactory names classes like this
+
+ private def LMF(f: Any): Unit = {
+ val className = f.getClass.toString
+ assert(!(className contains AnonFunClass), className)
+ assert((className contains LMFClass), className)
+ }
+
+ private def notLMF(f: Any): Unit = {
+ val className = f.getClass.toString
+ assert((className contains AnonFunClass), className)
+ assert(!(className contains LMFClass), className)
+ }
+
+ // Check that we expand the SAM of a type that is specialized.
+ // This is an implementation restriction -- the current specialization scheme is not
+ // amenable to using LambdaMetaFactory to spin up subclasses.
+ // Since the generic method is abstract, and the specialized ones are concrete,
+ // specialization is rendered moot because we cannot implement the specialized method
+ // with the lambda using LMF.
+
+ // not LMF if specialized at this type
+ notLMF((x => x): T[Int])
+ // not LMF if specialized at this type (via subclass)
+ notLMF((x => x): TInt)
+ // LMF ok if not specialized at this type
+ LMF((x => x): T[String])
+
+ // traits with a val member also cannot be instantiated by LMF
+ val fVal: TWithVal = (x => "a")
+ notLMF(fVal)
+ assert(fVal.x == 1)
+
+ notLMF((x => "a"): TImpure)
+ notLMF((x => "a"): TImpureSuper)
+
+ val fClassParent: TClassParent = x => "a"
+ notLMF(fClassParent)
+ assert(fClassParent(1) == "a")
+}
diff --git a/test/files/run/sammy_return.scala b/test/files/run/sammy_return.scala
new file mode 100644
index 0000000000..e959619dd1
--- /dev/null
+++ b/test/files/run/sammy_return.scala
@@ -0,0 +1,14 @@
+trait Fun[A, B] { def apply(a: A): B }
+class PF[A, B] { def runWith[U](action: Fun[B, U]): Fun[A, Boolean] = a => {action(a.asInstanceOf[B]); true} }
+
+class TO[A](x: A) {
+ def foreach[U](f: Fun[A, U]): U = f(x)
+ def collectFirst[B](pf: PF[A, B]): Option[B] = {
+ foreach(pf.runWith(b => return Some(b)))
+ None
+ }
+}
+
+object Test extends App {
+ assert(new TO("a").collectFirst(new PF[String, String]).get == "a")
+} \ No newline at end of file
diff --git a/test/files/run/sammy_seriazable.scala b/test/files/run/sammy_seriazable.scala
new file mode 100644
index 0000000000..458b99238a
--- /dev/null
+++ b/test/files/run/sammy_seriazable.scala
@@ -0,0 +1,47 @@
+import java.io._
+
+trait NotSerializableInterface { def apply(a: Any): Any }
+abstract class NotSerializableClass { def apply(a: Any): Any }
+// SAM type that supports lambdas-as-invoke-dynamic
+trait IsSerializableInterface extends java.io.Serializable { def apply(a: Any): Any }
+// SAM type that still requires lambdas-as-anonhmous-classes
+abstract class IsSerializableClass extends java.io.Serializable { def apply(a: Any): Any }
+
+object Test {
+ def main(args: Array[String]) {
+ val nsi: NotSerializableInterface = x => x
+ val nsc: NotSerializableClass = x => x
+
+ import SerDes._
+ assertNotSerializable(nsi)
+ assertNotSerializable(nsc)
+ assert(serializeDeserialize[IsSerializableInterface](x => x).apply("foo") == "foo")
+ assert(serializeDeserialize[IsSerializableClass](x => x).apply("foo") == "foo")
+ assert(ObjectStreamClass.lookup(((x => x): IsSerializableClass).getClass).getSerialVersionUID == 0)
+ }
+}
+
+object SerDes {
+ def assertNotSerializable(a: AnyRef): Unit = {
+ try {
+ serialize(a)
+ assert(false)
+ } catch {
+ case _: NotSerializableException => // okay
+ }
+ }
+
+ def serialize(obj: AnyRef): Array[Byte] = {
+ val buffer = new ByteArrayOutputStream
+ val out = new ObjectOutputStream(buffer)
+ out.writeObject(obj)
+ buffer.toByteArray
+ }
+
+ def deserialize(a: Array[Byte]): AnyRef = {
+ val in = new ObjectInputStream(new ByteArrayInputStream(a))
+ in.readObject
+ }
+
+ def serializeDeserialize[T <: AnyRef](obj: T) = deserialize(serialize(obj)).asInstanceOf[T]
+}
diff --git a/test/files/run/sammy_repeated.check b/test/files/run/sammy_vararg_cbn.check
index 1cff0f067c..1cff0f067c 100644
--- a/test/files/run/sammy_repeated.check
+++ b/test/files/run/sammy_vararg_cbn.check
diff --git a/test/files/run/sammy_vararg_cbn.scala b/test/files/run/sammy_vararg_cbn.scala
new file mode 100644
index 0000000000..e5b49498ea
--- /dev/null
+++ b/test/files/run/sammy_vararg_cbn.scala
@@ -0,0 +1,12 @@
+trait SamRepeated { def accept(a: Any*): Unit }
+trait SamByName { def accept(a: => Any): (Any, Any) }
+
+object Test extends App {
+ val rep: SamRepeated = (a) => println(a)
+ rep.accept(1)
+
+ val nam: SamByName = (a) => (a, a)
+ var v = 0
+ assert(nam.accept({v += 1; v}) == (1, 2))
+ assert(v == 2, "by name arg should be evaluated twice")
+}
diff --git a/test/files/run/sbt-icode-interface.check b/test/files/run/sbt-icode-interface.check
new file mode 100644
index 0000000000..7421f077f6
--- /dev/null
+++ b/test/files/run/sbt-icode-interface.check
@@ -0,0 +1 @@
+warning: there was one deprecation warning (since 2.12.0); re-run with -deprecation for details
diff --git a/test/files/run/sbt-icode-interface.scala b/test/files/run/sbt-icode-interface.scala
index 84d38cc65a..7cd2de5c00 100644
--- a/test/files/run/sbt-icode-interface.scala
+++ b/test/files/run/sbt-icode-interface.scala
@@ -9,34 +9,32 @@ object Test extends DirectTest {
""".trim
def show() {
- for (b <- List("GenASM", "GenBCode")) {
- val global = newCompiler("-usejavacp", s"-Ybackend:$b")
- import global._
- val r = new Run
- r.compileSources(newSourceFile(code) :: Nil)
-
- val results = collection.mutable.Buffer[(Boolean, String)]()
+ val global = newCompiler("-usejavacp")
+ import global._
+ val r = new Run
+ r.compileSources(newSourceFile(code) :: Nil)
- // Nailing down defacto compiler API from SBT's usage
- // https://github.com/sbt/sbt/blob/adb41611cf73260938274915d8462d924df200c8/compile/interface/src/main/scala/xsbt/Analyzer.scala#L29-L41
- def isTopLevelModule(sym: Symbol) = sym.isTopLevel && sym.isModule
- for (unit <- currentRun.units if !unit.isJava) {
- val sourceFile = unit.source.file.file
- for (iclass <- unit.icode) {
- val sym = iclass.symbol
- def addGenerated(separatorRequired: Boolean) {
- results += (separatorRequired -> sym.fullName)
- }
- if (sym.isModuleClass && !sym.isImplClass) {
- if (isTopLevelModule(sym) && sym.companionClass == NoSymbol)
- addGenerated(false)
- addGenerated(true)
- } else
- addGenerated(false)
+ val results = collection.mutable.Buffer[(Boolean, String)]()
+
+ // Nailing down defacto compiler API from SBT's usage
+ // https://github.com/sbt/sbt/blob/adb41611cf73260938274915d8462d924df200c8/compile/interface/src/main/scala/xsbt/Analyzer.scala#L29-L41
+ def isTopLevelModule(sym: Symbol) = sym.isTopLevel && sym.isModule
+ for (unit <- currentRun.units if !unit.isJava) {
+ val sourceFile = unit.source.file.file
+ for (iclass <- unit.icode) {
+ val sym = iclass.symbol
+ def addGenerated(separatorRequired: Boolean) {
+ results += (separatorRequired -> sym.fullName)
}
+ if (sym.isModuleClass && !sym.isImplClass) {
+ if (isTopLevelModule(sym) && sym.companionClass == NoSymbol)
+ addGenerated(false)
+ addGenerated(true)
+ } else
+ addGenerated(false)
}
- val expected = List((false, "C"), (true, "O"), (false, "C$D"))
- assert(results.toList == expected, b + ": " + results.toList)
}
+ val expected = List((false, "C"), (true, "O"), (false, "C$D"))
+ assert(results.toList == expected, s"expected: $expected, actual: ${results.toList}")
}
}
diff --git a/test/files/run/sd167.check b/test/files/run/sd167.check
new file mode 100644
index 0000000000..587be6b4c3
--- /dev/null
+++ b/test/files/run/sd167.check
@@ -0,0 +1 @@
+x
diff --git a/test/files/run/sd167.scala b/test/files/run/sd167.scala
new file mode 100644
index 0000000000..5095e772ad
--- /dev/null
+++ b/test/files/run/sd167.scala
@@ -0,0 +1,8 @@
+object Test {
+ implicit class ToExtractor(val s: StringContext) {
+ def x = {println("x"); Some }
+ }
+ def main(args: Array[String]) {
+ Some(1) match { case x"${a}" => } // used to convert to `case Some(a) =>` and omit side effects
+ }
+}
diff --git a/test/files/run/sd242.scala b/test/files/run/sd242.scala
new file mode 100644
index 0000000000..acd51ec893
--- /dev/null
+++ b/test/files/run/sd242.scala
@@ -0,0 +1,13 @@
+trait T {
+ def test: Unit = {
+ byName("".toString)
+ ()
+ }
+
+ @inline
+ final def byName(action: => Unit) = action
+}
+
+object Test extends App {
+ (new T {}).test
+}
diff --git a/test/files/run/sd275-java/A.java b/test/files/run/sd275-java/A.java
new file mode 100644
index 0000000000..b293cf6dab
--- /dev/null
+++ b/test/files/run/sd275-java/A.java
@@ -0,0 +1,5 @@
+package sample;
+public class A {
+ public void irrelevant(p1.p2.p3.DeleteMe arg) {}
+ public static class A_Inner {}
+}
diff --git a/test/files/run/sd275-java/DeleteMe.java b/test/files/run/sd275-java/DeleteMe.java
new file mode 100644
index 0000000000..ccff2951d0
--- /dev/null
+++ b/test/files/run/sd275-java/DeleteMe.java
@@ -0,0 +1,4 @@
+package p1.p2.p3;
+
+public class DeleteMe {}
+
diff --git a/test/files/run/sd275-java/LeaveMe.java b/test/files/run/sd275-java/LeaveMe.java
new file mode 100644
index 0000000000..cb58f0080f
--- /dev/null
+++ b/test/files/run/sd275-java/LeaveMe.java
@@ -0,0 +1,3 @@
+package p1;
+
+public class LeaveMe {}
diff --git a/test/files/run/sd275-java/Test.scala b/test/files/run/sd275-java/Test.scala
new file mode 100644
index 0000000000..84187527d2
--- /dev/null
+++ b/test/files/run/sd275-java/Test.scala
@@ -0,0 +1,39 @@
+import scala.tools.partest._
+import java.io.File
+
+object Test extends StoreReporterDirectTest {
+ def code = ???
+
+ def compileCode(code: String) = {
+ val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator")
+ compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(code)
+ }
+
+ def show(): Unit = {
+ deletePackage("p1/p2/p3")
+ deletePackage("p1/p2")
+
+ compileCode("""
+package sample
+
+class Test {
+ final class Inner extends A.A_Inner {
+ def foo = 42
+ }
+
+ def test = new Inner().foo
+}
+ """)
+ assert(storeReporter.infos.isEmpty, storeReporter.infos.mkString("\n"))
+ }
+
+ def deletePackage(name: String) {
+ val directory = new File(testOutput.path, name)
+ for (f <- directory.listFiles()) {
+ assert(f.getName.endsWith(".class"))
+ assert(f.delete())
+ }
+ assert(directory.listFiles().isEmpty)
+ assert(directory.delete())
+ }
+}
diff --git a/test/files/run/sd275.scala b/test/files/run/sd275.scala
new file mode 100644
index 0000000000..8cdee3ae15
--- /dev/null
+++ b/test/files/run/sd275.scala
@@ -0,0 +1,60 @@
+import scala.tools.partest._
+import java.io.File
+
+object Test extends StoreReporterDirectTest {
+ def code = ???
+
+ def compileCode(code: String) = {
+ val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator")
+ compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(code)
+ }
+
+ def show(): Unit = {
+ compileCode("""
+package sample {
+
+ class A1 {
+ def irrelevant: p1.p2.p3.DeleteMe = null
+ }
+ object A1 {
+ class A1_Inner
+ }
+}
+
+package p1 {
+ class LeaveMe
+ package p2 {
+ package p3 {
+ class DeleteMe
+ }
+ }
+}
+ """)
+ assert(filteredInfos.isEmpty, filteredInfos)
+ deletePackage("p1/p2/p3")
+ deletePackage("p1/p2")
+
+ compileCode("""
+package sample
+
+class Test {
+ final class Inner extends A1.A1_Inner {
+ def foo = 42
+ }
+
+ def test = new Inner().foo
+}
+ """)
+ assert(storeReporter.infos.isEmpty, storeReporter.infos.mkString("\n")) // Included a MissingRequirementError before.
+ }
+
+ def deletePackage(name: String) {
+ val directory = new File(testOutput.path, name)
+ for (f <- directory.listFiles()) {
+ assert(f.getName.endsWith(".class"))
+ assert(f.delete())
+ }
+ assert(directory.listFiles().isEmpty)
+ assert(directory.delete())
+ }
+}
diff --git a/test/files/run/sd329.scala b/test/files/run/sd329.scala
new file mode 100644
index 0000000000..c934e2c986
--- /dev/null
+++ b/test/files/run/sd329.scala
@@ -0,0 +1,76 @@
+object Test extends App {
+ def d1: Double = 0.0
+ def d2: Double = -0.0
+ def d3: Double = Double.NaN
+ def d4: Double = Double.NaN
+ assert(d1 == d2)
+ assert(d3 != d4)
+
+ def d1B: java.lang.Double = d1
+ def d2B: java.lang.Double = d2
+ def d3B: java.lang.Double = d3
+ def d4B: java.lang.Double = d4
+ assert(d1B == d2B)
+ assert(d1 == d1B)
+ assert(d1B == d1)
+ assert(d3B != d4B)
+ assert(d3 != d4B)
+ assert(d3B != d4)
+
+ assert(!d1B.equals(d2B)) // ! see javadoc
+ assert( d3B.equals(d4B)) // ! see javadoc
+
+ def d1A: Any = d1
+ def d2A: Any = d2
+ def d3A: Any = d3
+ def d4A: Any = d4
+ assert(d1A == d2A)
+ assert(d1 == d1A)
+ assert(d1A == d1)
+ assert(d1B == d1A)
+ assert(d1A == d1B)
+
+ assert(d3A != d4A)
+ assert(d3 != d4A)
+ assert(d3A != d4)
+ assert(d3B != d4A)
+ assert(d3A != d4B)
+
+
+ def f1: Float = 0.0f
+ def f2: Float = -0.0f
+ def f3: Float = Float.NaN
+ def f4: Float = Float.NaN
+ assert(f1 == f2)
+ assert(f3 != f4)
+
+ def f1B: java.lang.Float = f1
+ def f2B: java.lang.Float = f2
+ def f3B: java.lang.Float = f3
+ def f4B: java.lang.Float = f4
+ assert(f1B == f2B)
+ assert(f1 == f1B)
+ assert(f1B == f1)
+ assert(f3B != f4B)
+ assert(f3 != f4B)
+ assert(f3B != f4)
+
+ assert(!f1B.equals(f2B)) // ! see javadoc
+ assert( f3B.equals(f4B)) // ! see javadoc
+
+ def f1A: Any = f1
+ def f2A: Any = f2
+ def f3A: Any = f3
+ def f4A: Any = f4
+ assert(f1A == f2A)
+ assert(f1 == f1A)
+ assert(f1A == f1)
+ assert(f1B == f1A)
+ assert(f1A == f1B)
+
+ assert(f3A != f4A)
+ assert(f3 != f4A)
+ assert(f3A != f4)
+ assert(f3B != f4A)
+ assert(f3A != f4B)
+}
diff --git a/test/files/run/showdecl.check b/test/files/run/showdecl.check
index b8d7f94c57..d431c36f6d 100644
--- a/test/files/run/showdecl.check
+++ b/test/files/run/showdecl.check
@@ -8,7 +8,7 @@ initialized y: lazy val y: Int
uninitialized z: def z: <?>
initialized z: def z: Int
uninitialized t: def t: <?>
-initialized t: def t[T <: Int](x: D)(y: x.W): Int
+initialized t: def t[T <: <?>](x: D)(y: x.W): Int
uninitialized W: type W = String
initialized W: type W = String
uninitialized C: class C extends
diff --git a/test/files/run/showdecl/Macros_1.scala b/test/files/run/showdecl/Macros_1.scala
index c68dd275de..89b8e8d3c2 100644
--- a/test/files/run/showdecl/Macros_1.scala
+++ b/test/files/run/showdecl/Macros_1.scala
@@ -9,7 +9,7 @@ object Macros {
import c.universe._
def test(sym: Symbol): Unit = {
println(s"uninitialized ${sym.name}: ${showDecl(sym)}")
- sym.info
+ sym.info // NOTE: not fullyInitializeSymbol, so some parts may still be LazyTypes
println(s"initialized ${sym.name}: ${showDecl(sym)}")
}
diff --git a/test/files/run/showraw_mods.check b/test/files/run/showraw_mods.check
index 4d34160422..5afd7a438f 100644
--- a/test/files/run/showraw_mods.check
+++ b/test/files/run/showraw_mods.check
@@ -1 +1 @@
-Block(List(ClassDef(Modifiers(ABSTRACT | DEFAULTPARAM/TRAIT), TypeName("C"), List(), Template(List(Ident(TypeName("AnyRef"))), noSelfType, List(DefDef(Modifiers(), TermName("$init$"), List(), List(List()), TypeTree(), Block(List(), Literal(Constant(())))), ValDef(Modifiers(PRIVATE | LOCAL), TermName("x"), TypeTree(), Literal(Constant(2))), ValDef(Modifiers(MUTABLE), TermName("y"), TypeTree(), Select(This(TypeName("C")), TermName("x"))), ValDef(Modifiers(LAZY), TermName("z"), TypeTree(), Select(This(TypeName("C")), TermName("y"))))))), Literal(Constant(())))
+Block(List(ClassDef(Modifiers(ABSTRACT | DEFAULTPARAM/TRAIT), TypeName("C"), List(), Template(List(Ident(TypeName("AnyRef"))), noSelfType, List(DefDef(Modifiers(), TermName("$init$"), List(), List(List()), TypeTree(), Block(List(), Literal(Constant(())))), ValDef(Modifiers(PRIVATE | LOCAL), TermName("x"), TypeTree(), Literal(Constant(2))), ValDef(Modifiers(MUTABLE), TermName("y"), TypeTree(), Select(This(TypeName("C")), TermName("x"))), DefDef(Modifiers(METHOD | ACCESSOR), TermName("y_$eq"), List(), List(List(ValDef(Modifiers(PARAM | SYNTHETIC), TermName("x$1"), TypeTree(), EmptyTree))), TypeTree(), EmptyTree), ValDef(Modifiers(LAZY), TermName("z"), TypeTree(), Select(This(TypeName("C")), TermName("y"))))))), Literal(Constant(())))
diff --git a/test/files/run/showraw_tree_types_ids.check b/test/files/run/showraw_tree_types_ids.check
index 75347463cb..e122148040 100644
--- a/test/files/run/showraw_tree_types_ids.check
+++ b/test/files/run/showraw_tree_types_ids.check
@@ -4,9 +4,9 @@ Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](sca
[3] TypeRef(ThisType(scala.collection.immutable#<id>), scala.collection.immutable.HashMap#<id>, List())
[4] TypeRef(SingleType(ThisType(scala#<id>), scala.Predef#<id>), TypeName("String")#<id>, List())
[5] SingleType(ThisType(scala#<id>), scala.Predef#<id>)
-Apply[6](Select[7](New[6](TypeTree[6]().setOriginal(AppliedTypeTree(Ident[8](scala.collection.mutable.HashMap#<id>), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#<id>), TypeName("String")#<id>)), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#<id>), TypeName("String")#<id>)))))), termNames.CONSTRUCTOR#<id>), List())
+Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](scala.collection.mutable.HashMap#<id>), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#<id>), TypeName("String")#<id>)), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#<id>), TypeName("String")#<id>)))))), termNames.CONSTRUCTOR#<id>), List())
+[1] TypeRef(ThisType(scala.collection.mutable#<id>), scala.collection.mutable.HashMap#<id>, List(TypeRef(SingleType(ThisType(scala#<id>), scala.Predef#<id>), TypeName("String")#<id>, List()), TypeRef(SingleType(ThisType(scala#<id>), scala.Predef#<id>), TypeName("String")#<id>, List())))
+[2] MethodType(List(), TypeRef(ThisType(scala.collection.mutable#<id>), scala.collection.mutable.HashMap#<id>, List(TypeRef(SingleType(ThisType(scala#<id>), scala.Predef#<id>), TypeName("String")#<id>, List()), TypeRef(SingleType(ThisType(scala#<id>), scala.Predef#<id>), TypeName("String")#<id>, List()))))
+[3] TypeRef(ThisType(scala.collection.mutable#<id>), scala.collection.mutable.HashMap#<id>, List())
[4] TypeRef(SingleType(ThisType(scala#<id>), scala.Predef#<id>), TypeName("String")#<id>, List())
[5] SingleType(ThisType(scala#<id>), scala.Predef#<id>)
-[6] TypeRef(ThisType(scala.collection.mutable#<id>), scala.collection.mutable.HashMap#<id>, List(TypeRef(SingleType(ThisType(scala#<id>), scala.Predef#<id>), TypeName("String")#<id>, List()), TypeRef(SingleType(ThisType(scala#<id>), scala.Predef#<id>), TypeName("String")#<id>, List())))
-[7] MethodType(List(), TypeRef(ThisType(scala.collection.mutable#<id>), scala.collection.mutable.HashMap#<id>, List(TypeRef(SingleType(ThisType(scala#<id>), scala.Predef#<id>), TypeName("String")#<id>, List()), TypeRef(SingleType(ThisType(scala#<id>), scala.Predef#<id>), TypeName("String")#<id>, List()))))
-[8] TypeRef(ThisType(scala.collection.mutable#<id>), scala.collection.mutable.HashMap#<id>, List())
diff --git a/test/files/run/showraw_tree_types_typed.check b/test/files/run/showraw_tree_types_typed.check
index de691e369e..4934ed41dc 100644
--- a/test/files/run/showraw_tree_types_typed.check
+++ b/test/files/run/showraw_tree_types_typed.check
@@ -4,9 +4,9 @@ Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](sca
[3] TypeRef(ThisType(scala.collection.immutable), scala.collection.immutable.HashMap, List())
[4] TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List())
[5] SingleType(ThisType(scala), scala.Predef)
-Apply[6](Select[7](New[6](TypeTree[6]().setOriginal(AppliedTypeTree(Ident[8](scala.collection.mutable.HashMap), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef), TypeName("String"))), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef), TypeName("String"))))))), termNames.CONSTRUCTOR), List())
+Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](scala.collection.mutable.HashMap), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef), TypeName("String"))), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef), TypeName("String"))))))), termNames.CONSTRUCTOR), List())
+[1] TypeRef(ThisType(scala.collection.mutable), scala.collection.mutable.HashMap, List(TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()), TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List())))
+[2] MethodType(List(), TypeRef(ThisType(scala.collection.mutable), scala.collection.mutable.HashMap, List(TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()), TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()))))
+[3] TypeRef(ThisType(scala.collection.mutable), scala.collection.mutable.HashMap, List())
[4] TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List())
[5] SingleType(ThisType(scala), scala.Predef)
-[6] TypeRef(ThisType(scala.collection.mutable), scala.collection.mutable.HashMap, List(TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()), TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List())))
-[7] MethodType(List(), TypeRef(ThisType(scala.collection.mutable), scala.collection.mutable.HashMap, List(TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()), TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()))))
-[8] TypeRef(ThisType(scala.collection.mutable), scala.collection.mutable.HashMap, List())
diff --git a/test/files/run/showraw_tree_ultimate.check b/test/files/run/showraw_tree_ultimate.check
index 81efcc05ab..b94d568a75 100644
--- a/test/files/run/showraw_tree_ultimate.check
+++ b/test/files/run/showraw_tree_ultimate.check
@@ -4,9 +4,9 @@ Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](sca
[3] TypeRef(ThisType(scala.collection.immutable#<id>#PKC), scala.collection.immutable.HashMap#<id>#CLS, List())
[4] TypeRef(SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List())
[5] SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD)
-Apply[6](Select[7](New[6](TypeTree[6]().setOriginal(AppliedTypeTree(Ident[8](scala.collection.mutable.HashMap#<id>#CLS), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE)), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE)))))), termNames.CONSTRUCTOR#<id>#CTOR), List())
+Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](scala.collection.mutable.HashMap#<id>#CLS), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE)), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE)))))), termNames.CONSTRUCTOR#<id>#CTOR), List())
+[1] TypeRef(ThisType(scala.collection.mutable#<id>#PKC), scala.collection.mutable.HashMap#<id>#CLS, List(TypeRef(SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()), TypeRef(SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List())))
+[2] MethodType(List(), TypeRef(ThisType(scala.collection.mutable#<id>#PKC), scala.collection.mutable.HashMap#<id>#CLS, List(TypeRef(SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()), TypeRef(SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()))))
+[3] TypeRef(ThisType(scala.collection.mutable#<id>#PKC), scala.collection.mutable.HashMap#<id>#CLS, List())
[4] TypeRef(SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List())
[5] SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD)
-[6] TypeRef(ThisType(scala.collection.mutable#<id>#PKC), scala.collection.mutable.HashMap#<id>#CLS, List(TypeRef(SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()), TypeRef(SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List())))
-[7] MethodType(List(), TypeRef(ThisType(scala.collection.mutable#<id>#PKC), scala.collection.mutable.HashMap#<id>#CLS, List(TypeRef(SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()), TypeRef(SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()))))
-[8] TypeRef(ThisType(scala.collection.mutable#<id>#PKC), scala.collection.mutable.HashMap#<id>#CLS, List())
diff --git a/test/files/run/stringinterpolation_macro-run.check b/test/files/run/stringinterpolation_macro-run.check
deleted file mode 100644
index c7f46bac87..0000000000
--- a/test/files/run/stringinterpolation_macro-run.check
+++ /dev/null
@@ -1,71 +0,0 @@
-false
-false
-true
-false
-true
-FALSE
-FALSE
-TRUE
-FALSE
-TRUE
-true
-false
-null
-0
-80000000
-4c01926
-NULL
-4C01926
-null
-NULL
-Scala
-SCALA
-5
-x
-x
-x
-x
-x
-x
-x
-x
-x
-x
-x
-x
-S
-120
-120
-120
-120
-120
-120
-120
-120
-120
-120
-120
-120
- 0X4
-She is 4 feet tall.
-120
-42
-3.400000e+00
-3.400000e+00
-3.400000e+00
-3.400000e+00
-3.400000e+00
-3.400000e+00
-3.000000e+00
-3.000000e+00
-05/26/12
-05/26/12
-05/26/12
-05/26/12
-%
- mind
-------
-matter
-
-7 7 9
-7 9 9
diff --git a/test/files/run/stringinterpolation_macro-run.scala b/test/files/run/stringinterpolation_macro-run.scala
deleted file mode 100644
index ae7c0e5d7a..0000000000
--- a/test/files/run/stringinterpolation_macro-run.scala
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * filter: inliner warnings; re-run with
- */
-object Test extends App {
-
-// 'b' / 'B' (category: general)
-// -----------------------------
-println(f"${null}%b")
-println(f"${false}%b")
-println(f"${true}%b")
-println(f"${new java.lang.Boolean(false)}%b")
-println(f"${new java.lang.Boolean(true)}%b")
-
-println(f"${null}%B")
-println(f"${false}%B")
-println(f"${true}%B")
-println(f"${new java.lang.Boolean(false)}%B")
-println(f"${new java.lang.Boolean(true)}%B")
-
-implicit val stringToBoolean = java.lang.Boolean.parseBoolean(_: String)
-println(f"${"true"}%b")
-println(f"${"false"}%b")
-
-// 'h' | 'H' (category: general)
-// -----------------------------
-println(f"${null}%h")
-println(f"${0.0}%h")
-println(f"${-0.0}%h")
-println(f"${"Scala"}%h")
-
-println(f"${null}%H")
-println(f"${"Scala"}%H")
-
-// 's' | 'S' (category: general)
-// -----------------------------
-println(f"${null}%s")
-println(f"${null}%S")
-println(f"${"Scala"}%s")
-println(f"${"Scala"}%S")
-println(f"${5}")
-
-// 'c' | 'C' (category: character)
-// -------------------------------
-println(f"${120:Char}%c")
-println(f"${120:Byte}%c")
-println(f"${120:Short}%c")
-println(f"${120:Int}%c")
-println(f"${new java.lang.Character('x')}%c")
-println(f"${new java.lang.Byte(120:Byte)}%c")
-println(f"${new java.lang.Short(120:Short)}%c")
-println(f"${new java.lang.Integer(120)}%c")
-
-println(f"${'x' : java.lang.Character}%c")
-println(f"${(120:Byte) : java.lang.Byte}%c")
-println(f"${(120:Short) : java.lang.Short}%c")
-println(f"${120 : java.lang.Integer}%c")
-
-implicit val stringToChar = (x: String) => x(0)
-println(f"${"Scala"}%c")
-
-// 'd' | 'o' | 'x' | 'X' (category: integral)
-// ------------------------------------------
-println(f"${120:Byte}%d")
-println(f"${120:Short}%d")
-println(f"${120:Int}%d")
-println(f"${120:Long}%d")
-println(f"${new java.lang.Byte(120:Byte)}%d")
-println(f"${new java.lang.Short(120:Short)}%d")
-println(f"${new java.lang.Integer(120)}%d")
-println(f"${new java.lang.Long(120)}%d")
-println(f"${120 : java.lang.Integer}%d")
-println(f"${120 : java.lang.Long}%d")
-println(f"${BigInt(120)}%d")
-println(f"${new java.math.BigInteger("120")}%d")
-println(f"${4}%#10X")
-
-locally {
- val fff = new java.util.Formattable {
- def formatTo(f: java.util.Formatter, g: Int, w: Int, p: Int) = f.format("4")
- }
- println(f"She is ${fff}%#s feet tall.")
-}
-
-{
- implicit val strToShort = (s: String) => java.lang.Short.parseShort(s)
- println(f"${"120"}%d")
- implicit val strToInt = (s: String) => 42
- println(f"${"120"}%d")
-}
-
-// 'e' | 'E' | 'g' | 'G' | 'f' | 'a' | 'A' (category: floating point)
-// ------------------------------------------------------------------
-println(f"${3.4f}%e")
-println(f"${3.4}%e")
-println(f"${3.4f : java.lang.Float}%e")
-println(f"${3.4 : java.lang.Double}%e")
-println(f"${BigDecimal(3.4)}%e")
-println(f"${new java.math.BigDecimal(3.4)}%e")
-println(f"${3}%e")
-println(f"${3L}%e")
-
-// 't' | 'T' (category: date/time)
-// -------------------------------
-import java.util.Calendar
-import java.util.Locale
-val c = Calendar.getInstance(Locale.US)
-c.set(2012, Calendar.MAY, 26)
-println(f"${c}%TD")
-println(f"${c.getTime}%TD")
-println(f"${c.getTime.getTime}%TD")
-
-implicit val strToDate = (x: String) => c
-println(f"""${"1234"}%TD""")
-
-
-// literals and arg indexes
-println(f"%%")
-println(f" mind%n------%nmatter%n")
-println(f"${7}%d %<d ${9}%d")
-println(f"${7}%d %2$$d ${9}%d")
-
-}
diff --git a/test/files/run/synchronized.check b/test/files/run/synchronized.check
index dd9f4ef424..a7d75fa673 100644
--- a/test/files/run/synchronized.check
+++ b/test/files/run/synchronized.check
@@ -62,67 +62,67 @@
|.... O1.O.gi: OK
|...... O1.O.gv: OK
|...... O1.O.gf: OK
- .|..... c2.f1: OK
- .|..... c2.fi: OK
- .|....... c2.fv: OK
- .|....... c2.ff: OK
- .|..... c2.fl: OK
- .|....... c2.fo: OK
- |....... c2.g1: OK
- |....... c2.gi: OK
- |......... c2.gv: OK
- |......... c2.gf: OK
- .|........ c2.c.f1: OK
- .|........ c2.c.fi: OK
- .|.......... c2.c.fv: OK
- .|.......... c2.c.ff: OK
- .|........ c2.c.fl: OK
- .|.......... c2.c.fo: OK
- .|....... c2.c.fn: OK
- |......... c2.c.g1: OK
- |......... c2.c.gi: OK
- |........... c2.c.gv: OK
- |........... c2.c.gf: OK
- .|........ c2.O.f1: OK
- .|........ c2.O.fi: OK
- .|.......... c2.O.fv: OK
- .|.......... c2.O.ff: OK
- .|........ c2.O.fl: OK
- .|.......... c2.O.fo: OK
- .|....... c2.O.fn: OK
- |......... c2.O.g1: OK
- |......... c2.O.gi: OK
- |........... c2.O.gv: OK
- |........... c2.O.gf: OK
- .|..... O2.f1: OK
- .|..... O2.fi: OK
- .|....... O2.fv: OK
- .|....... O2.ff: OK
- .|..... O2.fl: OK
- .|....... O2.fo: OK
- |....... O2.g1: OK
- |....... O2.gi: OK
- |......... O2.gv: OK
- |......... O2.gf: OK
- .|........ O2.c.f1: OK
- .|........ O2.c.fi: OK
- .|.......... O2.c.fv: OK
- .|.......... O2.c.ff: OK
- .|........ O2.c.fl: OK
- .|.......... O2.c.fo: OK
- .|....... O2.c.fn: OK
- |......... O2.c.g1: OK
- |......... O2.c.gi: OK
- |........... O2.c.gv: OK
- |........... O2.c.gf: OK
- .|........ O2.O.f1: OK
- .|........ O2.O.fi: OK
- .|.......... O2.O.fv: OK
- .|.......... O2.O.ff: OK
- .|........ O2.O.fl: OK
- .|.......... O2.O.fo: OK
- .|....... O2.O.fn: OK
- |......... O2.O.g1: OK
- |......... O2.O.gi: OK
- |........... O2.O.gv: OK
- |........... O2.O.gf: OK
+ .|.... c2.f1: OK
+ .|.... c2.fi: OK
+ .|...... c2.fv: OK
+ .|...... c2.ff: OK
+ .|.... c2.fl: OK
+ .|...... c2.fo: OK
+ |...... c2.g1: OK
+ |...... c2.gi: OK
+ |........ c2.gv: OK
+ |........ c2.gf: OK
+ .|....... c2.c.f1: OK
+ .|....... c2.c.fi: OK
+ .|......... c2.c.fv: OK
+ .|......... c2.c.ff: OK
+ .|....... c2.c.fl: OK
+ .|......... c2.c.fo: OK
+ .|...... c2.c.fn: OK
+ |........ c2.c.g1: OK
+ |........ c2.c.gi: OK
+ |.......... c2.c.gv: OK
+ |.......... c2.c.gf: OK
+ .|....... c2.O.f1: OK
+ .|....... c2.O.fi: OK
+ .|......... c2.O.fv: OK
+ .|......... c2.O.ff: OK
+ .|....... c2.O.fl: OK
+ .|......... c2.O.fo: OK
+ .|...... c2.O.fn: OK
+ |........ c2.O.g1: OK
+ |........ c2.O.gi: OK
+ |.......... c2.O.gv: OK
+ |.......... c2.O.gf: OK
+ .|.... O2.f1: OK
+ .|.... O2.fi: OK
+ .|...... O2.fv: OK
+ .|...... O2.ff: OK
+ .|.... O2.fl: OK
+ .|...... O2.fo: OK
+ |...... O2.g1: OK
+ |...... O2.gi: OK
+ |........ O2.gv: OK
+ |........ O2.gf: OK
+ .|....... O2.c.f1: OK
+ .|....... O2.c.fi: OK
+ .|......... O2.c.fv: OK
+ .|......... O2.c.ff: OK
+ .|....... O2.c.fl: OK
+ .|......... O2.c.fo: OK
+ .|...... O2.c.fn: OK
+ |........ O2.c.g1: OK
+ |........ O2.c.gi: OK
+ |.......... O2.c.gv: OK
+ |.......... O2.c.gf: OK
+ .|....... O2.O.f1: OK
+ .|....... O2.O.fi: OK
+ .|......... O2.O.fv: OK
+ .|......... O2.O.ff: OK
+ .|....... O2.O.fl: OK
+ .|......... O2.O.fo: OK
+ .|...... O2.O.fn: OK
+ |........ O2.O.g1: OK
+ |........ O2.O.gi: OK
+ |.......... O2.O.gv: OK
+ |.......... O2.O.gf: OK
diff --git a/test/files/run/synchronized.flags b/test/files/run/synchronized.flags
index 49d036a887..82eb1b9bdd 100644
--- a/test/files/run/synchronized.flags
+++ b/test/files/run/synchronized.flags
@@ -1 +1 @@
--optimize
+-opt:l:project
diff --git a/test/files/run/synchronized.scala b/test/files/run/synchronized.scala
index 077e9d02e8..d777b85b2c 100644
--- a/test/files/run/synchronized.scala
+++ b/test/files/run/synchronized.scala
@@ -1,5 +1,5 @@
/*
- * filter: inliner warnings; re-run with
+ * filter: inliner warnings;
*/
import java.lang.Thread.holdsLock
import scala.collection.mutable.StringBuilder
@@ -201,88 +201,86 @@ object O1 {
trait T {
import Util._
- val Tclass = Class.forName("T$class")
-
val lock = new AnyRef
- def f1 = synchronized { checkLocks(this)(this.getClass, classOf[T], Tclass, classOf[C2], O2.getClass) }
- @inline final def fi = synchronized { checkLocks(this)(this.getClass, classOf[T], Tclass, classOf[C2], O2.getClass) }
- val fv: () => Boolean = () => synchronized { checkLocks(this)(this.getClass, fv, fv.getClass, classOf[T], Tclass, classOf[C2], O2.getClass) }
+ def f1 = synchronized { checkLocks(this)(this.getClass, classOf[T], classOf[C2], O2.getClass) }
+ @inline final def fi = synchronized { checkLocks(this)(this.getClass, classOf[T], classOf[C2], O2.getClass) }
+ val fv: () => Boolean = () => synchronized { checkLocks(this)(this.getClass, fv, fv.getClass, classOf[T], classOf[C2], O2.getClass) }
def ff = {
- lazy val ffv: AnyRef => Boolean = lock => synchronized { checkLocks(lock)(ffv, ffv.getClass, lock.getClass, classOf[T], Tclass, classOf[C2], O2.getClass) }
+ lazy val ffv: AnyRef => Boolean = lock => synchronized { checkLocks(lock)(ffv, ffv.getClass, lock.getClass, classOf[T], classOf[C2], O2.getClass) }
ffv(this)
}
def fl = {
- lazy val flv = synchronized { checkLocks(this)(this.getClass, classOf[T], Tclass, classOf[C2], O2.getClass) }
+ lazy val flv = synchronized { checkLocks(this)(this.getClass, classOf[T], classOf[C2], O2.getClass) }
flv
}
- def fo = lock.synchronized { checkLocks(lock)(lock.getClass, this, this.getClass, classOf[T], Tclass, classOf[C2], O2.getClass) }
+ def fo = lock.synchronized { checkLocks(lock)(lock.getClass, this, this.getClass, classOf[T], classOf[C2], O2.getClass) }
- def g1 = checkLocks()(this, this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass)
- @inline final def gi = checkLocks()(this, this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass)
- val gv: () => Boolean = () => checkLocks()(this, this.getClass, gv, gv.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass)
+ def g1 = checkLocks()(this, this.getClass, classOf[T], classOf[C2], O2, O2.getClass)
+ @inline final def gi = checkLocks()(this, this.getClass, classOf[T], classOf[C2], O2, O2.getClass)
+ val gv: () => Boolean = () => checkLocks()(this, this.getClass, gv, gv.getClass, classOf[T], classOf[C2], O2, O2.getClass)
def gf = {
- lazy val gfv: AnyRef => Boolean = lock => checkLocks()(gfv, gfv.getClass, lock, lock.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass)
+ lazy val gfv: AnyRef => Boolean = lock => checkLocks()(gfv, gfv.getClass, lock, lock.getClass, classOf[T], classOf[C2], O2, O2.getClass)
gfv(this)
}
def gl = {
- lazy val glv = checkLocks()(this, this.getClass, classOf[T], Tclass, classOf[C2], O2.getClass)
+ lazy val glv = checkLocks()(this, this.getClass, classOf[T], classOf[C2], O2.getClass)
glv
}
class C {
- def f1 = synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) }
- @inline final def fi = synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) }
- val fv: () => Boolean = () => synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, fv, fv.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) }
+ def f1 = synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, classOf[T], classOf[C2], O2, O2.getClass) }
+ @inline final def fi = synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, classOf[T], classOf[C2], O2, O2.getClass) }
+ val fv: () => Boolean = () => synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, fv, fv.getClass, classOf[T], classOf[C2], O2, O2.getClass) }
def ff = {
- lazy val ffv: AnyRef => Boolean = lock => synchronized { checkLocks(lock)(ffv, ffv.getClass, lock.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) }
+ lazy val ffv: AnyRef => Boolean = lock => synchronized { checkLocks(lock)(ffv, ffv.getClass, lock.getClass, T.this, T.this.getClass, classOf[T], classOf[C2], O2, O2.getClass) }
ffv(this)
}
def fl = {
- lazy val flv = synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) }
+ lazy val flv = synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, classOf[T], classOf[C2], O2, O2.getClass) }
flv
}
- def fo = lock.synchronized { checkLocks(lock)(lock.getClass, this, this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) }
- def fn = T.this.synchronized { checkLocks(T.this)(T.this.getClass, this, this.getClass, classOf[T], Tclass, classOf[C2], O2.getClass) }
+ def fo = lock.synchronized { checkLocks(lock)(lock.getClass, this, this.getClass, T.this, T.this.getClass, classOf[T], classOf[C2], O2, O2.getClass) }
+ def fn = T.this.synchronized { checkLocks(T.this)(T.this.getClass, this, this.getClass, classOf[T], classOf[C2], O2.getClass) }
- def g1 = checkLocks()(this, this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass)
- @inline final def gi = checkLocks()(this, this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass)
- val gv: () => Boolean = () => checkLocks()(this, this.getClass, T.this, T.this.getClass, gv, gv.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass)
+ def g1 = checkLocks()(this, this.getClass, T.this, T.this.getClass, classOf[T], classOf[C2], O2, O2.getClass)
+ @inline final def gi = checkLocks()(this, this.getClass, T.this, T.this.getClass, classOf[T], classOf[C2], O2, O2.getClass)
+ val gv: () => Boolean = () => checkLocks()(this, this.getClass, T.this, T.this.getClass, gv, gv.getClass, classOf[T], classOf[C2], O2, O2.getClass)
def gf = {
- lazy val gfv: AnyRef => Boolean = lock => checkLocks()(gfv, gfv.getClass, lock, lock.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass)
+ lazy val gfv: AnyRef => Boolean = lock => checkLocks()(gfv, gfv.getClass, lock, lock.getClass, T.this, T.this.getClass, classOf[T], classOf[C2], O2, O2.getClass)
gfv(this)
}
def gl = {
- lazy val glv = checkLocks()(this, this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass)
+ lazy val glv = checkLocks()(this, this.getClass, T.this, T.this.getClass, classOf[T], classOf[C2], O2, O2.getClass)
glv
}
}
val c = new C
object O {
- def f1 = synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) }
- @inline final def fi = synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) }
- val fv: () => Boolean = () => synchronized { checkLocks(this)(this.getClass, fv, fv.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) }
+ def f1 = synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, classOf[T], classOf[C2], O2, O2.getClass) }
+ @inline final def fi = synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, classOf[T], classOf[C2], O2, O2.getClass) }
+ val fv: () => Boolean = () => synchronized { checkLocks(this)(this.getClass, fv, fv.getClass, T.this, T.this.getClass, classOf[T], classOf[C2], O2, O2.getClass) }
def ff = {
- lazy val ffv: AnyRef => Boolean = lock => synchronized { checkLocks(lock)(lock.getClass, ffv, ffv.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) }
+ lazy val ffv: AnyRef => Boolean = lock => synchronized { checkLocks(lock)(lock.getClass, ffv, ffv.getClass, T.this, T.this.getClass, classOf[T], classOf[C2], O2, O2.getClass) }
ffv(this)
}
def fl = {
- lazy val flv = synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) }
+ lazy val flv = synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, classOf[T], classOf[C2], O2, O2.getClass) }
flv
}
- def fo = lock.synchronized { checkLocks(lock)(lock.getClass, this, this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) }
- def fn = T.this.synchronized { checkLocks(T.this)(T.this.getClass, this, this.getClass, classOf[T], Tclass, classOf[C2], O2.getClass) }
+ def fo = lock.synchronized { checkLocks(lock)(lock.getClass, this, this.getClass, T.this, T.this.getClass, classOf[T], classOf[C2], O2, O2.getClass) }
+ def fn = T.this.synchronized { checkLocks(T.this)(T.this.getClass, this, this.getClass, classOf[T], classOf[C2], O2.getClass) }
- def g1 = checkLocks()(this, this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass)
- @inline final def gi = checkLocks()(this, this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass)
- val gv: () => Boolean = () => checkLocks()(this, this.getClass, gv, gv.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass)
+ def g1 = checkLocks()(this, this.getClass, T.this, T.this.getClass, classOf[T], classOf[C2], O2, O2.getClass)
+ @inline final def gi = checkLocks()(this, this.getClass, T.this, T.this.getClass, classOf[T], classOf[C2], O2, O2.getClass)
+ val gv: () => Boolean = () => checkLocks()(this, this.getClass, gv, gv.getClass, T.this, T.this.getClass, classOf[T], classOf[C2], O2, O2.getClass)
def gf = {
- lazy val gfv: AnyRef => Boolean = lock => checkLocks()(lock, lock.getClass, gfv, gfv.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass)
+ lazy val gfv: AnyRef => Boolean = lock => checkLocks()(lock, lock.getClass, gfv, gfv.getClass, T.this, T.this.getClass, classOf[T], classOf[C2], O2, O2.getClass)
gfv(this)
}
def gl = {
- lazy val glv = checkLocks()(this, this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass)
+ lazy val glv = checkLocks()(this, this.getClass, T.this, T.this.getClass, classOf[T], classOf[C2], O2, O2.getClass)
glv
}
}
@@ -449,4 +447,4 @@ object Test extends App {
check("O2.O.gv", O2.O.gv())
check("O2.O.gf", O2.O.gf)
// check("O2.O.gl", O2.O.gl)
-} \ No newline at end of file
+}
diff --git a/test/files/run/t10009.scala b/test/files/run/t10009.scala
new file mode 100644
index 0000000000..2a318752f1
--- /dev/null
+++ b/test/files/run/t10009.scala
@@ -0,0 +1,28 @@
+import scala.reflect.runtime.currentMirror
+import scala.reflect.runtime.universe._
+import scala.tools.reflect.ToolBox
+
+object Test {
+ def test(code: String, log: Boolean = false) {
+ val tb = currentMirror.mkToolBox()
+ val tree = tb.parse(code)
+ val typed = tb.typecheck(tree)
+ if (log) {
+ println("=" * 80)
+ println(typed)
+ }
+ val untyped = tb.untypecheck(typed)
+ if (log) println(untyped)
+ val retyped = tb.typecheck(untyped)
+ if (log) println(retyped)
+ }
+ def main(args: Array[String]): Unit = {
+ test("{ class a { val x = 42 }; new a }") // failed
+ test("{ trait a { val x = 42 }; new a {} }") // worked
+ test("{ abstract class a { val x: Int } }") // worked
+ test("{ abstract class a { val x: Int }; new a { val x = 42 } }") // failed
+ test("{ class a { private val x = 42 }; new a }") // failed
+ test("{ class a { protected val x = 42 }; new a { x } }") // failed
+ test("{ class a { protected[a] val x = 42 }; new a }") // failed
+ }
+} \ No newline at end of file
diff --git a/test/files/run/t10026.check b/test/files/run/t10026.check
new file mode 100644
index 0000000000..15a62794a9
--- /dev/null
+++ b/test/files/run/t10026.check
@@ -0,0 +1 @@
+List(1, 2, 3)
diff --git a/test/files/run/t10026.scala b/test/files/run/t10026.scala
new file mode 100644
index 0000000000..a56840c8c2
--- /dev/null
+++ b/test/files/run/t10026.scala
@@ -0,0 +1,11 @@
+import scala.reflect.runtime.universe
+import scala.tools.reflect.ToolBox
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val classloader = getClass.getClassLoader
+ val toolbox = universe.runtimeMirror(classloader).mkToolBox()
+ println(toolbox.compile(toolbox.parse("Array(1, 2, 3).toList")).apply())
+ }
+}
+
diff --git a/test/files/run/t10032.check b/test/files/run/t10032.check
new file mode 100644
index 0000000000..565fe25848
--- /dev/null
+++ b/test/files/run/t10032.check
@@ -0,0 +1,82 @@
+t1
+ i1
+ a1
+t2
+ i1
+ a1
+ a2
+ a3
+t3
+ i1
+ a1
+ a3
+t3
+ e1
+ a1
+ i2
+ a2
+ a3
+t4
+ i1
+ i2
+t4
+ e1
+ i2
+t5
+ i1
+ a1
+ a3
+t5
+ e1
+ a1
+ i2
+ a3
+t6
+ i1
+ i2
+ i3
+t6
+ e1
+ i2
+ i3
+t7
+ i1
+ a1
+t7
+ e1
+ i2
+ a1
+t8
+ i1
+ i2
+ a1
+ a2
+t8
+ e1
+ i2
+ a1
+ a2
+t9
+ i1
+ i2
+ a1
+t9
+ e1
+ i2
+ a1
+t10
+ i1
+ i2
+ i3
+t10
+ e1
+ i2
+ i3
+t11
+ i1
+ i2
+ a1
+t11
+ e1
+ i2
+ a1
diff --git a/test/files/run/t10032.scala b/test/files/run/t10032.scala
new file mode 100644
index 0000000000..f7e8ef459f
--- /dev/null
+++ b/test/files/run/t10032.scala
@@ -0,0 +1,164 @@
+object Test extends App {
+ def a1(): Unit = println(" a1")
+ def a2(): Unit = println(" a2")
+ def a3(): Unit = println(" a3")
+
+ def i1: Int = { println(" i1"); 1 }
+ def i2: Int = { println(" i2"); 2 }
+ def i3: Int = { println(" i3"); 3 }
+
+ def e1: Int = { println(" e1"); throw new Exception() }
+
+ def t1: Int = {
+ println("t1")
+ try {
+ synchronized { return i1 }
+ } finally {
+ synchronized { a1() }
+ }
+ }
+
+ def t2: Int = {
+ println("t2")
+ try {
+ try { return i1 }
+ finally { a1() }
+ } finally {
+ try { a2() }
+ finally { a3() }
+ }
+ }
+
+ def t3(i: => Int): Int = {
+ println("t3")
+ try {
+ try { return i }
+ finally { a1() }
+ } catch {
+ case _: Throwable =>
+ try { i2 }
+ finally { a2() } // no cleanup version
+ } finally {
+ a3()
+ }
+ }
+
+ def t4(i: => Int): Int = {
+ println("t4")
+ try {
+ return i
+ } finally {
+ return i2
+ }
+ }
+
+ def t5(i: => Int): Int = {
+ println("t5")
+ try {
+ try {
+ try { return i }
+ finally { a1() }
+ } catch {
+ case _: Throwable => i2
+ }
+ } finally {
+ a3()
+ }
+ }
+
+ def t6(i: => Int): Int = {
+ println("t6")
+ try {
+ try { return i }
+ finally { return i2 }
+ } finally {
+ return i3
+ }
+ }
+
+ def t7(i: => Int): Int = {
+ println("t7")
+ try { i }
+ catch {
+ case _: Throwable =>
+ return i2
+ } finally {
+ a1() // cleanup required, early return in handler
+ }
+ }
+
+ def t8(i: => Int): Int = {
+ println("t8")
+ try {
+ try { i }
+ finally { // no cleanup version
+ try { return i2 }
+ finally { a1() } // cleanup version required
+ }
+ } finally { // cleanup version required
+ a2()
+ }
+ }
+
+ def t9(i: => Int): Int = {
+ println("t9")
+ try {
+ return i
+ } finally {
+ try { return i2 }
+ finally { a1() }
+ }
+ }
+
+ def t10(i: => Int): Int = {
+ println("t10")
+ try {
+ return i
+ } finally {
+ try { return i2 }
+ finally { return i3 }
+ }
+ }
+
+ // this changed semantics between 2.12.0 and 2.12.1, see https://github.com/scala/scala/pull/5509#issuecomment-259291609
+ def t11(i: => Int): Int = {
+ println("t11")
+ try {
+ try { return i }
+ finally { return i2 }
+ } finally {
+ a1()
+ }
+ }
+
+ assert(t1 == 1)
+
+ assert(t2 == 1)
+
+ assert(t3(i1) == 1)
+ assert(t3(e1) == 2)
+
+ assert(t4(i1) == 2)
+ assert(t4(e1) == 2)
+
+ assert(t5(i1) == 1)
+ assert(t5(e1) == 2)
+
+ assert(t6(i1) == 3)
+ assert(t6(e1) == 3)
+
+ assert(t7(i1) == 1)
+ assert(t7(e1) == 2)
+
+ assert(t8(i1) == 2)
+ assert(t8(e1) == 2)
+
+ assert(t9(i1) == 2)
+ assert(t9(e1) == 2)
+
+ assert(t10(i1) == 3)
+ assert(t10(e1) == 3)
+
+ assert(t11(i1) == 2)
+ assert(t11(e1) == 2)
+}
diff --git a/test/files/run/t10037.check b/test/files/run/t10037.check
deleted file mode 100644
index 94c07bddf5..0000000000
--- a/test/files/run/t10037.check
+++ /dev/null
@@ -1,2 +0,0 @@
--1073741824
-1073741824
diff --git a/test/files/run/t10037.flags b/test/files/run/t10037.flags
deleted file mode 100644
index 2a7be92cd4..0000000000
--- a/test/files/run/t10037.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimise -Ybackend:GenASM -Yinline-warnings
diff --git a/test/files/run/t10037/shifter_2.scala b/test/files/run/t10037/shifter_2.scala
deleted file mode 100644
index 901dd2a312..0000000000
--- a/test/files/run/t10037/shifter_2.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-
-object Test extends App {
- val i = shifty.X.f(Int.MinValue)
- val j = shifty.X.g(Int.MinValue)
- println(i)
- println(j)
-}
-
diff --git a/test/files/run/t10037/shifty_1.scala b/test/files/run/t10037/shifty_1.scala
deleted file mode 100644
index 2f28da01ca..0000000000
--- a/test/files/run/t10037/shifty_1.scala
+++ /dev/null
@@ -1,7 +0,0 @@
-
-package shifty
-
-object X {
- @inline def f(i: Int): Int = i >> 1
- @inline def g(i: Int): Int = i >>> 1
-}
diff --git a/test/files/run/t10059/A.java b/test/files/run/t10059/A.java
new file mode 100644
index 0000000000..49b6447817
--- /dev/null
+++ b/test/files/run/t10059/A.java
@@ -0,0 +1,3 @@
+public class A {
+ public static int foo(T t) { return t.m(1, 2, 3); }
+}
diff --git a/test/files/run/t10059/Test.scala b/test/files/run/t10059/Test.scala
new file mode 100644
index 0000000000..7bbb623e74
--- /dev/null
+++ b/test/files/run/t10059/Test.scala
@@ -0,0 +1,9 @@
+abstract class T {
+ @annotation.varargs def m(l: Int*): Int
+}
+class C extends T {
+ override def m(l: Int*): Int = 1
+}
+object Test extends App {
+ assert(A.foo(new C) == 1)
+}
diff --git a/test/files/run/t10067.flags b/test/files/run/t10067.flags
new file mode 100644
index 0000000000..c02e5f2461
--- /dev/null
+++ b/test/files/run/t10067.flags
@@ -0,0 +1 @@
+-unchecked
diff --git a/test/files/run/t10067/OuterClass.java b/test/files/run/t10067/OuterClass.java
new file mode 100644
index 0000000000..15c2c990d7
--- /dev/null
+++ b/test/files/run/t10067/OuterClass.java
@@ -0,0 +1,7 @@
+public class OuterClass {
+ public class InnerClass { }
+
+ public Object getInnerClassInstance() {
+ return new InnerClass();
+ }
+}
diff --git a/test/files/run/t10067/Test.scala b/test/files/run/t10067/Test.scala
new file mode 100644
index 0000000000..af1e12592e
--- /dev/null
+++ b/test/files/run/t10067/Test.scala
@@ -0,0 +1,19 @@
+object Test {
+ def main(args: Array[String]): Unit = {
+ //get inner class as some instance of super type
+ var oc = new OuterClass();
+ var icObj = oc.getInnerClassInstance();
+
+ //get a stable identifier on outer class
+ val ocStable = oc;
+
+ //these will work
+ icObj.isInstanceOf[ocStable.InnerClass];
+ icObj.asInstanceOf[ocStable.InnerClass];
+
+ //this will fail with java.lang.NoSuchMethodError
+ icObj match {
+ case ic: ocStable.InnerClass => ;
+ }
+ }
+}
diff --git a/test/files/run/t10069.scala b/test/files/run/t10069.scala
new file mode 100644
index 0000000000..4e70b7e814
--- /dev/null
+++ b/test/files/run/t10069.scala
@@ -0,0 +1,34 @@
+object Expected extends Exception
+object Test {
+ def throwExpected: Nothing = throw Expected
+ def foo0(a: Array[Double]) = { // does compile for Int instead of Double
+ val v = 42
+ a(0) = throwExpected // was crash in code gen: java.lang.NegativeArraySizeException
+ }
+
+ def foo1(a: Array[Double]) = { // does compile for Int instead of Double
+ a(0) = throwExpected // was VerifyError at runtime
+ }
+
+ def foo2(a: Array[Int]) = { // does compile for Int instead of Double
+ a(0) = throwExpected // was VerifyError at runtime
+ }
+
+ def foo3(a: Array[String]) = { // does compile for Int instead of Double
+ a(0) = throwExpected // was already working
+ }
+
+
+ def main(args: Array[String]): Unit = {
+ check(foo0(new Array[Double](1)))
+ check(foo1(new Array[Double](1)))
+ check(foo2(new Array[Int](1)))
+ check(foo3(new Array[String](1)))
+ }
+ def check(f: => Any) {
+ try {f ; sys.error("no exception thrown")
+ } catch {
+ case Expected =>
+ }
+ }
+}
diff --git a/test/files/run/t10069b.scala b/test/files/run/t10069b.scala
new file mode 100644
index 0000000000..c9d652bb0c
--- /dev/null
+++ b/test/files/run/t10069b.scala
@@ -0,0 +1,13 @@
+object Test {
+ def main(args: Array[String]): Unit = {
+ try {
+ Int.box(???) // crashed the compiler: java.util.NoSuchElementException: key not found: Lscala/runtime/Nothing$;
+ sys.error("no exception")
+ } catch {
+ case _: NotImplementedError =>
+ // oka
+ case e: Throwable =>
+ sys.error("wrong exception: " + e)
+ }
+ }
+}
diff --git a/test/files/run/t10072.scala b/test/files/run/t10072.scala
new file mode 100644
index 0000000000..0f1dca1838
--- /dev/null
+++ b/test/files/run/t10072.scala
@@ -0,0 +1,18 @@
+trait T[A] {
+ def a: A
+ def foldLeft[B](zero: B, op: (B, A) => B): B = op(zero, a)
+ def sum[B >: A](zero: B): B
+}
+
+class C[@specialized(Int) A](val a: A) extends T[A] {
+ override def sum[@specialized(Int) B >: A](zero: B): B = foldLeft(zero, (x: B, y: B) => x)
+}
+
+object Test extends App {
+ def factory[T](a: T): C[T] = new C[T](a)
+
+ assert(new C[Int](1).sum(2) == 2)
+ assert(new C[String]("ho").sum("hu") == "hu")
+ assert(factory[Int](1).sum(2) == 2)
+ assert(factory[String]("ho").sum("hu") == "hu")
+}
diff --git a/test/files/run/t10075.scala b/test/files/run/t10075.scala
new file mode 100644
index 0000000000..e7564c5c8b
--- /dev/null
+++ b/test/files/run/t10075.scala
@@ -0,0 +1,35 @@
+class NotSerializable
+
+trait SerializableActually {
+ @transient
+ lazy val notSerializedTLV: NotSerializable = new NotSerializable
+
+ @transient
+ val notSerializedTL: NotSerializable = new NotSerializable
+
+ @transient
+ var notSerializedTR: NotSerializable = new NotSerializable
+}
+
+class SerializableBecauseTransient extends Serializable with SerializableActually {
+ @transient
+ lazy val notSerializedLV: NotSerializable = new NotSerializable
+
+ @transient
+ val notSerializedL: NotSerializable = new NotSerializable
+
+ @transient
+ var notSerializedR: NotSerializable = new NotSerializable
+}
+
+// Indirectly check that the @transient annotation on `notSerialized` made it to the underyling field in bytecode.
+// If it doesn't, `writeObject` will fail to serialize the field `notSerialized`, because `NotSerializable` is not serializable
+object Test {
+ def main(args: Array[String]): Unit = {
+ val obj = new SerializableBecauseTransient
+ // must force, since `null` valued field is serialized regardless of its type
+ val forceTLV = obj.notSerializedTLV
+ val forceLV = obj.notSerializedLV
+ new java.io.ObjectOutputStream(new java.io.ByteArrayOutputStream) writeObject obj
+ }
+}
diff --git a/test/files/run/t10075b.check b/test/files/run/t10075b.check
new file mode 100644
index 0000000000..dc64e95ac7
--- /dev/null
+++ b/test/files/run/t10075b.check
@@ -0,0 +1,60 @@
+ private volatile byte C.bitmap$0
+@RetainedAnnotation() private int C.lzyValFieldAnnotation
+ public int C.lzyValFieldAnnotation()
+ private int C.lzyValFieldAnnotation$lzycompute()
+ private int C.lzyValGetterAnnotation
+@RetainedAnnotation() public int C.lzyValGetterAnnotation()
+ private int C.lzyValGetterAnnotation$lzycompute()
+@RetainedAnnotation() private final int C.valFieldAnnotation
+ public int C.valFieldAnnotation()
+ private final int C.valGetterAnnotation
+@RetainedAnnotation() public int C.valGetterAnnotation()
+@RetainedAnnotation() private int C.varFieldAnnotation
+ public int C.varFieldAnnotation()
+ public void C.varFieldAnnotation_$eq(int)
+ private int C.varGetterAnnotation
+@RetainedAnnotation() public int C.varGetterAnnotation()
+ public void C.varGetterAnnotation_$eq(int)
+ private int C.varSetterAnnotation
+ public int C.varSetterAnnotation()
+@RetainedAnnotation() public void C.varSetterAnnotation_$eq(int)
+ public static void T.$init$(T)
+ public abstract void T.T$_setter_$valFieldAnnotation_$eq(int)
+ public abstract void T.T$_setter_$valGetterAnnotation_$eq(int)
+ public default int T.lzyValFieldAnnotation()
+ public static int T.lzyValFieldAnnotation$(T)
+@RetainedAnnotation() public default int T.lzyValGetterAnnotation()
+ public static int T.lzyValGetterAnnotation$(T)
+@RetainedAnnotation() public default int T.method()
+ public static int T.method$(T)
+ public abstract int T.valFieldAnnotation()
+@RetainedAnnotation() public abstract int T.valGetterAnnotation()
+ public abstract int T.varFieldAnnotation()
+ public abstract void T.varFieldAnnotation_$eq(int)
+@RetainedAnnotation() public abstract int T.varGetterAnnotation()
+ public abstract void T.varGetterAnnotation_$eq(int)
+ public abstract int T.varSetterAnnotation()
+@RetainedAnnotation() public abstract void T.varSetterAnnotation_$eq(int)
+ public void TMix.T$_setter_$valFieldAnnotation_$eq(int)
+ public void TMix.T$_setter_$valGetterAnnotation_$eq(int)
+ private volatile byte TMix.bitmap$0
+@RetainedAnnotation() private int TMix.lzyValFieldAnnotation
+ public int TMix.lzyValFieldAnnotation()
+ private int TMix.lzyValFieldAnnotation$lzycompute()
+ private int TMix.lzyValGetterAnnotation
+@RetainedAnnotation() public int TMix.lzyValGetterAnnotation()
+ private int TMix.lzyValGetterAnnotation$lzycompute()
+@RetainedAnnotation() public int TMix.method()
+@RetainedAnnotation() private final int TMix.valFieldAnnotation
+ public int TMix.valFieldAnnotation()
+ private final int TMix.valGetterAnnotation
+@RetainedAnnotation() public int TMix.valGetterAnnotation()
+@RetainedAnnotation() private int TMix.varFieldAnnotation
+ public int TMix.varFieldAnnotation()
+ public void TMix.varFieldAnnotation_$eq(int)
+ private int TMix.varGetterAnnotation
+@RetainedAnnotation() public int TMix.varGetterAnnotation()
+ public void TMix.varGetterAnnotation_$eq(int)
+ private int TMix.varSetterAnnotation
+ public int TMix.varSetterAnnotation()
+@RetainedAnnotation() public void TMix.varSetterAnnotation_$eq(int)
diff --git a/test/files/run/t10075b/RetainedAnnotation_1.java b/test/files/run/t10075b/RetainedAnnotation_1.java
new file mode 100644
index 0000000000..86ac939ec7
--- /dev/null
+++ b/test/files/run/t10075b/RetainedAnnotation_1.java
@@ -0,0 +1,4 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface RetainedAnnotation { }
diff --git a/test/files/run/t10075b/Test_2.scala b/test/files/run/t10075b/Test_2.scala
new file mode 100644
index 0000000000..89ba2bd488
--- /dev/null
+++ b/test/files/run/t10075b/Test_2.scala
@@ -0,0 +1,56 @@
+class C {
+ @(RetainedAnnotation @annotation.meta.field)
+ lazy val lzyValFieldAnnotation = 42
+
+ @(RetainedAnnotation @annotation.meta.getter)
+ lazy val lzyValGetterAnnotation = 42
+
+ @(RetainedAnnotation @annotation.meta.field)
+ val valFieldAnnotation = 42
+
+ @(RetainedAnnotation @annotation.meta.getter)
+ val valGetterAnnotation = 42
+
+ @(RetainedAnnotation @annotation.meta.field)
+ var varFieldAnnotation = 42
+
+ @(RetainedAnnotation @annotation.meta.getter)
+ var varGetterAnnotation = 42
+
+ @(RetainedAnnotation @annotation.meta.setter)
+ var varSetterAnnotation = 42
+}
+
+trait T {
+ @(RetainedAnnotation @annotation.meta.field)
+ lazy val lzyValFieldAnnotation = 42
+
+ @(RetainedAnnotation @annotation.meta.getter)
+ lazy val lzyValGetterAnnotation = 42
+
+ @(RetainedAnnotation @annotation.meta.field)
+ val valFieldAnnotation = 42
+
+ @(RetainedAnnotation @annotation.meta.getter)
+ val valGetterAnnotation = 42
+
+ @(RetainedAnnotation @annotation.meta.field)
+ var varFieldAnnotation = 42
+
+ @(RetainedAnnotation @annotation.meta.getter)
+ var varGetterAnnotation = 42
+
+ @(RetainedAnnotation @annotation.meta.setter)
+ var varSetterAnnotation = 42
+
+ @RetainedAnnotation
+ def method = 42
+}
+class TMix extends T
+
+object Test extends App {
+ (List(classOf[C], classOf[T], classOf[TMix]).
+ flatMap(cls => cls.getDeclaredFields ++ cls.getDeclaredMethods)).
+ sortBy(x => (x.getDeclaringClass.getName, x.getName, x.toString)).
+ foreach(x => println(x.getAnnotations.toList.mkString(" ") + " " + x))
+} \ No newline at end of file
diff --git a/test/files/run/t10097.check b/test/files/run/t10097.check
new file mode 100644
index 0000000000..0e8b96061c
--- /dev/null
+++ b/test/files/run/t10097.check
@@ -0,0 +1,3 @@
+t10097.scala:2: warning: case classes should have a non-implicit parameter list; adapting to 'case class C()(...)'
+case class C(implicit c: Int)
+ ^
diff --git a/test/files/run/t10097.flags b/test/files/run/t10097.flags
new file mode 100644
index 0000000000..dcc59ebe32
--- /dev/null
+++ b/test/files/run/t10097.flags
@@ -0,0 +1 @@
+-deprecation
diff --git a/test/files/run/t10097.scala b/test/files/run/t10097.scala
new file mode 100644
index 0000000000..a16be897cc
--- /dev/null
+++ b/test/files/run/t10097.scala
@@ -0,0 +1,6 @@
+
+case class C(implicit c: Int)
+
+object Test extends App {
+ assert(C()(42).productArity == 0)
+}
diff --git a/test/files/run/t10171/Test.scala b/test/files/run/t10171/Test.scala
new file mode 100644
index 0000000000..37a2cfc67f
--- /dev/null
+++ b/test/files/run/t10171/Test.scala
@@ -0,0 +1,59 @@
+import scala.tools.partest._
+import java.io.File
+
+object Test extends StoreReporterDirectTest {
+ def code = ???
+
+ def compileCode(code: String) = {
+ val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator")
+ compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(code)
+ }
+
+ def library = """
+package a {
+ package b {
+ class C { class D }
+ }
+}
+package z {
+ class Base {
+ type S = String
+ def foo(s: S): a.b.C#D = null
+ }
+ class Sub extends Base {
+ def sub = "sub"
+ }
+}
+ """
+
+ def client = """
+ class Client { new z.Sub().sub }
+ """
+
+ def deleteClass(s: String) = {
+ val f = new File(testOutput.path, s + ".class")
+ assert(f.exists)
+ f.delete()
+ }
+
+ def deletePackage(s: String) = {
+ val f = new File(testOutput.path, s)
+ assert(f.exists)
+ f.delete()
+ }
+
+ def assertNoErrors(): Unit = {
+ assert(storeReporter.infos.isEmpty, storeReporter.infos.mkString("\n"))
+ storeReporter.reset()
+ }
+ def show(): Unit = {
+ compileCode(library)
+ assertNoErrors()
+ deleteClass("a/b/C$D")
+ deleteClass("a/b/C")
+ deletePackage("a/b")
+ compileCode(client)
+ assertNoErrors()
+ }
+}
+
diff --git a/test/files/run/t10231/A_1.java b/test/files/run/t10231/A_1.java
new file mode 100644
index 0000000000..5cc2ed3606
--- /dev/null
+++ b/test/files/run/t10231/A_1.java
@@ -0,0 +1,11 @@
+/*
+ * javac: -parameters
+ */
+public class A_1 {
+ public class Inner {
+ public int x;
+ public Inner(int i) {
+ x = i;
+ }
+ }
+}
diff --git a/test/files/run/t10231/Test_2.scala b/test/files/run/t10231/Test_2.scala
new file mode 100644
index 0000000000..8f8150cab1
--- /dev/null
+++ b/test/files/run/t10231/Test_2.scala
@@ -0,0 +1,5 @@
+object Test extends App {
+ val a = new A_1
+ val i = new a.Inner(i = 99)
+ assert(i.x == 99)
+}
diff --git a/test/files/run/t10261.flags b/test/files/run/t10261.flags
deleted file mode 100644
index 0acce1e7ce..0000000000
--- a/test/files/run/t10261.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xsource:2.12
diff --git a/test/files/run/t1459generic.check b/test/files/run/t1459generic.check
index 367ac87ad1..346fadbc0d 100644
--- a/test/files/run/t1459generic.check
+++ b/test/files/run/t1459generic.check
@@ -1,2 +1,4 @@
+Note: t1459generic/Test.java uses unchecked or unsafe operations.
+Note: Recompile with -Xlint:unchecked for details.
ab
ab
diff --git a/test/files/run/t1459generic/VarargGeneric.java b/test/files/run/t1459generic/VarargGeneric.java
index c043e39b40..9b37a0fe3f 100644
--- a/test/files/run/t1459generic/VarargGeneric.java
+++ b/test/files/run/t1459generic/VarargGeneric.java
@@ -1,4 +1,7 @@
public interface VarargGeneric<T> {
String genericOne(T x, String args);
+ // we cannot annotate this with @SafeVarargs, because
+ // it's in an interface. so that's why a warning from
+ // javac appears in the checkfile.
String genericVar(T x, String... args);
}
diff --git a/test/files/run/t1500.scala b/test/files/run/t1500.scala
index 30c026f70f..5a2735fbf1 100644
--- a/test/files/run/t1500.scala
+++ b/test/files/run/t1500.scala
@@ -20,7 +20,7 @@ object Test {
val settings = new Settings()
settings.classpath.value = System.getProperty("java.class.path")
- val tool = new interpreter.IMain(settings)
+ val tool = interpreter.IMain(settings)
val global = tool.global
import global._
diff --git a/test/files/run/t2106.check b/test/files/run/t2106.check
index 66a0e707b3..c8ebe575f0 100644
--- a/test/files/run/t2106.check
+++ b/test/files/run/t2106.check
@@ -1,13 +1,5 @@
-#partest -Ybackend:GenBCode
t2106.scala:7: warning: A::foo()Ljava/lang/Object; is annotated @inline but could not be inlined:
-The callee A::foo()Ljava/lang/Object; contains the instruction INVOKEVIRTUAL java/lang/Object.clone ()Ljava/lang/Object;
+The callee A::foo()Ljava/lang/Object; contains the instruction INVOKEVIRTUAL A.clone ()Ljava/lang/Object;
that would cause an IllegalAccessError when inlined into class Test$.
def main(args: Array[String]): Unit = x.foo
^
-#partest !-Ybackend:GenBCode
-t2106.scala:7: warning: Could not inline required method foo because access level required by callee not matched by caller.
- def main(args: Array[String]): Unit = x.foo
- ^
-t2106.scala:7: warning: At the end of the day, could not inline @inline-marked method foo
- def main(args: Array[String]): Unit = x.foo
- ^
diff --git a/test/files/run/t2106.flags b/test/files/run/t2106.flags
index a2e413bb22..cde9a0c4e6 100644
--- a/test/files/run/t2106.flags
+++ b/test/files/run/t2106.flags
@@ -1 +1 @@
--optimise -Yinline-warnings -Yopt:l:classpath
+-opt-warnings -opt:l:classpath
diff --git a/test/files/run/t2212.check b/test/files/run/t2212.check
index 1465f1341a..d13ea43b07 100644
--- a/test/files/run/t2212.check
+++ b/test/files/run/t2212.check
@@ -1,4 +1,4 @@
-warning: there were two deprecation warnings; re-run with -deprecation for details
+warning: there were two deprecation warnings (since 2.11.0); re-run with -deprecation for details
LinkedList(1)
LinkedList(1)
true
diff --git a/test/files/run/t2250.scala b/test/files/run/t2250.scala
index 1ed333792a..f87b76d4d7 100644
--- a/test/files/run/t2250.scala
+++ b/test/files/run/t2250.scala
@@ -6,7 +6,7 @@ object Test {
// we'll say rather unlikely a.sameElements(b) unless
// they are pointing to the same array
- import scala.collection.JavaConversions._
+ import scala.collection.convert.ImplicitConversionsToScala._
assert(a sameElements b)
}
}
diff --git a/test/files/run/t2251b.check b/test/files/run/t2251b.check
index 4231fc6ea6..b60698d605 100644
--- a/test/files/run/t2251b.check
+++ b/test/files/run/t2251b.check
@@ -1,4 +1,4 @@
-TypeTag[List[scala.collection.immutable.LinearSeq[B[_ >: D with C <: B[_ >: D with C <: A]]] with scala.collection.AbstractSeq[B[_ >: D with C <: B[_ >: D with C <: A]]] with java.io.Serializable]]
+TypeTag[List[scala.collection.immutable.LinearSeq[B[_ >: D with C <: B[_ >: D with C <: A]]] with scala.collection.AbstractSeq[B[_ >: D with C <: B[_ >: D with C <: A]]] with Serializable]]
TypeTag[List[scala.collection.immutable.Iterable[B[_ >: F with E with D with C <: B[_ >: F with E with D with C <: A]]] with F with Int => Any]]
TypeTag[List[scala.collection.immutable.Seq[B[_ >: D with C <: B[_ >: D with C <: A]]] with scala.collection.AbstractSeq[B[_ >: D with C <: B[_ >: D with C <: A]]] with Serializable]]
TypeTag[List[scala.collection.Set[_ >: G with F <: B[_ >: G with F <: B[_ >: G with F <: A]]]]]
@@ -6,6 +6,6 @@ TypeTag[List[scala.collection.Set[_ >: G with F <: B[_ >: G with F <: B[_ >: G w
TypeTag[List[scala.collection.Set[_ >: G with F <: B[_ >: G with F <: B[_ >: G with F <: A]]]]]
TypeTag[List[Seq[B[_ >: G with F <: B[_ >: G with F <: A]]]]]
TypeTag[List[scala.collection.Map[_ >: F with C <: B[_ >: F with C <: B[_ >: F with C <: A]], B[_ >: G with D <: B[_ >: G with D <: A]]]]]
-TypeTag[List[scala.collection.AbstractSeq[B[_ >: G with F <: B[_ >: G with F <: A]]] with scala.collection.LinearSeq[B[_ >: G with F <: B[_ >: G with F <: A]]] with java.io.Serializable]]
+TypeTag[List[scala.collection.AbstractSeq[B[_ >: G with F <: B[_ >: G with F <: A]]] with scala.collection.LinearSeq[B[_ >: G with F <: B[_ >: G with F <: A]]] with Serializable]]
TypeTag[List[Seq[B[_ >: G with F <: B[_ >: G with F <: A]]]]]
TypeTag[List[Seq[B[_ >: G with F <: B[_ >: G with F <: A]]]]]
diff --git a/test/files/run/t2813.2.scala b/test/files/run/t2813.2.scala
index f41f6451f4..f26753600d 100644
--- a/test/files/run/t2813.2.scala
+++ b/test/files/run/t2813.2.scala
@@ -1,5 +1,5 @@
import java.util.LinkedList
-import collection.JavaConversions._
+import collection.convert.ImplicitConversions._
object Test extends App {
def assertListEquals[A](expected: List[A], actual: Seq[A]) {
diff --git a/test/files/run/t2946/MyResponseCommon_2.scala b/test/files/run/t2946/MyResponseCommon_2.scala
new file mode 100644
index 0000000000..4f8f924f2c
--- /dev/null
+++ b/test/files/run/t2946/MyResponseCommon_2.scala
@@ -0,0 +1,7 @@
+class MyResponseCommon extends Parser with ResponseCommon
+
+object Test {
+ def main(args: Array[String]) {
+ new MyResponseCommon
+ }
+}
diff --git a/test/files/run/t2946/ResponseCommon_1.scala b/test/files/run/t2946/ResponseCommon_1.scala
new file mode 100644
index 0000000000..bb921e7027
--- /dev/null
+++ b/test/files/run/t2946/ResponseCommon_1.scala
@@ -0,0 +1,13 @@
+class Parser {
+ def parse(t: Any): Unit = {}
+}
+
+trait ResponseCommon extends Parser {
+ private[this] var paramsParser: Parser = null
+ def withParamsParser(parser: Parser) = {paramsParser = parser; this}
+
+ override abstract def parse(t: Any): Unit = t match {
+ case ("params", value: List[_]) => value.foreach {paramsParser.parse(_)}
+ case _ => super.parse(t)
+ }
+}
diff --git a/test/files/run/t3126.scala b/test/files/run/t3126.scala
index 36322bf896..865047ce4f 100644
--- a/test/files/run/t3126.scala
+++ b/test/files/run/t3126.scala
@@ -4,6 +4,6 @@ object Test {
def main(args: Array[String]): Unit = {
try C.unapply(null) catch { case _: MatchError => }
- try v match { case Some(1) => } catch { case _: MatchError => }
+ try ((v: @unchecked) match { case Some(1) => }) catch { case _: MatchError => }
}
}
diff --git a/test/files/run/t3158.scala b/test/files/run/t3158.scala
index c824b62e96..1e5ec186f5 100644
--- a/test/files/run/t3158.scala
+++ b/test/files/run/t3158.scala
@@ -1,6 +1,6 @@
object Test {
def main(args: Array[String]) {
- println(args.map(_ => foo _).deep)
+ println(args.map(_ => foo _).map(_ => "<function1>").deep)
}
def foo(xs: String*) {
diff --git a/test/files/run/t3235-minimal.check b/test/files/run/t3235-minimal.check
index d7f716002f..374ddc79fe 100644
--- a/test/files/run/t3235-minimal.check
+++ b/test/files/run/t3235-minimal.check
@@ -1,12 +1,12 @@
-t3235-minimal.scala:3: warning: method round in class RichInt is deprecated: This is an integer type; there is no reason to round it. Perhaps you meant to call this on a floating-point value?
+t3235-minimal.scala:3: warning: method round in class RichInt is deprecated (since 2.11.0): this is an integer type; there is no reason to round it. Perhaps you meant to call this on a floating-point value?
assert(123456789.round == 123456789)
^
-t3235-minimal.scala:4: warning: method round in package math is deprecated: This is an integer type; there is no reason to round it. Perhaps you meant to call this with a floating-point value?
+t3235-minimal.scala:4: warning: method round in package math is deprecated (since 2.11.0): This is an integer type; there is no reason to round it. Perhaps you meant to call this with a floating-point value?
assert(math.round(123456789) == 123456789)
^
-t3235-minimal.scala:5: warning: method round in class RichLong is deprecated: This is an integer type; there is no reason to round it. Perhaps you meant to call this on a floating-point value?
+t3235-minimal.scala:5: warning: method round in class RichLong is deprecated (since 2.11.0): this is an integer type; there is no reason to round it. Perhaps you meant to call this on a floating-point value?
assert(1234567890123456789L.round == 1234567890123456789L)
^
-t3235-minimal.scala:6: warning: method round in package math is deprecated: This is an integer type; there is no reason to round it. Perhaps you meant to call this with a floating-point value?
+t3235-minimal.scala:6: warning: method round in package math is deprecated (since 2.11.0): This is an integer type; there is no reason to round it. Perhaps you meant to call this with a floating-point value?
assert(math.round(1234567890123456789L) == 1234567890123456789L)
^
diff --git a/test/files/run/t3326.scala b/test/files/run/t3326.scala
index 4ac7ef9138..b6b4eac784 100644
--- a/test/files/run/t3326.scala
+++ b/test/files/run/t3326.scala
@@ -19,7 +19,7 @@ import scala.math.Ordering
* This is why `collection.SortedMap` used to resort to the generic
* `TraversableLike.++` which knows nothing about the ordering.
*
- * To avoid `collection.SortedMap`s resort to the more generic `TraverableLike.++`,
+ * To avoid `collection.SortedMap`s resort to the more generic `TraversableLike.++`,
* we override the `MapLike.++` overload in `collection.SortedMap` to return
* the proper type `SortedMap`.
*/
diff --git a/test/files/run/t3361.check b/test/files/run/t3361.check
index 5e0a763501..7d2fa3b155 100644
--- a/test/files/run/t3361.check
+++ b/test/files/run/t3361.check
@@ -1 +1 @@
-warning: there were 16 deprecation warnings; re-run with -deprecation for details
+warning: there were 16 deprecation warnings (since 2.11.0); re-run with -deprecation for details
diff --git a/test/files/run/t3368-c.check b/test/files/run/t3368-c.check
index e0c10cc0dd..4cbe98c577 100644
--- a/test/files/run/t3368-c.check
+++ b/test/files/run/t3368-c.check
@@ -6,8 +6,8 @@ package <empty> {
};
def x = {
val $buf = new _root_.scala.xml.NodeBuffer();
- $buf.$amp$plus(new _root_.scala.xml.Text("hi & bye"));
- $buf.$amp$plus(new _root_.scala.xml.Text("red & black"));
+ $buf.$amp$plus(new _root_.scala.xml.PCData("hi & bye"));
+ $buf.$amp$plus(new _root_.scala.xml.PCData("red & black"));
$buf
}
};
@@ -24,7 +24,8 @@ package <empty> {
new _root_.scala.xml.Elem(null, "b", _root_.scala.xml.Null, $scope, true)
}
});
- $buf.$amp$plus(new _root_.scala.xml.Text("starthi & bye"));
+ $buf.$amp$plus(new _root_.scala.xml.Text("start"));
+ $buf.$amp$plus(new _root_.scala.xml.PCData("hi & bye"));
$buf.$amp$plus({
{
new _root_.scala.xml.Elem(null, "c", _root_.scala.xml.Null, $scope, true)
@@ -36,7 +37,8 @@ package <empty> {
new _root_.scala.xml.Elem(null, "d", _root_.scala.xml.Null, $scope, true)
}
});
- $buf.$amp$plus(new _root_.scala.xml.Text("stuffred & black"));
+ $buf.$amp$plus(new _root_.scala.xml.Text("stuff"));
+ $buf.$amp$plus(new _root_.scala.xml.PCData("red & black"));
$buf
}: _*))
}
@@ -46,18 +48,19 @@ package <empty> {
def $init$() = {
()
};
- def d = new _root_.scala.xml.Text("hello, world");
+ def d = new _root_.scala.xml.PCData("hello, world");
def e = {
val $buf = new _root_.scala.xml.NodeBuffer();
- $buf.$amp$plus(new _root_.scala.xml.Text("hello, world"));
- $buf.$amp$plus(new _root_.scala.xml.Text("hello, world"));
+ $buf.$amp$plus(new _root_.scala.xml.PCData("hello, world"));
+ $buf.$amp$plus(new _root_.scala.xml.PCData("hello, world"));
$buf
};
def f = {
{
new _root_.scala.xml.Elem(null, "foo", _root_.scala.xml.Null, $scope, false, ({
val $buf = new _root_.scala.xml.NodeBuffer();
- $buf.$amp$plus(new _root_.scala.xml.Text("xhello, world"));
+ $buf.$amp$plus(new _root_.scala.xml.Text("x"));
+ $buf.$amp$plus(new _root_.scala.xml.PCData("hello, world"));
$buf
}: _*))
}
@@ -66,7 +69,7 @@ package <empty> {
{
new _root_.scala.xml.Elem(null, "foo", _root_.scala.xml.Null, $scope, false, ({
val $buf = new _root_.scala.xml.NodeBuffer();
- $buf.$amp$plus(new _root_.scala.xml.Text("hello, world"));
+ $buf.$amp$plus(new _root_.scala.xml.PCData("hello, world"));
$buf
}: _*))
}
@@ -75,7 +78,8 @@ package <empty> {
{
new _root_.scala.xml.Elem(null, "foo", _root_.scala.xml.Null, $scope, false, ({
val $buf = new _root_.scala.xml.NodeBuffer();
- $buf.$amp$plus(new _root_.scala.xml.Text("hello, worldhello, world"));
+ $buf.$amp$plus(new _root_.scala.xml.PCData("hello, world"));
+ $buf.$amp$plus(new _root_.scala.xml.PCData("hello, world"));
$buf
}: _*))
}
diff --git a/test/files/run/t3452b-bcode.check b/test/files/run/t3452b-bcode.check
deleted file mode 100644
index 204c3d0437..0000000000
--- a/test/files/run/t3452b-bcode.check
+++ /dev/null
@@ -1,2 +0,0 @@
-Search received: test
-SearchC received: test
diff --git a/test/files/run/t3452b-bcode.flags b/test/files/run/t3452b-bcode.flags
deleted file mode 100644
index c30091d3de..0000000000
--- a/test/files/run/t3452b-bcode.flags
+++ /dev/null
@@ -1 +0,0 @@
--Ybackend:GenBCode
diff --git a/test/files/run/t3452b-bcode/J_2.java b/test/files/run/t3452b-bcode/J_2.java
deleted file mode 100644
index 839f334508..0000000000
--- a/test/files/run/t3452b-bcode/J_2.java
+++ /dev/null
@@ -1,6 +0,0 @@
-public class J_2 {
- public static void j() {
- StringSearch.search("test");
- StringSearch.searchC("test");
- }
-}
diff --git a/test/files/run/t3452b-bcode/S_1.scala b/test/files/run/t3452b-bcode/S_1.scala
deleted file mode 100644
index a209f12035..0000000000
--- a/test/files/run/t3452b-bcode/S_1.scala
+++ /dev/null
@@ -1,17 +0,0 @@
-trait Search[M] {
- def search(input: M): C[Int] = {
- println("Search received: " + input)
- null
- }
-}
-
-class SearchC[M] {
- def searchC(input: M): C[Int] = {
- println("SearchC received: " + input)
- null
- }
-}
-
-object StringSearch extends SearchC[String] with Search[String]
-
-trait C[T]
diff --git a/test/files/run/t3488.check b/test/files/run/t3488.check
index 314dfc7838..75b2c3b07f 100644
--- a/test/files/run/t3488.check
+++ b/test/files/run/t3488.check
@@ -1,7 +1,13 @@
-t3488.scala:4: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+t3488.scala:4: warning: a pure expression does nothing in statement position
println(foo { val List(_*)=List(0); 1 } ())
^
-t3488.scala:5: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+t3488.scala:4: warning: multiline expressions might require enclosing parentheses; a value can be silently discarded when Unit is expected
+ println(foo { val List(_*)=List(0); 1 } ())
+ ^
+t3488.scala:5: warning: a pure expression does nothing in statement position
+ println(foo { val List(_*)=List(0); 1 } (1))
+ ^
+t3488.scala:5: warning: multiline expressions might require enclosing parentheses; a value can be silently discarded when Unit is expected
println(foo { val List(_*)=List(0); 1 } (1))
^
0
diff --git a/test/files/run/t3509.flags b/test/files/run/t3509.flags
index 6933d924d3..768ca4f13b 100644
--- a/test/files/run/t3509.flags
+++ b/test/files/run/t3509.flags
@@ -1 +1 @@
--Yinline \ No newline at end of file
+-opt:l:classpath \ No newline at end of file
diff --git a/test/files/run/t3569.check b/test/files/run/t3569.check
index a9fb5ff32e..e0e1d6c405 100644
--- a/test/files/run/t3569.check
+++ b/test/files/run/t3569.check
@@ -2,6 +2,8 @@
private final int Test$X.val1
private final int Test$X.val2
private final int Test$X.val3
+private int Test$X.const1
+private int Test$X.const2
private int Test$X.lval1
private int Test$X.lval2
private int Test$X.lval3
diff --git a/test/files/run/t3569.flags b/test/files/run/t3569.flags
index 6933d924d3..768ca4f13b 100644
--- a/test/files/run/t3569.flags
+++ b/test/files/run/t3569.flags
@@ -1 +1 @@
--Yinline \ No newline at end of file
+-opt:l:classpath \ No newline at end of file
diff --git a/test/files/run/t3569.scala b/test/files/run/t3569.scala
index eb3b424439..7da4de9e95 100644
--- a/test/files/run/t3569.scala
+++ b/test/files/run/t3569.scala
@@ -4,7 +4,13 @@ object Test {
lazy val lv = scala.util.Random.nextInt()
- class X(final var x: Int) {
+ trait T { final lazy val const1 = 1 } // no fields
+
+ class X(final var x: Int) extends T {
+ // a lazy val does not receive a constant type, for backwards compat (e.g. for the repl)
+ // besides, since you explicitly wanted something lazy, we'll give you something lazy! (a field and a bitmap)
+ final lazy val const2 = 2
+
final var var1: Int = 0
final private var var2: Int = 0
final private[this] var var3: Int = 0
diff --git a/test/files/run/t3647.check b/test/files/run/t3647.check
index e5c1ee1701..cb16c6486f 100644
--- a/test/files/run/t3647.check
+++ b/test/files/run/t3647.check
@@ -1 +1 @@
-warning: there were three deprecation warnings; re-run with -deprecation for details
+warning: there were three deprecation warnings (since 2.11.8); re-run with -deprecation for details
diff --git a/test/files/run/t3822.scala b/test/files/run/t3822.scala
deleted file mode 100644
index c35804035e..0000000000
--- a/test/files/run/t3822.scala
+++ /dev/null
@@ -1,19 +0,0 @@
-import scala.collection.{ mutable, immutable, generic }
-import immutable.ListSet
-
-object Test {
- def main(args: Array[String]): Unit = {
- val xs = ListSet(-100000 to 100001: _*)
-
- assert(xs.size == 200002)
- assert(xs.sum == 100001)
-
- val ys = ListSet[Int]()
- val ys1 = (1 to 12).grouped(3).foldLeft(ys)(_ ++ _)
- val ys2 = (1 to 12).foldLeft(ys)(_ + _)
-
- assert(ys1 == ys2)
- }
-}
-
-
diff --git a/test/files/run/t3888.check b/test/files/run/t3888.check
index df1629dd7e..e69de29bb2 100644
--- a/test/files/run/t3888.check
+++ b/test/files/run/t3888.check
@@ -1 +0,0 @@
-warning: there was one deprecation warning; re-run with -deprecation for details
diff --git a/test/files/run/t3888.scala b/test/files/run/t3888.scala
index 8701b42ff0..b1932ffb20 100644
--- a/test/files/run/t3888.scala
+++ b/test/files/run/t3888.scala
@@ -1,3 +1,4 @@
+case class Tuple2[+T1, +T2](_1: T1, _2: T2) extends Product2[T1, T2]
// in a match, which notion of equals prevails?
// extending Tuple doesn't seem to be at issue here.
@@ -7,13 +8,13 @@ object Test {
private[this] val T2 = T1
def m1 =
- (1, 2) match {
+ Tuple2(1, 2) match {
case T1 => true
case _ => false
}
def m2 =
- (1, 2) match {
+ Tuple2(1, 2) match {
case T2 => true
case _ => false
}
diff --git a/test/files/run/t3970.check b/test/files/run/t3970.check
index 0683a6c1a6..fd1c3af3bb 100644
--- a/test/files/run/t3970.check
+++ b/test/files/run/t3970.check
@@ -1 +1 @@
-warning: there were 5 deprecation warnings; re-run with -deprecation for details
+warning: there were 5 deprecation warnings (since 2.11.0); re-run with -deprecation for details
diff --git a/test/files/run/t3996.check b/test/files/run/t3996.check
index a9ecc29fea..f214cd8e6a 100644
--- a/test/files/run/t3996.check
+++ b/test/files/run/t3996.check
@@ -1 +1 @@
-warning: there were two deprecation warnings; re-run with -deprecation for details
+warning: there were two deprecation warnings (since 2.11.0); re-run with -deprecation for details
diff --git a/test/files/run/t4047.check b/test/files/run/t4047.check
index 3c41e6e244..c31f2f0858 100644
--- a/test/files/run/t4047.check
+++ b/test/files/run/t4047.check
@@ -1,13 +1,13 @@
-t4047.scala:23: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+t4047.scala:23: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
a.foo
^
-t4047.scala:24: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+t4047.scala:24: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
a.foo
^
-t4047.scala:26: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+t4047.scala:26: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
b.foo
^
-t4047.scala:27: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+t4047.scala:27: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
b.foo
^
Unit: called A.foo
diff --git a/test/files/run/t4080.check b/test/files/run/t4080.check
index 462e925b76..18f18ef2dd 100644
--- a/test/files/run/t4080.check
+++ b/test/files/run/t4080.check
@@ -1,2 +1,2 @@
-warning: there were three deprecation warnings; re-run with -deprecation for details
+warning: there were three deprecation warnings (since 2.11.0); re-run with -deprecation for details
LinkedList(1, 0, 2, 3)
diff --git a/test/files/run/t4124.scala b/test/files/run/t4124.scala
index 9f35b57ce3..db4e382634 100644
--- a/test/files/run/t4124.scala
+++ b/test/files/run/t4124.scala
@@ -2,22 +2,22 @@ import xml.Node
object Test extends App {
val body: Node = <elem>hi</elem>
- println ((body: AnyRef, "foo") match {
+ println (((body: AnyRef, "foo"): @unchecked) match {
case (node: Node, "bar") => "bye"
case (ser: Serializable, "foo") => "hi"
})
- println ((body, "foo") match {
+ println (((body, "foo"): @unchecked) match {
case (node: Node, "bar") => "bye"
case (ser: Serializable, "foo") => "hi"
})
- println ((body: AnyRef, "foo") match {
+ println (((body: AnyRef, "foo"): @unchecked) match {
case (node: Node, "foo") => "bye"
case (ser: Serializable, "foo") => "hi"
})
- println ((body: AnyRef, "foo") match {
+ println (((body: AnyRef, "foo"): @unchecked) match {
case (node: Node, "foo") => "bye"
case (ser: Serializable, "foo") => "hi"
})
diff --git a/test/files/run/t4172.check b/test/files/run/t4172.check
index 3141647dba..99e420678c 100644
--- a/test/files/run/t4172.check
+++ b/test/files/run/t4172.check
@@ -1,6 +1,6 @@
scala> val c = { class C { override def toString = "C" }; ((new C, new C { def f = 2 })) }
-warning: there was one feature warning; re-run with -feature for details
+warning: there was one feature warning; for details, enable `:setting -feature' or `:replay -feature'
c: (C, C{def f: Int}) forSome { type C <: AnyRef } = (C,C)
scala> :quit
diff --git a/test/files/run/t4285.flags b/test/files/run/t4285.flags
index eb4d19bcb9..768ca4f13b 100644
--- a/test/files/run/t4285.flags
+++ b/test/files/run/t4285.flags
@@ -1 +1 @@
--optimise \ No newline at end of file
+-opt:l:classpath \ No newline at end of file
diff --git a/test/files/run/t4287inferredMethodTypes.check b/test/files/run/t4287inferredMethodTypes.check
deleted file mode 100644
index 56e9c097cc..0000000000
--- a/test/files/run/t4287inferredMethodTypes.check
+++ /dev/null
@@ -1,30 +0,0 @@
-[[syntax trees at end of typer]] // newSource1.scala
-[0:92]package [0:0]<empty> {
- [0:21]class A extends [7:21][23]scala.AnyRef {
- [8:16]<paramaccessor> private[this] val a: [8]Int = _;
- <8:20>def <init>(<8:20>a: [11]<type: [11]scala.Int> = [17:20]A.a): [7]A = <8:20>{
- <8:20><8:20><8:20>A.super.<init>();
- <8:20>()
- }
- };
- [23:47]object A extends [32:47][49]scala.AnyRef {
- [49]def <init>(): [32]A.type = [49]{
- [49][49][49]A.super.<init>();
- [32]()
- };
- [36:45]private[this] val a: [40]Int = [44:45]2;
- [40]<stable> <accessor> def a: [40]Int = [40][40]A.this.a;
- [8]<synthetic> def <init>$default$1: [8]Int = [19]A.a
- };
- [49:92]class B extends [57:92][65:66]A {
- [65]def <init>(): [57]B = [65]{
- [65][65][65]B.super.<init>([65]A.<init>$default$1);
- [57]()
- };
- [70:90]def <init>([79:80]a: [79]Int): [74]B = [84:90]{
- [84:90][84:90][84]B.this.<init>();
- [84]()
- }
- }
-}
-
diff --git a/test/files/run/t4287inferredMethodTypes.scala b/test/files/run/t4287inferredMethodTypes.scala
deleted file mode 100644
index f14e672da8..0000000000
--- a/test/files/run/t4287inferredMethodTypes.scala
+++ /dev/null
@@ -1,25 +0,0 @@
-import scala.tools.partest.DirectTest
-
-object Test extends DirectTest {
-
- override def extraSettings: String =
- s"-usejavacp -Yinfer-argument-types -Xprint-pos -Xprint:typer -Yrangepos -Ystop-after:typer -d ${testOutput.path}"
-
- override def code = """
-class A(a: Int = A.a)
-
-object A {
- val a = 2
-}
-
-class B extends A {
- def this(a) = this()
-}
- """.trim
-
- override def show(): Unit = {
- Console.withErr(System.out) {
- compile()
- }
- }
-} \ No newline at end of file
diff --git a/test/files/run/t4332.scala b/test/files/run/t4332.scala
index 5a67922911..1c7e7d73de 100644
--- a/test/files/run/t4332.scala
+++ b/test/files/run/t4332.scala
@@ -12,7 +12,7 @@ object Test extends DirectTest {
}
def isExempt(sym: Symbol) = {
- val exempt = Set("view", "repr", "sliceWithKnownDelta", "sliceWithKnownBound", "transform")
+ val exempt = Set("view", "repr", "sliceWithKnownDelta", "sliceWithKnownBound", "transform", "filterImpl")
(exempt contains sym.name.decoded)
}
diff --git a/test/files/run/t4396.check b/test/files/run/t4396.check
index d38fb7fae7..9eb1be0255 100644
--- a/test/files/run/t4396.check
+++ b/test/files/run/t4396.check
@@ -1,4 +1,4 @@
-warning: there was one deprecation warning; re-run with -deprecation for details
+warning: there was one deprecation warning (since 2.11.0); re-run with -deprecation for details
hallo
constructor
out:22
diff --git a/test/files/run/t4461.check b/test/files/run/t4461.check
index 346993af6f..32c7f5c487 100644
--- a/test/files/run/t4461.check
+++ b/test/files/run/t4461.check
@@ -1,4 +1,4 @@
-warning: there were four deprecation warnings; re-run with -deprecation for details
+warning: there were four deprecation warnings (since 2.11.0); re-run with -deprecation for details
Include(End,1)
Include(End,2)
Include(End,3)
diff --git a/test/files/run/t4542.check b/test/files/run/t4542.check
index 6e099222b0..942de545b5 100644
--- a/test/files/run/t4542.check
+++ b/test/files/run/t4542.check
@@ -5,7 +5,7 @@ scala> @deprecated("foooo", "ReplTest version 1.0-FINAL") class Foo() {
defined class Foo
scala> val f = new Foo
-<console>:12: warning: class Foo is deprecated: foooo
+<console>:12: warning: class Foo is deprecated (since ReplTest version 1.0-FINAL): foooo
val f = new Foo
^
f: Foo = Bippy
diff --git a/test/files/run/t4594-repl-settings.scala b/test/files/run/t4594-repl-settings.scala
index f2d1a8b3f8..587bb2312b 100644
--- a/test/files/run/t4594-repl-settings.scala
+++ b/test/files/run/t4594-repl-settings.scala
@@ -9,13 +9,13 @@ object Test extends SessionTest {
|depp: String
|
|scala> def a = depp
- |warning: there was one deprecation warning; re-run with -deprecation for details
+ |warning: there was one deprecation warning (since Time began.); for details, enable `:setting -deprecation' or `:replay -deprecation'
|a: String
|
|scala> :settings -deprecation
|
|scala> def b = depp
- |<console>:12: warning: method depp is deprecated: Please don't do that.
+ |<console>:12: warning: method depp is deprecated (since Time began.): Please don't do that.
| def b = depp
| ^
|b: String
diff --git a/test/files/run/t4680.check b/test/files/run/t4680.check
index 21a1e0cd15..749ce4c627 100644
--- a/test/files/run/t4680.check
+++ b/test/files/run/t4680.check
@@ -1,10 +1,10 @@
-t4680.scala:51: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+t4680.scala:51: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
new C { 5 }
^
-t4680.scala:69: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+t4680.scala:69: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
new { val x = 5 } with E() { 5 }
^
-warning: there was one deprecation warning; re-run with -deprecation for details
+warning: there was one deprecation warning (since 2.11.0); re-run with -deprecation for details
// new C { }
diff --git a/test/files/run/t4700.check b/test/files/run/t4700.check
new file mode 100644
index 0000000000..ae854b959d
--- /dev/null
+++ b/test/files/run/t4700.check
@@ -0,0 +1,44 @@
+
+scala> import scala.annotation.showAsInfix
+import scala.annotation.showAsInfix
+
+scala> class &&[T,U]
+defined class $amp$amp
+
+scala> def foo: Int && Boolean = ???
+foo: Int && Boolean
+
+scala> def foo: Int && Boolean && String = ???
+foo: Int && Boolean && String
+
+scala> def foo: Int && (Boolean && String) = ???
+foo: Int && (Boolean && String)
+
+scala> @showAsInfix type Mappy[T, U] = Map[T, U]
+defined type alias Mappy
+
+scala> def foo: Int Mappy (Boolean && String) = ???
+foo: Int Mappy (Boolean && String)
+
+scala> @showAsInfix(false) class ||[T,U]
+defined class $bar$bar
+
+scala> def foo: Int || Boolean = ???
+foo: ||[Int,Boolean]
+
+scala> class &:[L, R]
+defined class $amp$colon
+
+scala> def foo: Int &: String = ???
+foo: Int &: String
+
+scala> def foo: Int &: Boolean &: String = ???
+foo: Int &: Boolean &: String
+
+scala> def foo: (Int && String) &: Boolean = ???
+foo: (Int && String) &: Boolean
+
+scala> def foo: Int && (Boolean &: String) = ???
+foo: Int && (Boolean &: String)
+
+scala> :quit
diff --git a/test/files/run/t4700.scala b/test/files/run/t4700.scala
new file mode 100644
index 0000000000..7c02676e89
--- /dev/null
+++ b/test/files/run/t4700.scala
@@ -0,0 +1,22 @@
+import scala.tools.nsc.interpreter._
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ def code = """
+ |import scala.annotation.showAsInfix
+ |class &&[T,U]
+ |def foo: Int && Boolean = ???
+ |def foo: Int && Boolean && String = ???
+ |def foo: Int && (Boolean && String) = ???
+ |@showAsInfix type Mappy[T, U] = Map[T, U]
+ |def foo: Int Mappy (Boolean && String) = ???
+ |@showAsInfix(false) class ||[T,U]
+ |def foo: Int || Boolean = ???
+ |class &:[L, R]
+ |def foo: Int &: String = ???
+ |def foo: Int &: Boolean &: String = ???
+ |def foo: (Int && String) &: Boolean = ???
+ |def foo: Int && (Boolean &: String) = ???
+ |""".stripMargin
+}
+
diff --git a/test/files/run/t4710.check b/test/files/run/t4710.check
index 5f90c68ed1..4a5d11f185 100644
--- a/test/files/run/t4710.check
+++ b/test/files/run/t4710.check
@@ -1,6 +1,6 @@
scala> def method : String = { implicit def f(s: Symbol) = "" ; 'symbol }
-warning: there was one feature warning; re-run with -feature for details
+warning: there was one feature warning; for details, enable `:setting -feature' or `:replay -feature'
method: String
scala> :quit
diff --git a/test/files/run/t4788-separate-compilation.check b/test/files/run/t4788-separate-compilation.check
index 172ad90102..618fddfea3 100644
--- a/test/files/run/t4788-separate-compilation.check
+++ b/test/files/run/t4788-separate-compilation.check
@@ -1,5 +1,5 @@
Some(@Ljava/lang/Deprecated;())
None
-None
-Some(@LCAnnotation;() // invisible)
+Some(@LSAnnotation;())
+Some(@LCAnnotation;())
Some(@LRAnnotation;())
diff --git a/test/files/run/t4788.check b/test/files/run/t4788.check
index 172ad90102..618fddfea3 100644
--- a/test/files/run/t4788.check
+++ b/test/files/run/t4788.check
@@ -1,5 +1,5 @@
Some(@Ljava/lang/Deprecated;())
None
-None
-Some(@LCAnnotation;() // invisible)
+Some(@LSAnnotation;())
+Some(@LCAnnotation;())
Some(@LRAnnotation;())
diff --git a/test/files/run/t4813.check b/test/files/run/t4813.check
index a9ecc29fea..f214cd8e6a 100644
--- a/test/files/run/t4813.check
+++ b/test/files/run/t4813.check
@@ -1 +1 @@
-warning: there were two deprecation warnings; re-run with -deprecation for details
+warning: there were two deprecation warnings (since 2.11.0); re-run with -deprecation for details
diff --git a/test/files/run/t4891.check b/test/files/run/t4891.check
index 79fd7f6fbb..a460569fd9 100644
--- a/test/files/run/t4891.check
+++ b/test/files/run/t4891.check
@@ -1,5 +1,7 @@
test.generic.T1
- (m) public abstract A test.generic.T1.t1(A)
+ (m) public static void test.generic.T1.$init$(test.generic.T1)
+ (m) public default A test.generic.T1.t1(A)
+ (m) public static java.lang.Object test.generic.T1.t1$(test.generic.T1,java.lang.Object)
test.generic.C1
(m) public void test.generic.C1.m1()
test.generic.C2
diff --git a/test/files/run/t4935.flags b/test/files/run/t4935.flags
index 49d036a887..63535a7f4f 100644
--- a/test/files/run/t4935.flags
+++ b/test/files/run/t4935.flags
@@ -1 +1 @@
--optimize
+-opt:l:classpath
diff --git a/test/files/run/t5064.check b/test/files/run/t5064.check
index 61ccfd16e7..f7d25a67e4 100644
--- a/test/files/run/t5064.check
+++ b/test/files/run/t5064.check
@@ -1,25 +1,26 @@
[53] T5064.super.<init>()
[53] T5064.super.<init>
[53] this
-[16:23] immutable.this.List.apply(scala.this.Predef.wrapIntArray(Array[Int]{1}))
-[16:20] immutable.this.List.apply
-<16:20> immutable.this.List
-<16:20> immutable.this
-[16:23] scala.this.Predef.wrapIntArray(Array[Int]{1})
-[20] scala.this.Predef.wrapIntArray
-[20] scala.this.Predef
-[20] scala.this
-[26:32] collection.this.Seq.apply(scala.this.Predef.wrapIntArray(Array[Int]{1}))
-[26:29] collection.this.Seq.apply
-<26:29> collection.this.Seq
-<26:29> collection.this
-[26:32] scala.this.Predef.wrapIntArray(Array[Int]{1})
-[29] scala.this.Predef.wrapIntArray
-[29] scala.this.Predef
-[29] scala.this
-[35:39] immutable.this.List
-<35:39> immutable.this
-[42:45] collection.this.Seq
-<42:45> collection.this
-[48:51] immutable.this.Nil
-<48:51> immutable.this
+[16:23] scala.collection.immutable.List.apply(scala.Predef.wrapIntArray(Array[Int]{1}))
+[16:20] scala.collection.immutable.List.apply
+<16:20> scala.collection.immutable.List
+<16:20> scala.collection.immutable
+<16:20> scala.collection
+[16:23] scala.Predef.wrapIntArray(Array[Int]{1})
+[20] scala.Predef.wrapIntArray
+[20] scala.Predef
+[26:32] scala.collection.Seq.apply(scala.Predef.wrapIntArray(Array[Int]{1}))
+[26:29] scala.collection.Seq.apply
+<26:29> scala.collection.Seq
+<26:29> scala.collection
+[26:32] scala.Predef.wrapIntArray(Array[Int]{1})
+[29] scala.Predef.wrapIntArray
+[29] scala.Predef
+[35:39] scala.collection.immutable.List
+<35:39> scala.collection.immutable
+<35:39> scala.collection
+[42:45] scala.collection.Seq
+<42:45> scala.collection
+[48:51] scala.collection.immutable.Nil
+<48:51> scala.collection.immutable
+<48:51> scala.collection
diff --git a/test/files/run/t5293-map.scala b/test/files/run/t5293-map.scala
deleted file mode 100644
index ad1bbcfe30..0000000000
--- a/test/files/run/t5293-map.scala
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-import scala.collection.JavaConverters._
-
-
-
-object Test extends App {
-
- def bench(label: String)(body: => Unit): Long = {
- val start = System.nanoTime
-
- 0.until(10).foreach(_ => body)
-
- val end = System.nanoTime
-
- //println("%s: %s ms".format(label, (end - start) / 1000.0 / 1000.0))
-
- end - start
- }
-
- def benchJava(values: java.util.Map[Int, Int]) = {
- bench("Java Map") {
- val m = new java.util.HashMap[Int, Int]
-
- m.putAll(values)
- }
- }
-
- def benchScala(values: Iterable[(Int, Int)]) = {
- bench("Scala Map") {
- val m = new scala.collection.mutable.HashMap[Int, Int]
-
- m ++= values
- }
- }
-
- def benchScalaSorted(values: Iterable[(Int, Int)]) = {
- bench("Scala Map sorted") {
- val m = new scala.collection.mutable.HashMap[Int, Int]
-
- m ++= values.toArray.sorted
- }
- }
-
- def benchScalaPar(values: Iterable[(Int, Int)]) = {
- bench("Scala ParMap") {
- val m = new scala.collection.parallel.mutable.ParHashMap[Int, Int] map { x => x }
-
- m ++= values
- }
- }
-
- val total = 50000
- val values = (0 until total) zip (0 until total)
- val map = scala.collection.mutable.HashMap.empty[Int, Int]
-
- map ++= values
-
- // warmup
- for (x <- 0 until 5) {
- benchJava(map.asJava)
- benchScala(map)
- benchScalaPar(map)
- benchJava(map.asJava)
- benchScala(map)
- benchScalaPar(map)
- }
-
- val javamap = benchJava(map.asJava)
- val scalamap = benchScala(map)
- val scalaparmap = benchScalaPar(map)
-
- // println(javamap)
- // println(scalamap)
- // println(scalaparmap)
-
- assert(scalamap < (javamap * 10), "scalamap: " + scalamap + " vs. javamap: " + javamap)
- assert(scalaparmap < (javamap * 10), "scalaparmap: " + scalaparmap + " vs. javamap: " + javamap)
-}
-
-
-
-
-
-
-
-
diff --git a/test/files/run/t5293.scala b/test/files/run/t5293.scala
deleted file mode 100644
index c42c967b42..0000000000
--- a/test/files/run/t5293.scala
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-import scala.collection.JavaConverters._
-
-
-
-object Test extends App {
-
- def bench(label: String)(body: => Unit): Long = {
- val start = System.nanoTime
-
- 0.until(10).foreach(_ => body)
-
- val end = System.nanoTime
-
- //println("%s: %s ms".format(label, (end - start) / 1000.0 / 1000.0))
-
- end - start
- }
-
- def benchJava(values: java.util.Collection[Int]) = {
- bench("Java Set") {
- val set = new java.util.HashSet[Int]
-
- set.addAll(values)
- }
- }
-
- def benchScala(values: Iterable[Int]) = {
- bench("Scala Set") {
- val set = new scala.collection.mutable.HashSet[Int]
-
- set ++= values
- }
- }
-
- def benchScalaSorted(values: Iterable[Int]) = {
- bench("Scala Set sorted") {
- val set = new scala.collection.mutable.HashSet[Int]
-
- set ++= values.toArray.sorted
- }
- }
-
- def benchScalaPar(values: Iterable[Int]) = {
- bench("Scala ParSet") {
- val set = new scala.collection.parallel.mutable.ParHashSet[Int] map { x => x }
-
- set ++= values
- }
- }
-
- val values = 0 until 50000
- val set = scala.collection.mutable.HashSet.empty[Int]
-
- set ++= values
-
- // warmup
- for (x <- 0 until 5) {
- benchJava(set.asJava)
- benchScala(set)
- benchScalaPar(set)
- benchJava(set.asJava)
- benchScala(set)
- benchScalaPar(set)
- }
-
- val javaset = benchJava(set.asJava)
- val scalaset = benchScala(set)
- val scalaparset = benchScalaPar(set)
-
- assert(scalaset < (javaset * 8), "scalaset: " + scalaset + " vs. javaset: " + javaset)
- assert(scalaparset < (javaset * 8), "scalaparset: " + scalaparset + " vs. javaset: " + javaset)
-}
-
-
-
-
-
-
-
-
diff --git a/test/files/run/t5294.scala b/test/files/run/t5294.scala
new file mode 100644
index 0000000000..2551ae89a6
--- /dev/null
+++ b/test/files/run/t5294.scala
@@ -0,0 +1,22 @@
+import scala.language.higherKinds
+
+package p {
+ trait T[+A, +CC] {
+ def t: CC
+ }
+ class C {
+ def test[CC[X] <: T[X,String] with T[X,Int]](from: CC[_]): Unit = ()
+ }
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val symtab = reflect.runtime.universe.asInstanceOf[reflect.internal.SymbolTable]
+ val CTpe = reflect.runtime.universe.typeOf[p.C].asInstanceOf[symtab.Type]
+ val TClass = reflect.runtime.universe.symbolOf[p.T[_, _]].asInstanceOf[symtab.Symbol]
+ import symtab._
+ val from = CTpe.member(TermName("test")).paramss.head.head
+ assert(from.baseClasses contains TClass)
+ assert(from.info.baseTypeIndex(TClass) != -1) // was failing!
+ }
+}
diff --git a/test/files/run/t5313.check b/test/files/run/t5313.check
deleted file mode 100644
index 7a48b2b711..0000000000
--- a/test/files/run/t5313.check
+++ /dev/null
@@ -1,12 +0,0 @@
-STORE_LOCAL(variable kept1)
-STORE_LOCAL(value result)
-STORE_LOCAL(variable kept1)
-STORE_LOCAL(variable kept2)
-STORE_LOCAL(value kept3)
-STORE_LOCAL(variable kept2)
-STORE_LOCAL(variable kept4)
-STORE_LOCAL(variable kept4)
-STORE_LOCAL(variable kept5)
-STORE_LOCAL(variable kept5)
-STORE_LOCAL(variable kept6)
-STORE_LOCAL(variable kept6)
diff --git a/test/files/run/t5313.scala b/test/files/run/t5313.scala
deleted file mode 100644
index 7f5af74c3f..0000000000
--- a/test/files/run/t5313.scala
+++ /dev/null
@@ -1,54 +0,0 @@
-import scala.tools.partest.IcodeComparison
-
-object Test extends IcodeComparison {
- override def printIcodeAfterPhase = "dce"
-
- override def extraSettings: String = super.extraSettings + " -optimize"
-
- override def code =
- """class Foo {
- def randomBoolean = scala.util.Random.nextInt % 2 == 0
- def bar = {
- var kept1 = new Object
- val result = new java.lang.ref.WeakReference(kept1)
- kept1 = null // we can't eliminate this assignment because result can observe
- // when the object has no more references. See SI-5313
- kept1 = new Object // but we can eliminate this one because kept1 has already been clobbered
- var erased2 = null // we can eliminate this store because it's never used
- val erased3 = erased2 // and this
- var erased4 = erased2 // and this
- val erased5 = erased4 // and this
- var kept2: Object = new Object // ultimately can't be eliminated
- while(randomBoolean) {
- val kept3 = kept2
- kept2 = null // this can't, because it clobbers kept2, which is used
- erased4 = null // safe to eliminate
- println(kept3)
- }
- var kept4 = new Object // have to keep, it's used
- try
- println(kept4)
- catch {
- case _ : Throwable => kept4 = null // have to keep, it clobbers kept4 which is used
- }
- var kept5 = new Object
- print(kept5)
- kept5 = null // can't eliminate it's a clobber and it's used
- print(kept5)
- kept5 = null // can eliminate because we don't care about clobbers of nulls
- while(randomBoolean) {
- var kept6: AnyRef = null // not used, but have to keep because it clobbers the next used store
- // on the back edge of the loop
- kept6 = new Object // used
- println(kept6)
- }
- result
- }
- }""".stripMargin
-
- override def show() {
- val storeLocal = "STORE_LOCAL"
- val lines1 = collectIcode() filter (_ contains storeLocal) map (x => x.drop(x.indexOf(storeLocal)))
- println(lines1 mkString "\n")
- }
-}
diff --git a/test/files/run/t5375.check b/test/files/run/t5375.check
index b1a57eeeec..e69de29bb2 100644
--- a/test/files/run/t5375.check
+++ b/test/files/run/t5375.check
@@ -1 +0,0 @@
-Runtime exception
diff --git a/test/files/run/t5375.scala b/test/files/run/t5375.scala
index 826ecd841e..2028b6f05d 100644
--- a/test/files/run/t5375.scala
+++ b/test/files/run/t5375.scala
@@ -1,8 +1,16 @@
object Test extends App {
val foos = (1 to 1000).toSeq
- try
- foos.par.map(i => if (i % 37 == 0) sys.error("i div 37") else i)
- catch {
- case ex: RuntimeException => println("Runtime exception")
+ try {
+ foos.par.map(i => if (i % 37 == 0) throw new MultipleOf37Exception(i) else i)
+ assert(false)
+ } catch {
+ case ex: MultipleOf37Exception =>
+ assert(ex.getSuppressed.size > 0)
+ assert(ex.getSuppressed.forall(_.isInstanceOf[MultipleOf37Exception]))
+ assert(ex.i == 37)
+ assert(ex.getSuppressed.map(_.asInstanceOf[MultipleOf37Exception].i).toList == List(74, 148, 259, 518))
+ case _: Throwable =>
+ assert(false)
}
+ class MultipleOf37Exception(val i: Int) extends RuntimeException
}
diff --git a/test/files/run/t5380.check b/test/files/run/t5380.check
index 731a798301..19471ac2d2 100644
--- a/test/files/run/t5380.check
+++ b/test/files/run/t5380.check
@@ -1,7 +1,7 @@
-t5380.scala:3: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+t5380.scala:3: warning: a pure expression does nothing in statement position
val f = () => return try { 1 } catch { case _: Throwable => 0 }
^
-t5380.scala:3: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+t5380.scala:3: warning: a pure expression does nothing in statement position
val f = () => return try { 1 } catch { case _: Throwable => 0 }
^
t5380.scala:3: warning: enclosing method main has result type Unit: return value discarded
diff --git a/test/files/run/t5428.check b/test/files/run/t5428.check
index 52fce09399..d298f0ef10 100644
--- a/test/files/run/t5428.check
+++ b/test/files/run/t5428.check
@@ -1,2 +1,2 @@
-warning: there was one deprecation warning; re-run with -deprecation for details
+warning: there was one deprecation warning (since 2.11.0); re-run with -deprecation for details
Stack(8, 7, 6, 5, 4, 3)
diff --git a/test/files/run/t5463.scala b/test/files/run/t5463.scala
new file mode 100644
index 0000000000..30b8306156
--- /dev/null
+++ b/test/files/run/t5463.scala
@@ -0,0 +1,21 @@
+import scala.reflect.internal.FatalError
+import scala.tools.partest.DirectTest
+
+object Test extends DirectTest {
+
+ def code = "class A"
+
+ override def show(): Unit = {
+ // Create a broken JAR file and put it on compiler classpath
+ val jarpath = testOutput.path + "/notajar.jar"
+ scala.reflect.io.File(jarpath).writeAll("This isn't really a JAR file")
+
+ val classpath = List(sys.props("partest.lib"), jarpath, testOutput.path) mkString sys.props("path.separator")
+ try {
+ compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(code)
+ throw new Error("Compilation should have failed");
+ } catch {
+ case ex: FatalError => // this is expected
+ }
+ }
+}
diff --git a/test/files/run/t5535.scala b/test/files/run/t5535.scala
index 7bc12f3470..2833b9c94b 100644
--- a/test/files/run/t5535.scala
+++ b/test/files/run/t5535.scala
@@ -7,4 +7,11 @@ println(h()(5))
val f = h() _
println(f(10))
"""
+
+ // replace indylambda function names by <function1>
+ override def eval() = {
+ val lines = super.eval
+ val r = """\$\$Lambda.*""".r
+ lines.map(l => r.replaceAllIn(l, "<function1>"))
+ }
}
diff --git a/test/files/run/t5552.check b/test/files/run/t5552.check
index a19a60840e..73ad9cf824 100644
--- a/test/files/run/t5552.check
+++ b/test/files/run/t5552.check
@@ -1,2 +1,6 @@
+lazy: 3
(3,3)
+(3,3)
+lazy: 3.0
+(3.0,3.0)
(3.0,3.0)
diff --git a/test/files/run/t5552.scala b/test/files/run/t5552.scala
index afb8a1f0be..5b717f9e13 100644
--- a/test/files/run/t5552.scala
+++ b/test/files/run/t5552.scala
@@ -1,10 +1,14 @@
class C[@specialized(Int) A](a:A) {
- lazy val b = (a, a)
+ lazy val b = {println(s"lazy: $a"); (a, a)} // there should only be two instances of "lazy" in the output
def c = b
}
object Test {
def main(args:Array[String]) {
- println(new C(3).c)
- println(new C(3.0).c)
+ val cInt = new C(3)
+ println(cInt.c)
+ println(cInt.c)
+ val cFloat = new C(3.0)
+ println(cFloat.c)
+ println(cFloat.c)
}
}
diff --git a/test/files/run/t5652.check b/test/files/run/t5652.check
index 11438ef217..1acd924c68 100644
--- a/test/files/run/t5652.check
+++ b/test/files/run/t5652.check
@@ -1,8 +1,9 @@
-public static final int T1$class.g$1(T1)
-public static int T1$class.f0(T1)
-public static void T1$class.$init$(T1)
-public final int A1.A1$$g$2()
+public default int T1.f0()
+public static int T1.T1$$g$1()
+public static int T1.f0$(T1)
+public static void T1.$init$(T1)
public int A1.f1()
-public final int A2.A2$$g$1()
+public static final int A1.A1$$g$2()
public int A2.f0()
public int A2.f2()
+public static final int A2.A2$$g$1()
diff --git a/test/files/run/t5652/t5652_2.scala b/test/files/run/t5652/t5652_2.scala
index 765d16f8f5..d1de937e31 100644
--- a/test/files/run/t5652/t5652_2.scala
+++ b/test/files/run/t5652/t5652_2.scala
@@ -4,6 +4,6 @@ class A2 extends A1 with T1{
object Test extends A2 {
def main(args: Array[String]) {
- println(Seq(Class.forName(classOf[T1].getName + "$class"), classOf[A1], classOf[A2]).flatMap(_.getDeclaredMethods.map(_.toString).sorted).mkString("\n"))
+ println(Seq(classOf[T1], classOf[A1], classOf[A2]).flatMap(_.getDeclaredMethods.map(_.toString).sorted).mkString("\n"))
}
}
diff --git a/test/files/run/t5652b.check b/test/files/run/t5652b.check
index ca9d0a74f0..0f4290796f 100644
--- a/test/files/run/t5652b.check
+++ b/test/files/run/t5652b.check
@@ -1,4 +1,4 @@
-private final int A1.g$1()
+private static final int A1.g$1()
public int A1.f1()
-private final int A2.g$1()
+private static final int A2.g$1()
public int A2.f2()
diff --git a/test/files/run/t5652c.check b/test/files/run/t5652c.check
index 3b889e066d..5a6d535f02 100644
--- a/test/files/run/t5652c.check
+++ b/test/files/run/t5652c.check
@@ -1,6 +1,6 @@
-public final int A1.A1$$g$1()
-public final int A1.A1$$g$2()
public int A1.f1()
public int A1.f2()
+public static final int A1.A1$$g$1()
+public static final int A1.A1$$g$2()
1
2
diff --git a/test/files/run/t5676.flags b/test/files/run/t5676.flags
index e1b37447c9..73f1330c31 100644
--- a/test/files/run/t5676.flags
+++ b/test/files/run/t5676.flags
@@ -1 +1 @@
--Xexperimental \ No newline at end of file
+-Yoverride-objects
diff --git a/test/files/run/t5699.check b/test/files/run/t5699.check
index df19644ae6..8d19ecd321 100644
--- a/test/files/run/t5699.check
+++ b/test/files/run/t5699.check
@@ -1,10 +1,10 @@
[[syntax trees at end of parser]] // annodef.java
package <empty> {
object MyAnnotation extends {
- def <init>() = _
+ def <init>()
};
class MyAnnotation extends scala.annotation.Annotation with _root_.java.lang.annotation.Annotation with scala.annotation.ClassfileAnnotation {
- def <init>() = _;
+ def <init>();
def value(): String
}
}
diff --git a/test/files/run/t5717.check b/test/files/run/t5717.check
new file mode 100644
index 0000000000..5001b57ffc
--- /dev/null
+++ b/test/files/run/t5717.check
@@ -0,0 +1 @@
+error: error writing a/B: t5717-run.obj/a/B.class: t5717-run.obj/a is not a directory
diff --git a/test/files/run/t5717.scala b/test/files/run/t5717.scala
index a0997f5a49..1434f40a6a 100644
--- a/test/files/run/t5717.scala
+++ b/test/files/run/t5717.scala
@@ -1,7 +1,7 @@
import scala.tools.partest._
import java.io.File
-object Test extends StoreReporterDirectTest {
+object Test extends DirectTest {
def code = ???
def compileCode(code: String) = {
diff --git a/test/files/run/t576.check b/test/files/run/t576.check
index 22f3843abf..2934e395ba 100644
--- a/test/files/run/t576.check
+++ b/test/files/run/t576.check
@@ -1,4 +1,4 @@
-warning: there was one deprecation warning; re-run with -deprecation for details
+warning: there was one deprecation warning (since 2.11.0); re-run with -deprecation for details
1
2
3
diff --git a/test/files/run/t5789.scala b/test/files/run/t5789.scala
index 461f6a4aae..893294b56b 100644
--- a/test/files/run/t5789.scala
+++ b/test/files/run/t5789.scala
@@ -5,10 +5,17 @@ import scala.tools.partest.ReplTest
object Test extends ReplTest {
- override def extraSettings = "-Yinline"
+ override def extraSettings = "-opt:l:classpath"
def code = """
val n = 2
() => n
"""
+
+ // replace indylambda function names by <function0>
+ override def eval() = {
+ val lines = super.eval
+ val r = """\$\$Lambda.*""".r
+ lines.map(l => r.replaceAllIn(l, "<function0>"))
+ }
}
diff --git a/test/files/run/t5880.scala b/test/files/run/t5880.scala
index f88df90160..284ba03ff6 100644
--- a/test/files/run/t5880.scala
+++ b/test/files/run/t5880.scala
@@ -1,8 +1,5 @@
-
-import scala.collection.JavaConversions._
-
-
+import scala.collection.convert.ImplicitConversionsToJava._
object Test {
diff --git a/test/files/run/t5907.scala b/test/files/run/t5907.scala
index a005e9fbd3..81fc43e3f5 100644
--- a/test/files/run/t5907.scala
+++ b/test/files/run/t5907.scala
@@ -86,7 +86,7 @@ object Test extends App {
}
}
-case class C1(implicit x: Int) {
+case class C1()(implicit x: Int) {
override def toString = s"c1: $x"
}
case class C2()(y: Int) {
diff --git a/test/files/run/t5943a1.check b/test/files/run/t5943a1.check
index 9f4d160af8..4b683a3da5 100644
--- a/test/files/run/t5943a1.check
+++ b/test/files/run/t5943a1.check
@@ -1 +1 @@
-scala.this.Predef.intWrapper(1).to(3).map[Int, scala.collection.immutable.IndexedSeq[Int]](((x$1: Int) => x$1.+(1)))(immutable.this.IndexedSeq.canBuildFrom[Int])
+scala.Predef.intWrapper(1).to(3).map[Int, scala.collection.immutable.IndexedSeq[Int]](((x$1: Int) => x$1.+(1)))(immutable.this.IndexedSeq.canBuildFrom[Int])
diff --git a/test/files/run/t6023.check b/test/files/run/t6023.check
index ee93565234..dd6d8f1f1c 100644
--- a/test/files/run/t6023.check
+++ b/test/files/run/t6023.check
@@ -1,12 +1,12 @@
{
abstract trait Foo extends AnyRef {
- <stable> <accessor> def a: Int
+ val a: Int
};
()
}
{
abstract trait Foo extends AnyRef {
- <stable> <accessor> def a: Int
+ <stable> <accessor> val a: Int
};
()
}
diff --git a/test/files/run/t6028.check b/test/files/run/t6028.check
index edc8b22d6d..05634fa8eb 100644
--- a/test/files/run/t6028.check
+++ b/test/files/run/t6028.check
@@ -15,7 +15,7 @@ package <empty> {
}
};
def bar(barParam: Int): Object = {
- @volatile var MethodLocalObject$module: runtime.VolatileObjectRef = scala.runtime.VolatileObjectRef.zero();
+ lazy <artifact> val MethodLocalObject$module: scala.runtime.LazyRef = new scala.runtime.LazyRef();
T.this.MethodLocalObject$1(barParam, MethodLocalObject$module)
};
def tryy(tryyParam: Int): Function0 = {
@@ -38,28 +38,30 @@ package <empty> {
<synthetic> <paramaccessor> private[this] val methodLocal$1: Int = _
};
abstract trait MethodLocalTrait$1 extends Object {
+ def /*MethodLocalTrait$1*/$init$(barParam$1: Int): Unit = {
+ ()
+ };
+ scala.Predef.print(scala.Int.box(barParam$1));
<synthetic> <stable> <artifact> def $outer(): T
};
object MethodLocalObject$2 extends Object with T#MethodLocalTrait$1 {
def <init>($outer: T, barParam$1: Int): T#MethodLocalObject$2.type = {
MethodLocalObject$2.super.<init>();
- MethodLocalObject$2.this.$asInstanceOf[T#MethodLocalTrait$1$class]()./*MethodLocalTrait$1$class*/$init$(barParam$1);
+ MethodLocalObject$2.super./*MethodLocalTrait$1*/$init$(barParam$1);
()
};
<synthetic> <paramaccessor> <artifact> private[this] val $outer: T = _;
<synthetic> <stable> <artifact> def $outer(): T = MethodLocalObject$2.this.$outer;
<synthetic> <stable> <artifact> def $outer(): T = MethodLocalObject$2.this.$outer
};
- final <stable> private[this] def MethodLocalObject$1(barParam$1: Int, MethodLocalObject$module$1: runtime.VolatileObjectRef): T#MethodLocalObject$2.type = {
- MethodLocalObject$module$1.elem = new T#MethodLocalObject$2.type(T.this, barParam$1);
- MethodLocalObject$module$1.elem.$asInstanceOf[T#MethodLocalObject$2.type]()
- };
- abstract trait MethodLocalTrait$1$class extends Object with T#MethodLocalTrait$1 {
- def /*MethodLocalTrait$1$class*/$init$(barParam$1: Int): Unit = {
- ()
- };
- scala.this.Predef.print(scala.Int.box(barParam$1))
- };
+ final <artifact> private[this] def MethodLocalObject$lzycompute$1(barParam$1: Int, MethodLocalObject$module$1: scala.runtime.LazyRef): T#MethodLocalObject$2.type = MethodLocalObject$module$1.synchronized[T#MethodLocalObject$2.type](if (MethodLocalObject$module$1.initialized())
+ MethodLocalObject$module$1.value().$asInstanceOf[T#MethodLocalObject$2.type]()
+ else
+ MethodLocalObject$module$1.initialize(new T#MethodLocalObject$2.type(T.this, barParam$1)).$asInstanceOf[T#MethodLocalObject$2.type]());
+ final private[this] def MethodLocalObject$1(barParam$1: Int, MethodLocalObject$module$1: scala.runtime.LazyRef): T#MethodLocalObject$2.type = if (MethodLocalObject$module$1.initialized())
+ MethodLocalObject$module$1.value().$asInstanceOf[T#MethodLocalObject$2.type]()
+ else
+ T.this.MethodLocalObject$lzycompute$1(barParam$1, MethodLocalObject$module$1);
@SerialVersionUID(value = 0) final <synthetic> class $anonfun$tryy$1 extends scala.runtime.AbstractFunction0$mcV$sp with Serializable {
def <init>($outer: T, tryyParam$1: Int, tryyLocal$1: runtime.IntRef): <$anon: Function0> = {
$anonfun$tryy$1.super.<init>();
diff --git a/test/files/run/t6089.scala b/test/files/run/t6089.scala
index c72d7ba792..c42a9f68c6 100644
--- a/test/files/run/t6089.scala
+++ b/test/files/run/t6089.scala
@@ -3,7 +3,7 @@ case class Foo(x: Int)
object Test {
def bippo(result: Boolean): Boolean = result
def bungus(m: Foo): Boolean =
- bippo(m match { case Foo(2) => bungus(m) })
+ bippo((m: @unchecked) match { case Foo(2) => bungus(m) })
def main(args: Array[String]): Unit = try {
bungus(Foo(0))
diff --git a/test/files/run/t6102.check b/test/files/run/t6102.check
index 07378f5ed4..ce01362503 100644
--- a/test/files/run/t6102.check
+++ b/test/files/run/t6102.check
@@ -1,37 +1 @@
-[running phase parser on t6102.scala]
-[running phase namer on t6102.scala]
-[running phase packageobjects on t6102.scala]
-[running phase typer on t6102.scala]
-[running phase patmat on t6102.scala]
-[running phase superaccessors on t6102.scala]
-[running phase extmethods on t6102.scala]
-[running phase pickler on t6102.scala]
-[running phase refchecks on t6102.scala]
-[running phase uncurry on t6102.scala]
-[running phase tailcalls on t6102.scala]
-[running phase specialize on t6102.scala]
-[running phase explicitouter on t6102.scala]
-[running phase erasure on t6102.scala]
-[running phase posterasure on t6102.scala]
-[running phase lazyvals on t6102.scala]
-[running phase lambdalift on t6102.scala]
-[running phase constructors on t6102.scala]
-[running phase flatten on t6102.scala]
-[running phase mixin on t6102.scala]
-[running phase cleanup on t6102.scala]
-[running phase delambdafy on t6102.scala]
-[running phase icode on t6102.scala]
-#partest -optimise
-[running phase inliner on t6102.scala]
-[running phase inlinehandlers on t6102.scala]
-[running phase closelim on t6102.scala]
-[running phase constopt on t6102.scala]
-#partest
-[running phase dce on t6102.scala]
-#partest !-Ybackend:GenBCode
-[running phase jvm on icode]
-#partest -Ybackend:GenBCode
-[running phase jvm on t6102.scala]
-[running phase jvm on t6102.scala]
-#partest
hello
diff --git a/test/files/run/t6102.flags b/test/files/run/t6102.flags
index 726e2a997f..7f938c550f 100644
--- a/test/files/run/t6102.flags
+++ b/test/files/run/t6102.flags
@@ -1 +1 @@
--Ydead-code -Ydebug -Xfatal-warnings
+-opt:l:classpath -Xfatal-warnings
diff --git a/test/files/run/t6111.check b/test/files/run/t6111.check
index 5880658001..99f9c551b2 100644
--- a/test/files/run/t6111.check
+++ b/test/files/run/t6111.check
@@ -1,3 +1,3 @@
-warning: there were two deprecation warnings; re-run with -deprecation for details
+warning: there were two deprecation warnings (since 2.11.0); re-run with -deprecation for details
(8,8)
(x,x)
diff --git a/test/files/run/t6188.flags b/test/files/run/t6188.flags
index 0ebca3e7af..768ca4f13b 100644
--- a/test/files/run/t6188.flags
+++ b/test/files/run/t6188.flags
@@ -1 +1 @@
- -optimize
+-opt:l:classpath \ No newline at end of file
diff --git a/test/files/run/t6198.scala b/test/files/run/t6198.scala
index 5aa8f1c1cf..65dbaf8160 100644
--- a/test/files/run/t6198.scala
+++ b/test/files/run/t6198.scala
@@ -1,13 +1,6 @@
import scala.collection.immutable._
object Test extends App {
- // test that ListSet.tail does not use a builder
- // we can't test for O(1) behavior, so the best we can do is to
- // check that ls.tail always returns the same instance
- val ls = ListSet.empty[Int] + 1 + 2
-
- if(ls.tail ne ls.tail)
- println("ListSet.tail should not use a builder!")
// class that always causes hash collisions
case class Collision(value:Int) { override def hashCode = 0 }
diff --git a/test/files/run/t6240-universe-code-gen.scala b/test/files/run/t6240-universe-code-gen.scala
index 60e1f76b54..80b60bab7e 100644
--- a/test/files/run/t6240-universe-code-gen.scala
+++ b/test/files/run/t6240-universe-code-gen.scala
@@ -54,7 +54,7 @@ object Test extends App {
|
|${forceCode("this", JavaUniverseTpe)}
|${forceCode("definitions", DefinitionsModule.info)}
- |${forceCode("refChecks", typeOf[scala.reflect.internal.transform.RefChecks])}
+ |
|${forceCode("uncurry", typeOf[scala.reflect.internal.transform.UnCurry])}
|${forceCode("erasure", typeOf[scala.reflect.internal.transform.Erasure])}
| }
diff --git a/test/files/run/t6240a/StepOne.java b/test/files/run/t6240a/StepOne.java
index 342d617c79..a9c076c000 100644
--- a/test/files/run/t6240a/StepOne.java
+++ b/test/files/run/t6240a/StepOne.java
@@ -31,7 +31,7 @@ public class StepOne {
// launch StepTwo
URL[] launchURLs = new URL[launchPaths.length];
for (int i = 0; i < launchPaths.length; i++) {
- launchURLs[i] = new File(launchPaths[i]).toURL();
+ launchURLs[i] = new File(launchPaths[i]).toURI().toURL();
}
URLClassLoader classLoader = new URLClassLoader(launchURLs, Object.class.getClassLoader());
Class<?> stepTwo = classLoader.loadClass("StepTwo");
diff --git a/test/files/run/t6240b/StepOne.java b/test/files/run/t6240b/StepOne.java
index 342d617c79..a9c076c000 100644
--- a/test/files/run/t6240b/StepOne.java
+++ b/test/files/run/t6240b/StepOne.java
@@ -31,7 +31,7 @@ public class StepOne {
// launch StepTwo
URL[] launchURLs = new URL[launchPaths.length];
for (int i = 0; i < launchPaths.length; i++) {
- launchURLs[i] = new File(launchPaths[i]).toURL();
+ launchURLs[i] = new File(launchPaths[i]).toURI().toURL();
}
URLClassLoader classLoader = new URLClassLoader(launchURLs, Object.class.getClassLoader());
Class<?> stepTwo = classLoader.loadClass("StepTwo");
diff --git a/test/files/run/t6260-delambdafy.check b/test/files/run/t6260-delambdafy.check
index b2a7bed988..2fea68afb1 100644
--- a/test/files/run/t6260-delambdafy.check
+++ b/test/files/run/t6260-delambdafy.check
@@ -1,4 +1,4 @@
f(C@2e)
-Test$lambda$1$$apply
apply
+writeReplace
diff --git a/test/files/run/t6260-delambdafy.flags b/test/files/run/t6260-delambdafy.flags
deleted file mode 100644
index 48b438ddf8..0000000000
--- a/test/files/run/t6260-delambdafy.flags
+++ /dev/null
@@ -1 +0,0 @@
--Ydelambdafy:method
diff --git a/test/files/run/t6260c.check b/test/files/run/t6260c.check
index 78e9b27371..388f6690d6 100644
--- a/test/files/run/t6260c.check
+++ b/test/files/run/t6260c.check
@@ -1,9 +1,5 @@
f(C@2e)
-#partest !-Ydelambdafy:method
-Test$$anonfun$$apply
-#partest -Ydelambdafy:method
-Test$lambda$1$$apply
-#partest
apply
+writeReplace
g(C@2e)
diff --git a/test/files/run/t6288.check b/test/files/run/t6288.check
index a032a10de6..7933f516a8 100644
--- a/test/files/run/t6288.check
+++ b/test/files/run/t6288.check
@@ -7,7 +7,7 @@
};
[21]def unapply([29]z: [32]<type: [32]scala.Any>): [21]Option[Int] = [56][52][52]scala.Some.apply[[52]Int]([58]-1);
[64]{
- [64]case <synthetic> val x1: [64]Any = [64]"";
+ [64]case <synthetic> val x1: [64]String = [64]"";
[64]case5()[84]{
[84]<synthetic> val o7: [84]Option[Int] = [84][84]Case3.unapply([84]x1);
[84]if ([84]o7.isEmpty.unary_!)
@@ -30,14 +30,11 @@
};
[127]def unapplySeq([138]z: [141]<type: [141]scala.Any>): [127]Option[List[Int]] = [167]scala.None;
[175]{
- [175]case <synthetic> val x1: [175]Any = [175]"";
+ [175]case <synthetic> val x1: [175]String = [175]"";
[175]case5()[195]{
[195]<synthetic> val o7: [195]Option[List[Int]] = [195][195]Case4.unapplySeq([195]x1);
- [195]if ([195]o7.isEmpty.unary_!)
- [195]if ([195][195][195][195]o7.get.!=([195]null).&&([195][195][195][195]o7.get.lengthCompare([195]1).==([195]0)))
- [208][208]matchEnd4([208]())
- else
- [195][195]case6()
+ [195]if ([195][195]o7.isEmpty.unary_!.&&([195][195][195][195]o7.get.!=([195]null).&&([195][195][195][195]o7.get.lengthCompare([195]1).==([195]0))))
+ [208][208]matchEnd4([208]())
else
[195][195]case6()
};
@@ -56,14 +53,11 @@
};
[238]def unapply([246]z: [249]<type: [249]scala.Any>): [238]Boolean = [265]true;
[273]{
- [273]case <synthetic> val x1: [273]Any = [273]"";
+ [273]case <synthetic> val x1: [273]String = [273]"";
[273]case5()[293]{
[293]<synthetic> val o7: [293]Option[List[Int]] = [293][293]Case4.unapplySeq([293]x1);
- [293]if ([293]o7.isEmpty.unary_!)
- [293]if ([293][293][293][293]o7.get.!=([293]null).&&([293][293][293][293]o7.get.lengthCompare([293]0).==([293]0)))
- [304][304]matchEnd4([304]())
- else
- [293][293]case6()
+ [293]if ([293][293]o7.isEmpty.unary_!.&&([293][293][293][293]o7.get.!=([293]null).&&([293][293][293][293]o7.get.lengthCompare([293]0).==([293]0))))
+ [304][304]matchEnd4([304]())
else
[293][293]case6()
};
diff --git a/test/files/run/t6288b-jump-position.check b/test/files/run/t6288b-jump-position.check
deleted file mode 100644
index ece88b18f0..0000000000
--- a/test/files/run/t6288b-jump-position.check
+++ /dev/null
@@ -1,76 +0,0 @@
-object Case3 extends Object {
- // fields:
-
- // methods
- def unapply(z: Object (REF(class Object))): Option {
- locals: value z
- startBlock: 1
- blocks: [1]
-
- 1:
- 2 NEW REF(class Some)
- 2 DUP(REF(class Some))
- 2 CONSTANT(-1)
- 2 BOX INT
- 2 CALL_METHOD scala.Some.<init> (static-instance)
- 2 RETURN(REF(class Option))
-
- }
- Exception handlers:
-
- def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
- locals: value args, value x1, value x
- startBlock: 1
- blocks: [1,2,3,6,7]
-
- 1:
- 4 CONSTANT("")
- 4 STORE_LOCAL(value x1)
- 4 SCOPE_ENTER value x1
- 4 JUMP 2
-
- 2:
- 5 LOAD_LOCAL(value x1)
- 5 IS_INSTANCE REF(class String)
- 5 CZJUMP (BOOL)NE ? 3 : 6
-
- 3:
- 6 LOAD_MODULE object Predef
- 6 CONSTANT("case 0")
- 6 CALL_METHOD scala.Predef.println (dynamic)
- 6 LOAD_FIELD scala.runtime.BoxedUnit.UNIT
- 6 STORE_LOCAL(value x)
- 6 JUMP 7
-
- 6:
- 8 LOAD_MODULE object Predef
- 8 CONSTANT("default")
- 8 CALL_METHOD scala.Predef.println (dynamic)
- 8 LOAD_FIELD scala.runtime.BoxedUnit.UNIT
- 8 STORE_LOCAL(value x)
- 8 JUMP 7
-
- 7:
- 10 LOAD_MODULE object Predef
- 10 CONSTANT("done")
- 10 CALL_METHOD scala.Predef.println (dynamic)
- 10 RETURN(UNIT)
-
- }
- Exception handlers:
-
- def <init>(): Case3.type {
- locals:
- startBlock: 1
- blocks: [1]
-
- 1:
- 12 THIS(Case3)
- 12 CALL_METHOD java.lang.Object.<init> (super())
- 12 RETURN(UNIT)
-
- }
- Exception handlers:
-
-
-}
diff --git a/test/files/run/t6288b-jump-position.scala b/test/files/run/t6288b-jump-position.scala
deleted file mode 100644
index c5f3bbe788..0000000000
--- a/test/files/run/t6288b-jump-position.scala
+++ /dev/null
@@ -1,19 +0,0 @@
-import scala.tools.partest.IcodeComparison
-
-object Test extends IcodeComparison {
- override def code =
- """object Case3 { // 01
- | def unapply(z: Any): Option[Int] = Some(-1) // 02
- | def main(args: Array[String]) { // 03
- | ("": Any) match { // 04
- | case x : String => // 05 Read: <linenumber> JUMP <target basic block id>
- | println("case 0") // 06 expecting "6 JUMP 7", was "8 JUMP 7"
- | case _ => // 07
- | println("default") // 08 expecting "8 JUMP 7"
- | } // 09
- | println("done") // 10
- | }
- |}""".stripMargin
-
- override def show() = showIcode()
-}
diff --git a/test/files/run/t6292.check b/test/files/run/t6292.check
index 6f7430d5b8..f7b8f483ab 100644
--- a/test/files/run/t6292.check
+++ b/test/files/run/t6292.check
@@ -1 +1 @@
-warning: there were 7 deprecation warnings; re-run with -deprecation for details
+warning: there were 7 deprecation warnings (since 2.11.0); re-run with -deprecation for details
diff --git a/test/files/run/t6329_repl.check b/test/files/run/t6329_repl.check
index 8909c47e79..22882a3597 100644
--- a/test/files/run/t6329_repl.check
+++ b/test/files/run/t6329_repl.check
@@ -3,28 +3,28 @@ scala> import scala.reflect.classTag
import scala.reflect.classTag
scala> classManifest[scala.List[_]]
-warning: there was one deprecation warning; re-run with -deprecation for details
+warning: there was one deprecation warning (since 2.10.0); for details, enable `:setting -deprecation' or `:replay -deprecation'
res0: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List[<?>]
scala> classTag[scala.List[_]]
res1: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List
scala> classManifest[scala.collection.immutable.List[_]]
-warning: there was one deprecation warning; re-run with -deprecation for details
+warning: there was one deprecation warning (since 2.10.0); for details, enable `:setting -deprecation' or `:replay -deprecation'
res2: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List[<?>]
scala> classTag[scala.collection.immutable.List[_]]
res3: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List
scala> classManifest[Predef.Set[_]]
-warning: there was one deprecation warning; re-run with -deprecation for details
+warning: there was one deprecation warning (since 2.10.0); for details, enable `:setting -deprecation' or `:replay -deprecation'
res4: scala.reflect.ClassTag[scala.collection.immutable.Set[_]] = scala.collection.immutable.Set[<?>]
scala> classTag[Predef.Set[_]]
res5: scala.reflect.ClassTag[scala.collection.immutable.Set[_]] = scala.collection.immutable.Set
scala> classManifest[scala.collection.immutable.Set[_]]
-warning: there was one deprecation warning; re-run with -deprecation for details
+warning: there was one deprecation warning (since 2.10.0); for details, enable `:setting -deprecation' or `:replay -deprecation'
res6: scala.reflect.ClassTag[scala.collection.immutable.Set[_]] = scala.collection.immutable.Set[<?>]
scala> classTag[scala.collection.immutable.Set[_]]
diff --git a/test/files/run/t6329_repl_bug.check b/test/files/run/t6329_repl_bug.check
index 4b539f9e58..11decae9bd 100644
--- a/test/files/run/t6329_repl_bug.check
+++ b/test/files/run/t6329_repl_bug.check
@@ -6,7 +6,7 @@ scala> import scala.reflect.runtime._
import scala.reflect.runtime._
scala> classManifest[List[_]]
-warning: there was one deprecation warning; re-run with -deprecation for details
+warning: there was one deprecation warning (since 2.10.0); for details, enable `:setting -deprecation' or `:replay -deprecation'
res0: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List[<?>]
scala> scala.reflect.classTag[List[_]]
diff --git a/test/files/run/t6329_vanilla_bug.check b/test/files/run/t6329_vanilla_bug.check
index 01bf0636ea..4e139dd954 100644
--- a/test/files/run/t6329_vanilla_bug.check
+++ b/test/files/run/t6329_vanilla_bug.check
@@ -1,3 +1,3 @@
-warning: there was one deprecation warning; re-run with -deprecation for details
+warning: there was one deprecation warning (since 2.10.0); re-run with -deprecation for details
scala.collection.immutable.List[<?>]
scala.collection.immutable.List
diff --git a/test/files/run/t6331b.check b/test/files/run/t6331b.check
index 6ca09e3814..565348ce3f 100644
--- a/test/files/run/t6331b.check
+++ b/test/files/run/t6331b.check
@@ -10,19 +10,19 @@ else
-0.0
res: Double = 0.0
-trace> Test.this.intercept.apply[Any](if (scala.this.Predef.???)
+trace> Test.this.intercept.apply[Any](if (scala.Predef.???)
-0.0
else
0.0)
res: Any = class scala.NotImplementedError
-trace> Test.this.intercept.apply[Any](if (scala.this.Predef.???)
+trace> Test.this.intercept.apply[Any](if (scala.Predef.???)
0.0
else
0.0)
res: Any = class scala.NotImplementedError
-trace> Test.this.intercept.apply[Any](if (scala.this.Predef.???)
+trace> Test.this.intercept.apply[Any](if (scala.Predef.???)
()
else
())
diff --git a/test/files/run/t6434.scala b/test/files/run/t6434.scala
index e4a4579613..6b6a783299 100644
--- a/test/files/run/t6434.scala
+++ b/test/files/run/t6434.scala
@@ -5,4 +5,11 @@ object Test extends ReplTest {
"""def f(x: => Int): Int = x
f _
"""
+
+ // replace indylambda function names by <function1>
+ override def eval() = {
+ val lines = super.eval
+ val r = """\$\$Lambda.*""".r
+ lines.map(l => r.replaceAllIn(l, "<function1>"))
+ }
}
diff --git a/test/files/run/t6481.check b/test/files/run/t6481.check
index 4a3f6f7ee9..0535110f75 100644
--- a/test/files/run/t6481.check
+++ b/test/files/run/t6481.check
@@ -1,4 +1,4 @@
-warning: there was one deprecation warning; re-run with -deprecation for details
+warning: there was one deprecation warning (since 2.11.0); re-run with -deprecation for details
delayed init
new foo(1, 2)
delayed init
diff --git a/test/files/run/t6502.scala b/test/files/run/t6502.scala
index f4fc39a03d..cb2b3ff449 100644
--- a/test/files/run/t6502.scala
+++ b/test/files/run/t6502.scala
@@ -1,6 +1,5 @@
import scala.tools.nsc.Settings
import scala.tools.nsc.interpreter.{ ILoop, replProps }
-import scala.tools.nsc.settings.ClassPathRepresentationType
import scala.tools.partest._
object Test extends StoreReporterDirectTest {
@@ -14,14 +13,6 @@ object Test extends StoreReporterDirectTest {
compileString(newCompiler("-cp", classpath, "-d", s"${testOutput.path}/$jarFileName"))(code)
}
- // TODO flat classpath doesn't support the classpath invalidation yet so we force using the recursive one
- // it's the only test which needed such a workaround
- override def settings = {
- val settings = new Settings
- settings.YclasspathImpl.value = ClassPathRepresentationType.Recursive
- settings
- }
-
def app1 = """
package test
@@ -72,9 +63,8 @@ object Test extends StoreReporterDirectTest {
s"[${added}] in [${output.lines.mkString("/")}]"
)
lines = lines drop promptLength
- assert {
- lines.next.contains("testing...")
- }
+ val r = lines.next
+ assert(r.contains("testing..."), r)
}
def test2(): Unit = {
@@ -91,14 +81,10 @@ object Test extends StoreReporterDirectTest {
var lines = output.lines.drop(headerLength)
lines = lines drop promptLength
val added = lines.next
- assert {
- added.contains("Added") && added.contains("test1.jar")
- }
+ assert(added.contains("Added") && added.contains("test1.jar"), added)
lines = lines drop promptLength
val msg = lines.next
- assert {
- msg.contains("test2.jar") && msg.contains("existing classpath entries conflict")
- }
+ assert(msg.contains("test2.jar") && msg.contains("contains a classfile that already exists on the classpath: test.Test$"), msg)
}
def test3(): Unit = {
@@ -116,13 +102,10 @@ object Test extends StoreReporterDirectTest {
var lines = output.lines.drop(headerLength)
lines = lines drop promptLength
val added = lines.next
- assert {
- added.contains("Added") && added.contains("test1.jar")
- }
+ assert(added.contains("Added") && added.contains("test1.jar"), added)
lines = lines drop (2 * promptLength + 1)
- assert {
- lines.next.contains("new object in existing package")
- }
+ val r = lines.next
+ assert(r.contains("new object in existing package"), r)
}
def test4(): Unit = {
@@ -136,14 +119,10 @@ object Test extends StoreReporterDirectTest {
var lines = output.lines.drop(headerLength)
lines = lines drop promptLength
val added = lines.next
- assert {
- added.contains("Added") && added.contains("test1.jar")
- }
+ assert(added.contains("Added") && added.contains("test1.jar"), added)
lines = lines drop promptLength
val msg = lines.next
- assert {
- msg.contains("test1.jar") && msg.contains("existing classpath entries conflict")
- }
+ assert(msg.contains("test1.jar") && msg.contains("contains a classfile that already exists on the classpath: test.Test$"), msg)
}
def test5(): Unit = {
diff --git a/test/files/run/t6546.flags b/test/files/run/t6546.flags
deleted file mode 100644
index eb4d19bcb9..0000000000
--- a/test/files/run/t6546.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimise \ No newline at end of file
diff --git a/test/files/run/t6546/A_1.scala b/test/files/run/t6546/A_1.scala
deleted file mode 100644
index bd086c08f8..0000000000
--- a/test/files/run/t6546/A_1.scala
+++ /dev/null
@@ -1,6 +0,0 @@
-final class Opt {
- @inline def getOrElse(x: => String): String = ""
-}
-class A_1 {
- def f(x: Opt): String = x getOrElse null
-}
diff --git a/test/files/run/t6546/B_2.scala b/test/files/run/t6546/B_2.scala
deleted file mode 100644
index 64ec966f75..0000000000
--- a/test/files/run/t6546/B_2.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-import scala.tools.partest.BytecodeTest
-
-object Test extends BytecodeTest {
- def show: Unit = {
- val node = loadClassNode("A_1")
- assert(node.innerClasses.isEmpty, node.innerClasses)
- }
-}
diff --git a/test/files/run/t6554.scala b/test/files/run/t6554.scala
index 5d29d16666..eed139fea6 100644
--- a/test/files/run/t6554.scala
+++ b/test/files/run/t6554.scala
@@ -1,8 +1,14 @@
-trait Foo[A] {
+trait T1[A] {
def minBy[B](b: B): A = ???
}
-
-class Bar extends Foo[Int]
+
+// The second trait is needed to make sure there's a forwarder generated in Bar.
+// otherwise Bar.minBy is just the inherited default method from T1.
+trait T2[A] { self: T1[A] =>
+ override def minBy[B](b: B): A = ???
+}
+
+class Bar extends T1[Int] with T2[Int]
object Test extends App {
val sigs = classOf[Bar].getDeclaredMethods.map(m => s"${m.toString} / ${m.toGenericString}").sorted
diff --git a/test/files/run/t6634.check b/test/files/run/t6634.check
index f6cbb30c67..b085f397e6 100644
--- a/test/files/run/t6634.check
+++ b/test/files/run/t6634.check
@@ -4,27 +4,31 @@ String OK.
Length OK.
Trying lb1 ...
+java.lang.IndexOutOfBoundsException: at 6 deleting 6
Checking ...
String OK.
Length OK.
Trying lb2 ...
+java.lang.IndexOutOfBoundsException: at 99 deleting 6
Checking ...
String OK.
Length OK.
Trying lb3 ...
+java.lang.IndexOutOfBoundsException: at 1 deleting 9
Checking ...
String OK.
Length OK.
Trying lb4 ...
+java.lang.IndexOutOfBoundsException: at -1 deleting 1
Checking ...
String OK.
Length OK.
Trying lb5 ...
-java.lang.IllegalArgumentException: removing negative number (-1) of elements
+java.lang.IllegalArgumentException: removing negative number of elements: -1
Checking ...
String OK.
Length OK.
diff --git a/test/files/run/t6634.scala b/test/files/run/t6634.scala
index 759e6d519d..081cca7502 100644
--- a/test/files/run/t6634.scala
+++ b/test/files/run/t6634.scala
@@ -8,7 +8,7 @@ object Test extends App {
try {
lb0.remove(5, 0)
} catch {
- // Not thrown in 2.10, will be thrown in 2.11
+ // Should not be thrown--nothing is deleted so nothing to do
case ex: IndexOutOfBoundsException => println(ex)
}
checkNotCorrupted(lb0)
@@ -17,8 +17,8 @@ object Test extends App {
println("Trying lb1 ...")
try {
lb1.remove(6, 6)
- } catch {
- // Not thrown in 2.10, will be thrown in 2.11
+ } catch {
+ // Not thrown in 2.11, is thrown in 2.12
case ex: IndexOutOfBoundsException => println(ex)
}
checkNotCorrupted(lb1)
@@ -28,7 +28,7 @@ object Test extends App {
try {
lb2.remove(99, 6)
} catch {
- // Not thrown in 2.10, will be thrown in 2.11
+ // Not thrown in 2.11, is thrown in 2.12
case ex: IndexOutOfBoundsException => println(ex)
}
checkNotCorrupted(lb2)
@@ -38,26 +38,27 @@ object Test extends App {
try {
lb3.remove(1, 9)
} catch {
- // Not thrown in 2.10, will be thrown in 2.11
- case ex: IllegalArgumentException => println(ex)
+ // Not thrown in 2.11, is thrown in 2.12
+ case ex: IndexOutOfBoundsException => println(ex)
}
- checkNotCorrupted(lb3, "ListBuffer('a)", 1)
+ checkNotCorrupted(lb3)
val lb4 = newLB
println("Trying lb4 ...")
try {
lb4.remove(-1, 1)
} catch {
- // Not thrown in 2.10, will be thrown in 2.11
+ // Not thrown in 2.11, is thrown in 2.12
case ex: IndexOutOfBoundsException => println(ex)
}
- checkNotCorrupted(lb4, "ListBuffer('b, 'c, 'd, 'e)", 4)
+ checkNotCorrupted(lb4)
val lb5 = newLB
println("Trying lb5 ...")
try {
lb5.remove(1, -1)
} catch {
+ // Was thrown prior to 2.12 also
case ex: IllegalArgumentException => println(ex)
}
checkNotCorrupted(lb5)
@@ -77,4 +78,4 @@ object Test extends App {
else println("!!! length FAILED: " + len)
println()
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/t6690.check b/test/files/run/t6690.check
index a9ecc29fea..f214cd8e6a 100644
--- a/test/files/run/t6690.check
+++ b/test/files/run/t6690.check
@@ -1 +1 @@
-warning: there were two deprecation warnings; re-run with -deprecation for details
+warning: there were two deprecation warnings (since 2.11.0); re-run with -deprecation for details
diff --git a/test/files/run/t6733.check b/test/files/run/t6733.check
index aeb595fbfd..811a7d8f70 100644
--- a/test/files/run/t6733.check
+++ b/test/files/run/t6733.check
@@ -2,24 +2,21 @@ method $init$: isPrivateThis = false, isProtectedThis = false
value pri1a: isPrivateThis = true, isProtectedThis = false
method pri2a: isPrivateThis = true, isProtectedThis = false
variable pri3a: isPrivateThis = true, isProtectedThis = false
-value pri4a: isPrivateThis = true, isProtectedThis = false
+variable pri3a: isPrivateThis = true, isProtectedThis = false
lazy value pri4a: isPrivateThis = true, isProtectedThis = false
type Pri5a: isPrivateThis = true, isProtectedThis = false
class Pri6: isPrivateThis = true, isProtectedThis = false
trait Pri7: isPrivateThis = true, isProtectedThis = false
object Pri8: isPrivateThis = true, isProtectedThis = false
value pro1a: isPrivateThis = false, isProtectedThis = true
-value pro1a: isPrivateThis = true, isProtectedThis = false
value pro1b: isPrivateThis = false, isProtectedThis = true
method pro2a: isPrivateThis = false, isProtectedThis = true
method pro2b: isPrivateThis = false, isProtectedThis = true
-method pro3a: isPrivateThis = false, isProtectedThis = true
-method pro3a_=: isPrivateThis = false, isProtectedThis = true
-variable pro3a: isPrivateThis = true, isProtectedThis = false
-method pro3b: isPrivateThis = false, isProtectedThis = true
-method pro3b_=: isPrivateThis = false, isProtectedThis = true
-value pro4a: isPrivateThis = false, isProtectedThis = true
-lazy value pro4a: isPrivateThis = true, isProtectedThis = false
+variable pro3a: isPrivateThis = false, isProtectedThis = true
+variable pro3a: isPrivateThis = false, isProtectedThis = true
+variable pro3b: isPrivateThis = false, isProtectedThis = true
+variable pro3b: isPrivateThis = false, isProtectedThis = true
+lazy value pro4a: isPrivateThis = false, isProtectedThis = true
type Pro5a: isPrivateThis = false, isProtectedThis = true
type Pro5b: isPrivateThis = false, isProtectedThis = true
class Pro6: isPrivateThis = false, isProtectedThis = true
diff --git a/test/files/run/t6827.check b/test/files/run/t6827.check
index 3a3a71c67d..4889e05be8 100644
--- a/test/files/run/t6827.check
+++ b/test/files/run/t6827.check
@@ -1,6 +1,6 @@
-start at -5: java.lang.IllegalArgumentException: requirement failed: start -5 out of range 10
-start at -1: java.lang.IllegalArgumentException: requirement failed: start -1 out of range 10
-start at limit: java.lang.IllegalArgumentException: requirement failed: start 10 out of range 10
+start at -5: java.lang.ArrayIndexOutOfBoundsException: -5
+start at -1: java.lang.ArrayIndexOutOfBoundsException: -1
+start at limit: ok
start at limit-1: ok
first 10: ok
read all: ok
@@ -8,8 +8,8 @@ test huge len: ok
5 from 5: ok
20 from 5: ok
test len overflow: ok
-start beyond limit: java.lang.IllegalArgumentException: requirement failed: start 30 out of range 10
+start beyond limit: ok
read 0: ok
read -1: ok
-invalid read 0: java.lang.IllegalArgumentException: requirement failed: start 30 out of range 10
-invalid read -1: java.lang.IllegalArgumentException: requirement failed: start 30 out of range 10
+invalid read 0: ok
+invalid read -1: ok
diff --git a/test/files/run/t6827.scala b/test/files/run/t6827.scala
index 8e17af09e2..eb020711bb 100644
--- a/test/files/run/t6827.scala
+++ b/test/files/run/t6827.scala
@@ -31,4 +31,24 @@ object Test extends App {
// okay, see SI-7128
"...".toIterator.copyToArray(new Array[Char](0), 0, 0)
+
+
+ // Bonus test from @som-snytt to check for overflow in
+ // index calculations.
+ def testOverflow(start: Int, len: Int, expected: List[Char]) {
+ def copyFromIterator = {
+ val arr = Array.fill[Char](3)('-')
+ "abc".toIterator.copyToArray(arr, start, len)
+ arr.toList
+ }
+ def copyFromArray = {
+ val arr = Array.fill[Char](3)('-')
+ "abc".toArray.copyToArray(arr, start, len)
+ arr.toList
+ }
+ assert(copyFromIterator == expected)
+ assert(copyFromArray == expected)
+ }
+ testOverflow(1, Int.MaxValue - 1, "-ab".toList)
+ testOverflow(1, Int.MaxValue, "-ab".toList)
}
diff --git a/test/files/run/t6863.check b/test/files/run/t6863.check
index d4df5f7a74..010e82a41e 100644
--- a/test/files/run/t6863.check
+++ b/test/files/run/t6863.check
@@ -10,4 +10,4 @@ t6863.scala:46: warning: comparing values of types Unit and Unit using `==' will
t6863.scala:59: warning: comparing values of types Unit and Unit using `==' will always yield true
assert({ () => x }.apply == ())
^
-warning: there were four deprecation warnings; re-run with -deprecation for details
+warning: there were four deprecation warnings (since 2.11.0); re-run with -deprecation for details
diff --git a/test/files/run/t6935.check b/test/files/run/t6935.check
index df1629dd7e..6fda32d713 100644
--- a/test/files/run/t6935.check
+++ b/test/files/run/t6935.check
@@ -1 +1 @@
-warning: there was one deprecation warning; re-run with -deprecation for details
+warning: there was one deprecation warning (since 2.11.0); re-run with -deprecation for details
diff --git a/test/files/run/t6955.scala b/test/files/run/t6955.scala
deleted file mode 100644
index 329af688e4..0000000000
--- a/test/files/run/t6955.scala
+++ /dev/null
@@ -1,34 +0,0 @@
-import scala.tools.partest.IcodeComparison
-
-// this class should compile to code that uses switches (twice)
-class Switches {
- type Tag = Byte
-
- def switchBad(i: Tag): Int = i match { // notice type of i is Tag = Byte
- case 1 => 1
- case 2 => 2
- case 3 => 3
- case _ => 0
- }
-
- // this worked before, should keep working
- def switchOkay(i: Byte): Int = i match {
- case 1 => 1
- case 2 => 2
- case 3 => 3
- case _ => 0
- }
-}
-
-object Test extends IcodeComparison {
- // ensure we get two switches out of this -- ignore the rest of the output for robustness
- // exclude the constant we emit for the "SWITCH ..." string below (we get the icode for all the code you see in this file)
- override def show() = {
- val expected = 2
- val actual = (collectIcode() filter {
- x => x.indexOf("SWITCH ...") >= 0 && x.indexOf("CONSTANT(") == -1
- }).size
- assert(actual == expected)
- }
-}
-
diff --git a/test/files/run/t6956.scala b/test/files/run/t6956.scala
deleted file mode 100644
index 3569adf483..0000000000
--- a/test/files/run/t6956.scala
+++ /dev/null
@@ -1,31 +0,0 @@
-import scala.tools.partest.IcodeComparison
-
-class Switches {
- private[this] final val ONE = 1
-
- def switchBad(i: Byte): Int = i match {
- case ONE => 1
- case 2 => 2
- case 3 => 3
- case _ => 0
- }
-
- def switchOkay(i: Byte): Int = i match {
- case 1 => 1
- case 2 => 2
- case 3 => 3
- case _ => 0
- }
-}
-
-object Test extends IcodeComparison {
- // ensure we get two switches out of this -- ignore the rest of the output for robustness
- // exclude the constant we emit for the "SWITCH ..." string below (we get the icode for all the code you see in this file)
- override def show() = {
- val expected = 2
- val actual = (collectIcode() filter {
- x => x.indexOf("SWITCH ...") >= 0 && x.indexOf("CONSTANT(") == -1
- }).size
- assert(actual == expected)
- }
-}
diff --git a/test/files/run/t7008-scala-defined.flags b/test/files/run/t7008-scala-defined.flags
deleted file mode 100644
index 49f2d2c4c8..0000000000
--- a/test/files/run/t7008-scala-defined.flags
+++ /dev/null
@@ -1 +0,0 @@
--Ybackend:GenASM
diff --git a/test/files/run/t7047.check b/test/files/run/t7047.check
index 32bd581094..129ce3eeca 100644
--- a/test/files/run/t7047.check
+++ b/test/files/run/t7047.check
@@ -1,3 +1,3 @@
-Test_2.scala:2: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+Test_2.scala:2: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
Macros.foo
^
diff --git a/test/files/run/t7139.check b/test/files/run/t7139.check
new file mode 100644
index 0000000000..9a29a6cef9
--- /dev/null
+++ b/test/files/run/t7139.check
@@ -0,0 +1,11 @@
+
+scala> import test._
+import test._
+
+scala> A(0)
+res0: test.A = 0
+
+scala> A(0)
+res1: test.A = 0
+
+scala> :quit
diff --git a/test/files/run/t7139/A_1.scala b/test/files/run/t7139/A_1.scala
new file mode 100644
index 0000000000..eb0eb300da
--- /dev/null
+++ b/test/files/run/t7139/A_1.scala
@@ -0,0 +1,8 @@
+package test {
+ object A {
+ def apply(n: A) = n
+ }
+}
+package object test {
+ type A = Int
+}
diff --git a/test/files/run/t7139/Test_2.scala b/test/files/run/t7139/Test_2.scala
new file mode 100644
index 0000000000..32feaa0284
--- /dev/null
+++ b/test/files/run/t7139/Test_2.scala
@@ -0,0 +1,9 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ def code =
+ """import test._
+ |A(0)
+ |A(0)
+ """.stripMargin
+}
diff --git a/test/files/run/t7171.check b/test/files/run/t7171.check
index d826f6cb94..5454142882 100644
--- a/test/files/run/t7171.check
+++ b/test/files/run/t7171.check
@@ -1,3 +1,6 @@
t7171.scala:2: warning: The outer reference in this type test cannot be checked at run time.
final case class A()
^
+t7171.scala:9: warning: The outer reference in this type test cannot be checked at run time.
+ case _: A => true; case _ => false
+ ^
diff --git a/test/files/run/t7269.scala b/test/files/run/t7269.scala
index d22e57dfee..1102d49ecb 100644
--- a/test/files/run/t7269.scala
+++ b/test/files/run/t7269.scala
@@ -1,4 +1,4 @@
-import scala.collection.JavaConversions._
+import scala.collection.convert.ImplicitConversionsToScala._
import scala.collection.mutable
object Test extends App {
diff --git a/test/files/run/t7319.check b/test/files/run/t7319.check
index 31923e7119..1dcb84c804 100644
--- a/test/files/run/t7319.check
+++ b/test/files/run/t7319.check
@@ -3,15 +3,15 @@ scala> class M[A]
defined class M
scala> implicit def ma0[A](a: A): M[A] = null
-warning: there was one feature warning; re-run with -feature for details
+warning: there was one feature warning; for details, enable `:setting -feature' or `:replay -feature'
ma0: [A](a: A)M[A]
scala> implicit def ma1[A](a: A): M[A] = null
-warning: there was one feature warning; re-run with -feature for details
+warning: there was one feature warning; for details, enable `:setting -feature' or `:replay -feature'
ma1: [A](a: A)M[A]
scala> def convert[F[X <: F[X]]](builder: F[_ <: F[_]]) = 0
-warning: there was one feature warning; re-run with -feature for details
+warning: there was one feature warning; for details, enable `:setting -feature' or `:replay -feature'
convert: [F[X <: F[X]]](builder: F[_ <: F[_]])Int
scala> convert(Some[Int](0))
diff --git a/test/files/run/t7375b.check b/test/files/run/t7375b.check
index d7578e28ba..0993cceca2 100644
--- a/test/files/run/t7375b.check
+++ b/test/files/run/t7375b.check
@@ -1,4 +1,4 @@
-Predef.this.classOf[C1]
-Predef.this.classOf[C2]
-Predef.this.classOf[C1]
-Predef.this.classOf[C2]
+scala.Predef.classOf[C1]
+scala.Predef.classOf[C2]
+scala.Predef.classOf[C1]
+scala.Predef.classOf[C2]
diff --git a/test/files/run/t7407.flags b/test/files/run/t7407.flags
index ffc65f4b81..213d7425d1 100644
--- a/test/files/run/t7407.flags
+++ b/test/files/run/t7407.flags
@@ -1 +1 @@
--Yopt:l:none -Ybackend:GenBCode
+-opt:l:none
diff --git a/test/files/run/t7407b.flags b/test/files/run/t7407b.flags
deleted file mode 100644
index c30091d3de..0000000000
--- a/test/files/run/t7407b.flags
+++ /dev/null
@@ -1 +0,0 @@
--Ybackend:GenBCode
diff --git a/test/files/run/t7445.scala b/test/files/run/t7445.scala
deleted file mode 100644
index e4ffeb8e1a..0000000000
--- a/test/files/run/t7445.scala
+++ /dev/null
@@ -1,6 +0,0 @@
-import scala.collection.immutable.ListMap
-
-object Test extends App {
- val a = ListMap(1 -> 1, 2 -> 2, 3 -> 3, 4 -> 4, 5 -> 5);
- require(a.tail == ListMap(2 -> 2, 3 -> 3, 4 -> 4, 5 -> 5));
-}
diff --git a/test/files/run/t7459b-optimize.flags b/test/files/run/t7459b-optimize.flags
index 49d036a887..63535a7f4f 100644
--- a/test/files/run/t7459b-optimize.flags
+++ b/test/files/run/t7459b-optimize.flags
@@ -1 +1 @@
--optimize
+-opt:l:classpath
diff --git a/test/files/run/t7459f.scala b/test/files/run/t7459f.scala
index 63e2109560..5cd972129a 100644
--- a/test/files/run/t7459f.scala
+++ b/test/files/run/t7459f.scala
@@ -3,7 +3,7 @@ object Test extends App {
case class FooSeq(x: Int, y: String, z: C*)
- FooSeq(1, "a", new C()) match {
+ (FooSeq(1, "a", new C()): @unchecked) match {
case FooSeq(1, "a", x@_* ) =>
//println(x.toList)
x.asInstanceOf[x.type]
diff --git a/test/files/run/t3452b-bcode/S_3.scala b/test/files/run/t7521/Test.scala
index 102b433f47..e9816ad6cb 100644
--- a/test/files/run/t3452b-bcode/S_3.scala
+++ b/test/files/run/t7521/Test.scala
@@ -1,5 +1,5 @@
object Test {
def main(args: Array[String]): Unit = {
- J_2.j()
+ new Wrapper(new Array[Int](1))
}
}
diff --git a/test/files/run/t7521/Wrapper.scala b/test/files/run/t7521/Wrapper.scala
new file mode 100644
index 0000000000..0b923f8924
--- /dev/null
+++ b/test/files/run/t7521/Wrapper.scala
@@ -0,0 +1 @@
+class Wrapper[Repr](val xs: Repr) extends AnyVal
diff --git a/test/files/run/t7521b.check b/test/files/run/t7521b.check
new file mode 100644
index 0000000000..4d96df106d
--- /dev/null
+++ b/test/files/run/t7521b.check
@@ -0,0 +1,7 @@
+= Java Erased Signatures =
+public int C.a(Wrapper)
+public int C.b(Wrapper)
+
+= Java Generic Signatures =
+public int C.a(Wrapper<int[]>)
+public int C.b(Wrapper<java.lang.Object>)
diff --git a/test/files/run/t7521b.scala b/test/files/run/t7521b.scala
new file mode 100644
index 0000000000..c9e27f28b4
--- /dev/null
+++ b/test/files/run/t7521b.scala
@@ -0,0 +1,20 @@
+class Wrapper[X](x: X)
+
+class C {
+ def a(w: Wrapper[Array[Int]]) = 0
+ def b(w: Wrapper[Int]) = 0
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val c = new C
+ c.a(new Wrapper(Array(1, 2)))
+ c.b(new Wrapper(1))
+
+ val methods = classOf[C].getDeclaredMethods.sortBy(_.getName)
+ println("= Java Erased Signatures =")
+ println(methods.mkString("\n"))
+ println("\n= Java Generic Signatures =")
+ println(methods.map(_.toGenericString).mkString("\n"))
+ }
+}
diff --git a/test/files/run/t7533.check b/test/files/run/t7533.check
index fa5b3edc8f..61fd4657bd 100644
--- a/test/files/run/t7533.check
+++ b/test/files/run/t7533.check
@@ -1,30 +1,29 @@
Testing Symbol.isAbstract...
=======class C=======
-class C => true
-constructor C => false
-value x1 => true
-value x2 => false
-value x2 => false
-method y1 => true
-method y2 => false
-type T1 => true
-type T2 => false
+class C => abstract
+constructor C => concrete
+value xAbs => abstract
+value x => concrete
+value x => concrete
+method yAbs => abstract
+method y => concrete
+type TAbs => abstract
+type T => concrete
=======trait T=======
-trait T => true
-method $init$ => false
-value z1 => true
-value z2 => false
-value z2 => false
-method w1 => true
-method w2 => false
-type U1 => true
-type U2 => false
-=======class D=======
-class D => false
-constructor D => false
-value x1 => false
-value x1 => false
-method y1 => false
+trait T => abstract
+method $init$ => concrete
+value zAbs => abstract
+value z => concrete
+method wAbs => abstract
+method w => concrete
+type UAbs => abstract
+type U => concrete
+=======class AllConcrete=======
+class AllConcrete => concrete
+constructor AllConcrete => concrete
+value xAbs => concrete
+value xAbs => concrete
+method yAbs => concrete
=======object M=======
-object M => false
-constructor M => false
+object M => concrete
+constructor M => concrete
diff --git a/test/files/run/t7533.scala b/test/files/run/t7533.scala
index c7bd8e8d43..65c5c26b42 100644
--- a/test/files/run/t7533.scala
+++ b/test/files/run/t7533.scala
@@ -1,24 +1,24 @@
import scala.reflect.runtime.universe._
abstract class C {
- val x1: Int
- val x2: Int = 2
- def y1: Int
- def y2: Int = 2
- type T1 <: Int
- type T2 = Int
+ val xAbs: Int
+ val x: Int = 2
+ def yAbs: Int
+ def y: Int = 2
+ type TAbs <: Int
+ type T = Int
}
trait T {
- val z1: Int
- val z2: Int = 2
- def w1: Int
- def w2: Int = 2
- type U1 <: Int
- type U2 = Int
+ val zAbs: Int
+ val z: Int = 2
+ def wAbs: Int
+ def w: Int = 2
+ type UAbs <: Int
+ type U = Int
}
-class D extends C {
- val x1 = 3
- def y1 = 3
+class AllConcrete extends C {
+ val xAbs = 3
+ def yAbs = 3
}
object M
@@ -27,12 +27,12 @@ object Test extends App {
def test[T: TypeTag] = {
val sym = typeOf[T].typeSymbol
println(s"=======$sym=======")
- def printAbstract(sym: Symbol) = println(s"$sym => ${sym.isAbstract}")
+ def printAbstract(sym: Symbol) = println(s"$sym => ${if (sym.isAbstract) "abstract" else "concrete"}")
printAbstract(sym)
sym.info.decls.sorted.foreach(printAbstract)
}
test[C]
test[T]
- test[D]
+ test[AllConcrete]
test[M.type]
} \ No newline at end of file
diff --git a/test/files/run/t7582.check b/test/files/run/t7582.check
index 0cfbf08886..d0a0975d4c 100644
--- a/test/files/run/t7582.check
+++ b/test/files/run/t7582.check
@@ -1 +1,6 @@
+InlineHolder_2.scala:9: warning: p1/InlineHolder$::inlinable()I is annotated @inline but could not be inlined:
+The callee p1/InlineHolder$::inlinable()I contains the instruction INVOKESTATIC p1/PackageProtectedJava_1.protectedMethod ()I
+that would cause an IllegalAccessError when inlined into class O$.
+ def x = p1.InlineHolder.inlinable
+ ^
2
diff --git a/test/files/run/t7582.flags b/test/files/run/t7582.flags
index 1182725e86..7e64669429 100644
--- a/test/files/run/t7582.flags
+++ b/test/files/run/t7582.flags
@@ -1 +1 @@
--optimize \ No newline at end of file
+-opt:l:classpath -opt-warnings \ No newline at end of file
diff --git a/test/files/run/t7582/InlineHolder.scala b/test/files/run/t7582/InlineHolder_2.scala
index 3cbf233ce1..44c68d49b9 100644
--- a/test/files/run/t7582/InlineHolder.scala
+++ b/test/files/run/t7582/InlineHolder_2.scala
@@ -1,9 +1,6 @@
-/*
- * filter: inliner warning; re-run with
- */
package p1 {
object InlineHolder {
- @inline def inlinable = p1.PackageProtectedJava.protectedMethod() + 1
+ @inline def inlinable = p1.PackageProtectedJava_1.protectedMethod() + 1
}
}
diff --git a/test/files/run/t7582/PackageProtectedJava.java b/test/files/run/t7582/PackageProtectedJava_1.java
index b7ea2a7676..a3a957dad8 100644
--- a/test/files/run/t7582/PackageProtectedJava.java
+++ b/test/files/run/t7582/PackageProtectedJava_1.java
@@ -1,6 +1,6 @@
package p1;
// public class, protected method
-public class PackageProtectedJava {
+public class PackageProtectedJava_1 {
static final int protectedMethod() { return 1; }
}
diff --git a/test/files/run/t7582b.check b/test/files/run/t7582b.check
index 0cfbf08886..d0a0975d4c 100644
--- a/test/files/run/t7582b.check
+++ b/test/files/run/t7582b.check
@@ -1 +1,6 @@
+InlineHolder_2.scala:9: warning: p1/InlineHolder$::inlinable()I is annotated @inline but could not be inlined:
+The callee p1/InlineHolder$::inlinable()I contains the instruction INVOKESTATIC p1/PackageProtectedJava_1.protectedMethod ()I
+that would cause an IllegalAccessError when inlined into class O$.
+ def x = p1.InlineHolder.inlinable
+ ^
2
diff --git a/test/files/run/t7582b.flags b/test/files/run/t7582b.flags
index 1182725e86..7e64669429 100644
--- a/test/files/run/t7582b.flags
+++ b/test/files/run/t7582b.flags
@@ -1 +1 @@
--optimize \ No newline at end of file
+-opt:l:classpath -opt-warnings \ No newline at end of file
diff --git a/test/files/run/t7582b/InlineHolder.scala b/test/files/run/t7582b/InlineHolder_2.scala
index 3cbf233ce1..44c68d49b9 100644
--- a/test/files/run/t7582b/InlineHolder.scala
+++ b/test/files/run/t7582b/InlineHolder_2.scala
@@ -1,9 +1,6 @@
-/*
- * filter: inliner warning; re-run with
- */
package p1 {
object InlineHolder {
- @inline def inlinable = p1.PackageProtectedJava.protectedMethod() + 1
+ @inline def inlinable = p1.PackageProtectedJava_1.protectedMethod() + 1
}
}
diff --git a/test/files/run/t7582b/PackageProtectedJava.java b/test/files/run/t7582b/PackageProtectedJava_1.java
index 55a44b79f9..42a2019b91 100644
--- a/test/files/run/t7582b/PackageProtectedJava.java
+++ b/test/files/run/t7582b/PackageProtectedJava_1.java
@@ -1,6 +1,6 @@
package p1;
// protected class, public method
-class PackageProtectedJava {
+class PackageProtectedJava_1 {
public static final int protectedMethod() { return 1; }
}
diff --git a/test/files/run/t7700.check b/test/files/run/t7700.check
index ca8e686984..7d18dbfcb4 100644
--- a/test/files/run/t7700.check
+++ b/test/files/run/t7700.check
@@ -1,2 +1,4 @@
-public abstract java.lang.Object C.bar(java.lang.Object)
-public abstract java.lang.Object C.foo(java.lang.Object)
+public static void C.$init$(C)
+public default java.lang.Object C.bar(java.lang.Object)
+public static java.lang.Object C.bar$(C,java.lang.Object)
+public abstract java.lang.Object C.foo(java.lang.Object) \ No newline at end of file
diff --git a/test/files/run/t7700.scala b/test/files/run/t7700.scala
index 76d16b808c..fd13666467 100644
--- a/test/files/run/t7700.scala
+++ b/test/files/run/t7700.scala
@@ -7,11 +7,13 @@ trait C[@specialized U] {
def bar[A](u: U) = u
}
-object Test extends App {
- val declared = classOf[C[_]].getDeclaredMethods.sortBy(_.getName)
- println(declared.mkString("\n"))
- object CInt extends C[Int] { def foo(i: Int) = i }
- object CAny extends C[Any] { def foo(a: Any) = a }
- assert(CInt.foo(1) == 1)
- assert(CAny.foo("") == "")
+object Test {
+ def main(args: Array[String]) {
+ val declared = classOf[C[_]].getDeclaredMethods.sortBy(_.getName)
+ println(declared.mkString("\n"))
+ object CInt extends C[Int] { def foo(i: Int) = i }
+ object CAny extends C[Any] { def foo(a: Any) = a }
+ assert(CInt.foo(1) == 1)
+ assert(CAny.foo("") == "")
+ }
}
diff --git a/test/files/run/t7747-repl.check b/test/files/run/t7747-repl.check
index d698ea668d..ab37da5722 100644
--- a/test/files/run/t7747-repl.check
+++ b/test/files/run/t7747-repl.check
@@ -15,13 +15,13 @@ scala> val z = x * y
z: Int = 156
scala> 2 ; 3
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
2 ;;
^
res0: Int = 3
scala> { 2 ; 3 }
-<console>:12: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:12: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
{ 2 ; 3 }
^
res1: Int = 3
@@ -30,16 +30,16 @@ scala> 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Mooo
1 +
2 +
3 } ; bippy+88+11
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
^
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
^
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
^
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
^
defined object Cow
@@ -81,10 +81,10 @@ scala> ( (2 + 2 ) )
res10: Int = 4
scala> 5 ; ( (2 + 2 ) ) ; ((5))
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
5 ; ( (2 + 2 ) ) ;;
^
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
5 ; ( (2 + 2 ) ) ;;
^
res11: Int = 5
@@ -101,16 +101,16 @@ res14: String = 4423
scala>
scala> 55 ; ((2 + 2)) ; (1, 2, 3)
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
55 ; ((2 + 2)) ;;
^
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
55 ; ((2 + 2)) ;;
^
res15: (Int, Int, Int) = (1,2,3)
scala> 55 ; (x: Int) => x + 1 ; () => ((5))
-<console>:13: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:13: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
55 ; (x: Int) => x + 1 ;;
^
res16: () => Int = <function0>
@@ -121,7 +121,7 @@ scala> () => 5
res17: () => Int = <function0>
scala> 55 ; () => 5
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
55 ;;
^
res18: () => Int = <function0>
@@ -246,12 +246,12 @@ scala> case class Bingo()
defined class Bingo
scala> List(BippyBups(), PuppyPups(), Bingo()) // show
-class $read extends Serializable {
+sealed class $read extends _root_.java.io.Serializable {
def <init>() = {
super.<init>;
()
};
- class $iw extends Serializable {
+ sealed class $iw extends _root_.java.io.Serializable {
def <init>() = {
super.<init>;
()
@@ -262,7 +262,7 @@ class $read extends Serializable {
import $line45.$read.INSTANCE.$iw.$iw.PuppyPups;
import $line46.$read.INSTANCE.$iw.$iw.Bingo;
import $line46.$read.INSTANCE.$iw.$iw.Bingo;
- class $iw extends Serializable {
+ sealed class $iw extends _root_.java.io.Serializable {
def <init>() = {
super.<init>;
()
diff --git a/test/files/run/t7747-repl.scala b/test/files/run/t7747-repl.scala
index 141c2d9844..8203f4c802 100644
--- a/test/files/run/t7747-repl.scala
+++ b/test/files/run/t7747-repl.scala
@@ -8,6 +8,11 @@ object Test extends ReplTest {
s
}
+ override def normalize(s: String) = {
+ // replace indylambda function names by <function0>
+ """\$Lambda.*""".r.replaceAllIn(s, "<function0>")
+ }
+
def code = """
|var x = 10
|var y = 11
diff --git a/test/files/run/t7775.scala b/test/files/run/t7775.scala
index 48b0d89974..bc69064e17 100644
--- a/test/files/run/t7775.scala
+++ b/test/files/run/t7775.scala
@@ -1,3 +1,45 @@
+import scala.concurrent._, duration._
+import ExecutionContext.Implicits.global
+import scala.tools.reflect.WrappedProperties.AccessControl._
+import java.util.concurrent.CyclicBarrier
+
+object Test extends App {
+ @volatile var done = false
+ val barrier = new CyclicBarrier(2)
+
+ val probe = Future {
+ val attempts = 1024 // previously, failed after a few
+ def fail(i: Int) = s"Failed at $i"
+ barrier.await()
+ for (i <- 1 to attempts ; p <- systemProperties)
+ p match { case (k, v) => assert (k != null && v != null, fail(i)) }
+ }
+ probe onComplete {
+ case _ => done = true
+ }
+
+ System.setProperty("foo", "fooz")
+ System.setProperty("bar", "barz")
+ barrier.await() // just for fun, wait to start mucking with properties
+
+ // continually modify properties trying to break live iteration over sys props
+ // hint: don't iterate lively over sys props
+ var alt = true
+ while (!done) {
+ if (alt) {
+ System.getProperties.remove("foo")
+ System.setProperty("bar", "barz")
+ alt = false
+ } else {
+ System.getProperties.remove("bar")
+ System.setProperty("foo", "fooz")
+ alt = true
+ }
+ }
+ Await.result(probe, Duration.Inf)
+}
+
+/*
import scala.concurrent.{duration, Future, Await, ExecutionContext}
import scala.tools.nsc.Settings
import ExecutionContext.Implicits.global
@@ -15,3 +57,4 @@ object Test {
Await.result(compiler, duration.Duration.Inf)
}
}
+*/
diff --git a/test/files/run/t7807.check b/test/files/run/t7807.check
new file mode 100644
index 0000000000..fd22077f2e
--- /dev/null
+++ b/test/files/run/t7807.check
@@ -0,0 +1,3 @@
+...
+...
+...
diff --git a/test/files/run/t7807.scala b/test/files/run/t7807.scala
new file mode 100644
index 0000000000..8e3099ec14
--- /dev/null
+++ b/test/files/run/t7807.scala
@@ -0,0 +1,21 @@
+object Test {
+ def main(args: Array[String]) {
+ try {
+ println("...")
+ }
+ finally {
+ try {
+ println("...")
+ }
+ finally {
+ try {
+ println("...")
+ }
+ catch {
+ case ct: scala.util.control.ControlThrowable => throw(ct)
+ case t: Throwable => t.printStackTrace()
+ }
+ }
+ }
+ }
+}
diff --git a/test/files/run/t7817-tree-gen.check b/test/files/run/t7817-tree-gen.check
index 4ed4b0d94a..69ad2b2f28 100644
--- a/test/files/run/t7817-tree-gen.check
+++ b/test/files/run/t7817-tree-gen.check
@@ -38,13 +38,13 @@ Joint Compilation:
mixin [ test2.PO] - test2.package$PO
cleanup [ test2.PO] - test2.package$PO
- typer [ test2.bar] - `package`.this.bar
- pickler [ test2.bar] - `package`.this.bar
- refchecks [ test2.bar] - `package`.this.bar
- uncurry [ test2.bar] - `package`.this.bar
- specialize [ test2.bar] - `package`.this.bar
- explicitouter [ test2.bar] - `package`.this.bar
- erasure [ test2.bar] - `package`.this.bar
+ typer [ test2.bar] - test2.`package`.bar
+ pickler [ test2.bar] - test2.`package`.bar
+ refchecks [ test2.bar] - test2.`package`.bar
+ uncurry [ test2.bar] - test2.`package`.bar
+ specialize [ test2.bar] - test2.`package`.bar
+ explicitouter [ test2.bar] - test2.`package`.bar
+ erasure [ test2.bar] - test2.`package`.bar
posterasure [ test2.bar] - test2.`package`.bar
flatten [ test2.bar] - test2.`package`.bar
mixin [ test2.bar] - test2.`package`.bar
@@ -90,13 +90,13 @@ Separate Compilation:
mixin [ PO] - test2.package$PO
cleanup [ PO] - test2.package$PO
- typer [testSep2.bar] - `package`.this.bar
- pickler [testSep2.bar] - `package`.this.bar
- refchecks [testSep2.bar] - `package`.this.bar
- uncurry [testSep2.bar] - `package`.this.bar
- specialize [testSep2.bar] - `package`.this.bar
- explicitouter [testSep2.bar] - `package`.this.bar
- erasure [testSep2.bar] - `package`.this.bar
+ typer [testSep2.bar] - test2.`package`.bar
+ pickler [testSep2.bar] - test2.`package`.bar
+ refchecks [testSep2.bar] - test2.`package`.bar
+ uncurry [testSep2.bar] - test2.`package`.bar
+ specialize [testSep2.bar] - test2.`package`.bar
+ explicitouter [testSep2.bar] - test2.`package`.bar
+ erasure [testSep2.bar] - test2.`package`.bar
posterasure [testSep2.bar] - test2.`package`.bar
flatten [testSep2.bar] - test2.`package`.bar
mixin [testSep2.bar] - test2.`package`.bar
diff --git a/test/files/run/t7817-tree-gen.flags b/test/files/run/t7817-tree-gen.flags
deleted file mode 100644
index ce6e93b3da..0000000000
--- a/test/files/run/t7817-tree-gen.flags
+++ /dev/null
@@ -1 +0,0 @@
--Ynooptimise \ No newline at end of file
diff --git a/test/files/run/t7852.flags b/test/files/run/t7852.flags
index f6262fd3e0..213d7425d1 100644
--- a/test/files/run/t7852.flags
+++ b/test/files/run/t7852.flags
@@ -1 +1 @@
--Ynooptimise
+-opt:l:none
diff --git a/test/files/run/t7899-regression.check b/test/files/run/t7899-regression.check
deleted file mode 100644
index 602b03a1d1..0000000000
--- a/test/files/run/t7899-regression.check
+++ /dev/null
@@ -1 +0,0 @@
-warning: -Yinfer-by-name is deprecated: This flag is scheduled for removal in 2.12. If you have a case where you need this flag then please report a bug.
diff --git a/test/files/run/t7899-regression.flags b/test/files/run/t7899-regression.flags
deleted file mode 100644
index 553a27eafd..0000000000
--- a/test/files/run/t7899-regression.flags
+++ /dev/null
@@ -1 +0,0 @@
--Yinfer-by-name -deprecation
diff --git a/test/files/run/t7899-regression.scala b/test/files/run/t7899-regression.scala
deleted file mode 100644
index 67d38cdd1d..0000000000
--- a/test/files/run/t7899-regression.scala
+++ /dev/null
@@ -1,24 +0,0 @@
-import language.higherKinds
-
-object Test {
- trait Monad[M[_]] {
- def foo[A](ma: M[A])(f: M[A] => Any) = f(ma)
- }
- implicit def function1Covariant[T]: Monad[({type l[a] = (T => a)})#l] =
- new Monad[({type l[a] = (T => a)})#l] {}
-
- def main(args: Array[String]) {
- // inference of T = (=> Any) here was outlawed by SI-7899 / 8ed7099
- // but this pattern is used in Scalaz in just a few places and caused
- // a regression.
- //
- // Inference of a by-name type doesn't *always* lead to a ClassCastException,
- // it only gets there if a method in generic code accepts a parameter of
- // that type.
- //
- // We need to introduce the stricter inference rules gradually, probably
- // with a warning.
- val m = implicitly[Monad[({type f[+x] = (=> Any) => x})#f]]
- assert(m.foo[Int]((x => 0))(f => f(???)) == 0)
- }
-}
diff --git a/test/files/run/t7932.check b/test/files/run/t7932.check
index 3f0a0c4f62..76968fd179 100644
--- a/test/files/run/t7932.check
+++ b/test/files/run/t7932.check
@@ -1,3 +1,10 @@
-warning: there was one feature warning; re-run with -feature for details
public Category<?> C.category()
public Category<scala.Tuple2> C.category1()
+public default Category<java.lang.Object> M1.category()
+public default Category<scala.Tuple2> M1.category1()
+public static Category M1.category$(M1)
+public static Category M1.category1$(M1)
+public default Category<java.lang.Object> M2.category()
+public default Category<scala.Tuple2> M2.category1()
+public static Category M2.category$(M2)
+public static Category M2.category1$(M2) \ No newline at end of file
diff --git a/test/files/run/t7932.scala b/test/files/run/t7932.scala
index 8743abff88..40b0b9989b 100644
--- a/test/files/run/t7932.scala
+++ b/test/files/run/t7932.scala
@@ -1,11 +1,30 @@
+import scala.language.higherKinds
+
class Category[M[_, _]]
-trait M[F] {
+
+trait M1[F] {
type X[a, b] = F
def category: Category[X] = null
def category1: Category[Tuple2] = null
}
-abstract class C extends M[Float]
-object Test extends App {
- val ms = classOf[C].getMethods.filter(_.getName.startsWith("category"))
- println(ms.map(_.toGenericString).sorted.mkString("\n"))
+
+// The second trait is needed to make sure there's a forwarder generated in C.
+// otherwise the trait methods are just the inherited default methods from M1.
+trait M2[F] { self: M1[F] =>
+ override def category: Category[X] = null
+ override def category1: Category[Tuple2] = null
+}
+
+abstract class C extends M1[Float] with M2[Float]
+
+object Test {
+ def t(c: Class[_]) = {
+ val ms = c.getMethods.filter(_.getName.startsWith("category"))
+ println(ms.map(_.toGenericString).sorted.mkString("\n"))
+ }
+ def main(args: Array[String]) {
+ t(classOf[C])
+ t(classOf[M1[_]])
+ t(classOf[M2[_]])
+ }
}
diff --git a/test/files/run/t7974.check b/test/files/run/t7974.check
index 4eae5eb152..f649161ae9 100644
--- a/test/files/run/t7974.check
+++ b/test/files/run/t7974.check
@@ -1,26 +1,12 @@
- // access flags 0x9
- public static <clinit>()V
- GETSTATIC scala/Symbol$.MODULE$ : Lscala/Symbol$;
- LDC "Symbolic1"
- INVOKEVIRTUAL scala/Symbol$.apply (Ljava/lang/String;)Lscala/Symbol;
- PUTSTATIC Symbols.symbol$1 : Lscala/Symbol;
- GETSTATIC scala/Symbol$.MODULE$ : Lscala/Symbol$;
- LDC "Symbolic2"
- INVOKEVIRTUAL scala/Symbol$.apply (Ljava/lang/String;)Lscala/Symbol;
- PUTSTATIC Symbols.symbol$2 : Lscala/Symbol;
- GETSTATIC scala/Symbol$.MODULE$ : Lscala/Symbol$;
- LDC "Symbolic3"
- INVOKEVIRTUAL scala/Symbol$.apply (Ljava/lang/String;)Lscala/Symbol;
- PUTSTATIC Symbols.symbol$3 : Lscala/Symbol;
- RETURN
- MAXSTACK = 2
- MAXLOCALS = 0
-
-
// access flags 0x1
public someSymbol1()Lscala/Symbol;
- GETSTATIC Symbols.symbol$1 : Lscala/Symbol;
+ INVOKEDYNAMIC apply()Lscala/Symbol; [
+ // handle kind 0x6 : INVOKESTATIC
+ scala/runtime/SymbolLiteral.bootstrap(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;)Ljava/lang/invoke/CallSite;
+ // arguments:
+ "Symbolic1"
+ ]
ARETURN
MAXSTACK = 1
MAXLOCALS = 1
@@ -28,7 +14,12 @@
// access flags 0x1
public someSymbol2()Lscala/Symbol;
- GETSTATIC Symbols.symbol$2 : Lscala/Symbol;
+ INVOKEDYNAMIC apply()Lscala/Symbol; [
+ // handle kind 0x6 : INVOKESTATIC
+ scala/runtime/SymbolLiteral.bootstrap(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;)Ljava/lang/invoke/CallSite;
+ // arguments:
+ "Symbolic2"
+ ]
ARETURN
MAXSTACK = 1
MAXLOCALS = 1
@@ -36,7 +27,12 @@
// access flags 0x1
public sameSymbol1()Lscala/Symbol;
- GETSTATIC Symbols.symbol$1 : Lscala/Symbol;
+ INVOKEDYNAMIC apply()Lscala/Symbol; [
+ // handle kind 0x6 : INVOKESTATIC
+ scala/runtime/SymbolLiteral.bootstrap(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;)Ljava/lang/invoke/CallSite;
+ // arguments:
+ "Symbolic1"
+ ]
ARETURN
MAXSTACK = 1
MAXLOCALS = 1
@@ -56,7 +52,12 @@
ALOAD 0
INVOKESPECIAL java/lang/Object.<init> ()V
ALOAD 0
- GETSTATIC Symbols.symbol$3 : Lscala/Symbol;
+ INVOKEDYNAMIC apply()Lscala/Symbol; [
+ // handle kind 0x6 : INVOKESTATIC
+ scala/runtime/SymbolLiteral.bootstrap(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;)Ljava/lang/invoke/CallSite;
+ // arguments:
+ "Symbolic3"
+ ]
PUTFIELD Symbols.someSymbol3 : Lscala/Symbol;
RETURN
MAXSTACK = 2
diff --git a/test/files/run/t7974/Test.scala b/test/files/run/t7974/Test.scala
index 296ec32ee2..53ec71bc2b 100644
--- a/test/files/run/t7974/Test.scala
+++ b/test/files/run/t7974/Test.scala
@@ -4,7 +4,7 @@ import scala.tools.partest.BytecodeTest
import scala.tools.nsc.backend.jvm.AsmUtils
import scala.tools.asm.util._
import scala.tools.nsc.util.stringFromWriter
-import scala.collection.convert.decorateAsScala._
+import scala.collection.JavaConverters._
object Test extends BytecodeTest {
def show {
diff --git a/test/files/run/t8196.check b/test/files/run/t8196.check
index d11dc27e68..8a07ebb6d7 100644
--- a/test/files/run/t8196.check
+++ b/test/files/run/t8196.check
@@ -1,4 +1,4 @@
-t8196.scala:26: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+t8196.scala:26: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
form2.g1 // comment this line in order to make the test pass
^
warning: there were two feature warnings; re-run with -feature for details
diff --git a/test/files/run/t8199.scala b/test/files/run/t8199.scala
index 50994159ed..ebe14a74df 100644
--- a/test/files/run/t8199.scala
+++ b/test/files/run/t8199.scala
@@ -21,17 +21,17 @@ class cls01234567
class cls012345678
class cls0123456789
class cls01234567890
-trait trt0 { def x = Test.checkCallerImplClassName() }
-trait trt01 { def x = Test.checkCallerImplClassName() }
-trait trt012 { def x = Test.checkCallerImplClassName() }
-trait trt0123 { def x = Test.checkCallerImplClassName() }
-trait trt01234 { def x = Test.checkCallerImplClassName() }
-trait trt012345 { def x = Test.checkCallerImplClassName() }
-trait trt0123456 { def x = Test.checkCallerImplClassName() }
-trait trt01234567 { def x = Test.checkCallerImplClassName() }
-trait trt012345678 { def x = Test.checkCallerImplClassName() }
-trait trt0123456789 { def x = Test.checkCallerImplClassName() }
-trait trt01234567890 { def x = Test.checkCallerImplClassName() }
+trait trt0
+trait trt01
+trait trt012
+trait trt0123
+trait trt01234
+trait trt012345
+trait trt0123456
+trait trt01234567
+trait trt012345678
+trait trt0123456789
+trait trt01234567890
}
object Test extends App {
@@ -42,11 +42,6 @@ object Test extends App {
val defaultMaxClassFileLength = 255
assert((name + ".class").length <= defaultMaxClassFileLength, name)
}
- def checkCallerImplClassName() {
- val name = Thread.currentThread.getStackTrace.apply(2).getClassName
- assert(name.contains("$class"))
- Test.checkClassName(name)
- }
val c = new reallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongname
import c._
@@ -75,7 +70,6 @@ object Test extends App {
check(classOf[cls0123456789])
check(classOf[cls01234567890])
- // interface facets
check(classOf[trt0])
check(classOf[trt01])
check(classOf[trt012])
@@ -88,18 +82,6 @@ object Test extends App {
check(classOf[trt0123456789])
check(classOf[trt01234567890])
- // impl classes are harder to find the names of to test!
- (new trt0 {}).x
- (new trt01 {}).x
- (new trt012 {}).x
- (new trt0123 {}).x
- (new trt01234 {}).x
- (new trt012345 {}).x
- (new trt0123456 {}).x
- (new trt01234567 {}).x
- (new trt012345678 {}).x
- (new trt0123456789 {}).x
- (new trt01234567890 {}).x
}
// filename too long: reallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongname$obj012345$.class
diff --git a/test/files/run/t8233-bcode.flags b/test/files/run/t8233-bcode.flags
deleted file mode 100644
index c30091d3de..0000000000
--- a/test/files/run/t8233-bcode.flags
+++ /dev/null
@@ -1 +0,0 @@
--Ybackend:GenBCode
diff --git a/test/files/run/t8233-bcode.scala b/test/files/run/t8233-bcode.scala
deleted file mode 100644
index 72d013e553..0000000000
--- a/test/files/run/t8233-bcode.scala
+++ /dev/null
@@ -1,31 +0,0 @@
-object Test {
- def bar(s: String) = s;
- val o: Option[Null] = None
- def nullReference {
- val a: Null = o.get
- bar(a) // Was: VerifyError under GenICode
- }
-
- def literal {
- val a: Null = null
- bar(a)
- }
-
- /** Check SI-8330 for details */
- def expectedUnitInABranch(b: Boolean): Boolean = {
- if (b) {
- val x = 12
- ()
- } else {
- // here expected type is (unboxed) Unit
- null
- }
- true
- }
-
- def main(args: Array[String]): Unit = {
- try { nullReference } catch { case _: NoSuchElementException => }
- literal
- expectedUnitInABranch(true)
- }
-}
diff --git a/test/files/run/t8334.scala b/test/files/run/t8334.scala
new file mode 100644
index 0000000000..bc7e97bd04
--- /dev/null
+++ b/test/files/run/t8334.scala
@@ -0,0 +1,17 @@
+object Test extends App {
+ def f: Boolean = {
+ val xs = Nil map (_ => return false)
+ true
+ }
+
+ def g: Boolean = {
+ val xs = Nil collect { case _ => return false }
+ true
+ }
+
+ def h: Boolean = {
+ val xs = Nil flatMap { _ => return false }
+ true
+ }
+ assert(f && g && h)
+}
diff --git a/test/files/run/t8433.check b/test/files/run/t8433.check
new file mode 100644
index 0000000000..9480ca51cb
--- /dev/null
+++ b/test/files/run/t8433.check
@@ -0,0 +1,2 @@
+high
+high
diff --git a/test/files/run/t8433.scala b/test/files/run/t8433.scala
new file mode 100644
index 0000000000..79e18757b8
--- /dev/null
+++ b/test/files/run/t8433.scala
@@ -0,0 +1,46 @@
+
+import tools.partest.DirectTest
+import reflect.internal.util._
+
+// mimic the resident compiler failure by recompiling
+// the class with new run of same global.
+object Test extends DirectTest {
+
+ override def code = """
+ object Main {
+ def main(args: Array[String]): Unit = {
+ Surf xmain args
+ import trial.core.Rankable
+ object Surf {
+ def xmain(args: Array[String]): Unit = println(new Strategy("win").rank)
+ }
+ class Strategy(name:String) extends Rankable
+ }
+ }
+ """
+
+ override def show(): Unit = {
+ // first, compile the interface
+ val dependency = """
+ |package trial
+ |
+ |object core {
+ | trait Rankable {
+ | val rank: String = "high"
+ | }
+ |}
+ |""".stripMargin
+
+ assert(compileString(newCompiler())(dependency))
+
+ // a resident global
+ val g = newCompiler()
+
+ assert(compileString(g)(code))
+ ScalaClassLoader(getClass.getClassLoader) run ("Main", Nil)
+ assert(compileString(g)(code))
+ ScalaClassLoader(getClass.getClassLoader) run ("Main", Nil)
+ }
+
+ override def extraSettings = s"-usejavacp -d ${testOutput.path}"
+}
diff --git a/test/files/run/t8549.check b/test/files/run/t8549.check
index a9ecc29fea..f214cd8e6a 100644
--- a/test/files/run/t8549.check
+++ b/test/files/run/t8549.check
@@ -1 +1 @@
-warning: there were two deprecation warnings; re-run with -deprecation for details
+warning: there were two deprecation warnings (since 2.11.0); re-run with -deprecation for details
diff --git a/test/files/run/t8549.scala b/test/files/run/t8549.scala
index cb254e3810..7ec3635ab6 100644
--- a/test/files/run/t8549.scala
+++ b/test/files/run/t8549.scala
@@ -79,10 +79,10 @@ object Test extends App {
}
}
- // Generated on 20141010-14:01:28 with Scala version 2.11.2)
+ // Generated on 20160930-16:09:23 with Scala version 2.12.0-local-ffc8e3e)
overwrite.foreach(updateComment)
- check(Some(1))("rO0ABXNyAApzY2FsYS5Tb21lESLyaV6hi3QCAAFMAAF4dAASTGphdmEvbGFuZy9PYmplY3Q7eHIADHNjYWxhLk9wdGlvbv5pN/3bDmZ0AgAAeHBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAQ==")
+ check(Some(1))("rO0ABXNyAApzY2FsYS5Tb21lESLyaV6hi3QCAAFMAAV2YWx1ZXQAEkxqYXZhL2xhbmcvT2JqZWN0O3hyAAxzY2FsYS5PcHRpb27+aTf92w5mdAIAAHhwc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAE=")
check(None)("rO0ABXNyAAtzY2FsYS5Ob25lJEZQJPZTypSsAgAAeHIADHNjYWxhLk9wdGlvbv5pN/3bDmZ0AgAAeHA=")
check(List(1, 2, 3))( "rO0ABXNyADJzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5MaXN0JFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAABAwAAeHBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAgAAAAJzcQB+AAIAAAADc3IALHNjYWxhLmNvbGxlY3Rpb24uaW1tdXRhYmxlLkxpc3RTZXJpYWxpemVFbmQkilxjW/dTC20CAAB4cHg=")
@@ -95,10 +95,10 @@ object Test extends App {
import collection.{ mutable, immutable }
class C
- check(reflect.classTag[C])("rO0ABXNyAB5zY2FsYS5yZWZsZWN0LkNsYXNzVGFnJCRhbm9uJDG7ePPrmQBkhgIAAUwAD3J1bnRpbWVDbGFzczEkMXQAEUxqYXZhL2xhbmcvQ2xhc3M7eHB2cgAGVGVzdCRDAAAAAAAAAAAAAAB4cA==")
- check(reflect.classTag[Int])("rO0ABXNyACVzY2FsYS5yZWZsZWN0Lk1hbmlmZXN0RmFjdG9yeSQkYW5vbiQ5zfmiSVNjtVICAAB4cgAcc2NhbGEucmVmbGVjdC5BbnlWYWxNYW5pZmVzdAAAAAAAAAABAgABTAAIdG9TdHJpbmd0ABJMamF2YS9sYW5nL1N0cmluZzt4cHQAA0ludA==")
- check(reflect.classTag[String])("rO0ABXNyAB5zY2FsYS5yZWZsZWN0LkNsYXNzVGFnJCRhbm9uJDG7ePPrmQBkhgIAAUwAD3J1bnRpbWVDbGFzczEkMXQAEUxqYXZhL2xhbmcvQ2xhc3M7eHB2cgAQamF2YS5sYW5nLlN0cmluZ6DwpDh6O7NCAgAAeHA=")
- check(reflect.classTag[Object])("rO0ABXNyACVzY2FsYS5yZWZsZWN0Lk1hbmlmZXN0RmFjdG9yeSQkYW5vbiQymPrtq/Ci1gsCAAB4cgAtc2NhbGEucmVmbGVjdC5NYW5pZmVzdEZhY3RvcnkkUGhhbnRvbU1hbmlmZXN0rzigP7KRh/kCAAFMAAh0b1N0cmluZ3QAEkxqYXZhL2xhbmcvU3RyaW5nO3hyAC9zY2FsYS5yZWZsZWN0Lk1hbmlmZXN0RmFjdG9yeSRDbGFzc1R5cGVNYW5pZmVzdFq6NWvfTgYFAgADTAAGcHJlZml4dAAOTHNjYWxhL09wdGlvbjtMAAxydW50aW1lQ2xhc3N0ABFMamF2YS9sYW5nL0NsYXNzO0wADXR5cGVBcmd1bWVudHN0ACFMc2NhbGEvY29sbGVjdGlvbi9pbW11dGFibGUvTGlzdDt4cHNyAAtzY2FsYS5Ob25lJEZQJPZTypSsAgAAeHIADHNjYWxhLk9wdGlvbv5pN/3bDmZ0AgAAeHB2cgAQamF2YS5sYW5nLk9iamVjdAAAAAAAAAAAAAAAeHBzcgAyc2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuTGlzdCRTZXJpYWxpemF0aW9uUHJveHkAAAAAAAAAAQMAAHhwc3IALHNjYWxhLmNvbGxlY3Rpb24uaW1tdXRhYmxlLkxpc3RTZXJpYWxpemVFbmQkilxjW/dTC20CAAB4cHh0AAZPYmplY3Q=")
+ check(reflect.classTag[C])("rO0ABXNyACZzY2FsYS5yZWZsZWN0LkNsYXNzVGFnJEdlbmVyaWNDbGFzc1RhZwAAAAAAAAABAgABTAAMcnVudGltZUNsYXNzdAARTGphdmEvbGFuZy9DbGFzczt4cHZyAAZUZXN0JEMAAAAAAAAAAAAAAHhw")
+ check(reflect.classTag[Int])("rO0ABXNyAClzY2FsYS5yZWZsZWN0Lk1hbmlmZXN0RmFjdG9yeSRJbnRNYW5pZmVzdAAAAAAAAAABAgAAeHIAHHNjYWxhLnJlZmxlY3QuQW55VmFsTWFuaWZlc3QAAAAAAAAAAQIAAUwACHRvU3RyaW5ndAASTGphdmEvbGFuZy9TdHJpbmc7eHB0AANJbnQ=")
+ check(reflect.classTag[String])("rO0ABXNyACZzY2FsYS5yZWZsZWN0LkNsYXNzVGFnJEdlbmVyaWNDbGFzc1RhZwAAAAAAAAABAgABTAAMcnVudGltZUNsYXNzdAARTGphdmEvbGFuZy9DbGFzczt4cHZyABBqYXZhLmxhbmcuU3RyaW5noPCkOHo7s0ICAAB4cA==")
+ check(reflect.classTag[Object])("rO0ABXNyACxzY2FsYS5yZWZsZWN0Lk1hbmlmZXN0RmFjd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W5nJDtMAA9WYWx1ZVNldCRtb2R1bGV0AB1Mc2NhbGEvRW51bWVyYXRpb24kVmFsdWVTZXQkO0wACG5leHROYW1ldAAbTHNjYWxhL2NvbGxlY3Rpb24vSXRlcmF0b3I7TAAXc2NhbGEkRW51bWVyYXRpb24kJG5tYXB0AB5Mc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL01hcDtMABdzY2FsYSRFbnVtZXJhdGlvbiQkdm1hcHEAfgAHeHAAAAArAAAAAAAAACtwcHBzcgAgc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLkhhc2hNYXAAAAAAAAAAAQMAAHhwdw0AAALuAAAAAAAAAAQAeHNxAH4ACXcNAAAC7gAAAAEAAAAEAHNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAAqc3IAFXNjYWxhLkVudW1lcmF0aW9uJFZhbM9pZ6/J/O1PAgACSQAYc2NhbGEkRW51bWVyYXRpb24kVmFsJCRpTAAEbmFtZXQAEkxqYXZhL2xhbmcvU3RyaW5nO3hyABdzY2FsYS5FbnVtZXJhdGlvbiRWYWx1ZWJpfC/tIR1RAgACTAAGJG91dGVydAATTHNjYWxhL0VudW1lcmF0aW9uO0wAHHNjYWxhJEVudW1lcmF0aW9uJCRvdXRlckVudW1xAH4AEnhwcQB+AAhxAH4ACAAAACpweHNyABFUZXN0JEVudW0kJGFub24kMVlIjlmE1sXaAgAAeHEAfgARcQB+AAhxAH4ACHEAfgAT")
@@ -116,6 +116,19 @@ object Test extends App {
// TODO SI-8576 unstable under -Xcheckinit
check(collection.convert.Wrappers)( "rO0ABXNyACJzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkrrSziizavIECABJMABhEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJERpY3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Ab")
+
check(immutable.BitSet(1, 2, 3))( "rO0ABXNyAClzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5CaXRTZXQkQml0U2V0MR9dg8JGRI8UAgABSgAFZWxlbXN4cgAhc2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuQml0U2V0Flz5Ms3qxsoCAAB4cAAAAAAAAAAO")
check(immutable.HashMap())( "rO0ABXNyADVzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5IYXNoTWFwJFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAACAwAAeHB3BAAAAAB4")
check(immutable.HashMap(1 -> 2))( "rO0ABXNyADVzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5IYXNoTWFwJFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAACAwAAeHB3BAAAAAFzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAgAAAAJ4")
@@ -128,6 +141,8 @@ object Test extends App {
check(immutable.HashSet(1, 2, 3))( "rO0ABXNyADVzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5IYXNoU2V0JFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAACAwAAeHB3BAAAAANzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAgAAAAJzcQB+AAIAAAADeA==")
// TODO provoke HashSetCollision1
+ check(immutable.ListSet())( "rO0ABXNyADBzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5MaXN0U2V0JEVtcHR5TGlzdFNldCRFiHGwmKwhTAIAAHhyACJzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5MaXN0U2V0izCZaSia0jYCAAB4cA==")
+ check(immutable.ListSet(1))( "rO0ABXNy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AAAAXNxAH4ABwAAAAI=")
check(immutable.Queue())( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5RdWV1ZZY146W3qSuhAgACTAACaW50ACFMc2NhbGEvY29sbGVjdGlvbi9pbW11dGFibGUvTGlzdDtMAANvdXRxAH4AAXhwc3IAMnNjYWxhLmNvbGxlY3Rpb24uaW1tdXRhYmxlLkxpc3QkU2VyaWFsaXphdGlvblByb3h5AAAAAAAAAAEDAAB4cHNyACxzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5MaXN0U2VyaWFsaXplRW5kJIpcY1v3UwttAgAAeHB4cQB+AAQ=")
@@ -136,7 +151,7 @@ object Test extends App {
// TODO SI-8576 throws scala.UnitializedFieldError under -Xcheckinit
// check(new immutable.Range(0, 1, 1))( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5SYW5nZWm7o1SrFTINAgAHSQADZW5kWgAHaXNFbXB0eUkAC2xhc3RFbGVtZW50SQAQbnVtUmFuZ2VFbGVtZW50c0kABXN0YXJ0SQAEc3RlcEkAD3Rlcm1pbmFsRWxlbWVudHhwAAAAAQAAAAAAAAAAAQAAAAAAAAABAAAAAQ==")
- check(immutable.Set())( "rO0ABXNyAChzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5TZXQkRW1wdHlTZXQk8Hk3TFN0uDYCAAB4cA==")
+ check(immutable.Set())( "rO0ABXNyAChzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5TZXQkRW1wdHlTZXQk3hYx1+cpzHgCAAB4cA==")
check(immutable.Set(1))( "rO0ABXNyACNzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5TZXQkU2V0MREd3c4yqtWTAgABTAAFZWxlbTF0ABJMamF2YS9sYW5nL09iamVjdDt4cHNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAAB")
check(immutable.Set(1, 2))( "rO0ABXNyACNzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5TZXQkU2V0MqaV02sZQzV0AgACTAAFZWxlbTF0ABJMamF2YS9sYW5nL09iamVjdDtMAAVlbGVtMnEAfgABeHBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAwAAAAI=")
check(immutable.Set(1, 2, 3))( "rO0ABXNyACNzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5TZXQkU2V0M84syT0560SgAgADTAAFZWxlbTF0ABJMamF2YS9sYW5nL09iamVjdDtMAAVlbGVtMnEAfgABTAAFZWxlbTNxAH4AAXhwc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAFzcQB+AAMAAAACc3EAfgADAAAAAw==")
@@ -148,7 +163,7 @@ object Test extends App {
// TODO SI-8576 Uninitialized field: IndexedSeqLike.scala: 56
// check(immutable.Stream(1, 2, 3))( "rO0ABXNyACZzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5TdHJlYW0kQ29uc/ekjBXM3TlFAgADTAACaGR0ABJMamF2YS9sYW5nL09iamVjdDtMAAV0bEdlbnQAEUxzY2FsYS9GdW5jdGlvbjA7TAAFdGxWYWx0ACNMc2NhbGEvY29sbGVjdGlvbi9pbW11dGFibGUvU3RyZWFtO3hyACFzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5TdHJlYW0552RDntM42gIAAHhwc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAFzcgAtc2NhbGEuY29sbGVjdGlvbi5JdGVyYXRvciQkYW5vbmZ1biR0b1N0cmVhbSQxRWR4We0SX0UCAAFMAAYkb3V0ZXJ0ABtMc2NhbGEvY29sbGVjdGlvbi9JdGVyYXRvcjt4cHNyAChzY2FsYS5jb2xsZWN0aW9uLkluZGV4ZWRTZXFMaWtlJEVsZW1lbnRzGF+1cBwmcx0CAANJAANlbmRJAAVpbmRleEwABiRvdXRlcnQAIUxzY2FsYS9jb2xsZWN0aW9uL0luZGV4ZWRTZXFMaWtlO3hwAAAAAwAAAAFzcgArc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLldyYXBwZWRBcnJheSRvZkludMmRLBcI15VjAgABWwAFYXJyYXl0AAJbSXhwdXIAAltJTbpgJnbqsqUCAAB4cAAAAAMAAAABAAAAAgAAAANw")
- check(immutable.TreeSet[Int]())( "rO0ABXNyACJzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5UcmVlU2V0sRdVIDjbWAsCAAJMAAhvcmRlcmluZ3QAFUxzY2FsYS9tYXRoL09yZGVyaW5nO0wABHRyZWV0AC5Mc2NhbGEvY29sbGVjdGlvbi9pbW11dGFibGUvUmVkQmxhY2tUcmVlJFRyZWU7eHBzcgAYc2NhbGEubWF0aC5PcmRlcmluZyRJbnQkC4BMdr1Z51wCAAB4cHA=")
+ check(immutable.TreeSet[Int]())( "rO0ABXNyACJzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5UcmVlU2V0sRdVIDjbWAsCAAJMAAhvcmRlcmluZ3QAFUxzY2FsYS9tYXRoL09yZGVyaW5nO0wABHRyZWV0AC5Mc2NhbGEvY29sbGVjdGlvbi9pbW11dGFibGUvUmVkQmxhY2tUcmVlJFRyZWU7eHBzcgAYc2NhbGEubWF0aC5PcmRlcmluZyRJbnQk8u7cgruVzucCAAB4cHA=")
// TODO SI-8576 unstable under -Xcheckinit
// check(immutable.TreeSet(1, 2, 3))( "rO0ABXNyACJzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5UcmVlU2V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ANwcHBwcHBwcHBwcHBw")
// TODO SI-8576 Uninitialized field under -Xcheckinit
// check(mutable.ArraySeq(1, 2, 3))( "rO0ABXNyACFzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuQXJyYXlTZXEVPD3SKEkOcwIAAkkABmxlbmd0aFsABWFycmF5dAATW0xqYXZhL2xhbmcvT2JqZWN0O3hwAAAAA3VyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAANzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4ABQAAAAJzcQB+AAUAAAAD")
+ check(mutable.AnyRefMap("a" -> "A"))( "rO0ABXNyACJzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuQW55UmVmTWFwAAAAAAAAAAECAAdJAAVfc2l6ZUkAB192YWNhbnRJAARtYXNrTAAMZGVmYXVsdEVudHJ5dAARTHNjYWxhL0Z1bmN0aW9uMTtbACtzY2FsYSRjb2xsZWN0aW9uJG11dGFibGUkQW55UmVmTWFwJCRfaGFzaGVzdAACW0lbAClzY2FsYSRjb2xsZWN0aW9uJG11dGFibGUkQW55UmVmTWFwJCRfa2V5c3QAE1tMamF2YS9sYW5nL09iamVjdDtbACtzY2FsYSRjb2xsZWN0aW9uJG11dGFibGUkQW55UmVmTWFwJCRfdmFsdWVzcQB+AAN4cAAAAAEAAAAAAAAAB3NyADNzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuQW55UmVmTWFwJEV4Y2VwdGlvbkRlZmF1bHQAAAAAAAAAAQIAAHhwdXIAAltJTbpgJnbqsqUCAAB4cAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+UkA2AAAAAHVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAhwcHBwcHB0AAFhcHVxAH4ACQAAAAhwcHBwcHB0AAFBcA==")
check(mutable.ArrayStack(1, 2, 3))( "rO0ABXNyACNzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuQXJyYXlTdGFja3bdxXbcnLBeAgACSQAqc2NhbGEkY29sbGVjdGlvbiRtdXRhYmxlJEFycmF5U3RhY2skJGluZGV4WwAqc2NhbGEkY29sbGVjdGlvbiRtdXRhYmxlJEFycmF5U3RhY2skJHRhYmxldAATW0xqYXZhL2xhbmcvT2JqZWN0O3hwAAAAA3VyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAANzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAA3NxAH4ABQAAAAJzcQB+AAUAAAAB")
- check(mutable.DoubleLinkedList(1, 2, 3))( "rO0ABXNyAClzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuRG91YmxlTGlua2VkTGlzdI73LKsKRr1RAgADTAAEZWxlbXQAEkxqYXZhL2xhbmcvT2JqZWN0O0wABG5leHR0AB5Mc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL1NlcTtMAARwcmV2cQB+AAJ4cHNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAABc3EAfgAAc3EAfgAEAAAAAnNxAH4AAHNxAH4ABAAAAANzcQB+AABwcQB+AAtxAH4ACXEAfgAHcQB+AANw")
+ check(mutable.DoubleLinkedList(1, 2, 3))( "rO0ABXNyAClzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuRG91YmxlTGlua2VkTGlzdI73LKsKRr1RAgADTAAEZWxlbXQAEkxqYXZhL2xhbmcvT2JqZWN0O0wABG5leHR0ACtMc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL0RvdWJsZUxpbmtlZExpc3Q7TAAEcHJldnEAfgACeHBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAHNxAH4ABAAAAAJzcQB+AABzcQB+AAQAAAADc3EAfgAAcHEAfgALcQB+AAlxAH4AB3EAfgADcA==")
check(mutable.HashMap())( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGFzaE1hcAAAAAAAAAABAwAAeHB3DQAAAu4AAAAAAAAABAB4")
check(mutable.HashMap(1 -> 1))( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGFzaE1hcAAAAAAAAAABAwAAeHB3DQAAAu4AAAABAAAABABzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXEAfgAEeA==")
check(mutable.HashSet(1, 2, 3))( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGFzaFNldAAAAAAAAAABAwAAeHB3DQAAAcIAAAADAAAABQBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAgAAAAJzcQB+AAIAAAADeA==")
+ check(mutable.TreeMap[Int, Int]())( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuVHJlZU1hcNx8qC229ZvwAgACTAAIb3JkZXJpbmd0ABVMc2NhbGEvbWF0aC9PcmRlcmluZztMACZzY2FsYSRjb2xsZWN0aW9uJG11dGFibGUkVHJlZU1hcCQkdHJlZXQALExzY2FsYS9jb2xsZWN0aW9uL211dGFibGUvUmVkQmxhY2tUcmVlJFRyZWU7eHBzcgAYc2NhbGEubWF0aC5PcmRlcmluZyRJbnQk8u7cgruVzucCAAB4cHNyACpzY2FsYS5jb2xsZWN0aW9uLm11dGFibG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bmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAABcHBzcQB+AAwBc3EAfgAPAAAAA3BxAH4ADnBwcHNxAH4AA3EAfgAIcQB+AAtzcgAKc2NhbGEuU29tZREi8mleoYt0AgABTAAFdmFsdWVxAH4ADXhyAAxzY2FsYS5PcHRpb27+aTf92w5mdAIAAHhwcQB+ABFzcQB+ABVzcQB+AA8AAAAC")
// TODO SI-8576 Uninitialized field under -Xcheckinit
// check(new mutable.History())( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGlzdG9yeUhuXxDIFJrsAgACSQAKbWF4SGlzdG9yeUwAA2xvZ3QAIExzY2FsYS9jb2xsZWN0aW9uL211dGFibGUvUXVldWU7eHAAAAPoc3IAHnNjYWxhLmNvbGxlY3Rpb24ubXV0YWJsZS5RdWV1ZbjMURVfOuHHAgAAeHIAJHNjYWxhLmNvbGxlY3Rpb24ubXV0YWJsZS5NdXRhYmxlTGlzdFJpnjJ+gFbAAgADSQADbGVuTAAGZmlyc3QwdAAlTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9MaW5rZWRMaXN0O0wABWxhc3QwcQB+AAV4cAAAAABzcgAjc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLkxpbmtlZExpc3Sak+nGCZHaUQIAAkwABGVsZW10ABJMamF2YS9sYW5nL09iamVjdDtMAARuZXh0dAAeTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9TZXE7eHBwcQB+AApxAH4ACg==")
check(mutable.LinkedHashMap(1 -> 2))( "rO0ABXNyACZzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuTGlua2VkSGFzaE1hcAAAAAAAAAABAwAAeHB3DQAAAu4AAAABAAAABABzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAgAAAAJ4")
check(mutable.LinkedHashSet(1, 2, 3))( "rO0ABXNyACZzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuTGlua2VkSGFzaFNldAAAAAAAAAABAwAAeHB3DQAAAu4AAAADAAAABABzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAgAAAAJzcQB+AAIAAAADeA==")
- check(mutable.LinkedList(1, 2, 3))( "rO0ABXNyACNzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuTGlua2VkTGlzdJqT6cYJkdpRAgACTAAEZWxlbXQAEkxqYXZhL2xhbmcvT2JqZWN0O0wABG5leHR0AB5Mc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL1NlcTt4cHNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAABc3EAfgAAc3EAfgAEAAAAAnNxAH4AAHNxAH4ABAAAAANzcQB+AABwcQB+AAs=")
+ check(mutable.LinkedList(1, 2, 3))( "rO0ABXNyACNzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuTGlua2VkTGlzdJqT6cYJkdpRAgACTAAEZWxlbXQAEkxqYXZhL2xhbmcvT2JqZWN0O0wABG5leHR0ACVMc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL0xpbmtlZExpc3Q7eHBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAHNxAH4ABAAAAAJzcQB+AABzcQB+AAQAAAADc3EAfgAAcHEAfgAL")
// TODO SI-8576 unstable under -Xcheckinit
// check(mutable.ListBuffer(1, 2, 3))( "rO0ABXNyACNzY2FsYS5jb2xsZWN0aW9uL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N0cmluZ3QAEkxqYXZhL2xhbmcvU3RyaW5nO3hwdAADSW50dwQAAAAAeA==")
+ check(mutable.UnrolledBuffer[Int]())( "rO0ABXNyACdzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuVW5yb2xsZWRCdWZmZXIAAAAAAAAAAQMAAUwAA3RhZ3QAGExzY2FsYS9yZWZsZWN0L0NsYXNzVGFnO3hwc3IAKXNjYWxhLnJlZmxlY3QuTWFuaWZlc3RGYWN0b3J5JEludE1hbmlmZXN0AAAAAAAAAAECAAB4cgAcc2NhbGEucmVmbGVjdC5BbnlWYWxNYW5pZmVzdAAAAAAAAAABAgABTAAIdG9TdHJpbmd0ABJMamF2YS9sYW5nL1N0cmluZzt4cHQAA0ludHcEAAAAAHg=")
import collection.parallel
check(parallel.immutable.ParHashMap(1 -> 2))( "rO0ABXNyAC5zY2FsYS5jb2xsZWN0aW9uLnBhcmFsbGVsLmltbXV0YWJsZS5QYXJIYXNoTWFwAAAAAAAAAAECAANMAA9TY2FuTGVhZiRtb2R1bGV0ADVMc2NhbGEvY29sbGVjdGlvbi9wYXJhbGxlbC9QYXJJdGVyYWJsZUxpa2UkU2NhbkxlYWYkO0wAD1NjYW5Ob2RlJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL3BhcmFsbGVsL1Bhckl0ZXJhYmxlTGlrZSRTY2FuTm9kZSQ7TAAEdHJpZXQAJExzY2FsYS9jb2xsZWN0aW9uL2ltbXV0YWJsZS9IYXNoTWFwO3hwcHBzcgA1c2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuSGFzaE1hcCRTZXJpYWxpemF0aW9uUHJveHkAAAAAAAAAAgMAAHhwdwQAAAABc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAFzcQB+AAcAAAACeA==")
@@ -186,4 +208,4 @@ object Test extends App {
check("...".r)("rO0ABXNyABlzY2FsYS51dGlsLm1hdGNoaW5nLlJlZ2V44u3Vap7wIb8CAAJMAAdwYXR0ZXJudAAZTGphdmEvdXRpbC9yZWdleC9QYXR0ZXJuO0wAJXNjYWxhJHV0aWwkbWF0Y2hpbmckUmVnZXgkJGdyb3VwTmFtZXN0ABZMc2NhbGEvY29sbGVjdGlvbi9TZXE7eHBzcgAXamF2YS51dGlsLnJlZ2V4LlBhdHRlcm5GZ9VrbkkCDQIAAkkABWZsYWdzTAAHcGF0dGVybnQAEkxqYXZhL2xhbmcvU3RyaW5nO3hwAAAAAHQAAy4uLnNyADJzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5MaXN0JFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAABAwAAeHBzcgAsc2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuTGlzdFNlcmlhbGl6ZUVuZCSKXGNb91MLbQIAAHhweA==",
r => (r.toString))
-}
+} \ No newline at end of file
diff --git a/test/files/run/t8575.scala b/test/files/run/t8575.scala
new file mode 100644
index 0000000000..fb8f603f3e
--- /dev/null
+++ b/test/files/run/t8575.scala
@@ -0,0 +1,32 @@
+class E[F]
+class A
+class B
+class C
+
+trait TypeMember {
+ type X
+
+ // This call throws an AbstractMethodError, because it invokes the erasure of
+ // consume(X): Unit that is consume(Object): Unit. But the corresponding
+ // bridge method is not generated.
+ consume(value)
+
+ def value: X
+ def consume(x: X): Unit
+}
+
+object Test extends TypeMember {
+ type F = A with B
+
+ // works if replaced by type X = E[A with B with C]
+ type X = E[F with C]
+
+ def value = new E[F with C]
+
+ // This call passes, since it invokes consume(E): Unit
+ def consume(x: X) {}
+
+ def main(args: Array[String]) {
+ consume(value)
+ }
+}
diff --git a/test/files/run/t8575b.scala b/test/files/run/t8575b.scala
new file mode 100644
index 0000000000..0d731ccf9f
--- /dev/null
+++ b/test/files/run/t8575b.scala
@@ -0,0 +1,17 @@
+class A
+class B
+class C
+
+object Test {
+ type F = A with B
+
+ def main(args: Array[String]) {
+ import reflect.runtime.universe._
+ val t1 = typeOf[F with C]
+ val t2 = typeOf[(A with B) with C]
+ val t3 = typeOf[A with B with C]
+ assert(t1 =:= t2)
+ assert(t2 =:= t3)
+ assert(t3 =:= t1)
+ }
+}
diff --git a/test/files/run/t8575c.scala b/test/files/run/t8575c.scala
new file mode 100644
index 0000000000..8219952299
--- /dev/null
+++ b/test/files/run/t8575c.scala
@@ -0,0 +1,23 @@
+class C
+
+trait TypeMember {
+ type X
+ type Y
+ type Z
+}
+
+object Test extends TypeMember {
+ type A = X with Y
+ type B = Z with A
+ type F = A with B
+
+ def main(args: Array[String]) {
+ import reflect.runtime.universe._
+ val t1 = typeOf[F with C]
+ val t2 = typeOf[(A with B) with C]
+ val t3 = typeOf[A with B with C]
+ assert(t1 =:= t2)
+ assert(t2 =:= t3)
+ assert(t3 =:= t1)
+ }
+}
diff --git a/test/files/run/t8601-closure-elim.flags b/test/files/run/t8601-closure-elim.flags
index 9158076b71..24396d4d02 100644
--- a/test/files/run/t8601-closure-elim.flags
+++ b/test/files/run/t8601-closure-elim.flags
@@ -1 +1 @@
--optimize -Ydelambdafy:inline -Ybackend:GenASM
+-Ydelambdafy:method -opt:l:classpath
diff --git a/test/files/run/t8601-closure-elim.scala b/test/files/run/t8601-closure-elim.scala
index ebeb16e0c7..40fbf1fe0e 100644
--- a/test/files/run/t8601-closure-elim.scala
+++ b/test/files/run/t8601-closure-elim.scala
@@ -1,4 +1,5 @@
import scala.tools.partest.BytecodeTest
+import scala.tools.partest.ASMConverters.instructionsFromMethod
import scala.tools.asm
import scala.tools.asm.util._
import scala.collection.JavaConverters._
@@ -10,8 +11,9 @@ object Test extends BytecodeTest {
def test(methodName: String) {
val classNode = loadClassNode("Foo")
val methodNode = getMethod(classNode, "b")
+ val instrs = instructionsFromMethod(methodNode)
val ops = methodNode.instructions.iterator.asScala.map(_.getOpcode).toList
- assert(!ops.contains(asm.Opcodes.NEW), ops)// should be allocation free if the closure is eliminated
+ assert(!ops.contains(asm.Opcodes.NEW), instrs)// should be allocation free if the closure is eliminated
}
test("b")
}
diff --git a/test/files/run/t8601.flags b/test/files/run/t8601.flags
index 1182725e86..63535a7f4f 100644
--- a/test/files/run/t8601.flags
+++ b/test/files/run/t8601.flags
@@ -1 +1 @@
--optimize \ No newline at end of file
+-opt:l:classpath
diff --git a/test/files/run/t8601b.flags b/test/files/run/t8601b.flags
index 1182725e86..63535a7f4f 100644
--- a/test/files/run/t8601b.flags
+++ b/test/files/run/t8601b.flags
@@ -1 +1 @@
--optimize \ No newline at end of file
+-opt:l:classpath
diff --git a/test/files/run/t8601c.flags b/test/files/run/t8601c.flags
index 1182725e86..63535a7f4f 100644
--- a/test/files/run/t8601c.flags
+++ b/test/files/run/t8601c.flags
@@ -1 +1 @@
--optimize \ No newline at end of file
+-opt:l:classpath
diff --git a/test/files/run/t8601d.flags b/test/files/run/t8601d.flags
index 1182725e86..63535a7f4f 100644
--- a/test/files/run/t8601d.flags
+++ b/test/files/run/t8601d.flags
@@ -1 +1 @@
--optimize \ No newline at end of file
+-opt:l:classpath
diff --git a/test/files/run/t8601e.flags b/test/files/run/t8601e.flags
index 49d036a887..63535a7f4f 100644
--- a/test/files/run/t8601e.flags
+++ b/test/files/run/t8601e.flags
@@ -1 +1 @@
--optimize
+-opt:l:classpath
diff --git a/test/files/run/t8601e/StaticInit.class b/test/files/run/t8601e/StaticInit.class
deleted file mode 100644
index 99a0e2a643..0000000000
--- a/test/files/run/t8601e/StaticInit.class
+++ /dev/null
Binary files differ
diff --git a/test/files/run/t8710.scala b/test/files/run/t8710.scala
new file mode 100644
index 0000000000..15aab5b8a4
--- /dev/null
+++ b/test/files/run/t8710.scala
@@ -0,0 +1,17 @@
+class Bar(val x: Int) extends AnyVal {
+ def f: String = f(0)
+ private def f(x: Int): String = ""
+}
+
+class Baz(val x: Int) extends AnyVal {
+ def f: String = "123"
+ private def f(x: Int): String = ""
+}
+object Baz {
+ def x(b: Baz) = b.f(0)
+}
+
+object Test extends App {
+ new Bar(23).f
+ new Baz(23).f
+}
diff --git a/test/files/run/t8756.check b/test/files/run/t8756.check
new file mode 100644
index 0000000000..9b9dcafe7d
--- /dev/null
+++ b/test/files/run/t8756.check
@@ -0,0 +1,9 @@
+public Bippy<java.lang.Object> Test.f1(long)
+public Bippy<java.lang.Object> Test.f2(long)
+public Bippy<java.lang.Object> Test.i1(Bippy<java.lang.Object>)
+public Bippy<java.lang.Object> Test.i2(Bippy<java.lang.Object>)
+public int Test.g1(long)
+public int Test.g2(long)
+public java.lang.Object Test.h1(long)
+public java.lang.Object Test.h2(long)
+public static void Test.main(java.lang.String[])
diff --git a/test/files/run/t8756.scala b/test/files/run/t8756.scala
new file mode 100644
index 0000000000..edd243473a
--- /dev/null
+++ b/test/files/run/t8756.scala
@@ -0,0 +1,22 @@
+trait Bippy[A]
+
+class Test {
+ type T1 = Long
+ type T2 = Long { type Tag = Nothing }
+
+ def f1(t: T1): Bippy[Object] = ???
+ def f2(t: T2): Bippy[Object] = ???
+ def g1(t: T1): Int = ???
+ def g2(t: T2): Int = ???
+ def h1(t: T1): Object = ???
+ def h2(t: T2): Object = ???
+ def i1(t: Bippy[T1]): Bippy[T1] = ???
+ def i2(t: Bippy[T2]): Bippy[T2] = ???
+
+}
+
+object Test {
+ def main(args: Array[String]) {
+ println(classOf[Test].getDeclaredMethods.map(_.toGenericString).toList.sorted.mkString("\n"))
+ }
+}
diff --git a/test/files/run/t8764.check b/test/files/run/t8764.check
deleted file mode 100644
index 6260069602..0000000000
--- a/test/files/run/t8764.check
+++ /dev/null
@@ -1,5 +0,0 @@
-IntOnly: should return an unboxed int
-Int: int
-IntAndDouble: should just box and return Anyval
-Double: class java.lang.Double
-Int: class java.lang.Integer
diff --git a/test/files/run/t8764.scala b/test/files/run/t8764.scala
deleted file mode 100644
index decc658f6e..0000000000
--- a/test/files/run/t8764.scala
+++ /dev/null
@@ -1,16 +0,0 @@
-object Test extends App {
-case class IntOnly(i: Int, j: Int)
-
-println("IntOnly: should return an unboxed int")
-val a = IntOnly(1, 2)
-val i: Int = a.productElement(0)
-println(s"Int: ${a.productElement(0).getClass}")
-
-case class IntAndDouble(i: Int, d: Double)
-
-println("IntAndDouble: should just box and return Anyval")
-val b = IntAndDouble(1, 2.0)
-val j: AnyVal = b.productElement(0)
-println(s"Double: ${b.productElement(1).getClass}")
-println(s"Int: ${b.productElement(0).getClass}")
-}
diff --git a/test/files/run/t8845.flags b/test/files/run/t8845.flags
deleted file mode 100644
index c30091d3de..0000000000
--- a/test/files/run/t8845.flags
+++ /dev/null
@@ -1 +0,0 @@
--Ybackend:GenBCode
diff --git a/test/files/run/t8918-unary-ids.check b/test/files/run/t8918-unary-ids.check
new file mode 100644
index 0000000000..92f02371c7
--- /dev/null
+++ b/test/files/run/t8918-unary-ids.check
@@ -0,0 +1,7 @@
+Expected 41 lines, got 39
+--- expected
++++ actual
+@@ -1,3 +1,1 @@
+-Type in expressions to have them evaluated.
+-Type :help for more information.
+
diff --git a/test/files/run/t8918-unary-ids.scala b/test/files/run/t8918-unary-ids.scala
new file mode 100644
index 0000000000..3aa990f72c
--- /dev/null
+++ b/test/files/run/t8918-unary-ids.scala
@@ -0,0 +1,49 @@
+
+
+import scala.tools.partest.SessionTest
+
+// Taking unary ids as plain
+object Test extends SessionTest {
+ def session =
+"""Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala> val - = 42
+-: Int = 42
+
+scala> val i = -
+i: Int = 42
+
+scala> - { 42 }
+res0: Int = -42
+
+scala> - if (true) 1 else 2
+<console>:1: error: illegal start of simple expression
+- if (true) 1 else 2
+ ^
+
+scala> - - 1
+<console>:1: error: ';' expected but integer literal found.
+- - 1
+ ^
+
+scala> -.-(1)
+res1: Int = 41
+
+scala> -
+res2: Int = 42
+
+scala> - -
+res3: Int = -42
+
+scala> + -
+res4: Int = 42
+
+scala> object X { def -(i: Int) = 42 - i ; def f(g: Int => Int) = g(7) ; def j = f(-) }
+defined object X
+
+scala> X.j
+res5: Int = 35
+
+scala> :quit"""
+}
diff --git a/test/files/run/t8925.flags b/test/files/run/t8925.flags
index ffc65f4b81..213d7425d1 100644
--- a/test/files/run/t8925.flags
+++ b/test/files/run/t8925.flags
@@ -1 +1 @@
--Yopt:l:none -Ybackend:GenBCode
+-opt:l:none
diff --git a/test/files/run/t8944/A_1.scala b/test/files/run/t8944/A_1.scala
new file mode 100644
index 0000000000..7ff80327b0
--- /dev/null
+++ b/test/files/run/t8944/A_1.scala
@@ -0,0 +1 @@
+case class A(private val x: String)
diff --git a/test/files/run/t8944/A_2.scala b/test/files/run/t8944/A_2.scala
new file mode 100644
index 0000000000..3dcdea1583
--- /dev/null
+++ b/test/files/run/t8944/A_2.scala
@@ -0,0 +1,6 @@
+case class Other(private val x: String) // consume a fresh name suffix
+
+// the param accessor will now be called "x$2",
+// whereas the previously compiled client expects it to be called
+// x$1
+case class A(private val x: String)
diff --git a/test/files/run/t8944/Test_1.scala b/test/files/run/t8944/Test_1.scala
new file mode 100644
index 0000000000..fe466693cf
--- /dev/null
+++ b/test/files/run/t8944/Test_1.scala
@@ -0,0 +1,3 @@
+object Test extends App {
+ val A("") = new A("")
+}
diff --git a/test/files/run/t8944b.scala b/test/files/run/t8944b.scala
new file mode 100644
index 0000000000..f469122ce6
--- /dev/null
+++ b/test/files/run/t8944b.scala
@@ -0,0 +1,9 @@
+case class A(private var foo: Any) {
+ def m = { def foo = 42 /*will be lamba lifted to `A#foo$1`*/ }
+}
+object Test {
+ def main(args: Array[String]): Unit = {
+ val A("") = new A("")
+ new A("").m
+ }
+}
diff --git a/test/files/run/t8944c.check b/test/files/run/t8944c.check
new file mode 100644
index 0000000000..7738f76980
--- /dev/null
+++ b/test/files/run/t8944c.check
@@ -0,0 +1,5 @@
+private java.lang.Object Foo.ant()
+public java.lang.Object Foo.ant$access$0()
+private scala.collection.Seq Foo.cat()
+public scala.collection.Seq Foo.cat$access$2()
+public java.lang.Object Foo.elk()
diff --git a/test/files/run/t8944c.scala b/test/files/run/t8944c.scala
new file mode 100644
index 0000000000..95c2143851
--- /dev/null
+++ b/test/files/run/t8944c.scala
@@ -0,0 +1,8 @@
+case class Foo[A](private val ant: Any, elk: Any, private val cat: A*)
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ def pred(name: String) = Set("ant", "elk", "cat").exists(name contains _)
+ println(classOf[Foo[_]].getDeclaredMethods.filter(m => pred(m.getName)).sortBy(_.getName).mkString("\n"))
+ }
+}
diff --git a/test/files/run/t8955.scala b/test/files/run/t8955.scala
new file mode 100644
index 0000000000..afa31aa5d7
--- /dev/null
+++ b/test/files/run/t8955.scala
@@ -0,0 +1,12 @@
+import scala.collection.parallel.immutable.ParSet
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ for (i <- 1 to 2000) test()
+ }
+
+ def test() {
+ ParSet[Int]((1 to 10000): _*) foreach (x => ()) // hangs non deterministically
+ }
+}
+
diff --git a/test/files/run/t8960.scala b/test/files/run/t8960.scala
index a58ac53d33..a43d5679d8 100644
--- a/test/files/run/t8960.scala
+++ b/test/files/run/t8960.scala
@@ -1,5 +1,5 @@
object Test extends App {
- def test(o: AnyRef, sp: Boolean = false) = {
+ def testAnonFunClass(o: AnyRef, sp: Boolean = false) = {
val isSpecialized = o.getClass.getSuperclass.getName contains "$sp"
val isDelambdafyMethod = o.getClass.getName contains "$lambda$"
assert(
@@ -11,62 +11,68 @@ object Test extends App {
assert(f.getLong(null) == 0l)
}
- test(() => (), sp = true)
- test(() => 1, sp = true)
- test(() => "")
+ def testIndyLambda(o: AnyRef, sp: Boolean = false) = {
+ val isSpecialized = o.getClass.getInterfaces.exists(_.getName contains "$sp")
+ assert(sp == isSpecialized, o.getClass.getName)
+ }
+
+
+ testIndyLambda(() => (), sp = true)
+ testIndyLambda(() => 1, sp = true)
+ testIndyLambda(() => "")
- test((x: Int) => x, sp = true)
- test((x: Boolean) => x)
- test((x: Int) => "")
+ testIndyLambda((x: Int) => x, sp = true)
+ testIndyLambda((x: Boolean) => x)
+ testIndyLambda((x: Int) => "")
- test((x1: Int, x2: Int) => 0d, sp = true)
- test((x1: Int, x2: AnyRef) => 0d)
- test((x1: Any, x2: Any) => x1)
+ testIndyLambda((x1: Int, x2: Int) => 0d, sp = true)
+ testIndyLambda((x1: Int, x2: AnyRef) => 0d)
+ testIndyLambda((x1: Any, x2: Any) => x1)
- // scala> println((for (i <- 3 to 22) yield (for (j <- 1 to i) yield s"x$j: Int").mkString(" test((", ", ", ") => x1)")).mkString("\n"))
+ // scala> println((for (i <- 3 to 22) yield (for (j <- 1 to i) yield s"x$j: Int").mkString(" testIndyLambda((", ", ", ") => x1)")).mkString("\n"))
- test((x1: Int, x2: Int, x3: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int, x21: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int, x21: Int, x22: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int, x21: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int, x21: Int, x22: Int) => x1)
- test({
+ testAnonFunClass({
case x: Int => x
}: PartialFunction[Int, Int], sp = true)
- test({
+ testAnonFunClass({
case x: Int => x
}: PartialFunction[Any, Any])
- test({
+ testAnonFunClass({
case x: Int => ()
}: PartialFunction[Int, Unit], sp = true)
- test({
+ testAnonFunClass({
case x: String => 1
}: PartialFunction[String, Int])
- test({
+ testAnonFunClass({
case x: String => ()
}: PartialFunction[String, Unit])
- test({
+ testAnonFunClass({
case x: String => x
}: PartialFunction[String, String])
}
diff --git a/test/files/run/t9003.flags b/test/files/run/t9003.flags
index 49d036a887..63535a7f4f 100644
--- a/test/files/run/t9003.flags
+++ b/test/files/run/t9003.flags
@@ -1 +1 @@
--optimize
+-opt:l:classpath
diff --git a/test/files/run/t9097.scala b/test/files/run/t9097.scala
index aa2b23bbac..49c9e2f2e5 100644
--- a/test/files/run/t9097.scala
+++ b/test/files/run/t9097.scala
@@ -6,7 +6,6 @@ object Test extends StoreReporterDirectTest {
override def extraSettings: String = List(
"-usejavacp",
"-Xfatal-warnings",
- "-Ybackend:GenBCode",
"-Ydelambdafy:method",
"-Xprint:delambdafy",
s"-d ${testOutput.path}"
@@ -29,6 +28,6 @@ object Test extends StoreReporterDirectTest {
assert(!storeReporter.hasErrors, message = filteredInfos map (_.msg) mkString "; ")
val out = baos.toString("UTF-8")
// was 2 before the fix, the two PackageDefs for a would both contain the ClassDef for the closure
- assert(out.lines.count(_ contains "class hihi$1") == 1, out)
+ assert(out.lines.count(_ contains "def $anonfun$hihi$1(x$1: Int): String") == 1, out)
}
}
diff --git a/test/files/run/t9110.scala b/test/files/run/t9110.scala
new file mode 100644
index 0000000000..660291a4d1
--- /dev/null
+++ b/test/files/run/t9110.scala
@@ -0,0 +1,27 @@
+trait Event
+
+trait Domain {
+ case class Created(name: String) extends Event
+}
+
+// declare three instances of Domain trait, one here and two
+// in an inner scope
+
+object DomainC extends Domain
+
+object Test {
+ def main(args: Array[String]) {
+ object DomainA extends Domain
+ object DomainB extends Domain
+
+ def lookingForAs(event: Event): Unit = {
+ event match {
+ case DomainB.Created(_) => throw null
+ case DomainC.Created(_) => throw null
+ case DomainA.Created(_) => // okay
+ }
+ }
+
+ lookingForAs(DomainA.Created("I am an A"))
+ }
+}
diff --git a/test/files/run/t9174.check b/test/files/run/t9174.check
new file mode 100644
index 0000000000..14d6bc10db
--- /dev/null
+++ b/test/files/run/t9174.check
@@ -0,0 +1,17 @@
+
+scala> import scala.util.{Success, Failure}
+import scala.util.{Success, Failure}
+
+scala> def f1(b: Boolean) = if (b) Left(1) else Right(2)
+f1: (b: Boolean)scala.util.Either[Int,Int]
+
+scala> def f2(b: Boolean) = if (b) Nil else 1 :: Nil
+f2: (b: Boolean)List[Int]
+
+scala> def f3(b: Boolean) = if (b) Stream.Empty else new Stream.Cons(1, Stream.Empty)
+f3: (b: Boolean)scala.collection.immutable.Stream[Int]
+
+scala> def f4(b: Boolean) = if (b) Success(1) else Failure(new Exception(""))
+f4: (b: Boolean)scala.util.Try[Int]
+
+scala> :quit
diff --git a/test/files/run/t9174.scala b/test/files/run/t9174.scala
new file mode 100644
index 0000000000..0c70e9bca9
--- /dev/null
+++ b/test/files/run/t9174.scala
@@ -0,0 +1,11 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ def code = """
+ |import scala.util.{Success, Failure}
+ |def f1(b: Boolean) = if (b) Left(1) else Right(2)
+ |def f2(b: Boolean) = if (b) Nil else 1 :: Nil
+ |def f3(b: Boolean) = if (b) Stream.Empty else new Stream.Cons(1, Stream.Empty)
+ |def f4(b: Boolean) = if (b) Success(1) else Failure(new Exception(""))
+ |""".stripMargin
+}
diff --git a/test/files/run/sammy_java8.flags b/test/files/run/t9178a.flags
index 48fd867160..48fd867160 100644
--- a/test/files/run/sammy_java8.flags
+++ b/test/files/run/t9178a.flags
diff --git a/test/files/run/t9178a.scala b/test/files/run/t9178a.scala
new file mode 100644
index 0000000000..4788841f8d
--- /dev/null
+++ b/test/files/run/t9178a.scala
@@ -0,0 +1,15 @@
+trait Sam { def apply(): Unit }
+abstract class Test {
+ def foo(): Sam
+ // no parens, instantiateToMethodType would wrap in a `new Sam { def apply = foo }`
+ // rather than applying to an empty param list() */
+ val f: Sam = foo
+}
+
+object Test extends Test {
+ lazy val samIAm = new Sam { def apply() {} }
+ def foo() = samIAm
+ def main(args: Array[String]): Unit = {
+ assert(f eq samIAm, f)
+ }
+}
diff --git a/test/files/run/t9200/Test.java b/test/files/run/t9200/Test.java
new file mode 100644
index 0000000000..8ff0314f6c
--- /dev/null
+++ b/test/files/run/t9200/Test.java
@@ -0,0 +1,6 @@
+public class Test {
+ public static void main(String[] args) {
+ new C1(new C2()); // Was NoSuchMethodError
+ }
+}
+
diff --git a/test/files/run/t9200/test.scala b/test/files/run/t9200/test.scala
new file mode 100644
index 0000000000..6fa7e91571
--- /dev/null
+++ b/test/files/run/t9200/test.scala
@@ -0,0 +1,12 @@
+trait W
+
+trait T1
+trait T2 extends T1
+
+object O1 {
+ type t = T1 with T2
+}
+
+class C1[w<:W](o: O1.t)
+
+class C2 extends T1 with T2
diff --git a/test/files/run/t9349/data.scala b/test/files/run/t9349/data.scala
new file mode 100644
index 0000000000..f88a6cfaeb
--- /dev/null
+++ b/test/files/run/t9349/data.scala
@@ -0,0 +1 @@
+case class Outer(i: Int) { class Inner }
diff --git a/test/files/run/t9349/test.scala b/test/files/run/t9349/test.scala
new file mode 100644
index 0000000000..ebce4e77dd
--- /dev/null
+++ b/test/files/run/t9349/test.scala
@@ -0,0 +1,21 @@
+object Test {
+ def main(args: Array[String]): Unit = {
+ val o1 = Outer(5)
+ o1 match {
+ case o @ Outer(_) =>
+ val i = new o.Inner
+ }
+ o1 match {
+ case o : Outer =>
+ val i = new o.Inner
+
+ }
+ object Extractor {
+ def unapply(a: Any): Option[Outer] = Some(o1)
+ }
+ null match {
+ case Extractor(o2) =>
+ val i = new o2.Inner
+ }
+ }
+}
diff --git a/test/files/run/t9375.check b/test/files/run/t9375.check
index 87551dccd1..8f43fab025 100644
--- a/test/files/run/t9375.check
+++ b/test/files/run/t9375.check
@@ -21,7 +21,7 @@ now initializing nested objects
konstruktor: class A$T$O$
konstruktor: class A$T$Op$
konstruktor: class A$O$11$
- konstruktor: class A$$anonfun$1$O$13$
+ konstruktor: class A$O$13$
konstruktor: class A$$anon$1$O$
konstruktor: class A$$anon$1$Op$
konstruktor: class T$O$
@@ -33,7 +33,7 @@ now initializing nested objects
konstruktor: class T$T$O$
konstruktor: class T$T$Op$
konstruktor: class T$O$14$
- konstruktor: class T$$anonfun$2$O$16$
+ konstruktor: class T$O$16$
konstruktor: class T$$anon$2$O$
konstruktor: class T$$anon$2$Op$
no object konstruktors called when serializing / deserializing objects (starting at the outer or the object itself)
@@ -56,5 +56,5 @@ init lazy val M.w
objects declared in lazy val are not static modules either
konstruktor: class M$O$19$
object declared in a function: new instance created on each invocation
- konstruktor: class M$$anonfun$3$O$20$
- konstruktor: class M$$anonfun$3$O$20$
+ konstruktor: class M$O$20$
+ konstruktor: class M$O$20$
diff --git a/test/files/run/t9375.scala b/test/files/run/t9375.scala
index 6ff4a425f8..58893c963b 100644
--- a/test/files/run/t9375.scala
+++ b/test/files/run/t9375.scala
@@ -1,6 +1,3 @@
-/*
- * filter: inliner warning
- */
import java.io._
object SerDes {
@@ -21,7 +18,7 @@ object SerDes {
import SerDes._
-// tests to make sure that de-serializing an object does not run its constructor
+// tests to make sure that deserializing an object does not run its constructor
trait S extends Serializable {
println(" konstruktor: " + this.getClass)
diff --git a/test/files/run/t9388-bin-compat.scala b/test/files/run/t9388-bin-compat.scala
deleted file mode 100644
index a03646612f..0000000000
--- a/test/files/run/t9388-bin-compat.scala
+++ /dev/null
@@ -1,16 +0,0 @@
-class C {
- private object N extends Serializable { override def toString = "N" }
- def foo = N.toString
-}
-object Test {
- def main(args: Array[String]): Unit = {
- val c = Class.forName("C")
- assert(c.getDeclaredFields().toList.map(_.toString) ==
- List("private volatile C$N$ C.C$$N$module")) // field is name-mangled (C$$N$module instead of just N$module)
- assert(c.getDeclaredMethods().toList.map(_.toString).sorted ==
- List("private C$N$ C.C$$N$lzycompute()",
- "public C$N$ C.C$$N()",
- "public java.lang.String C.foo()")) // accessor is public, name-mangled
- assert((new C).foo == "N")
- }
-}
diff --git a/test/files/run/t9390.scala b/test/files/run/t9390.scala
new file mode 100644
index 0000000000..8d7e1be557
--- /dev/null
+++ b/test/files/run/t9390.scala
@@ -0,0 +1,67 @@
+class C {
+ def methodLift1 = {
+ def isEven(c: Int) = c % 2 == 0
+ val f: Int => Boolean = isEven
+ f
+ }
+ def methodLift2 = {
+ def isEven(c: Int) = c % 2 == 0
+ def isEven0(c: Int) = isEven(c)
+ val f: Int => Boolean = isEven0
+ f
+ }
+
+ def methodLift3 = {
+ def isEven(c: Int) = {toString; c % 2 == 0}
+ def isEven0(c: Int) = isEven(c)
+ val f: Int => Boolean = isEven0
+ f
+ }
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val c = new C
+
+ {
+ val f = c.methodLift1
+ assert(f(0))
+ assert(!f(1))
+ val f1 = serializeDeserialize(f)
+ assert(f1(0))
+ assert(!f1(1))
+ }
+
+
+ {
+ val f = c.methodLift2
+ assert(f(0))
+ assert(!f(1))
+ val f1 = serializeDeserialize(f)
+ assert(f1(0))
+ assert(!f1(1))
+ }
+
+ {
+ val f = c.methodLift3
+ assert(f(0))
+ assert(!f(1))
+ try {
+ serializeDeserialize(this)
+ assert(false)
+ } catch {
+ case _: java.io.NotSerializableException =>
+ // expected, the closure in methodLift3 must capture C which is not serializable
+ }
+ }
+ }
+
+ def serializeDeserialize[T <: AnyRef](obj: T): T = {
+ import java.io._
+ val buffer = new ByteArrayOutputStream
+ val out = new ObjectOutputStream(buffer)
+ out.writeObject(obj)
+ val in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray))
+ in.readObject.asInstanceOf[T]
+ }
+}
diff --git a/test/files/run/t9390b.scala b/test/files/run/t9390b.scala
new file mode 100644
index 0000000000..439e21e0a0
--- /dev/null
+++ b/test/files/run/t9390b.scala
@@ -0,0 +1,31 @@
+class C { // C is not serializable
+ def foo = (x: Int) => (y: Int) => x + y
+ def bar = (x: Int) => (y: Int) => {toString; x + y}
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val c = new C
+ val f = c.foo
+ assert(f(1)(2) == 3)
+ val f1 = serializeDeserialize(f)
+ assert(f1(1)(2) == 3)
+
+ try {
+ serializeDeserialize(c.bar)
+ assert(false)
+ } catch {
+ case _: java.io.NotSerializableException =>
+ // expected, lambda transitively refers to this
+ }
+ }
+
+ def serializeDeserialize[T <: AnyRef](obj: T): T = {
+ import java.io._
+ val buffer = new ByteArrayOutputStream
+ val out = new ObjectOutputStream(buffer)
+ out.writeObject(obj)
+ val in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray))
+ in.readObject.asInstanceOf[T]
+ }
+}
diff --git a/test/files/run/t9390c.scala b/test/files/run/t9390c.scala
new file mode 100644
index 0000000000..db39da57cd
--- /dev/null
+++ b/test/files/run/t9390c.scala
@@ -0,0 +1,21 @@
+class C { // C is not serializable
+ def foo = {
+ { (x: Any) => new Object {} }
+ }
+}
+object Test {
+ def main(args: Array[String]): Unit = {
+ val c = new C
+ val f = c.foo
+ val f1 = serializeDeserialize(f)
+ }
+
+ def serializeDeserialize[T <: AnyRef](obj: T): T = {
+ import java.io._
+ val buffer = new ByteArrayOutputStream
+ val out = new ObjectOutputStream(buffer)
+ out.writeObject(obj)
+ val in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray))
+ in.readObject.asInstanceOf[T]
+ }
+}
diff --git a/test/files/run/t9390d.scala b/test/files/run/t9390d.scala
new file mode 100644
index 0000000000..3c5de3abf7
--- /dev/null
+++ b/test/files/run/t9390d.scala
@@ -0,0 +1,12 @@
+class C { // C is not serializable
+ def foo: () => Any = {
+ { () => class UseOuterInConstructor { C.this.toString }; new UseOuterInConstructor : Any}
+ }
+}
+object Test {
+ def main(args: Array[String]): Unit = {
+ val c = new C
+ val f = c.foo
+ f() // Doesn't NPE, as we didn't elide the outer instance in the constructor call.
+ }
+}
diff --git a/test/files/run/t9403.flags b/test/files/run/t9403.flags
index 307668060c..63535a7f4f 100644
--- a/test/files/run/t9403.flags
+++ b/test/files/run/t9403.flags
@@ -1 +1 @@
--Ybackend:GenASM -optimize
+-opt:l:classpath
diff --git a/test/files/run/t9408.scala b/test/files/run/t9408.scala
new file mode 100644
index 0000000000..231dca4ce7
--- /dev/null
+++ b/test/files/run/t9408.scala
@@ -0,0 +1,61 @@
+class Outer {
+ def assertNoFields(c: Class[_]) {
+ assert(c.getDeclaredFields.isEmpty)
+ }
+ def assertHasOuter(c: Class[_]) {
+ assert(c.getDeclaredFields.exists(_.getName.contains("outer")))
+ }
+ class Member
+ final class FinalMember
+
+ def test {
+ assertHasOuter(classOf[Member])
+ assertNoFields(classOf[FinalMember])
+ final class C
+ assertNoFields(classOf[C])
+ class D
+ assertNoFields(classOf[D])
+ (() => {class E; assertNoFields(classOf[E])}).apply()
+
+ // The outer reference elision currently runs on a class-by-class basis. If it cannot rule out that a class has
+ // subclasses, it will not remove the outer reference. A smarter analysis here could detect if no members of
+ // a sealed (or effectively sealed) hierarchy use the outer reference, the optimization could be performed.
+ class Parent
+ class Child extends Parent
+ assertHasOuter(classOf[Parent])
+
+ // Note: outer references (if they haven't been elided) are used in pattern matching as follows.
+ // This isn't relevant to term-owned classes, as you can't refer to them with a prefix that includes
+ // the outer class.
+ val outer1 = new Outer
+ val outer2 = new Outer
+ (new outer1.Member: Any) match {
+ case _: outer2.Member => sys.error("wrong match!")
+ case _: outer1.Member => // okay
+ }
+
+ // ... continuing on that theme, note that `Member` isn't considered as a local class, it is owned by a the class
+ // `LocalOuter`, which itself happens to be term-owned. So we expect that it has an outer reference, and that this
+ // is respected in type tests.
+ class LocalOuter {
+ class Member
+ final class FinalMember
+ }
+ assertNoFields(classOf[LocalOuter])
+ assertHasOuter(classOf[LocalOuter#Member])
+ val localOuter1 = new LocalOuter
+ val localOuter2 = new LocalOuter
+ (new localOuter1.Member: Any) match {
+ case _: localOuter2.Member => sys.error("wrong match!")
+ case _: localOuter1.Member => // okay
+ }
+ // Final member classes still lose the outer reference.
+ assertNoFields(classOf[LocalOuter#FinalMember])
+ }
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ new Outer().test
+ }
+}
diff --git a/test/files/run/t9437a.check b/test/files/run/t9437a.check
new file mode 100644
index 0000000000..564213c587
--- /dev/null
+++ b/test/files/run/t9437a.check
@@ -0,0 +1,10 @@
+name: a; isNamePresent: true; isSynthetic: false
+name: _; isNamePresent: true; isSynthetic: false
+name: ***; isNamePresent: true; isSynthetic: false
+name: unary_!; isNamePresent: true; isSynthetic: false
+name: ABC; isNamePresent: true; isSynthetic: false
+name: a; isNamePresent: true; isSynthetic: false
+name: _; isNamePresent: true; isSynthetic: false
+name: ***; isNamePresent: true; isSynthetic: false
+name: unary_!; isNamePresent: true; isSynthetic: false
+name: ABC; isNamePresent: true; isSynthetic: false
diff --git a/test/files/run/t9437a/Test.scala b/test/files/run/t9437a/Test.scala
new file mode 100644
index 0000000000..a86c17b646
--- /dev/null
+++ b/test/files/run/t9437a/Test.scala
@@ -0,0 +1,20 @@
+class Foo(a: Int, `_`: String, *** : Long, `unary_!` : Float, ABC: Double) {
+ def bar(a: Int, `_`: String, *** : Long, `unary_!` : Float, ABC: Double) = null
+}
+
+object Test extends App {
+ val constrParams = classOf[Foo].getConstructors.head.getParameters
+ val methodParams = classOf[Foo].getDeclaredMethods.head.getParameters
+
+ def printParams(params: Array[java.lang.reflect.Parameter]) = {
+ params.foreach { param =>
+ println(s"name: ${param.getName}; isNamePresent: ${param.isNamePresent}; isSynthetic: ${param.isSynthetic}")
+ }
+ }
+
+ printParams(constrParams)
+ printParams(methodParams)
+
+ val foo = new Foo(a = 1, `_` = "2", *** = 3L, `unary_!` = 4.0f, ABC = 5.0)
+ foo.bar(a = 1, `_` = "2", *** = 3L, `unary_!` = 4.0f, ABC = 5.0)
+}
diff --git a/test/files/run/t9437b.check b/test/files/run/t9437b.check
new file mode 100644
index 0000000000..564213c587
--- /dev/null
+++ b/test/files/run/t9437b.check
@@ -0,0 +1,10 @@
+name: a; isNamePresent: true; isSynthetic: false
+name: _; isNamePresent: true; isSynthetic: false
+name: ***; isNamePresent: true; isSynthetic: false
+name: unary_!; isNamePresent: true; isSynthetic: false
+name: ABC; isNamePresent: true; isSynthetic: false
+name: a; isNamePresent: true; isSynthetic: false
+name: _; isNamePresent: true; isSynthetic: false
+name: ***; isNamePresent: true; isSynthetic: false
+name: unary_!; isNamePresent: true; isSynthetic: false
+name: ABC; isNamePresent: true; isSynthetic: false
diff --git a/test/files/run/t9437b/Foo_1.scala b/test/files/run/t9437b/Foo_1.scala
new file mode 100644
index 0000000000..ca6c9c6156
--- /dev/null
+++ b/test/files/run/t9437b/Foo_1.scala
@@ -0,0 +1,3 @@
+class Foo(a: Int, `_`: String, *** : Long, `unary_!` : Float, ABC: Double) {
+ def bar(a: Int, `_`: String, *** : Long, `unary_!` : Float, ABC: Double) = null
+}
diff --git a/test/files/run/t9437b/Test_2.scala b/test/files/run/t9437b/Test_2.scala
new file mode 100644
index 0000000000..521f525f1d
--- /dev/null
+++ b/test/files/run/t9437b/Test_2.scala
@@ -0,0 +1,16 @@
+object Test extends App {
+ val constrParams = classOf[Foo].getConstructors.head.getParameters
+ val methodParams = classOf[Foo].getDeclaredMethods.head.getParameters
+
+ def printParams(params: Array[java.lang.reflect.Parameter]) = {
+ params.foreach { param =>
+ println(s"name: ${param.getName}; isNamePresent: ${param.isNamePresent}; isSynthetic: ${param.isSynthetic}")
+ }
+ }
+
+ printParams(constrParams)
+ printParams(methodParams)
+
+ val foo = new Foo(a = 1, `_` = "2", *** = 3L, `unary_!` = 4.0f, ABC = 5.0)
+ foo.bar(a = 1, `_` = "2", *** = 3L, `unary_!` = 4.0f, ABC = 5.0)
+}
diff --git a/test/files/run/t9437c.check b/test/files/run/t9437c.check
new file mode 100644
index 0000000000..564213c587
--- /dev/null
+++ b/test/files/run/t9437c.check
@@ -0,0 +1,10 @@
+name: a; isNamePresent: true; isSynthetic: false
+name: _; isNamePresent: true; isSynthetic: false
+name: ***; isNamePresent: true; isSynthetic: false
+name: unary_!; isNamePresent: true; isSynthetic: false
+name: ABC; isNamePresent: true; isSynthetic: false
+name: a; isNamePresent: true; isSynthetic: false
+name: _; isNamePresent: true; isSynthetic: false
+name: ***; isNamePresent: true; isSynthetic: false
+name: unary_!; isNamePresent: true; isSynthetic: false
+name: ABC; isNamePresent: true; isSynthetic: false
diff --git a/test/files/run/t9437c/Test.scala b/test/files/run/t9437c/Test.scala
new file mode 100644
index 0000000000..4be233a258
--- /dev/null
+++ b/test/files/run/t9437c/Test.scala
@@ -0,0 +1,92 @@
+import java.io.{File, FileOutputStream}
+
+import scala.tools.nsc.settings.ScalaVersion
+import scala.tools.partest._
+import scala.tools.asm
+import asm.{AnnotationVisitor, ClassWriter, FieldVisitor, Handle, MethodVisitor, Opcodes}
+import Opcodes._
+
+// This test ensures that we can read JDK 8 (classfile format 52) files with
+// parameter names. To do that it first uses ASM to generate a class containing
+// these additional attributes. Then it runs a normal compile on Scala source
+// that uses the class with named arguments.
+// Any failure will be dumped to std out.
+object Test extends DirectTest {
+ override def extraSettings: String = "-usejavacp -d " + testOutput.path + " -cp " + testOutput.path
+
+ def generateCode(): Unit = {
+ val className = "Foo"
+
+ val cw = new ClassWriter(0)
+ cw.visit(52, ACC_PUBLIC + ACC_SUPER, className, null, "java/lang/Object", null);
+
+ val mvC = cw.visitMethod(ACC_PUBLIC, "<init>", "(ILjava/lang/String;JFD)V", null, null);
+ mvC.visitParameter("a", ACC_FINAL);
+ mvC.visitParameter("_", ACC_FINAL);
+ mvC.visitParameter("***", ACC_FINAL);
+ mvC.visitParameter("unary_!", ACC_FINAL);
+ mvC.visitParameter("ABC", ACC_FINAL);
+ mvC.visitCode();
+ mvC.visitVarInsn(ALOAD, 0);
+ mvC.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
+ mvC.visitInsn(RETURN);
+ mvC.visitMaxs(1, 8);
+ mvC.visitEnd();
+
+ val mvM = cw.visitMethod(ACC_PUBLIC, "bar", "(ILjava/lang/String;JFD)Lscala/runtime/Null$;", null, null);
+ mvM.visitParameter("a", ACC_FINAL);
+ mvM.visitParameter("_", ACC_FINAL);
+ mvM.visitParameter("***", ACC_FINAL);
+ mvM.visitParameter("unary_!", ACC_FINAL);
+ mvM.visitParameter("ABC", ACC_FINAL);
+ mvM.visitCode();
+ mvM.visitInsn(ACONST_NULL);
+ mvM.visitInsn(ARETURN);
+ mvM.visitMaxs(1, 8);
+ mvM.visitEnd();
+
+ cw.visitEnd();
+
+ val bytes = cw.toByteArray()
+
+ val fos = new FileOutputStream(new File(s"${testOutput.path}/$className.class"))
+ try
+ fos write bytes
+ finally
+ fos.close()
+
+ }
+
+ def code =
+"""
+class Driver {
+ val constrParams = classOf[Foo].getConstructors.head.getParameters
+ val methodParams = classOf[Foo].getDeclaredMethods.head.getParameters
+
+ def printParams(params: Array[java.lang.reflect.Parameter]) = {
+ params.foreach { param =>
+ println(s"name: ${param.getName}; isNamePresent: ${param.isNamePresent}; isSynthetic: ${param.isSynthetic}")
+ }
+ }
+
+ printParams(constrParams)
+ printParams(methodParams)
+
+ val foo = new Foo(a = 1, `_` = "2", *** = 3L, `unary_!` = 4.0f, ABC = 5.0)
+ foo.bar(a = 1, `_` = "2", *** = 3L, `unary_!` = 4.0f, ABC = 5.0)
+}
+"""
+
+ override def show(): Unit = {
+ // redirect err to out, for logging
+ val prevErr = System.err
+ System.setErr(System.out)
+ try {
+ generateCode()
+ compile()
+ Class.forName("Driver").newInstance()
+ }
+ finally
+ System.setErr(prevErr)
+ }
+}
diff --git a/test/files/run/t8764.flags b/test/files/run/t9489.flags
index 48fd867160..48fd867160 100644
--- a/test/files/run/t8764.flags
+++ b/test/files/run/t9489.flags
diff --git a/test/files/run/t9489/A.java b/test/files/run/t9489/A.java
new file mode 100644
index 0000000000..c3536faa14
--- /dev/null
+++ b/test/files/run/t9489/A.java
@@ -0,0 +1,3 @@
+public class A {
+ public B b() { return null; }
+}
diff --git a/test/files/run/t9489/B.java b/test/files/run/t9489/B.java
new file mode 100644
index 0000000000..e5d1278cd7
--- /dev/null
+++ b/test/files/run/t9489/B.java
@@ -0,0 +1,3 @@
+public abstract class B {
+ public abstract int m();
+}
diff --git a/test/files/run/t9489/test.scala b/test/files/run/t9489/test.scala
new file mode 100644
index 0000000000..1b745af865
--- /dev/null
+++ b/test/files/run/t9489/test.scala
@@ -0,0 +1,10 @@
+class T {
+ def f(a: A) = g(a.b) // was: "found Int, required B"
+ def g(b: => B) = null
+}
+
+object Test extends T {
+ def main(args: Array[String]): Unit = {
+ f(new A)
+ }
+}
diff --git a/test/files/run/t9516.scala b/test/files/run/t9516.scala
new file mode 100644
index 0000000000..b3068dd1ff
--- /dev/null
+++ b/test/files/run/t9516.scala
@@ -0,0 +1,52 @@
+object Test {
+ def main(args: Array[String]): Unit = {
+ intShiftLeftLongConstantFolded()
+ intShiftLeftLongAtRuntime()
+ intShiftLogicalRightLongConstantFolded()
+ intShiftLogicalRightLongAtRuntime()
+ intShiftArithmeticRightLongConstantFolded()
+ intShiftArithmeticRightLongAtRuntime()
+ }
+
+ def intShiftLeftLongConstantFolded(): Unit = {
+ assert(0x01030507 << 36L == 271601776)
+ val r = 0x01030507 << 36L
+ assert(r == 271601776)
+ }
+
+ def intShiftLeftLongAtRuntime(): Unit = {
+ var x: Int = 0x01030507
+ var y: Long = 36L
+ assert(x << y == 271601776)
+ val r = x << y
+ assert(r == 271601776)
+ }
+
+ def intShiftLogicalRightLongConstantFolded(): Unit = {
+ assert(0x90503010 >>> 36L == 151323393)
+ val r = 0x90503010 >>> 36L
+ assert(r == 151323393)
+ }
+
+ def intShiftLogicalRightLongAtRuntime(): Unit = {
+ var x: Int = 0x90503010
+ var y: Long = 36L
+ assert(x >>> y == 151323393)
+ val r = x >>> y
+ assert(r == 151323393)
+ }
+
+ def intShiftArithmeticRightLongConstantFolded(): Unit = {
+ assert(0x90503010 >> 36L == -117112063)
+ val r = 0x90503010 >> 36L
+ assert(r == -117112063)
+ }
+
+ def intShiftArithmeticRightLongAtRuntime(): Unit = {
+ var x: Int = 0x90503010
+ var y: Long = 36L
+ assert(x >> y == -117112063)
+ val r = x >> y
+ assert(r == -117112063)
+ }
+}
diff --git a/test/files/run/t9535.scala b/test/files/run/t9535.scala
new file mode 100644
index 0000000000..62e156e456
--- /dev/null
+++ b/test/files/run/t9535.scala
@@ -0,0 +1,22 @@
+class C[E <: Exception] {
+ @throws[E] def f = 1
+
+ @throws(classOf[Exception]) def g: E = ???
+
+ @throws[E] @throws[Exception] def h = 1
+}
+
+object Test extends App {
+ val c = classOf[C[_]]
+ def sig(method: String) = c.getDeclaredMethod(method).toString
+ def genSig(method: String) = c.getDeclaredMethod(method).toGenericString
+
+ assert(sig("f") == "public int C.f() throws java.lang.Exception")
+ assert(genSig("f") == "public int C.f() throws E")
+
+ assert(sig("g") == "public java.lang.Exception C.g() throws java.lang.Exception")
+ assert(genSig("g") == "public E C.g() throws java.lang.Exception")
+
+ assert(sig("h") == "public int C.h() throws java.lang.Exception,java.lang.Exception")
+ assert(genSig("h") == "public int C.h() throws E,java.lang.Exception")
+}
diff --git a/test/files/run/t9656.check b/test/files/run/t9656.check
new file mode 100644
index 0000000000..03e3ff3b5f
--- /dev/null
+++ b/test/files/run/t9656.check
@@ -0,0 +1,14 @@
+Range 1 to 10
+Range 1 to 10
+inexact Range 1 to 10 by 2
+Range 1 to 10 by 3
+inexact Range 1 until 10 by 2
+Range 100 to 100
+empty Range 100 until 100
+NumericRange 1 to 10
+NumericRange 1 to 10 by 2
+NumericRange 0.1 until 1.0 by 0.1
+NumericRange 0.1 until 1.0 by 0.1
+NumericRange 0.1 until 1.0 by 0.1 (using NumericRange 0.1 until 1.0 by 0.1 of BigDecimal)
+NumericRange 0 days until 10 seconds by 1 second
+empty NumericRange 0 days until 0 days by 1 second
diff --git a/test/files/run/t9656.scala b/test/files/run/t9656.scala
new file mode 100644
index 0000000000..3732719553
--- /dev/null
+++ b/test/files/run/t9656.scala
@@ -0,0 +1,43 @@
+
+import scala.math.BigDecimal
+
+object Test extends App {
+ println(1 to 10)
+ println(1 to 10 by 1)
+ println(1 to 10 by 2)
+ println(1 to 10 by 3)
+ println(1 until 10 by 2)
+ println(100 to 100)
+ println(100 until 100)
+
+ println(1L to 10L)
+ println(1L to 10L by 2)
+
+ // want to know if this is BigDecimal or Double stepping by BigDecimal
+ println(0.1 until 1.0 by 0.1)
+ println(Range.BigDecimal(BigDecimal("0.1"), BigDecimal("1.0"), BigDecimal("0.1")))
+ println(Range.Double(0.1, 1.0, 0.1))
+
+ import concurrent.duration.{SECONDS => Seconds, _}, collection.immutable.NumericRange
+ implicit val `duration is integerish`: math.Integral[FiniteDuration] = new math.Integral[FiniteDuration] {
+ def quot(x: scala.concurrent.duration.FiniteDuration,y: scala.concurrent.duration.FiniteDuration): scala.concurrent.duration.FiniteDuration = ???
+ def rem(x: scala.concurrent.duration.FiniteDuration,y: scala.concurrent.duration.FiniteDuration): scala.concurrent.duration.FiniteDuration = ???
+
+ // Members declared in scala.math.Numeric
+ def fromInt(x: Int): scala.concurrent.duration.FiniteDuration = Duration(x, Seconds)
+ def minus(x: scala.concurrent.duration.FiniteDuration,y: scala.concurrent.duration.FiniteDuration): scala.concurrent.duration.FiniteDuration = ???
+ def negate(x: scala.concurrent.duration.FiniteDuration): scala.concurrent.duration.FiniteDuration = ???
+ def plus(x: scala.concurrent.duration.FiniteDuration,y: scala.concurrent.duration.FiniteDuration): scala.concurrent.duration.FiniteDuration = ???
+ def times(x: scala.concurrent.duration.FiniteDuration,y: scala.concurrent.duration.FiniteDuration): scala.concurrent.duration.FiniteDuration = ???
+ def toDouble(x: scala.concurrent.duration.FiniteDuration): Double = ???
+ def toFloat(x: scala.concurrent.duration.FiniteDuration): Float = ???
+ def toInt(x: scala.concurrent.duration.FiniteDuration): Int = toLong(x).toInt
+ def toLong(x: scala.concurrent.duration.FiniteDuration): Long = x.length
+
+ // Members declared in scala.math.Ordering
+ def compare(x: scala.concurrent.duration.FiniteDuration,y: scala.concurrent.duration.FiniteDuration): Int =
+ x.compare(y)
+ }
+ println(NumericRange(Duration.Zero, Duration(10, Seconds), Duration(1, Seconds)))
+ println(NumericRange(Duration.Zero, Duration.Zero, Duration(1, Seconds)))
+}
diff --git a/test/files/run/t9689.check b/test/files/run/t9689.check
new file mode 100644
index 0000000000..61ed6e13a2
--- /dev/null
+++ b/test/files/run/t9689.check
@@ -0,0 +1,14 @@
+
+scala> import bug._
+import bug._
+
+scala> import Wrap._
+import Wrap._
+
+scala> object Bar extends Foo
+defined object Bar
+
+scala> Bar.foo
+ok
+
+scala> :quit
diff --git a/test/files/run/t9689/Test_2.scala b/test/files/run/t9689/Test_2.scala
new file mode 100644
index 0000000000..086ddecdea
--- /dev/null
+++ b/test/files/run/t9689/Test_2.scala
@@ -0,0 +1,12 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+
+ def code = """
+import bug._
+import Wrap._
+object Bar extends Foo
+Bar.foo
+ """
+
+}
diff --git a/test/files/run/t9689/bug_1.scala b/test/files/run/t9689/bug_1.scala
new file mode 100644
index 0000000000..1dfd7bdad8
--- /dev/null
+++ b/test/files/run/t9689/bug_1.scala
@@ -0,0 +1,8 @@
+
+package bug
+
+object Wrap {
+ trait Foo {
+ def foo: Unit = println("ok")
+ }
+}
diff --git a/test/files/run/t9697.check b/test/files/run/t9697.check
new file mode 100644
index 0000000000..2a4f01c14f
--- /dev/null
+++ b/test/files/run/t9697.check
@@ -0,0 +1 @@
+warning: there were 9 deprecation warnings (since 2.11.0); re-run with -deprecation for details
diff --git a/test/files/run/t9697.scala b/test/files/run/t9697.scala
new file mode 100644
index 0000000000..eb8e44f8fc
--- /dev/null
+++ b/test/files/run/t9697.scala
@@ -0,0 +1,204 @@
+object log {
+ val b = new collection.mutable.StringBuilder
+ def apply(s: Any): Unit = b.append(s)
+ def check(s: String) = {
+ val bs = b.toString
+ assert(s == bs, bs)
+ b.clear()
+ }
+}
+
+package t9697 {
+ abstract class WA extends DelayedInit {
+ override def delayedInit(x: => Unit): Unit = x
+ val waField = "4"
+ }
+
+ class C {
+ def b(s: String) = log(s)
+ val cField = "1"
+
+ {
+ val dummyLocal = "2"
+ new WA {
+ val anonField = "3"
+ b(cField)
+ b(dummyLocal)
+ b(anonField)
+ b(waField)
+ }
+ }
+ }
+}
+
+package sd229 {
+ class Broken {
+ def is(ee: AnyRef) = {
+ new Delayed {
+ log(ee)
+ }
+ }
+ }
+
+ class Delayed extends DelayedInit {
+ def delayedInit(x: => Unit): Unit = x
+ }
+}
+
+
+// already fixed in 2.11.8, crashes in 2.10.6
+package t4683a {
+ class A { log("a") }
+ class B { log("b") }
+ class Bug extends DelayedInit {
+ log("bug")
+ def foo(a: A): B = new B
+ def delayedInit(init: => Unit): Unit = init
+ }
+}
+
+// already fixed in 2.12.0-RC1, crashes in 2.11.8
+package t4683b {
+ class Entity extends DelayedInit {
+ def delayedInit(x: => Unit): Unit = x
+
+ class Field
+
+ protected def EntityField[T <: Entity: reflect.ClassTag] = new Field
+
+ def find[T <: Entity: reflect.ClassTag] {
+ Nil.map(dbo => {
+ class EntityHolder extends Entity {
+ val entity = EntityField[T]
+ }
+ })
+ log("find")
+ }
+ }
+}
+
+package t4683c {
+ trait T extends DelayedInit {
+ def delayedInit(body: => Unit) = {
+ log("init")
+ body
+ }
+ }
+}
+
+package t4683d {
+ class C extends DelayedInit {
+ def delayedInit(body: => Unit): Unit = body
+ }
+ class Injector {
+ def test: Object = {
+ val name = "k"
+ class crash extends C {
+ log(name)
+ }
+ new crash()
+ }
+ }
+}
+
+package t4683e {
+ class DelayedInitTest {
+ def a = log("uh")
+ class B extends DelayedInit {
+ a
+ def delayedInit(body: => Unit): Unit = body
+ }
+ }
+}
+
+package t4683f {
+ class Foo extends DelayedInit {
+ log("fooInit")
+ def delayedInit(newBody: => Unit): Unit = {
+ log("delayedInit")
+ inits = {
+ val f = () => newBody
+ if (inits == null) {
+ log("initsNull")
+ List(f)
+ } else
+ f :: inits
+ }
+ }
+ def foo = log("foo")
+ var inits: List[() => Unit] = Nil
+ }
+
+ class Bar extends Foo {
+ log("barInit")
+ def bar = foo
+ def newBaz: Foo = new Baz
+ private class Baz extends Foo {
+ log("bazInit")
+ bar
+ }
+ }
+}
+
+package t4683g {
+ trait MatExpWorld { self =>
+ class T extends Runner { val expWorld: self.type = self }
+ }
+
+ trait Runner extends DelayedInit {
+ def delayedInit(init: => Unit): Unit = init
+ val expWorld: MatExpWorld
+ }
+}
+
+
+object Test extends App {
+ new t9697.C()
+ log.check("1234")
+
+ new sd229.Broken().is("hi")
+ log.check("hi")
+
+ val a: t4683a.A = new t4683a.A
+ var b: t4683a.B = null
+ new t4683a.Bug {
+ val b = foo(a)
+ }
+ log.check("abugb")
+
+ new t4683b.Entity().find[t4683b.Entity]
+ log.check("find")
+
+ val f = (p1: Int) => new t4683c.T { log(p1) }
+ f(5)
+ log.check("init5")
+
+ new t4683d.Injector().test
+ log.check("k")
+
+ val dit = new t4683e.DelayedInitTest()
+ new dit.B()
+ log.check("uh")
+
+ val fuu = new t4683f.Foo
+ log.check("delayedInitinitsNull")
+ fuu.inits.foreach(_.apply())
+ log.check("fooInit")
+ assert(fuu.inits == Nil) // the (delayed) initializer of Foo sets the inits field to Nil
+
+ val brr = new t4683f.Bar
+ log.check("delayedInitinitsNulldelayedInit") // delayedInit is called once for each constructor
+ brr.inits.foreach(_.apply())
+ log.check("barInitfooInit")
+ assert(brr.inits == Nil)
+
+ val bzz = brr.newBaz
+ log.check("delayedInitinitsNulldelayedInit")
+ bzz.inits.foreach(_.apply())
+ log.check("bazInitfoofooInit")
+ assert(bzz.inits == Nil)
+
+ val mew = new t4683g.MatExpWorld { }
+ val mt = new mew.T
+ assert(mt.expWorld == mew)
+}
diff --git a/test/files/run/t9749-repl-dot.check b/test/files/run/t9749-repl-dot.check
new file mode 100644
index 0000000000..5ffec4ce60
--- /dev/null
+++ b/test/files/run/t9749-repl-dot.check
@@ -0,0 +1,8 @@
+
+scala> "3"
+res0: String = 3
+
+scala> .toInt
+res1: Int = 3
+
+scala> :quit
diff --git a/test/files/run/t9749-repl-dot.scala b/test/files/run/t9749-repl-dot.scala
new file mode 100644
index 0000000000..19cecbf444
--- /dev/null
+++ b/test/files/run/t9749-repl-dot.scala
@@ -0,0 +1,10 @@
+
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ def code =
+ """
+"3"
+ .toInt
+ """
+}
diff --git a/test/files/run/t9806.scala b/test/files/run/t9806.scala
deleted file mode 100644
index ccde989efe..0000000000
--- a/test/files/run/t9806.scala
+++ /dev/null
@@ -1,18 +0,0 @@
-object Ex extends Exception
-object Test {
- def main(args: Array[String]) {
- try foo catch { case Ex => }
- }
-
- def isTrue(b: Boolean) = b
- def foo = {
- var streamErrors1 = true
- try {
- streamErrors1 = false
- throw Ex
- } catch {
- case ex if streamErrors1 =>
- assert(isTrue(streamErrors1))
- }
- }
-}
diff --git a/test/files/run/t9814.scala b/test/files/run/t9814.scala
new file mode 100644
index 0000000000..3aef3928f6
--- /dev/null
+++ b/test/files/run/t9814.scala
@@ -0,0 +1,28 @@
+import java.lang.reflect.Modifier
+
+import scala.annotation.strictfp
+
+class Foo extends (() => Unit) {
+ def apply(): Unit = synchronized {
+ // we're in a specialized subclass
+ assert(Thread.currentThread.getStackTrace.apply(1).getMethodName == "apply$mcV$sp")
+ assert(Thread.holdsLock(this))
+ }
+}
+
+class Bar extends (() => Unit) {
+ @strictfp def apply(): Unit = synchronized {
+ // we're in a specialized subclass
+ assert(Thread.currentThread.getStackTrace.apply(1).getMethodName == "apply$mcV$sp")
+ assert(Thread.holdsLock(this))
+ }
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ new Foo().apply()
+
+ val m = classOf[Bar].getDeclaredMethod("apply$mcV$sp")
+ assert(Modifier.isStrict(m.getModifiers))
+ }
+}
diff --git a/test/files/run/t9841.scala b/test/files/run/t9841.scala
index 19cfef28a5..2f7642ed03 100644
--- a/test/files/run/t9841.scala
+++ b/test/files/run/t9841.scala
@@ -1,10 +1,4 @@
-// SI-9841 regrettable behavior initializing private inner object
-// A fix is not yet planned for 2.11.9, but it works in 2.12.x.
-//
-//at Container.Container$$Inner$lzycompute(t9841.scala:4)
-//at Container.Container$$Inner(t9841.scala:4)
-//at Container$Inner$.<init>(t9841.scala:5)
-//
+
class Container {
private case class Inner(s: String)
private object Inner {
@@ -14,11 +8,5 @@ class Container {
}
object Test extends App {
- val catcher: PartialFunction[Throwable, Unit] = {
- case _: StackOverflowError =>
- }
- try {
- new Container
- Console println "Expected StackOverflowError"
- } catch catcher
+ new Container
}
diff --git a/test/files/run/t9880-9881.check b/test/files/run/t9880-9881.check
new file mode 100644
index 0000000000..36513e249a
--- /dev/null
+++ b/test/files/run/t9880-9881.check
@@ -0,0 +1,36 @@
+
+scala> // import in various ways
+
+scala> import java.util.Date
+import java.util.Date
+
+scala> import scala.util._
+import scala.util._
+
+scala> import scala.reflect.runtime.{universe => ru}
+import scala.reflect.runtime.{universe=>ru}
+
+scala> import ru.TypeTag
+import ru.TypeTag
+
+scala>
+
+scala> // show the imports
+
+scala> :imports
+ 1) import java.lang._ (...)
+ 2) import scala._ (...)
+ 3) import scala.Predef._ (...)
+ 4) import java.util.Date (...)
+ 5) import scala.util._ (...)
+ 6) import scala.reflect.runtime.{universe=>ru} (...)
+ 7) import ru.TypeTag (...)
+
+scala>
+
+scala> // should be able to define this class with the imports above
+
+scala> class C[T](date: Date, rand: Random, typeTag: TypeTag[T])
+defined class C
+
+scala> :quit
diff --git a/test/files/run/t9880-9881.scala b/test/files/run/t9880-9881.scala
new file mode 100644
index 0000000000..0268c8c32c
--- /dev/null
+++ b/test/files/run/t9880-9881.scala
@@ -0,0 +1,29 @@
+import scala.tools.partest.ReplTest
+import scala.tools.nsc.Settings
+
+object Test extends ReplTest {
+
+ override def transformSettings(s: Settings): Settings = {
+ s.Yreplclassbased.value = true
+ s
+ }
+
+ lazy val normalizeRegex = """(import\s.*)\(.*\)""".r
+
+ override def normalize(s: String): String = normalizeRegex.replaceFirstIn(s, "$1(...)")
+
+ def code =
+ """
+ |// import in various ways
+ |import java.util.Date
+ |import scala.util._
+ |import scala.reflect.runtime.{universe => ru}
+ |import ru.TypeTag
+ |
+ |// show the imports
+ |:imports
+ |
+ |// should be able to define this class with the imports above
+ |class C[T](date: Date, rand: Random, typeTag: TypeTag[T])
+ """.stripMargin
+}
diff --git a/test/files/run/t9915/C_1.java b/test/files/run/t9915/C_1.java
new file mode 100644
index 0000000000..4269cf74e0
--- /dev/null
+++ b/test/files/run/t9915/C_1.java
@@ -0,0 +1,20 @@
+/*
+ * javac: -encoding UTF-8
+ */
+public class C_1 {
+ public static final String NULLED = "X\000ABC";
+ public static final String SUPPED = "𐒈𐒝𐒑𐒛𐒐𐒘𐒕𐒖";
+
+ public String nulled() {
+ return C_1.NULLED;
+ }
+ public String supped() {
+ return C_1.SUPPED;
+ }
+ public int nulledSize() {
+ return C_1.NULLED.length();
+ }
+ public int suppedSize() {
+ return C_1.SUPPED.length();
+ }
+}
diff --git a/test/files/run/t9915/Test_2.scala b/test/files/run/t9915/Test_2.scala
new file mode 100644
index 0000000000..afed667cc6
--- /dev/null
+++ b/test/files/run/t9915/Test_2.scala
@@ -0,0 +1,12 @@
+
+object Test extends App {
+ val c = new C_1
+ assert(c.nulled == "X\u0000ABC") // "X\000ABC"
+ assert(c.supped == "𐒈𐒝𐒑𐒛𐒐𐒘𐒕𐒖")
+
+ assert(C_1.NULLED == "X\u0000ABC") // "X\000ABC"
+ assert(C_1.SUPPED == "𐒈𐒝𐒑𐒛𐒐𐒘𐒕𐒖")
+
+ assert(C_1.NULLED.size == "XYABC".size)
+ assert(C_1.SUPPED.codePointCount(0, C_1.SUPPED.length) == 8)
+}
diff --git a/test/files/run/t9920.scala b/test/files/run/t9920.scala
new file mode 100644
index 0000000000..5dc32e99b7
--- /dev/null
+++ b/test/files/run/t9920.scala
@@ -0,0 +1,17 @@
+class C0
+trait T { self: C0 =>
+ def test = {
+ object Local
+
+ class C1 {
+ Local
+ }
+ new C1()
+ }
+}
+
+object Test extends C0 with T {
+ def main(args: Array[String]): Unit = {
+ test
+ }
+}
diff --git a/test/files/run/t9920b.scala b/test/files/run/t9920b.scala
new file mode 100644
index 0000000000..fab196b669
--- /dev/null
+++ b/test/files/run/t9920b.scala
@@ -0,0 +1,17 @@
+class C0
+trait T {
+ def test = {
+ object Local
+
+ class C1 {
+ Local
+ }
+ new C1()
+ }
+}
+
+object Test extends C0 with T {
+ def main(args: Array[String]): Unit = {
+ test
+ }
+}
diff --git a/test/files/run/t9920c.scala b/test/files/run/t9920c.scala
new file mode 100644
index 0000000000..9541dc650a
--- /dev/null
+++ b/test/files/run/t9920c.scala
@@ -0,0 +1,21 @@
+class C0
+trait T { self: C0 =>
+ def test = {
+ object Local
+
+ class C2 {
+ class C1 {
+ Local
+ }
+ T.this.toString
+ new C1
+ }
+ new C2()
+ }
+}
+
+object Test extends C0 with T {
+ def main(args: Array[String]): Unit = {
+ test
+ }
+}
diff --git a/test/files/run/t9920d.scala b/test/files/run/t9920d.scala
new file mode 100644
index 0000000000..debc99e199
--- /dev/null
+++ b/test/files/run/t9920d.scala
@@ -0,0 +1,14 @@
+class C { object O }
+trait T { _: C =>
+ def foo {
+ class D { O }
+ new D
+ }
+}
+
+
+object Test extends C with T {
+ def main(args: Array[String]): Unit = {
+ foo
+ }
+}
diff --git a/test/files/run/t9944.check b/test/files/run/t9944.check
new file mode 100755
index 0000000000..c2b0adf311
--- /dev/null
+++ b/test/files/run/t9944.check
@@ -0,0 +1,12 @@
+[[syntax trees at end of parser]] // newSource1.scala
+package <empty> {
+ class C extends scala.AnyRef {
+ def <init>() = {
+ super.<init>();
+ ()
+ };
+ def g = 42;
+ def f = StringContext("123\r\n", "\r\n123\r\n").s(g)
+ }
+}
+
diff --git a/test/files/run/t9944.scala b/test/files/run/t9944.scala
new file mode 100644
index 0000000000..01cd481266
--- /dev/null
+++ b/test/files/run/t9944.scala
@@ -0,0 +1,7 @@
+
+import scala.tools.partest.ParserTest
+
+object Test extends ParserTest {
+
+ def code = s"""class C { def g = 42 ; def f = s""\"123\r\n$${ g }\r\n123\r\n""\"}"""
+}
diff --git a/test/files/run/t9946a.scala b/test/files/run/t9946a.scala
new file mode 100644
index 0000000000..491fb31f7b
--- /dev/null
+++ b/test/files/run/t9946a.scala
@@ -0,0 +1,14 @@
+package p1 {
+ object O {
+ private case class N(a: Any)
+ lazy val x: AnyRef = N
+ lazy val y: AnyRef = new { assert(N != null) }
+ }
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ p1.O.x
+ p1.O.y
+ }
+}
diff --git a/test/files/run/t9946b.scala b/test/files/run/t9946b.scala
new file mode 100644
index 0000000000..ac102a38f7
--- /dev/null
+++ b/test/files/run/t9946b.scala
@@ -0,0 +1,12 @@
+class Test(private val x: String) {
+ lazy val y = x.reverse
+}
+object Test {
+ def getX(t: Test) = t.x
+ def main(args: Array[String]): Unit = {
+ val t = new Test("foo")
+ assert(t.y == "oof", t.y)
+ assert(t.x == "foo", t.x)
+ }
+}
+
diff --git a/test/files/run/t9946c.scala b/test/files/run/t9946c.scala
new file mode 100644
index 0000000000..f9fe68d48f
--- /dev/null
+++ b/test/files/run/t9946c.scala
@@ -0,0 +1,10 @@
+class Test(private[this] val x: String) {
+ lazy val y = x.reverse
+}
+object Test {
+ def main(args: Array[String]): Unit = {
+ val t = new Test("foo")
+ assert(t.y == "oof", t.y)
+ }
+}
+
diff --git a/test/files/run/test-cpp.check b/test/files/run/test-cpp.check
deleted file mode 100644
index 13f4c64be3..0000000000
--- a/test/files/run/test-cpp.check
+++ /dev/null
@@ -1,81 +0,0 @@
---- a
-+++ b
-@@ -36,3 +36,3 @@
- def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
-- locals: value args, value x, value y
-+ locals: value args
- startBlock: 1
-@@ -41,10 +41,6 @@
- 1:
-- 52 CONSTANT(2)
-- 52 STORE_LOCAL(value x)
- 52 SCOPE_ENTER value x
-- 53 LOAD_LOCAL(value x)
-- 53 STORE_LOCAL(value y)
- 53 SCOPE_ENTER value y
- 54 LOAD_MODULE object Predef
-- 54 LOAD_LOCAL(value y)
-+ 54 CONSTANT(2)
- 54 BOX INT
-@@ -91,3 +87,3 @@
- def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
-- locals: value args, value x, value y
-+ locals: value args, value x
- startBlock: 1
-@@ -100,7 +96,5 @@
- 81 SCOPE_ENTER value x
-- 82 LOAD_LOCAL(value x)
-- 82 STORE_LOCAL(value y)
- 82 SCOPE_ENTER value y
- 83 LOAD_MODULE object Predef
-- 83 LOAD_LOCAL(value y)
-+ 83 LOAD_LOCAL(value x)
- 83 BOX INT
-@@ -134,3 +128,3 @@
- def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
-- locals: value args, value x, value y
-+ locals: value args
- startBlock: 1
-@@ -139,10 +133,6 @@
- 1:
-- 66 THIS(TestAliasChainDerefThis)
-- 66 STORE_LOCAL(value x)
- 66 SCOPE_ENTER value x
-- 67 LOAD_LOCAL(value x)
-- 67 STORE_LOCAL(value y)
- 67 SCOPE_ENTER value y
- 68 LOAD_MODULE object Predef
-- 68 LOAD_LOCAL(value y)
-+ 68 THIS(Object)
- 68 CALL_METHOD scala.Predef.println (dynamic)
-@@ -175,3 +165,3 @@
- def test(x: Int (INT)): Unit {
-- locals: value x, value y
-+ locals: value x
- startBlock: 1
-@@ -180,7 +170,5 @@
- 1:
-- 29 LOAD_LOCAL(value x)
-- 29 STORE_LOCAL(value y)
- 29 SCOPE_ENTER value y
- 30 LOAD_MODULE object Predef
-- 30 LOAD_LOCAL(value y)
-+ 30 LOAD_LOCAL(value x)
- 30 BOX INT
-@@ -222,7 +210,5 @@
- 96 SCOPE_ENTER variable x
-- 97 LOAD_LOCAL(variable x)
-- 97 STORE_LOCAL(variable y)
- 97 SCOPE_ENTER variable y
- 98 LOAD_MODULE object Predef
-- 98 LOAD_LOCAL(variable y)
-+ 98 LOAD_LOCAL(variable x)
- 98 BOX INT
-@@ -232,6 +218,4 @@
- 100 STORE_LOCAL(variable y)
-- 101 LOAD_LOCAL(variable y)
-- 101 STORE_LOCAL(variable x)
- 102 LOAD_MODULE object Predef
-- 102 LOAD_LOCAL(variable x)
-+ 102 LOAD_LOCAL(variable y)
- 102 BOX INT
diff --git a/test/files/run/test-cpp.scala b/test/files/run/test-cpp.scala
deleted file mode 100644
index 4fca67d51e..0000000000
--- a/test/files/run/test-cpp.scala
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
- * The only change is in the decision to replace a LOAD_LOCAL(l)
- * in the copy-propagation performed before ClosureElimination.
- *
- * In the general case, the local variable 'l' is connected through
- * an alias chain with other local variables and at the end of the
- * alias chain there may be a Value, call it 'v'.
- *
- * If 'v' is cheaper to access (it is a Deref(This) or Const(_)), then
- * replace the instruction to load it from the cheaper place.
- * Otherwise, we use the local variable at the end of the alias chain
- * instead of 'l'.
- */
-
-import scala.tools.partest.IcodeComparison
-
-object Test extends IcodeComparison {
- override def printIcodeAfterPhase = "dce"
-}
-
-import scala.util.Random._
-
-/**
- * The example in the bug report (Issue-5321): an alias chain which store
- * an Unknown. Should remove local variable 'y'.
- */
-object TestBugReport {
- def test(x: Int) = {
- val y = x
- println(y)
- }
-}
-
-/**
- * The code taken from scala.tools.nsc.settings.Settings:
- * After inlining of the setter is performed, there is an opportunity for
- * copy-propagation to eliminate some local variables.
- */
-object TestSetterInline {
- private var _postSetHook: this.type => Unit = (x: this.type) => ()
- def withPostSetHook(f: this.type => Unit): this.type = { _postSetHook = f ; this }
-}
-
-
-/**
- * The access of the local variable 'y' should be replaced by the
- * constant.
- */
-object TestAliasChainConstant {
-
- def main(args: Array[String]): Unit = {
- val x = 2
- val y = x
- println(y)
- }
-}
-
-/**
- * At the end of the alias chain we have a reference to 'this'.
- * The local variables should be all discarded and replace by a
- * direct reference to this
- */
-class TestAliasChainDerefThis {
-
- def main(args: Array[String]): Unit = {
- val x = this
- val y = x
- println(y)
- }
-}
-
-/**
- * At the end of the alias chain, there is the value of a field.
- * The use of variable 'y' should be replaced by 'x', not by an access
- * to the field 'f' since it is more costly.
- */
-object TestAliasChainDerefField {
- def f = nextInt
-
- def main(args: Array[String]): Unit = {
- val x = f
- val y = x
- println(y)
- }
-}
-
-
-/**
- * The first time 'println' is called, 'x' is replaced by 'y'
- * and the second time, 'y' is replaced by 'x'. But none of them
- * can be removed.
- */
-object TestDifferentBindings {
-
- def main(args: Array[String]): Unit = {
- var x = nextInt
- var y = x
- println(y)
-
- y = nextInt
- x = y
- println(x)
- }
-}
diff --git a/test/files/run/toolbox_console_reporter.check b/test/files/run/toolbox_console_reporter.check
index 1395c68740..fca10ba458 100644
--- a/test/files/run/toolbox_console_reporter.check
+++ b/test/files/run/toolbox_console_reporter.check
@@ -1,8 +1,8 @@
hello
============compiler console=============
-warning: method foo in object Utils is deprecated: test
+warning: method foo in object Utils is deprecated (since 2.10.0): test
=========================================
============compiler messages============
-Info(NoPosition,method foo in object Utils is deprecated: test,WARNING)
+Info(NoPosition,method foo in object Utils is deprecated (since 2.10.0): test,WARNING)
=========================================
diff --git a/test/files/run/toolbox_silent_reporter.check b/test/files/run/toolbox_silent_reporter.check
index 2d05b1e3f8..dff89f635f 100644
--- a/test/files/run/toolbox_silent_reporter.check
+++ b/test/files/run/toolbox_silent_reporter.check
@@ -1,4 +1,4 @@
hello
============compiler messages============
-Info(NoPosition,method foo in object Utils is deprecated: test,WARNING)
+Info(NoPosition,method foo in object Utils is deprecated (since 2.10.0): test,WARNING)
=========================================
diff --git a/test/files/run/trailing-commas.check b/test/files/run/trailing-commas.check
new file mode 100644
index 0000000000..0dc4335ccd
--- /dev/null
+++ b/test/files/run/trailing-commas.check
@@ -0,0 +1,9 @@
+
+scala> // test varargs in patterns
+
+scala> val List(x, y, _*,
+) = 42 :: 17 :: Nil
+x: Int = 42
+y: Int = 17
+
+scala> :quit
diff --git a/test/files/run/trailing-commas.scala b/test/files/run/trailing-commas.scala
new file mode 100644
index 0000000000..6a7f1bb55f
--- /dev/null
+++ b/test/files/run/trailing-commas.scala
@@ -0,0 +1,7 @@
+object Test extends scala.tools.partest.ReplTest {
+ def code = """
+// test varargs in patterns
+val List(x, y, _*,
+) = 42 :: 17 :: Nil
+"""
+}
diff --git a/test/files/run/trait-clonable.scala b/test/files/run/trait-clonable.scala
new file mode 100644
index 0000000000..5be59d2586
--- /dev/null
+++ b/test/files/run/trait-clonable.scala
@@ -0,0 +1,11 @@
+// minimization of failure in run/t4813.scala related to the special
+// case for default methods that override methods owned by Object.class in
+// Java interfaces.
+trait C[A >: Null <: AnyRef] { override def clone(): A = null }
+trait X extends C[X]
+class D extends X { def foo = (this: X).clone() }
+object Test {
+ def main(args: Array[String]) {
+ assert(new D().foo == null)
+ }
+}
diff --git a/test/files/run/trait-default-specialize.check b/test/files/run/trait-default-specialize.check
new file mode 100644
index 0000000000..1034d1c703
--- /dev/null
+++ b/test/files/run/trait-default-specialize.check
@@ -0,0 +1,3 @@
+public abstract void T.t(java.lang.Object)
+0
+0
diff --git a/test/files/run/trait-default-specialize.scala b/test/files/run/trait-default-specialize.scala
new file mode 100644
index 0000000000..6faa9d5f47
--- /dev/null
+++ b/test/files/run/trait-default-specialize.scala
@@ -0,0 +1,14 @@
+trait T[@specialized(Int) A] {
+ def t(a: A): Unit
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ class TInt extends T[Int] { def t(a : Int) = println(a) }
+ val tMethods = classOf[TInt].getInterfaces.head.getMethods.filter(_.getName == "t")
+ println(tMethods.map(_.toString).sorted.mkString("\n"))
+ new TInt().t(0)
+ def call[A](t: T[A], a: A) = t.t(a)
+ call[Int](new TInt(), 0)
+ }
+}
diff --git a/test/files/run/trait-defaults-modules.scala b/test/files/run/trait-defaults-modules.scala
new file mode 100644
index 0000000000..93fc74baff
--- /dev/null
+++ b/test/files/run/trait-defaults-modules.scala
@@ -0,0 +1,20 @@
+trait T1 { def a: Any }
+
+trait T2 extends T1 { object a; object b; private object c; def usec: Any = c}
+trait T3 extends T2
+
+class C1 extends T1 { object a; object b }
+class C2 extends C1
+class C3 extends T2
+class C4 extends T3
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val (c1, c2, c3, c4) = (new C1, new C2, new C3, new C4)
+ c1.a; c1.b; (c1: T1).a
+ c2.a; c2.b; (c2: T1).a
+ c3.a; c3.b; (c3: T1).a; c3.usec
+ c4.a; c4.b; (c4: T1).a; c4.usec
+ }
+
+}
diff --git a/test/files/run/trait-defaults-modules2/T_1.scala b/test/files/run/trait-defaults-modules2/T_1.scala
new file mode 100644
index 0000000000..962acdade1
--- /dev/null
+++ b/test/files/run/trait-defaults-modules2/T_1.scala
@@ -0,0 +1,4 @@
+trait T {
+ private object O
+ def useO: Any = O
+}
diff --git a/test/files/run/trait-defaults-modules2/Test_2.scala b/test/files/run/trait-defaults-modules2/Test_2.scala
new file mode 100644
index 0000000000..a1c49f5ddd
--- /dev/null
+++ b/test/files/run/trait-defaults-modules2/Test_2.scala
@@ -0,0 +1,5 @@
+object Test extends T {
+ def main(args: Array[String]): Unit = {
+ useO
+ }
+}
diff --git a/test/files/run/trait-defaults-modules3.scala b/test/files/run/trait-defaults-modules3.scala
new file mode 100644
index 0000000000..8790a95f4c
--- /dev/null
+++ b/test/files/run/trait-defaults-modules3.scala
@@ -0,0 +1,8 @@
+object Test {
+ def main(args: Array[String]): Unit = {
+ object O
+ val x = O
+ val y = O
+ assert(x eq y)
+ }
+}
diff --git a/test/files/run/trait-fields-override-lazy.check b/test/files/run/trait-fields-override-lazy.check
new file mode 100644
index 0000000000..9e4a9fe6c2
--- /dev/null
+++ b/test/files/run/trait-fields-override-lazy.check
@@ -0,0 +1,2 @@
+warning: there was one feature warning; re-run with -feature for details
+ok
diff --git a/test/files/run/trait-fields-override-lazy.scala b/test/files/run/trait-fields-override-lazy.scala
new file mode 100644
index 0000000000..2c1cf0e3b0
--- /dev/null
+++ b/test/files/run/trait-fields-override-lazy.scala
@@ -0,0 +1,13 @@
+trait T {
+ protected lazy val lv: Boolean = ???
+}
+
+object Test extends App {
+ val overrideLazy = new T {
+ override lazy val lv = true
+ def foo = lv
+ }
+
+ assert(overrideLazy.foo)
+ println("ok")
+}
diff --git a/test/files/run/trait-renaming.check b/test/files/run/trait-renaming.check
deleted file mode 100644
index b2e5affde5..0000000000
--- a/test/files/run/trait-renaming.check
+++ /dev/null
@@ -1,2 +0,0 @@
-public static int bippy.A$B$1$class.f(bippy.A$B$1)
-public static void bippy.A$B$1$class.$init$(bippy.A$B$1)
diff --git a/test/files/run/trait-renaming/A_1.scala b/test/files/run/trait-renaming/A_1.scala
deleted file mode 100644
index d0fab7bfc3..0000000000
--- a/test/files/run/trait-renaming/A_1.scala
+++ /dev/null
@@ -1,15 +0,0 @@
-package bippy {
- class A {
- def f = {
- trait B {
- def f = 5
- }
- trait C {
- def g = 10
- }
- new B with C { }
- }
-
- def g = Class.forName("bippy.A$B$1$class")
- }
-}
diff --git a/test/files/run/trait-renaming/B_2.scala b/test/files/run/trait-renaming/B_2.scala
deleted file mode 100644
index 174e929fe2..0000000000
--- a/test/files/run/trait-renaming/B_2.scala
+++ /dev/null
@@ -1,5 +0,0 @@
-object Test {
- def main(args: Array[String]): Unit = {
- (new bippy.A).g.getDeclaredMethods.map(_.toString).sorted foreach println
- }
-}
diff --git a/test/files/run/trait-static-clash.scala b/test/files/run/trait-static-clash.scala
new file mode 100644
index 0000000000..603cf6b6e5
--- /dev/null
+++ b/test/files/run/trait-static-clash.scala
@@ -0,0 +1,10 @@
+trait T {
+ def foo = 1
+ def foo(t: T) = 2
+}
+object Test extends T {
+ def main(args: Array[String]) {
+ assert(foo == 1)
+ assert(foo(this) == 2)
+ }
+}
diff --git a/test/files/run/trait-static-forwarder.check b/test/files/run/trait-static-forwarder.check
new file mode 100644
index 0000000000..d81cc0710e
--- /dev/null
+++ b/test/files/run/trait-static-forwarder.check
@@ -0,0 +1 @@
+42
diff --git a/test/files/run/trait-static-forwarder/Test.java b/test/files/run/trait-static-forwarder/Test.java
new file mode 100644
index 0000000000..89012c0162
--- /dev/null
+++ b/test/files/run/trait-static-forwarder/Test.java
@@ -0,0 +1,5 @@
+public final class Test {
+ public static void main(String... args) {
+ System.out.println(T.foo());
+ }
+}
diff --git a/test/files/run/trait-static-forwarder/forwarders.scala b/test/files/run/trait-static-forwarder/forwarders.scala
new file mode 100644
index 0000000000..d6ee9a081d
--- /dev/null
+++ b/test/files/run/trait-static-forwarder/forwarders.scala
@@ -0,0 +1,5 @@
+trait T
+
+object T {
+ def foo = 42
+}
diff --git a/test/files/run/trait-super-calls.scala b/test/files/run/trait-super-calls.scala
new file mode 100644
index 0000000000..df405d0f13
--- /dev/null
+++ b/test/files/run/trait-super-calls.scala
@@ -0,0 +1,127 @@
+object t1 {
+ trait T { def f = 1 }
+ trait U extends T
+ class C extends U { def t = super.f }
+}
+
+object t2 {
+ class A { def f = 1 }
+ trait T extends A { override def f = 2 }
+ class B extends A
+ class C extends B with T {
+ def t1 = super.f
+ def t2 = super[T].f
+ def t3 = super[B].f
+ }
+}
+
+object t3 {
+ class A { def f = 1 }
+ trait T extends A
+ class B extends A { override def f = 2 }
+ class C extends B with T {
+ def t1 = super.f
+ // def t2 = super[T].f // error: cannot emit super call (test exists)
+ def t3 = super[B].f
+ }
+}
+
+object t4 {
+ trait T1 { def f = 1 }
+ trait T2 { self: T1 => override def f = 2 }
+ trait U extends T1 with T2
+ class C extends U {
+ def t1 = super.f
+ def t2 = super[U].f
+ }
+}
+
+object t5 {
+ trait T { override def hashCode = -1 }
+ trait U extends T
+ class C extends U {
+ def t1 = super[U].hashCode
+ def t2 = super.hashCode
+ }
+}
+
+object t6 {
+ trait T { def f = 1 }
+ trait U1 extends T { override def f = 2 }
+ trait U2 extends T { override def f = 3 }
+ class C1 extends T with U1 with U2 {
+ def t1 = super.f
+ def t2 = super[T].f
+ def t3 = super[U1].f
+ def t4 = super[U2].f
+ }
+ class C2 extends T with U2 with U1 {
+ def t1 = super.f
+ }
+}
+
+object t7 {
+ trait T1 { def f = 1 }
+ trait T2 { _: T1 => override def f = 2 }
+ trait U extends T1 with T2
+ trait V extends U with T2
+ class C extends V {
+ def t1 = super.f
+ def t2 = super[V].f
+ }
+}
+
+object t8 {
+ trait HasNewBuilder { def newBuilder: Int }
+ trait GenericTraversableTemplate extends HasNewBuilder { def newBuilder = 0 }
+ trait Iterable extends GenericTraversableTemplate
+ trait MutMapLike extends HasNewBuilder { override def newBuilder = 1 }
+ trait MutMap extends Iterable with MutMapLike
+ class TrieMap extends MutMap with MutMapLike
+}
+
+object Test {
+ def e(a: Any, b: Any) = assert(a == b, s"expected: $b\ngot: $a")
+
+ def main(args: Array[String]): Unit = {
+ e(new t1.C().t, 1)
+
+ val c2 = new t2.C
+ e(c2.f, 2)
+ e(c2.t1, 2)
+ e(c2.t2, 2)
+ e(c2.t3, 1)
+
+ val c3 = new t3.C
+ e(c3.f, 2)
+ e(c3.t1, 2)
+ e(c3.t3, 2)
+
+ val c4 = new t4.C
+ e(c4.f, 2)
+ e(c4.t1, 2)
+ e(c4.t2, 2)
+
+ val c5 = new t5.C
+ e(c5.hashCode, -1)
+ e(c5.t1, -1)
+ e(c5.t2, -1)
+
+ val c6a = new t6.C1
+ val c6b = new t6.C2
+ e(c6a.f, 3)
+ e(c6a.t1, 3)
+ e(c6a.t2, 1)
+ e(c6a.t3, 2)
+ e(c6a.t4, 3)
+ e(c6b.f, 2)
+ e(c6b.t1, 2)
+
+ val c7 = new t7.C
+ e(c7.f, 2)
+ e(c7.t1, 2)
+ e(c7.t2, 2)
+
+ e(new t8.TrieMap().newBuilder, 1)
+ }
+}
diff --git a/test/files/run/trait_fields_bytecode.scala b/test/files/run/trait_fields_bytecode.scala
new file mode 100644
index 0000000000..d87412f43e
--- /dev/null
+++ b/test/files/run/trait_fields_bytecode.scala
@@ -0,0 +1,23 @@
+trait TFinal { final val bla: Int = 123 }
+
+// bla should be final in C
+class CFinal extends TFinal
+
+
+trait TConst { final val C = "S" }
+// there should be a C method in `T$class`!
+class CConst extends TConst { }
+
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val f1 = classOf[CFinal].getDeclaredMethod("bla")
+ import java.lang.reflect.Modifier._
+ assert(isFinal(f1.getModifiers), f1)
+
+ classOf[CConst].getMethod("C")
+
+ import language.reflectiveCalls
+ assert(new CConst().asInstanceOf[{def C: String}].C == "S")
+ }
+}
diff --git a/test/files/run/trait_fields_final.scala b/test/files/run/trait_fields_final.scala
new file mode 100644
index 0000000000..8b32e5b47d
--- /dev/null
+++ b/test/files/run/trait_fields_final.scala
@@ -0,0 +1,21 @@
+// TODO: clarify meaning of final in traits
+// In the new compiler, there's no final modifier after mixin for `meh`'s setter,
+// whereas 2.12.0-M3 makes meh's trait setter final.
+// NOTE: bytecode is identical, but the scalasignature is different
+trait Foo { self: Meh =>
+ def bar(x: String) = x == "a"
+ private final val meh = bar("a")
+}
+
+abstract class Meh extends Foo
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val setter = classOf[Meh].getDeclaredMethod("Foo$_setter_$Foo$$meh_$eq", java.lang.Boolean.TYPE)
+ val getter = classOf[Meh].getDeclaredMethod("Foo$$meh")
+ import java.lang.reflect.Modifier._
+ assert(isFinal(setter.getModifiers), setter)
+ assert(isFinal(getter.getModifiers), getter)
+ }
+
+}
diff --git a/test/files/run/trait_fields_init.check b/test/files/run/trait_fields_init.check
new file mode 100644
index 0000000000..84c1a2ead9
--- /dev/null
+++ b/test/files/run/trait_fields_init.check
@@ -0,0 +1,21 @@
+x
+y
+z
+abstract
+public
+protected
+abstract protected
+private
+private[this]
+abstract
+public
+protected
+abstract protected
+private
+private[this]
+abstract
+public
+protected
+abstract protected
+private
+private[this]
diff --git a/test/files/run/trait_fields_init.scala b/test/files/run/trait_fields_init.scala
new file mode 100644
index 0000000000..496911d538
--- /dev/null
+++ b/test/files/run/trait_fields_init.scala
@@ -0,0 +1,55 @@
+trait T {
+ val abs: String
+ protected val protabs: String
+ val pub = "public"
+ protected val prot = "protected"
+ private val privvy = "private"
+ private[this] val privateThis = "private[this]"
+ // TODO:
+ // final val const = "const"
+
+ trait Nested { println(abs + privateThis) }
+
+ object NO {
+ println(abs)
+ println(pub)
+ println(prot)
+ println(protabs)
+ println(privvy)
+ println(privateThis)
+ }
+
+ trait NT {
+ println(abs)
+ println(pub)
+ println(prot)
+ println(protabs)
+ println(privvy)
+ println(privateThis)
+ }
+
+ class NC {
+ println(abs)
+ println(pub)
+ println(prot)
+ println(protabs)
+ println(privvy)
+ println(privateThis)
+ }
+}
+
+class C extends AnyRef with T {
+ println("x")
+ val abs = "abstract"
+ println("y")
+ val protabs = "abstract protected"
+ final val const = "const"
+ println("z")
+}
+
+object Test extends C {
+ def main(args: Array[String]): Unit = {
+ NO
+ new NT{}
+ new NC
+}} \ No newline at end of file
diff --git a/test/files/run/trait_fields_repl.check b/test/files/run/trait_fields_repl.check
new file mode 100644
index 0000000000..d03a565c7b
--- /dev/null
+++ b/test/files/run/trait_fields_repl.check
@@ -0,0 +1,11 @@
+
+scala> trait B { val y = "a" }
+defined trait B
+
+scala> trait T extends B { val x: y.type = y }
+defined trait T
+
+scala> println((new T{}).x)
+a
+
+scala> :quit
diff --git a/test/files/run/trait_fields_repl.scala b/test/files/run/trait_fields_repl.scala
new file mode 100644
index 0000000000..311477b7d2
--- /dev/null
+++ b/test/files/run/trait_fields_repl.scala
@@ -0,0 +1,10 @@
+// TODO: fix AME when this runs in REPL
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ def code = """
+trait B { val y = "a" }
+trait T extends B { val x: y.type = y }
+println((new T{}).x)
+"""
+}
diff --git a/test/files/run/trait_fields_three_layer_overrides.check b/test/files/run/trait_fields_three_layer_overrides.check
new file mode 100644
index 0000000000..8bb45803c5
--- /dev/null
+++ b/test/files/run/trait_fields_three_layer_overrides.check
@@ -0,0 +1,2 @@
+the real universe.TypeTag
+1
diff --git a/test/files/run/trait_fields_three_layer_overrides.scala b/test/files/run/trait_fields_three_layer_overrides.scala
new file mode 100644
index 0000000000..9d7aa94341
--- /dev/null
+++ b/test/files/run/trait_fields_three_layer_overrides.scala
@@ -0,0 +1,25 @@
+// interesting hierarchies/overrides distilled from reflect/compiler
+
+trait Aliases {
+ val TypeTag = "universe.TypeTag"
+}
+trait AliasesOverrides extends Aliases { // or self: Aliases =>
+ override val TypeTag = "the real universe.TypeTag"
+}
+class Context extends Aliases with AliasesOverrides
+
+
+
+trait SymbolTable {
+ def currentRunId: Int = -1
+}
+trait ReflectSetup extends SymbolTable {
+ override val currentRunId = 1
+}
+class G extends SymbolTable with ReflectSetup
+
+
+object Test extends App {
+ println((new Context).TypeTag)
+ println((new G).currentRunId)
+} \ No newline at end of file
diff --git a/test/files/run/trait_fields_volatile.scala b/test/files/run/trait_fields_volatile.scala
new file mode 100644
index 0000000000..eedb6de1c2
--- /dev/null
+++ b/test/files/run/trait_fields_volatile.scala
@@ -0,0 +1,13 @@
+// bytecode should reflect volatile annotation
+trait VolatileAbort {
+ @volatile private var abortflag = false
+}
+class DefaultSignalling extends VolatileAbort
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val field = classOf[DefaultSignalling].getDeclaredFields.find(_.getName.contains("abortflag")).get
+ assert(java.lang.reflect.Modifier.isVolatile(field.getModifiers), field)
+ }
+
+}
diff --git a/test/files/run/try-2.check b/test/files/run/try-2.check
index 987d3462df..7fd45414da 100644
--- a/test/files/run/try-2.check
+++ b/test/files/run/try-2.check
@@ -1,4 +1,4 @@
-try-2.scala:41: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+try-2.scala:41: warning: a pure expression does nothing in statement position
10;
^
exception happened
diff --git a/test/files/run/try.check b/test/files/run/try.check
index f742ccb0df..d9521c2362 100644
--- a/test/files/run/try.check
+++ b/test/files/run/try.check
@@ -1,4 +1,4 @@
-try.scala:65: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+try.scala:65: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
1+1;
^
1 + 1 = 2
diff --git a/test/files/run/tuple-zipped.scala b/test/files/run/tuple-zipped.scala
deleted file mode 100644
index 37ac52977f..0000000000
--- a/test/files/run/tuple-zipped.scala
+++ /dev/null
@@ -1,41 +0,0 @@
-
-import scala.language.postfixOps
-
-object Test {
- val xs1 = List.range(1, 100)
- val xs2 = xs1.view
- val xs3 = xs1 take 10
- val ss1 = Stream from 1
- val ss2 = ss1.view
- val ss3 = ss1 take 10
- val as1 = 1 to 100 toArray
- val as2 = as1.view
- val as3 = as1 take 10
-
- def xss1 = List[Seq[Int]](xs1, xs2, xs3, ss1, ss2, ss3, as1, as2, as3)
- def xss2 = List[Seq[Int]](xs1, xs2, xs3, ss3, as1, as2, as3) // no infinities
- def xss3 = List[Seq[Int]](xs2, xs3, ss3, as1) // representative sampling
-
- def main(args: Array[String]): Unit = {
- for (cc1 <- xss1 ; cc2 <- xss2) {
- val sum1 = (cc1, cc2).zipped map { case (x, y) => x + y } sum
- val sum2 = (cc1, cc2).zipped map (_ + _) sum
-
- assert(sum1 == sum2)
- }
-
- for (cc1 <- xss1 ; cc2 <- xss2 ; cc3 <- xss3) {
- val sum1 = (cc1, cc2, cc3).zipped map { case (x, y, z) => x + y + z } sum
- val sum2 = (cc1, cc2, cc3).zipped map (_ + _ + _) sum
-
- assert(sum1 == sum2)
- }
-
- assert((ss1, ss1).zipped exists ((x, y) => true))
- assert((ss1, ss1, ss1).zipped exists ((x, y, z) => true))
-
- assert(!(ss1, ss2, 1 to 3).zipped.exists(_ + _ + _ > 100000))
- assert((1 to 3, ss1, ss2).zipped.forall(_ + _ + _ > 0))
- assert((ss1, 1 to 3, ss2).zipped.map(_ + _ + _).size == 3)
- }
-}
diff --git a/test/files/run/unittest_collection.check b/test/files/run/unittest_collection.check
index df1629dd7e..6fda32d713 100644
--- a/test/files/run/unittest_collection.check
+++ b/test/files/run/unittest_collection.check
@@ -1 +1 @@
-warning: there was one deprecation warning; re-run with -deprecation for details
+warning: there was one deprecation warning (since 2.11.0); re-run with -deprecation for details
diff --git a/test/files/run/various-flat-classpath-types.scala b/test/files/run/various-flat-classpath-types.scala
index d39019e885..bc54ffb6cc 100644
--- a/test/files/run/various-flat-classpath-types.scala
+++ b/test/files/run/various-flat-classpath-types.scala
@@ -5,7 +5,7 @@
import java.io.{File => JFile, FileInputStream, FileOutputStream}
import java.util.zip.{ZipEntry, ZipOutputStream}
import scala.reflect.io.{Directory, File}
-import scala.tools.nsc.classpath.FlatClassPath.RootPackage
+import scala.tools.nsc.util.ClassPath.RootPackage
import scala.tools.nsc.classpath.PackageNameUtils
import scala.tools.nsc.io.Jar
@@ -80,7 +80,6 @@ object Test {
private val compiler = new scala.tools.nsc.MainClass
private val appRunner = new scala.tools.nsc.MainGenericRunner
- private val classPathImplFlag = "-YclasspathImpl:flat"
private val javaClassPath = sys.props("java.class.path")
// creates a test dir in a temporary dir containing compiled files of this test
@@ -166,13 +165,13 @@ object Test {
val classPath = mkPath(javaClassPath, binDir.path, zipsDir.path + "/Bin.zip", jarsDir.path + "/Bin.jar")
val sourcePath = mkPath(srcDir.path, zipsDir.path + "/Src.zip", jarsDir.path + "/Src.jar")
- compiler.process(Array(classPathImplFlag, "-cp", classPath, "-sourcepath", sourcePath,
+ compiler.process(Array("-cp", classPath, "-sourcepath", sourcePath,
"-d", outDir.path, s"${srcDir.path}/Main.scala"))
}
private def runApp(): Unit = {
val classPath = mkPath(javaClassPath, outDir.path, binDir.path, zipsDir.path + "/Bin.zip", jarsDir.path + "/Bin.jar")
- appRunner.process(Array(classPathImplFlag, "-cp", classPath, "Main"))
+ appRunner.process(Array("-cp", classPath, "Main"))
}
private def createStandardSrcHierarchy(baseFileName: String): Unit =
@@ -200,7 +199,7 @@ object Test {
private def compileSrc(baseFileName: String, destination: JFile = outDir): Unit = {
val srcDirPath = srcDir.path
- compiler.process(Array(classPathImplFlag, "-cp", javaClassPath, "-d", destination.path,
+ compiler.process(Array("-cp", javaClassPath, "-d", destination.path,
s"$srcDirPath/$baseFileName.scala", s"$srcDirPath/nested/Nested$baseFileName.scala"))
}
diff --git a/test/files/run/virtpatmat_staging.flags b/test/files/run/virtpatmat_staging.flags
index 0a22f7c729..bec3aa96e9 100644
--- a/test/files/run/virtpatmat_staging.flags
+++ b/test/files/run/virtpatmat_staging.flags
@@ -1,2 +1,2 @@
-Yrangepos:false
--Xexperimental
+-Yvirtpatmat
diff --git a/test/files/run/xMigration.check b/test/files/run/xMigration.check
index cd860bf394..b812d6a282 100644
--- a/test/files/run/xMigration.check
+++ b/test/files/run/xMigration.check
@@ -1,47 +1,47 @@
scala> Map(1 -> "eis").values // no warn
-res0: Iterable[String] = MapLike(eis)
+res0: Iterable[String] = MapLike.DefaultValuesIterable(eis)
scala> :setting -Xmigration:none
scala> Map(1 -> "eis").values // no warn
-res1: Iterable[String] = MapLike(eis)
+res1: Iterable[String] = MapLike.DefaultValuesIterable(eis)
scala> :setting -Xmigration:any
scala> Map(1 -> "eis").values // warn
<console>:12: warning: method values in trait MapLike has changed semantics in version 2.8.0:
-`values` returns `Iterable[B]` rather than `Iterator[B]`.
+`values` returns `Iterable[V]` rather than `Iterator[V]`.
Map(1 -> "eis").values // warn
^
-res2: Iterable[String] = MapLike(eis)
+res2: Iterable[String] = MapLike.DefaultValuesIterable(eis)
scala> :setting -Xmigration:2.8
scala> Map(1 -> "eis").values // no warn
-res3: Iterable[String] = MapLike(eis)
+res3: Iterable[String] = MapLike.DefaultValuesIterable(eis)
scala> :setting -Xmigration:2.7
scala> Map(1 -> "eis").values // warn
<console>:12: warning: method values in trait MapLike has changed semantics in version 2.8.0:
-`values` returns `Iterable[B]` rather than `Iterator[B]`.
+`values` returns `Iterable[V]` rather than `Iterator[V]`.
Map(1 -> "eis").values // warn
^
-res4: Iterable[String] = MapLike(eis)
+res4: Iterable[String] = MapLike.DefaultValuesIterable(eis)
scala> :setting -Xmigration:2.11
scala> Map(1 -> "eis").values // no warn
-res5: Iterable[String] = MapLike(eis)
+res5: Iterable[String] = MapLike.DefaultValuesIterable(eis)
scala> :setting -Xmigration // same as :any
scala> Map(1 -> "eis").values // warn
<console>:12: warning: method values in trait MapLike has changed semantics in version 2.8.0:
-`values` returns `Iterable[B]` rather than `Iterator[B]`.
+`values` returns `Iterable[V]` rather than `Iterator[V]`.
Map(1 -> "eis").values // warn
^
-res6: Iterable[String] = MapLike(eis)
+res6: Iterable[String] = MapLike.DefaultValuesIterable(eis)
scala> :quit