summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
Diffstat (limited to 'test/files')
-rw-r--r--test/files/instrumented/InstrumentationTest.check6
-rw-r--r--test/files/instrumented/indy-symbol-literal.scala19
-rw-r--r--test/files/instrumented/inline-in-constructors.flags2
-rw-r--r--test/files/jvm/actor-exceptions.check1
-rw-r--r--test/files/jvm/actor-exceptions.scala67
-rw-r--r--test/files/jvm/actor-executor.check20
-rw-r--r--test/files/jvm/actor-executor.scala78
-rw-r--r--test/files/jvm/actor-executor2.check21
-rw-r--r--test/files/jvm/actor-executor2.scala92
-rw-r--r--test/files/jvm/actor-executor3.check20
-rw-r--r--test/files/jvm/actor-executor3.scala66
-rw-r--r--test/files/jvm/actor-getstate.check2
-rw-r--r--test/files/jvm/actor-getstate.scala87
-rw-r--r--test/files/jvm/actor-link-getstate.check2
-rw-r--r--test/files/jvm/actor-link-getstate.scala65
-rw-r--r--test/files/jvm/actor-looping.check5
-rw-r--r--test/files/jvm/actor-looping.scala33
-rw-r--r--test/files/jvm/actor-normal-exit.check2
-rw-r--r--test/files/jvm/actor-normal-exit.scala38
-rw-r--r--test/files/jvm/actor-receivewithin.check16
-rw-r--r--test/files/jvm/actor-receivewithin.scala72
-rw-r--r--test/files/jvm/actor-sync-send-timeout.scala48
-rw-r--r--test/files/jvm/actor-termination.check2
-rw-r--r--test/files/jvm/actor-termination.scala19
-rw-r--r--test/files/jvm/actor-uncaught-exception.check2
-rw-r--r--test/files/jvm/actor-uncaught-exception.scala64
-rw-r--r--test/files/jvm/actor-uncaught-exception2.check2
-rw-r--r--test/files/jvm/actor-uncaught-exception2.scala63
-rw-r--r--test/files/jvm/annotations.check3
-rw-r--r--test/files/jvm/annotations.flags1
-rw-r--r--test/files/jvm/bytecode-test-example.flags1
-rw-r--r--test/files/jvm/bytecode-test-example/Foo_1.flags1
-rw-r--r--test/files/jvm/constant-optimization/Foo_1.flags1
-rw-r--r--test/files/jvm/constant-optimization/Foo_1.scala9
-rw-r--r--test/files/jvm/constant-optimization/Test.scala27
-rw-r--r--test/files/jvm/daemon-actor-termination.check2
-rw-r--r--test/files/jvm/daemon-actor-termination.scala40
-rw-r--r--test/files/jvm/future-alarm.check20
-rw-r--r--test/files/jvm/future-alarm.scala23
-rw-r--r--test/files/jvm/future-awaitall-zero.check1
-rw-r--r--test/files/jvm/future-awaitall-zero.scala24
-rw-r--r--test/files/jvm/future-spec.check4
-rw-r--r--test/files/jvm/future-spec/FutureTests.scala295
-rw-r--r--test/files/jvm/future-termination.check1
-rw-r--r--test/files/jvm/future-termination.scala21
-rw-r--r--test/files/jvm/innerClassAttribute.check54
-rw-r--r--test/files/jvm/innerClassAttribute/Classes_1.scala101
-rw-r--r--test/files/jvm/innerClassAttribute/Test.scala223
-rw-r--r--test/files/jvm/interpreter.check4
-rw-r--r--test/files/jvm/javaReflection.check99
-rw-r--r--test/files/jvm/nooptimise/Foo_1.flags1
-rw-r--r--test/files/jvm/nooptimise/Foo_1.scala8
-rw-r--r--test/files/jvm/nooptimise/Test.scala23
-rw-r--r--test/files/jvm/patmat_opt_ignore_underscore.check1
-rw-r--r--test/files/jvm/patmat_opt_ignore_underscore.flags1
-rw-r--r--test/files/jvm/patmat_opt_ignore_underscore/Analyzed_1.scala29
-rw-r--r--test/files/jvm/patmat_opt_ignore_underscore/test.scala15
-rw-r--r--test/files/jvm/patmat_opt_no_nullcheck.check1
-rw-r--r--test/files/jvm/patmat_opt_no_nullcheck.flags1
-rw-r--r--test/files/jvm/patmat_opt_no_nullcheck/Analyzed_1.scala24
-rw-r--r--test/files/jvm/patmat_opt_no_nullcheck/test.scala8
-rw-r--r--test/files/jvm/patmat_opt_primitive_typetest.check1
-rw-r--r--test/files/jvm/patmat_opt_primitive_typetest.flags1
-rw-r--r--test/files/jvm/patmat_opt_primitive_typetest/Analyzed_1.scala24
-rw-r--r--test/files/jvm/patmat_opt_primitive_typetest/test.scala8
-rw-r--r--test/files/jvm/reactor-exceptionOnSend.check2
-rw-r--r--test/files/jvm/reactor-exceptionOnSend.scala58
-rw-r--r--test/files/jvm/reactor-producer-consumer.check10
-rw-r--r--test/files/jvm/reactor-producer-consumer.scala97
-rw-r--r--test/files/jvm/reactor.check22
-rw-r--r--test/files/jvm/reactor.scala72
-rw-r--r--test/files/jvm/replyablereactor.check5
-rw-r--r--test/files/jvm/replyablereactor.scala59
-rw-r--r--test/files/jvm/replyablereactor2.check5
-rw-r--r--test/files/jvm/replyablereactor2.scala58
-rw-r--r--test/files/jvm/replyablereactor3.check5
-rw-r--r--test/files/jvm/replyablereactor3.scala57
-rw-r--r--test/files/jvm/replyablereactor4.check5
-rw-r--r--test/files/jvm/replyablereactor4.scala57
-rw-r--r--test/files/jvm/replyreactor-react-sender.check1
-rw-r--r--test/files/jvm/replyreactor-react-sender.scala53
-rw-r--r--test/files/jvm/replyreactor.check1
-rw-r--r--test/files/jvm/replyreactor.scala43
-rw-r--r--test/files/jvm/scala-concurrent-tck.check1
-rw-r--r--test/files/jvm/scala-concurrent-tck.scala157
-rw-r--r--test/files/jvm/scheduler-adapter.check6
-rw-r--r--test/files/jvm/scheduler-adapter.scala54
-rw-r--r--test/files/jvm/serialization-new.check28
-rw-r--r--test/files/jvm/serialization.check28
-rw-r--r--test/files/jvm/t1449.scala28
-rw-r--r--test/files/jvm/t1948.scala26
-rw-r--r--test/files/jvm/t2359.check5
-rw-r--r--test/files/jvm/t2359.scala48
-rw-r--r--test/files/jvm/t2530.check21
-rw-r--r--test/files/jvm/t2530.scala98
-rw-r--r--test/files/jvm/t3102.check2
-rw-r--r--test/files/jvm/t3102.scala39
-rw-r--r--test/files/jvm/t3356.check3
-rw-r--r--test/files/jvm/t3356.scala58
-rw-r--r--test/files/jvm/t3365.check5
-rw-r--r--test/files/jvm/t3365.scala68
-rw-r--r--test/files/jvm/t3407.check10
-rw-r--r--test/files/jvm/t3407.scala21
-rw-r--r--test/files/jvm/t3412-channel.check10
-rw-r--r--test/files/jvm/t3412-channel.scala40
-rw-r--r--test/files/jvm/t3412.check10
-rw-r--r--test/files/jvm/t3412.scala34
-rw-r--r--test/files/jvm/t3470.check3
-rw-r--r--test/files/jvm/t3470.scala32
-rw-r--r--test/files/jvm/t3838.check1
-rw-r--r--test/files/jvm/t3838.scala17
-rw-r--r--test/files/jvm/t6941.check1
-rw-r--r--test/files/jvm/t6941.flags1
-rw-r--r--test/files/jvm/t6941/Analyzed_1.flags1
-rw-r--r--test/files/jvm/t6941/Analyzed_1.scala11
-rw-r--r--test/files/jvm/t6941/test.scala15
-rw-r--r--test/files/jvm/t7006.check29
-rw-r--r--test/files/jvm/t7006/Foo_1.flags1
-rw-r--r--test/files/jvm/t7006/Foo_1.scala10
-rw-r--r--test/files/jvm/t7006/Test.scala19
-rw-r--r--test/files/jvm/t7146.check7
-rw-r--r--test/files/jvm/t7146.scala28
-rw-r--r--test/files/jvm/t8582.check3
-rw-r--r--test/files/jvm/t8582.flags1
-rw-r--r--test/files/jvm/t8786-sig.scala30
-rw-r--r--test/files/jvm/t8786/B_2.java2
-rw-r--r--test/files/jvm/t9105.check14
-rw-r--r--test/files/jvm/try-type-tests.scala43
-rw-r--r--test/files/jvm/unreachable.check (renamed from test/files/run/reflection-attachments.check)0
-rw-r--r--test/files/jvm/unreachable/Foo_1.flags2
-rw-r--r--test/files/jvm/varargs/JavaClass.java2
-rw-r--r--test/files/neg/abstract-inaccessible.check2
-rw-r--r--test/files/neg/abstract-inaccessible.flags2
-rw-r--r--test/files/neg/abstract-inaccessible.scala2
-rw-r--r--test/files/neg/ambiguous-same.check6
-rw-r--r--test/files/neg/ambiguous-same.scala15
-rw-r--r--test/files/neg/anytrait.check5
-rw-r--r--test/files/neg/beanInfoDeprecation.check6
-rw-r--r--test/files/neg/beanInfoDeprecation.flags1
-rw-r--r--test/files/neg/beanInfoDeprecation.scala2
-rw-r--r--test/files/neg/case-collision.check6
-rw-r--r--test/files/neg/case-collision.flags2
-rw-r--r--test/files/neg/case-collision2.flags2
-rw-r--r--test/files/neg/checksensible.check2
-rw-r--r--test/files/neg/choices.check3
-rw-r--r--test/files/neg/classmanifests_new_deprecations.check16
-rw-r--r--test/files/neg/compile-time-only-a.check8
-rw-r--r--test/files/neg/constrs.check2
-rw-r--r--test/files/neg/delayed-init-ref.check3
-rw-r--r--test/files/neg/deprecated-target.check4
-rw-r--r--test/files/neg/deprecated-target.flags1
-rw-r--r--test/files/neg/deprecated-target.scala1
-rw-r--r--test/files/neg/eta-expand-star-deprecation.check4
-rw-r--r--test/files/neg/eta-expand-star-deprecation.flags1
-rw-r--r--test/files/neg/eta-expand-star-deprecation.scala8
-rw-r--r--test/files/neg/eta-expand-star.check4
-rw-r--r--test/files/neg/forgot-interpolator.flags2
-rw-r--r--test/files/neg/hkgadt.check31
-rw-r--r--test/files/neg/hkgadt.scala35
-rw-r--r--test/files/neg/implicit-ambiguous-2.check4
-rw-r--r--test/files/neg/implicit-ambiguous-2.scala11
-rw-r--r--test/files/neg/implicit-ambiguous-invalid.check7
-rw-r--r--test/files/neg/implicit-ambiguous-invalid.flags (renamed from test/files/neg/t6375.flags)0
-rw-r--r--test/files/neg/implicit-ambiguous-invalid.scala6
-rw-r--r--test/files/neg/implicit-ambiguous.check4
-rw-r--r--test/files/neg/implicit-ambiguous.scala11
-rw-r--r--test/files/neg/inlineIndyLambdaPrivate.check16
-rw-r--r--test/files/neg/inlineIndyLambdaPrivate.flags1
-rw-r--r--test/files/neg/inlineIndyLambdaPrivate/A_1.java9
-rw-r--r--test/files/neg/inlineIndyLambdaPrivate/Test_2.scala3
-rw-r--r--test/files/neg/inlineMaxSize.flags2
-rw-r--r--test/files/neg/literals.check14
-rw-r--r--test/files/neg/literals.scala13
-rw-r--r--test/files/neg/logImplicits.check4
-rw-r--r--test/files/neg/lub-from-hell-2.check7
-rw-r--r--test/files/neg/lub-from-hell-2.scala13
-rw-r--r--test/files/neg/macro-invalidret.check2
-rw-r--r--test/files/neg/macro-invalidusage-badargs.check4
-rw-r--r--test/files/neg/maxerrs.check16
-rw-r--r--test/files/neg/maxerrs.flags1
-rw-r--r--test/files/neg/maxerrs.scala32
-rw-r--r--test/files/neg/maxwarns.check12
-rw-r--r--test/files/neg/maxwarns.flags1
-rw-r--r--test/files/neg/maxwarns.scala32
-rw-r--r--test/files/neg/missing-arg-list.check7
-rw-r--r--test/files/neg/missing-arg-list.scala3
-rw-r--r--test/files/neg/multi-array.check4
-rw-r--r--test/files/neg/names-defaults-neg-warn.check4
-rw-r--r--test/files/neg/names-defaults-neg.check58
-rw-r--r--test/files/neg/names-defaults-neg.scala4
-rw-r--r--test/files/neg/nested-fn-print.check2
-rw-r--r--test/files/neg/no-predef.check8
-rw-r--r--test/files/neg/optimiseDeprecated.check4
-rw-r--r--test/files/neg/optimiseDeprecated.flags1
-rw-r--r--test/files/neg/optimiseDeprecated.scala1
-rw-r--r--test/files/neg/outer-ref-checks.check24
-rw-r--r--test/files/neg/outer-ref-checks.flags1
-rw-r--r--test/files/neg/outer-ref-checks.scala106
-rw-r--r--test/files/neg/overloaded-implicit.flags2
-rw-r--r--test/files/neg/overloaded-unapply.check4
-rw-r--r--test/files/neg/override-object-no.check10
-rw-r--r--test/files/neg/override-object-no.scala11
-rw-r--r--test/files/neg/partestInvalidFlag.check4
-rw-r--r--test/files/neg/partestInvalidFlag.flags2
-rw-r--r--test/files/neg/protected-constructors.check21
-rw-r--r--test/files/neg/quasiquotes-syntax-error-position.check3
-rw-r--r--test/files/neg/sabin2.check2
-rw-r--r--test/files/neg/saferJavaConversions.scala6
-rw-r--r--test/files/neg/sammy_disabled.check4
-rw-r--r--test/files/neg/sammy_disabled.flags1
-rw-r--r--test/files/neg/sammy_disabled.scala3
-rw-r--r--test/files/neg/sammy_error.check4
-rw-r--r--test/files/neg/sammy_error.scala7
-rw-r--r--test/files/neg/sammy_error_exist_no_crash.check4
-rw-r--r--test/files/neg/sammy_error_exist_no_crash.flags1
-rw-r--r--test/files/neg/sammy_error_exist_no_crash.scala4
-rw-r--r--test/files/neg/sammy_expected.check6
-rw-r--r--test/files/neg/sammy_expected.scala5
-rw-r--r--test/files/neg/sammy_overload.check7
-rw-r--r--test/files/neg/sammy_overload.scala15
-rw-r--r--test/files/neg/sammy_restrictions.check47
-rw-r--r--test/files/neg/sammy_restrictions.scala26
-rw-r--r--test/files/neg/scopes.check2
-rw-r--r--test/files/neg/sd128.check17
-rw-r--r--test/files/neg/sd128/A.java3
-rw-r--r--test/files/neg/sd128/Test.scala19
-rw-r--r--test/files/neg/sealed-final-neg.check13
-rw-r--r--test/files/neg/sealed-final-neg.flags2
-rw-r--r--test/files/neg/sealed-final-neg.scala2
-rw-r--r--test/files/neg/specification-scopes.check18
-rw-r--r--test/files/neg/specification-scopes/P_1.scala9
-rw-r--r--test/files/neg/specification-scopes/P_2.scala43
-rw-r--r--test/files/neg/stmt-expr-discard.check4
-rw-r--r--test/files/neg/t10066.check7
-rw-r--r--test/files/neg/t10066.scala38
-rw-r--r--test/files/neg/t10068.check13
-rw-r--r--test/files/neg/t10068.flags1
-rw-r--r--test/files/neg/t10068.scala9
-rw-r--r--test/files/neg/t10097.check10
-rw-r--r--test/files/neg/t10097.flags1
-rw-r--r--test/files/neg/t10097.scala4
-rw-r--r--test/files/neg/t10097b.check6
-rw-r--r--test/files/neg/t10097b.flags1
-rw-r--r--test/files/neg/t10097b.scala3
-rw-r--r--test/files/neg/t1010.check2
-rwxr-xr-xtest/files/neg/t10207.check4
-rw-r--r--test/files/neg/t10207.scala16
-rw-r--r--test/files/neg/t1112.check4
-rw-r--r--test/files/neg/t1181.check6
-rw-r--r--test/files/neg/t1523.check4
-rw-r--r--test/files/neg/t1838.check6
-rw-r--r--test/files/neg/t1960.check11
-rw-r--r--test/files/neg/t1960.scala7
-rw-r--r--test/files/neg/t1980.flags2
-rw-r--r--test/files/neg/t200.check4
-rw-r--r--test/files/neg/t2102.check4
-rw-r--r--test/files/neg/t2712.flags1
-rw-r--r--test/files/neg/t2779.check4
-rw-r--r--test/files/neg/t278.check4
-rw-r--r--test/files/neg/t3234.check6
-rw-r--r--test/files/neg/t3234.flags1
-rw-r--r--test/files/neg/t3772.check7
-rw-r--r--test/files/neg/t3772.scala17
-rw-r--r--test/files/neg/t3871.check2
-rw-r--r--test/files/neg/t4158.check6
-rw-r--r--test/files/neg/t4425.flags1
-rw-r--r--test/files/neg/t4460a.check2
-rw-r--r--test/files/neg/t4460b.check2
-rw-r--r--test/files/neg/t4541.check2
-rw-r--r--test/files/neg/t4541b.check2
-rw-r--r--test/files/neg/t4851.check12
-rw-r--r--test/files/neg/t4877.flags1
-rw-r--r--test/files/neg/t5120.check2
-rw-r--r--test/files/neg/t5148.check10
-rw-r--r--test/files/neg/t5429.check2
-rw-r--r--test/files/neg/t5580b.scala2
-rw-r--r--test/files/neg/t5639b.flags1
-rw-r--r--test/files/neg/t565.check2
-rw-r--r--test/files/neg/t5761.check2
-rw-r--r--test/files/neg/t591.check4
-rw-r--r--test/files/neg/t591.scala3
-rw-r--r--test/files/neg/t6120.check4
-rw-r--r--test/files/neg/t6162-inheritance.check2
-rw-r--r--test/files/neg/t6162-overriding.check2
-rw-r--r--test/files/neg/t6214.check7
-rw-r--r--test/files/neg/t6289.check6
-rw-r--r--test/files/neg/t6323a.check6
-rw-r--r--test/files/neg/t6335.check8
-rw-r--r--test/files/neg/t6375.check27
-rw-r--r--test/files/neg/t6375.scala67
-rw-r--r--test/files/neg/t6406-regextract.check2
-rw-r--r--test/files/neg/t6446-additional.check30
-rw-r--r--test/files/neg/t6446-missing.check27
-rw-r--r--test/files/neg/t6446-show-phases.check27
-rw-r--r--test/files/neg/t6455.flags1
-rw-r--r--test/files/neg/t6455.scala4
-rw-r--r--test/files/neg/t6567.flags2
-rw-r--r--test/files/neg/t6666.check4
-rw-r--r--test/files/neg/t6675.flags2
-rw-r--r--test/files/neg/t6810.check28
-rw-r--r--test/files/neg/t6810.scala26
-rw-r--r--test/files/neg/t6829.check14
-rw-r--r--test/files/neg/t6920.check4
-rw-r--r--test/files/neg/t7014.check5
-rw-r--r--test/files/neg/t7014.flags1
-rw-r--r--test/files/neg/t7014/ThreadSafetyLevel_1.java (renamed from test/files/pos/t7014/ThreadSafetyLevel.java)4
-rw-r--r--test/files/neg/t7014/ThreadSafety_1.java (renamed from test/files/pos/t7014/ThreadSafety.java)4
-rw-r--r--test/files/neg/t7014/t7014_2.scala3
-rw-r--r--test/files/neg/t712.check3
-rw-r--r--test/files/neg/t7157.check48
-rw-r--r--test/files/neg/t7171.check5
-rw-r--r--test/files/neg/t7171b.check8
-rw-r--r--test/files/neg/t7187.check6
-rw-r--r--test/files/neg/t7187.flags1
-rw-r--r--test/files/neg/t7187.scala6
-rw-r--r--test/files/neg/t7294.check6
-rw-r--r--test/files/neg/t7294.flags1
-rw-r--r--test/files/neg/t7294b.check4
-rw-r--r--test/files/neg/t7294b.flags1
-rw-r--r--test/files/neg/t7475d.check7
-rw-r--r--test/files/neg/t7494-no-options.check30
-rw-r--r--test/files/neg/t7602.check4
-rw-r--r--test/files/neg/t7622-cyclic-dependency.check2
-rw-r--r--test/files/neg/t7622-cyclic-dependency/ThePlugin.scala2
-rw-r--r--test/files/neg/t7848-interp-warn.check28
-rw-r--r--test/files/neg/t7848-interp-warn.scala29
-rw-r--r--test/files/neg/t7860.check9
-rw-r--r--test/files/neg/t7860.flags1
-rw-r--r--test/files/neg/t7860.scala42
-rw-r--r--test/files/neg/t800.check12
-rw-r--r--test/files/neg/t8002-nested-scope.check4
-rw-r--r--test/files/neg/t8002-nested-scope.scala12
-rw-r--r--test/files/neg/t8006.check4
-rw-r--r--test/files/neg/t8035-deprecated.check6
-rw-r--r--test/files/neg/t8035-no-adapted-args.check4
-rw-r--r--test/files/neg/t8044-b.check4
-rw-r--r--test/files/neg/t8044-b.scala4
-rw-r--r--test/files/neg/t8044.check4
-rw-r--r--test/files/neg/t8044.scala4
-rw-r--r--test/files/neg/t8079a.check4
-rw-r--r--test/files/neg/t8079a.scala4
-rw-r--r--test/files/neg/t8217-local-alias-requires-rhs.check10
-rw-r--r--test/files/neg/t8417.check15
-rw-r--r--test/files/neg/t8417.flags1
-rw-r--r--test/files/neg/t8417.scala6
-rw-r--r--test/files/neg/t8667.check91
-rw-r--r--test/files/neg/t8667.scala37
-rw-r--r--test/files/neg/t8685.check48
-rw-r--r--test/files/neg/t8685.flags1
-rw-r--r--test/files/neg/t8685.scala54
-rw-r--r--test/files/neg/t8700a.check11
-rw-r--r--test/files/neg/t8700a.flags1
-rw-r--r--test/files/neg/t8700a/Bar.scala9
-rw-r--r--test/files/neg/t8700a/Baz.java11
-rw-r--r--test/files/neg/t8700a/Foo.java4
-rw-r--r--test/files/neg/t8700b.check11
-rw-r--r--test/files/neg/t8700b.flags1
-rw-r--r--test/files/neg/t8700b/Bar_2.scala9
-rw-r--r--test/files/neg/t8700b/Baz_1.java11
-rw-r--r--test/files/neg/t8700b/Foo_1.java4
-rw-r--r--test/files/neg/t8704.check11
-rw-r--r--test/files/neg/t8704.flags1
-rw-r--r--test/files/neg/t8704.scala7
-rw-r--r--test/files/neg/t876.check4
-rw-r--r--test/files/neg/t8764.check6
-rw-r--r--test/files/neg/t8764.scala9
-rw-r--r--test/files/neg/t8849.check7
-rw-r--r--test/files/neg/t8849.scala10
-rw-r--r--test/files/neg/t9045.check7
-rw-r--r--test/files/neg/t9045.scala8
-rw-r--r--test/files/neg/t9361.check11
-rw-r--r--test/files/neg/t9361.scala5
-rw-r--r--test/files/neg/t9382.check10
-rw-r--r--test/files/neg/t9382.scala6
-rw-r--r--test/files/neg/t9398.check7
-rw-r--r--test/files/neg/t9398.flags1
-rw-r--r--test/files/neg/t9398/data.scala5
-rw-r--r--test/files/neg/t9398/match.scala6
-rw-r--r--test/files/neg/t9527a.check7
-rw-r--r--test/files/neg/t9527a.scala8
-rw-r--r--test/files/neg/t9527b.check4
-rw-r--r--test/files/neg/t9527b.scala9
-rw-r--r--test/files/neg/t9535.check7
-rw-r--r--test/files/neg/t9535.scala7
-rw-r--r--test/files/neg/t9629.check17
-rw-r--r--test/files/neg/t9629.scala12
-rw-r--r--test/files/neg/t963.check10
-rw-r--r--test/files/neg/t9636.check6
-rw-r--r--test/files/neg/t9636.flags1
-rw-r--r--test/files/neg/t9636.scala17
-rw-r--r--test/files/neg/t9675.check27
-rw-r--r--test/files/neg/t9675.flags1
-rw-r--r--test/files/neg/t9675.scala24
-rw-r--r--test/files/neg/t9684.check9
-rw-r--r--test/files/neg/t9684.flags1
-rw-r--r--test/files/neg/t9684.scala9
-rw-r--r--test/files/neg/t9684b.check7
-rw-r--r--test/files/neg/t9684b.scala14
-rw-r--r--test/files/neg/t9781.check4
-rw-r--r--test/files/neg/t9781.scala4
-rw-r--r--test/files/neg/t9847.check45
-rw-r--r--test/files/neg/t9847.flags1
-rw-r--r--test/files/neg/t9847.scala23
-rw-r--r--test/files/neg/t9849.check7
-rw-r--r--test/files/neg/t9849.scala16
-rw-r--r--test/files/neg/t9953.check6
-rw-r--r--test/files/neg/t9953.flags1
-rw-r--r--test/files/neg/t9953.scala13
-rw-r--r--test/files/neg/trailing-commas.check130
-rw-r--r--test/files/neg/trailing-commas.scala56
-rw-r--r--test/files/neg/trait-defaults-super.check4
-rw-r--r--test/files/neg/trait-defaults-super.scala21
-rw-r--r--test/files/neg/trait-no-native.check4
-rw-r--r--test/files/neg/trait-no-native.scala4
-rw-r--r--test/files/neg/trait_fields_conflicts.check273
-rw-r--r--test/files/neg/trait_fields_conflicts.scala87
-rw-r--r--test/files/neg/trait_fields_deprecated_overriding.check6
-rw-r--r--test/files/neg/trait_fields_deprecated_overriding.flags1
-rw-r--r--test/files/neg/trait_fields_deprecated_overriding.scala11
-rw-r--r--test/files/neg/trait_fields_var_override.check5
-rw-r--r--test/files/neg/trait_fields_var_override.scala2
-rw-r--r--test/files/neg/type-diagnostics.check4
-rw-r--r--test/files/neg/unit-returns-value.check6
-rw-r--r--test/files/neg/userdefined_apply.flags1
-rw-r--r--test/files/neg/val_infer.check6
-rw-r--r--test/files/neg/val_infer.scala4
-rw-r--r--test/files/neg/val_sig_infer_match.check4
-rw-r--r--test/files/neg/val_sig_infer_match.scala22
-rw-r--r--test/files/neg/val_sig_infer_struct.check4
-rw-r--r--test/files/neg/val_sig_infer_struct.scala8
-rw-r--r--test/files/neg/variances.check2
-rw-r--r--test/files/neg/warn-inferred-any.check2
-rw-r--r--test/files/neg/warn-unused-implicits.check9
-rw-r--r--test/files/neg/warn-unused-implicits.flags1
-rw-r--r--test/files/neg/warn-unused-implicits.scala32
-rw-r--r--test/files/neg/warn-unused-imports.check5
-rw-r--r--test/files/neg/warn-unused-imports.flags2
-rw-r--r--test/files/neg/warn-unused-imports/sample_1.scala15
-rw-r--r--test/files/neg/warn-unused-imports/warn-unused-imports_2.scala6
-rw-r--r--test/files/neg/warn-unused-params.check18
-rw-r--r--test/files/neg/warn-unused-params.flags1
-rw-r--r--test/files/neg/warn-unused-params.scala69
-rw-r--r--test/files/neg/warn-unused-patvars.check12
-rw-r--r--test/files/neg/warn-unused-patvars.flags1
-rw-r--r--test/files/neg/warn-unused-patvars.scala53
-rw-r--r--test/files/neg/warn-unused-privates.check99
-rw-r--r--test/files/neg/warn-unused-privates.scala120
-rw-r--r--test/files/pos/MailBox.scala2
-rw-r--r--test/files/pos/SI-7060.flags1
-rw-r--r--test/files/pos/SI-7060.scala11
-rw-r--r--test/files/pos/alladin763.scala37
-rw-r--r--test/files/pos/arrays2.scala2
-rw-r--r--test/files/pos/constant-warning.check4
-rw-r--r--test/files/pos/constant-warning.flags1
-rw-r--r--test/files/pos/constant-warning.scala3
-rw-r--r--test/files/pos/fields_widen_trait_var.scala4
-rw-r--r--test/files/pos/fun_undo_eta.scala10
-rw-r--r--test/files/pos/functions.scala4
-rw-r--r--test/files/pos/hkgadt.scala27
-rw-r--r--test/files/pos/infer_override_def_args.flags (renamed from test/files/presentation/t4287c.flags)0
-rw-r--r--test/files/pos/infer_override_def_args.scala5
-rw-r--r--test/files/pos/inline-access-levels.flags2
-rw-r--r--test/files/pos/inliner2.flags1
-rw-r--r--test/files/pos/inliner2.scala57
-rw-r--r--test/files/pos/issue244.scala2
-rw-r--r--test/files/pos/java-type-annotations/NotNull.java6
-rw-r--r--test/files/pos/java-type-annotations/Test.java4
-rw-r--r--test/files/pos/javaConversions-2.10-ambiguity.scala4
-rw-r--r--test/files/pos/javaConversions-2.10-regression.scala6
-rw-r--r--test/files/pos/list-optim-check.flags1
-rw-r--r--test/files/pos/list-optim-check.scala21
-rw-r--r--test/files/pos/lub-from-hell.scala6
-rw-r--r--test/files/pos/native-warning.scala4
-rw-r--r--test/files/pos/overloaded_ho_fun.scala66
-rw-r--r--test/files/pos/sam_erasure_boundedwild.scala11
-rw-r--r--test/files/pos/sammy_ctor_arg.scala4
-rw-r--r--test/files/pos/sammy_exist.flags1
-rw-r--r--test/files/pos/sammy_extends_function.scala4
-rw-r--r--test/files/pos/sammy_implicit.scala11
-rw-r--r--test/files/pos/sammy_infer_argtype_subtypes.scala6
-rw-r--r--test/files/pos/sammy_inferargs.scala6
-rw-r--r--test/files/pos/sammy_overload.flags1
-rw-r--r--test/files/pos/sammy_overload.scala27
-rw-r--r--test/files/pos/sammy_override.flags1
-rw-r--r--test/files/pos/sammy_poly.flags1
-rw-r--r--test/files/pos/sammy_poly.scala13
-rw-r--r--test/files/pos/sammy_scope.flags1
-rw-r--r--test/files/pos/sammy_scope.scala4
-rw-r--r--test/files/pos/sammy_single.flags1
-rw-r--r--test/files/pos/sammy_twice.flags1
-rw-r--r--test/files/pos/sd219.scala11
-rw-r--r--test/files/pos/sd248/Prop_1.scala2
-rw-r--r--test/files/pos/sd248/Test_2.scala5
-rw-r--r--test/files/pos/sd248/package_1.scala3
-rw-r--r--test/files/pos/sd268.scala17
-rw-r--r--test/files/pos/sealed-final.flags1
-rw-r--r--test/files/pos/sealed-final.scala14
-rw-r--r--test/files/pos/shapeless-regression.scala16
-rw-r--r--test/files/pos/t10009.scala6
-rw-r--r--test/files/pos/t10066.scala38
-rw-r--r--test/files/pos/t10093.flags1
-rw-r--r--test/files/pos/t10093.scala5
-rw-r--r--test/files/pos/t10154.scala11
-rw-r--r--test/files/pos/t10154b.scala16
-rw-r--r--test/files/pos/t2171.flags1
-rw-r--r--test/files/pos/t2171.scala7
-rw-r--r--test/files/pos/t2293.scala4
-rw-r--r--test/files/pos/t2377b/Q.java13
-rw-r--r--test/files/pos/t2377b/a.scala5
-rw-r--r--test/files/pos/t2956/t2956.scala4
-rw-r--r--test/files/pos/t3234.flags1
-rw-r--r--test/files/pos/t3234.scala (renamed from test/files/neg/t3234.scala)10
-rw-r--r--test/files/pos/t3252.flags1
-rw-r--r--test/files/pos/t3252.scala15
-rw-r--r--test/files/pos/t3420.flags2
-rw-r--r--test/files/pos/t3430.flags1
-rw-r--r--test/files/pos/t3430.scala13
-rw-r--r--test/files/pos/t3688.scala4
-rw-r--r--test/files/pos/t3772.scala8
-rw-r--r--test/files/pos/t4237.scala15
-rw-r--r--test/files/pos/t4365/a_1.scala2
-rw-r--r--test/files/pos/t4365/b_1.scala2
-rw-r--r--test/files/pos/t4579.flags1
-rw-r--r--test/files/pos/t482.scala7
-rw-r--r--test/files/pos/t4840.flags2
-rw-r--r--test/files/pos/t4914.scala20
-rw-r--r--test/files/pos/t5120.scala2
-rw-r--r--test/files/pos/t5165b.flags1
-rw-r--r--test/files/pos/t5183.scala34
-rw-r--r--test/files/pos/t5240.scala8
-rw-r--r--test/files/pos/t5294b.scala36
-rw-r--r--test/files/pos/t5294c.scala30
-rw-r--r--test/files/pos/t533.scala11
-rw-r--r--test/files/pos/t5644/BoxesRunTime.java4
-rw-r--r--test/files/pos/t5729.scala6
-rw-r--r--test/files/pos/t5899.scala1
-rw-r--r--test/files/pos/t6091.scala4
-rw-r--r--test/files/pos/t6157.flags1
-rw-r--r--test/files/pos/t6157.scala25
-rw-r--r--test/files/pos/t6161b.scala22
-rw-r--r--test/files/pos/t6547.flags1
-rw-r--r--test/files/pos/t6547.scala6
-rw-r--r--test/files/pos/t6734.scala17
-rw-r--r--test/files/pos/t6778.scala5
-rw-r--r--test/files/pos/t6978.flags1
-rw-r--r--test/files/pos/t6978/J.java5
-rw-r--r--test/files/pos/t6978/S.scala7
-rw-r--r--test/files/pos/t7014/t7014.scala3
-rw-r--r--test/files/pos/t7088.scala8
-rw-r--r--test/files/pos/t7239.scala38
-rw-r--r--test/files/pos/t7294.scala6
-rw-r--r--test/files/pos/t7551.flags1
-rw-r--r--test/files/pos/t7551/A.java9
-rw-r--r--test/files/pos/t7551/T.scala9
-rw-r--r--test/files/pos/t7551/Test.scala5
-rw-r--r--test/files/pos/t7784.scala13
-rw-r--r--test/files/pos/t8002-nested-scope.scala20
-rw-r--r--test/files/pos/t8013.flags2
-rw-r--r--test/files/pos/t8040.flags1
-rw-r--r--test/files/pos/t8040.scala13
-rw-r--r--test/files/pos/t8044.scala15
-rw-r--r--test/files/pos/t8062.flags1
-rw-r--r--test/files/pos/t8062/A_1.scala5
-rw-r--r--test/files/pos/t8062/B_2.scala3
-rw-r--r--test/files/pos/t8079b.scala7
-rw-r--r--test/files/pos/t8306.flags1
-rw-r--r--test/files/pos/t8306.scala8
-rw-r--r--test/files/pos/t8310.flags1
-rw-r--r--test/files/pos/t8315.flags1
-rw-r--r--test/files/pos/t8315.scala12
-rw-r--r--test/files/pos/t8315b.flags1
-rw-r--r--test/files/pos/t8315b.scala11
-rw-r--r--test/files/pos/t8359-closelim-crash.flags1
-rw-r--r--test/files/pos/t8359-closelim-crash.scala23
-rw-r--r--test/files/pos/t8410.flags2
-rw-r--r--test/files/pos/t8429.scala7
-rw-r--r--test/files/pos/t8462.scala11
-rw-r--r--test/files/pos/t8862a.scala47
-rw-r--r--test/files/pos/t8862b.scala12
-rw-r--r--test/files/pos/t8873.scala1
-rw-r--r--test/files/pos/t8947/Macro_1.scala2
-rw-r--r--test/files/pos/t9020.scala6
-rw-r--r--test/files/pos/t9074.scala24
-rw-r--r--test/files/pos/t9074b.scala15
-rw-r--r--test/files/pos/t9111-inliner-workaround.flags2
-rw-r--r--test/files/pos/t9123.flags1
-rw-r--r--test/files/pos/t9123.scala10
-rw-r--r--test/files/pos/t9131.scala12
-rw-r--r--test/files/pos/t9178b.flags (renamed from test/files/neg/sammy_restrictions.flags)0
-rw-r--r--test/files/pos/t9178b.scala7
-rw-r--r--test/files/pos/t9326a.scala6
-rw-r--r--test/files/pos/t9397.scala12
-rw-r--r--test/files/pos/t9449.scala19
-rw-r--r--test/files/pos/t9479.scala15
-rw-r--r--test/files/pos/t9479b.scala15
-rw-r--r--test/files/pos/t9498.scala25
-rw-r--r--test/files/pos/t9542.scala8
-rw-r--r--test/files/pos/t9658.scala10
-rw-r--r--test/files/pos/t9665.scala7
-rw-r--r--test/files/pos/t9855.scala10
-rw-r--r--test/files/pos/t9855b.scala16
-rw-r--r--test/files/pos/t9918/package.scala1
-rw-r--r--test/files/pos/t9918/t9918.scala3
-rw-r--r--test/files/pos/t9920.scala6
-rw-r--r--test/files/pos/t9943.scala9
-rw-r--r--test/files/pos/tcpoly_bounds1.scala6
-rw-r--r--test/files/pos/trailing-commas.scala155
-rw-r--r--test/files/pos/trait-defaults-super.scala21
-rw-r--r--test/files/pos/trait-force-info.flags1
-rw-r--r--test/files/pos/trait-force-info.scala18
-rw-r--r--test/files/pos/trait_fields_dependent_conflict.scala20
-rw-r--r--test/files/pos/trait_fields_dependent_rebind.scala15
-rw-r--r--test/files/pos/trait_fields_inherit_double_def.scala20
-rw-r--r--test/files/pos/trait_fields_lambdalift.scala22
-rw-r--r--test/files/pos/trait_fields_nested_private_object.scala8
-rw-r--r--test/files/pos/trait_fields_nested_public_object.scala5
-rw-r--r--test/files/pos/trait_fields_owners.scala19
-rw-r--r--test/files/pos/trait_fields_private_this.scala5
-rw-r--r--test/files/pos/trait_fields_static_fwd.scala10
-rw-r--r--test/files/pos/trait_fields_var_override_deferred.scala2
-rw-r--r--test/files/pos/trait_fields_volatile.scala13
-rw-r--r--test/files/pos/trait_lazy_accessboundary.scala2
-rw-r--r--test/files/pos/typevar-in-prefix.scala9
-rw-r--r--test/files/pos/userdefined_apply.flags1
-rw-r--r--test/files/pos/userdefined_apply_poly_overload.flags1
-rw-r--r--test/files/pos/val_infer.scala5
-rw-r--r--test/files/pos/virtpatmat_exist1.scala3
-rw-r--r--test/files/presentation/callcc-interpreter/Runner.scala2
-rw-r--r--test/files/presentation/doc/doc.scala8
-rw-r--r--test/files/presentation/ide-bug-1000531/src/CrashOnLoad.scala2
-rw-r--r--test/files/presentation/random.check2
-rw-r--r--test/files/presentation/scope-completion-3.check14
-rw-r--r--test/files/presentation/scope-completion-3/src/Completions.scala2
-rw-r--r--test/files/presentation/t4287c.check11
-rw-r--r--test/files/presentation/t4287c/Test.scala3
-rw-r--r--test/files/presentation/t4287c/src/Foo.scala9
-rw-r--r--test/files/presentation/t5708.check2
-rw-r--r--test/files/presentation/t7678/Runner.scala2
-rw-r--r--test/files/presentation/t8459.check1
-rw-r--r--test/files/presentation/t8941.check2
-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.scala (renamed from test/files/pos/t4579.scala)2
-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-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_java8.flags1
-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.flags1
-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/neg/sammy_wrong_arity.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/neg/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.check (renamed from test/files/jvm/t1449.check)0
-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
-rw-r--r--test/files/scalacheck/CheckCollections.scala52
-rw-r--r--test/files/scalacheck/CheckEither.scala179
-rw-r--r--test/files/scalacheck/Ctrie.scala218
-rw-r--r--test/files/scalacheck/ReflectionExtractors.scala52
-rw-r--r--test/files/scalacheck/Unrolled.scala26
-rw-r--r--test/files/scalacheck/array-new.scala37
-rw-r--r--test/files/scalacheck/array-old.scala37
-rw-r--r--test/files/scalacheck/avl.scala112
-rw-r--r--test/files/scalacheck/duration.scala69
-rw-r--r--test/files/scalacheck/list.scala21
-rw-r--r--test/files/scalacheck/nan-ordering.scala130
-rw-r--r--test/files/scalacheck/parallel-collections/IntOperators.scala129
-rw-r--r--test/files/scalacheck/parallel-collections/IntValues.scala29
-rw-r--r--test/files/scalacheck/parallel-collections/Operators.scala36
-rw-r--r--test/files/scalacheck/parallel-collections/PairOperators.scala101
-rw-r--r--test/files/scalacheck/parallel-collections/PairValues.scala28
-rw-r--r--test/files/scalacheck/parallel-collections/ParallelArrayCheck.scala72
-rw-r--r--test/files/scalacheck/parallel-collections/ParallelArrayTest.scala112
-rw-r--r--test/files/scalacheck/parallel-collections/ParallelArrayViewCheck.scala122
-rw-r--r--test/files/scalacheck/parallel-collections/ParallelCtrieCheck.scala101
-rw-r--r--test/files/scalacheck/parallel-collections/ParallelHashMapCheck.scala100
-rw-r--r--test/files/scalacheck/parallel-collections/ParallelHashSetCheck.scala97
-rw-r--r--test/files/scalacheck/parallel-collections/ParallelHashTrieCheck.scala144
-rw-r--r--test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala477
-rw-r--r--test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala67
-rw-r--r--test/files/scalacheck/parallel-collections/ParallelRangeCheck.scala75
-rw-r--r--test/files/scalacheck/parallel-collections/ParallelSeqCheck.scala299
-rw-r--r--test/files/scalacheck/parallel-collections/ParallelSetCheck.scala62
-rw-r--r--test/files/scalacheck/parallel-collections/ParallelVectorCheck.scala67
-rw-r--r--test/files/scalacheck/parallel-collections/pc.scala71
-rw-r--r--test/files/scalacheck/primitive-eqeq.scala37
-rw-r--r--test/files/scalacheck/quasiquotes/ArbitraryTreesAndNames.scala295
-rw-r--r--test/files/scalacheck/quasiquotes/DefinitionConstructionProps.scala453
-rw-r--r--test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala290
-rw-r--r--test/files/scalacheck/quasiquotes/DeprecationProps.scala52
-rw-r--r--test/files/scalacheck/quasiquotes/ErrorProps.scala213
-rw-r--r--test/files/scalacheck/quasiquotes/ForProps.scala70
-rw-r--r--test/files/scalacheck/quasiquotes/LiftableProps.scala174
-rw-r--r--test/files/scalacheck/quasiquotes/PatternConstructionProps.scala36
-rw-r--r--test/files/scalacheck/quasiquotes/PatternDeconstructionProps.scala44
-rw-r--r--test/files/scalacheck/quasiquotes/QuasiquoteProperties.scala120
-rw-r--r--test/files/scalacheck/quasiquotes/RuntimeErrorProps.scala75
-rw-r--r--test/files/scalacheck/quasiquotes/TermConstructionProps.scala325
-rw-r--r--test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala256
-rw-r--r--test/files/scalacheck/quasiquotes/Test.scala19
-rw-r--r--test/files/scalacheck/quasiquotes/TypeConstructionProps.scala42
-rw-r--r--test/files/scalacheck/quasiquotes/TypeDeconstructionProps.scala78
-rw-r--r--test/files/scalacheck/quasiquotes/TypecheckedProps.scala215
-rw-r--r--test/files/scalacheck/quasiquotes/UnliftableProps.scala166
-rw-r--r--test/files/scalacheck/range.scala314
-rw-r--r--test/files/scalacheck/redblacktree.scala258
-rw-r--r--test/files/scalacheck/scan.scala19
-rw-r--r--test/files/scalacheck/substringTests.scala20
-rw-r--r--test/files/scalacheck/t2460.scala27
-rw-r--r--test/files/scalacheck/t4147.scala68
-rw-r--r--test/files/scalacheck/test.scala8
-rw-r--r--test/files/scalacheck/testdir/dep.scala7
-rw-r--r--test/files/scalacheck/testdir/test.scala10
-rw-r--r--test/files/scalacheck/treemap.scala154
-rw-r--r--test/files/scalacheck/treeset.scala155
-rw-r--r--test/files/specialized/SI-7343.scala2
-rw-r--r--test/files/specialized/fft.check2
-rw-r--r--test/files/specialized/tb3651.check2
-rw-r--r--test/files/specialized/tc3651.check2
-rw-r--r--test/files/specialized/td3651.check4
1237 files changed, 10965 insertions, 14552 deletions
diff --git a/test/files/instrumented/InstrumentationTest.check b/test/files/instrumented/InstrumentationTest.check
index c82d16bd34..d317fc4207 100644
--- a/test/files/instrumented/InstrumentationTest.check
+++ b/test/files/instrumented/InstrumentationTest.check
@@ -1,4 +1,3 @@
-#partest !avian
true
Method call statistics:
1 Foo1.<init>()V
@@ -7,8 +6,5 @@ Method call statistics:
1 instrumented/Foo2.someMethod()I
1 scala/DeprecatedConsole.<init>()V
1 scala/Predef$.println(Ljava/lang/Object;)V
- 1 scala/io/AnsiColor$class.$init$(Lscala/io/AnsiColor;)V
+ 1 scala/io/AnsiColor.$init$(Lscala/io/AnsiColor;)V
1 scala/runtime/BoxesRunTime.boxToBoolean(Z)Ljava/lang/Boolean;
-#partest avian
-!!!TEST SKIPPED!!!
-Instrumentation is not supported on Avian.
diff --git a/test/files/instrumented/indy-symbol-literal.scala b/test/files/instrumented/indy-symbol-literal.scala
new file mode 100644
index 0000000000..a1c333cf95
--- /dev/null
+++ b/test/files/instrumented/indy-symbol-literal.scala
@@ -0,0 +1,19 @@
+import scala.tools.partest.instrumented._
+import scala.tools.partest.instrumented.Instrumentation._
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ 'warmup
+ startProfiling()
+ var i = 0;
+ while (i < 2) {
+ 'foo.name
+ i += 1
+ }
+ stopProfiling()
+ // Only expect a single call to lookup the interned Symbol at each call site the defines
+ // a single literal.
+ val Symbol_apply = MethodCallTrace("scala/Symbol$", "apply", "(Ljava/lang/String;)Lscala/Symbol;")
+ assert(getStatistics.get(Symbol_apply) == Some(1), getStatistics);
+ }
+}
diff --git a/test/files/instrumented/inline-in-constructors.flags b/test/files/instrumented/inline-in-constructors.flags
index d1ebc4c940..63535a7f4f 100644
--- a/test/files/instrumented/inline-in-constructors.flags
+++ b/test/files/instrumented/inline-in-constructors.flags
@@ -1 +1 @@
--optimise -Ydelambdafy:inline -Ybackend:GenASM
+-opt:l:classpath
diff --git a/test/files/jvm/actor-exceptions.check b/test/files/jvm/actor-exceptions.check
deleted file mode 100644
index d86bac9de5..0000000000
--- a/test/files/jvm/actor-exceptions.check
+++ /dev/null
@@ -1 +0,0 @@
-OK
diff --git a/test/files/jvm/actor-exceptions.scala b/test/files/jvm/actor-exceptions.scala
deleted file mode 100644
index bdd983a0e8..0000000000
--- a/test/files/jvm/actor-exceptions.scala
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.{Actor, Exit}
-import Actor._
-
-case class MyException(text: String) extends Exception {
- override def fillInStackTrace() = this
-}
-
-case class MyOtherException(text: String) extends Exception {
- override def fillInStackTrace() = this
-}
-
-object Master extends Actor {
- trapExit = true
- def act() {
- try {
- link(Slave)
- Slave.start()
- for (i <- 0 until 10) Slave ! A
- react {
- case Exit(from, reason) =>
- println("OK")
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
-object Slave extends Actor {
- override def toString = "Slave"
- override def exceptionHandler: PartialFunction[Exception, Unit] = {
- case MyException(text) =>
- case other if !other.isInstanceOf[scala.util.control.ControlThrowable] => super.exceptionHandler(other)
- }
- def act() {
- try {
- var cnt = 0
- loop {
- react {
- case A =>
- cnt += 1
- if (cnt % 2 != 0) throw MyException("problem")
- if (cnt == 10) {
- throw MyOtherException("unhandled")
- }
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] &&
- !e.isInstanceOf[MyException] &&
- !e.isInstanceOf[MyOtherException] =>
- e.printStackTrace()
- }
- }
-}
-
-case object A
-
- def main(args: Array[String]) {
- Master.start()
- }
-}
diff --git a/test/files/jvm/actor-executor.check b/test/files/jvm/actor-executor.check
deleted file mode 100644
index bdbdb5c6a2..0000000000
--- a/test/files/jvm/actor-executor.check
+++ /dev/null
@@ -1,20 +0,0 @@
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
diff --git a/test/files/jvm/actor-executor.scala b/test/files/jvm/actor-executor.scala
deleted file mode 100644
index 0fc28b4d85..0000000000
--- a/test/files/jvm/actor-executor.scala
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import java.util.concurrent.Executors
-import scala.actors.{Actor, SchedulerAdapter}
-import Actor._
-
-trait AdaptedActor extends Actor {
- override def scheduler =
- Test.scheduler
-}
-
-object One extends AdaptedActor {
- def act() {
- try {
- Two.start()
- var i = 0
- loopWhile (i < 10000) {
- i += 1
- Two ! 'MsgForTwo
- react {
- case 'MsgForOne =>
- if (i % 1000 == 0)
- println("One: OK")
- if (i == 10000)
- Test.executor.shutdown()
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
-object Two extends AdaptedActor {
- def act() {
- try {
- var i = 0
- loopWhile (i < 10000) {
- i += 1
- react {
- case 'MsgForTwo =>
- if (i % 1000 == 0)
- println("Two: OK")
- One ! 'MsgForOne
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
- val executor =
- Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors())
-
- val scheduler =
- new SchedulerAdapter {
- def execute(block: => Unit) {
- val task = new Runnable {
- def run() { block }
- }
- try {
- executor.execute(task)
- } catch {
- case ree: java.util.concurrent.RejectedExecutionException =>
- task.run()
- }
- }
- }
-
- def main(args: Array[String]) {
- One.start()
- }
-}
diff --git a/test/files/jvm/actor-executor2.check b/test/files/jvm/actor-executor2.check
deleted file mode 100644
index da78f45836..0000000000
--- a/test/files/jvm/actor-executor2.check
+++ /dev/null
@@ -1,21 +0,0 @@
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-One exited
diff --git a/test/files/jvm/actor-executor2.scala b/test/files/jvm/actor-executor2.scala
deleted file mode 100644
index 5badf2ae7e..0000000000
--- a/test/files/jvm/actor-executor2.scala
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.{Actor, SchedulerAdapter, Exit}
-import Actor._
-import java.util.concurrent.{Executors, RejectedExecutionException}
-
-object One extends AdaptedActor {
- def act() {
- try {
- Two.start()
- var i = 0
- loopWhile (i < Test.NUM_MSG) {
- i += 1
- Two ! 'MsgForTwo
- react {
- case 'MsgForOne =>
- if (i % (Test.NUM_MSG/10) == 0)
- println("One: OK")
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
-object Two extends AdaptedActor {
- def act() {
- try {
- var i = 0
- loopWhile (i < Test.NUM_MSG) {
- i += 1
- react {
- case 'MsgForTwo =>
- if (i % (Test.NUM_MSG/10) == 0)
- println("Two: OK")
- One ! 'MsgForOne
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
-trait AdaptedActor extends Actor {
- override def scheduler =
- Test.scheduler
-}
-
- val NUM_MSG = 100000
-
- val executor =
- Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors())
-
- val scheduler =
- new SchedulerAdapter {
- def execute(block: => Unit) {
- val task = new Runnable {
- def run() { block }
- }
- try {
- executor.execute(task)
- } catch {
- case ree: RejectedExecutionException =>
- task.run() // run task on current thread
- }
- }
- }
-
- def main(args: Array[String]) {
- try {
- self.trapExit = true
- link(One)
- One.start()
-
- receive {
- case Exit(from, reason) =>
- println("One exited")
- Test.executor.shutdown()
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
diff --git a/test/files/jvm/actor-executor3.check b/test/files/jvm/actor-executor3.check
deleted file mode 100644
index bdbdb5c6a2..0000000000
--- a/test/files/jvm/actor-executor3.check
+++ /dev/null
@@ -1,20 +0,0 @@
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
diff --git a/test/files/jvm/actor-executor3.scala b/test/files/jvm/actor-executor3.scala
deleted file mode 100644
index f8b57d84b3..0000000000
--- a/test/files/jvm/actor-executor3.scala
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.Actor
-import scala.actors.scheduler.ExecutorScheduler
-import java.util.concurrent.Executors
-
-object One extends AdaptedActor {
- def act() {
- try {
- Two.start()
- var i = 0
- loopWhile (i < Test.NUM_MSG) {
- i += 1
- Two ! 'MsgForTwo
- react {
- case 'MsgForOne =>
- if (i % (Test.NUM_MSG/10) == 0)
- println("One: OK")
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
-object Two extends AdaptedActor {
- def act() {
- try {
- var i = 0
- loopWhile (i < Test.NUM_MSG) {
- i += 1
- react {
- case 'MsgForTwo =>
- if (i % (Test.NUM_MSG/10) == 0)
- println("Two: OK")
- One ! 'MsgForOne
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
-trait AdaptedActor extends Actor {
- override def scheduler =
- Test.scheduler
-}
-
- val NUM_MSG = 100000
-
- val executor =
- Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors())
-
- val scheduler = ExecutorScheduler(executor)
-
- def main(args: Array[String]) {
- One.start()
- }
-}
diff --git a/test/files/jvm/actor-getstate.check b/test/files/jvm/actor-getstate.check
deleted file mode 100644
index 2c94e48371..0000000000
--- a/test/files/jvm/actor-getstate.check
+++ /dev/null
@@ -1,2 +0,0 @@
-OK
-OK
diff --git a/test/files/jvm/actor-getstate.scala b/test/files/jvm/actor-getstate.scala
deleted file mode 100644
index 425efbe5e6..0000000000
--- a/test/files/jvm/actor-getstate.scala
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.{Reactor, Actor, TIMEOUT}
- import Actor._
-
- def assert(cond: => Boolean, hint: String) {
- if (!cond)
- println("FAIL ["+hint+"]")
- }
-
- def expectActorState(a: Reactor[T] forSome { type T }, s: Actor.State.Value) {
- var done = false
- var i = 0
- while (!done) {
- i = i + 1
- if (i == 10) { // only wait for 2 seconds total
- println("FAIL ["+a+": expected "+s+"]")
- done = true
- }
-
- Thread.sleep(200)
- if (a.getState == s) // success
- done = true
- }
- }
-
- def main(args: Array[String]) {
- actor {
- val a = new Reactor[Any] {
- def act() {
- assert(getState == Actor.State.Runnable, "runnable1")
- react {
- case 'go =>
- println("OK")
- }
- }
- }
- expectActorState(a, Actor.State.New)
-
- a.start()
- expectActorState(a, Actor.State.Suspended)
-
- a ! 'go
- expectActorState(a, Actor.State.Terminated)
-
- val b = new Actor {
- def act() {
- assert(getState == Actor.State.Runnable, "runnable2: "+getState)
- react {
- case 'go =>
- reactWithin(100000) {
- case TIMEOUT =>
- case 'go =>
- receive {
- case 'go =>
- }
- receiveWithin(100000) {
- case TIMEOUT =>
- case 'go =>
- println("OK")
- }
- }
- }
- }
- }
- expectActorState(b, Actor.State.New)
-
- b.start()
- expectActorState(b, Actor.State.Suspended)
-
- b ! 'go
- expectActorState(b, Actor.State.TimedSuspended)
-
- b ! 'go
- expectActorState(b, Actor.State.Blocked)
-
- b ! 'go
- expectActorState(b, Actor.State.TimedBlocked)
-
- b ! 'go
- expectActorState(b, Actor.State.Terminated)
- }
- }
-
-}
diff --git a/test/files/jvm/actor-link-getstate.check b/test/files/jvm/actor-link-getstate.check
deleted file mode 100644
index 9755447320..0000000000
--- a/test/files/jvm/actor-link-getstate.check
+++ /dev/null
@@ -1,2 +0,0 @@
-Done
-Terminated
diff --git a/test/files/jvm/actor-link-getstate.scala b/test/files/jvm/actor-link-getstate.scala
deleted file mode 100644
index d8b8ada1e6..0000000000
--- a/test/files/jvm/actor-link-getstate.scala
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.{Actor, Exit}
- import scala.actors.Actor._
-
-case class MyException(text: String) extends Exception(text) {
- override def fillInStackTrace() = this
-}
-
-object Slave extends Actor {
- def act() {
- try {
- loop {
- react {
- case 'doWork =>
- Console.out.println("Done")
- reply('done)
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
-object Master extends Actor {
- override def toString = "Master"
- def act() {
- try {
- link(Slave)
- Slave ! 'doWork
- react {
- case 'done =>
- throw new MyException("Master crashed")
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
-
- def main(args: Array[String]) {
- actor {
- try {
- self.trapExit = true
- link(Slave)
- Slave.start()
- Master.start()
- react {
- case Exit(from, reason) if (from == Slave) =>
- Console.out.println(Slave.getState)
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
-}
diff --git a/test/files/jvm/actor-looping.check b/test/files/jvm/actor-looping.check
deleted file mode 100644
index a6f5c2e73a..0000000000
--- a/test/files/jvm/actor-looping.check
+++ /dev/null
@@ -1,5 +0,0 @@
-received A
-received A
-received A
-received A
-received last A
diff --git a/test/files/jvm/actor-looping.scala b/test/files/jvm/actor-looping.scala
deleted file mode 100644
index 7bc6f1e5c5..0000000000
--- a/test/files/jvm/actor-looping.scala
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.Actor._
- case object A
-
- def main(args: Array[String]) {
- val a = actor {
- try {
- var cnt = 0
- loop {
- react {
- case A =>
- cnt += 1
- if (cnt % 2 != 0) continue
- if (cnt < 10)
- println("received A")
- else {
- println("received last A")
- exit()
- }
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-
- for (i <- 0 until 10) a ! A
- }
-}
diff --git a/test/files/jvm/actor-normal-exit.check b/test/files/jvm/actor-normal-exit.check
deleted file mode 100644
index 6865f83b90..0000000000
--- a/test/files/jvm/actor-normal-exit.check
+++ /dev/null
@@ -1,2 +0,0 @@
-Done
-slave exited for reason 'normal
diff --git a/test/files/jvm/actor-normal-exit.scala b/test/files/jvm/actor-normal-exit.scala
deleted file mode 100644
index 90495866e2..0000000000
--- a/test/files/jvm/actor-normal-exit.scala
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.{Actor, Exit}
- object Master extends Actor {
- trapExit = true
- def act() {
- try {
- Slave.start()
- react {
- case Exit(from, reason) =>
- println("slave exited for reason " + reason)
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- object Slave extends Actor {
- def act() {
- try {
- link(Master)
- println("Done")
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- def main(args: Array[String]) {
- Master.start()
- }
-}
diff --git a/test/files/jvm/actor-receivewithin.check b/test/files/jvm/actor-receivewithin.check
deleted file mode 100644
index a6a3e88c61..0000000000
--- a/test/files/jvm/actor-receivewithin.check
+++ /dev/null
@@ -1,16 +0,0 @@
-'msg
-'msg
-'msg
-'msg
-'msg
-TIMEOUT
-TIMEOUT
-TIMEOUT
-TIMEOUT
-TIMEOUT
-'msg2
-'msg2
-'msg2
-'msg2
-'msg2
-TIMEOUT
diff --git a/test/files/jvm/actor-receivewithin.scala b/test/files/jvm/actor-receivewithin.scala
deleted file mode 100644
index 5982462502..0000000000
--- a/test/files/jvm/actor-receivewithin.scala
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.{Actor, TIMEOUT}
-
-object A extends Actor {
- def act() {
- receive {
- case 'done =>
- var cnt = 0
- while (cnt < 500) {
- cnt += 1
- receiveWithin (0) {
- case 'msg =>
- if (cnt % 100 == 0)
- println("'msg")
- case TIMEOUT =>
- // should not happen
- println("FAIL1")
- }
- }
- cnt = 0
- while (cnt < 500) {
- cnt += 1
- receiveWithin (0) {
- case 'msg =>
- // should not happen
- println("FAIL2")
- case TIMEOUT =>
- if (cnt % 100 == 0)
- println("TIMEOUT")
- }
- }
- B ! 'next
- receive { case 'done => }
- cnt = 0
- while (cnt < 501) {
- cnt += 1
- receiveWithin (500) {
- case 'msg2 =>
- if (cnt % 100 == 0)
- println("'msg2")
- case TIMEOUT =>
- println("TIMEOUT")
- }
- }
- }
- }
-}
-
-object B extends Actor {
- def act() {
- A.start()
- for (_ <- 1 to 500) {
- A ! 'msg
- }
- A ! 'done
- receive {
- case 'next =>
- for (_ <- 1 to 500) {
- A ! 'msg2
- }
- A ! 'done
- }
- }
-}
-
- def main(args:Array[String]) {
- B.start()
- }
-}
diff --git a/test/files/jvm/actor-sync-send-timeout.scala b/test/files/jvm/actor-sync-send-timeout.scala
deleted file mode 100644
index 66a0b0a6ff..0000000000
--- a/test/files/jvm/actor-sync-send-timeout.scala
+++ /dev/null
@@ -1,48 +0,0 @@
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.Actor
-
-/* This test is a regression test for SI-4759.
- */
- val Runs = 5
-
- def main(args: Array[String]) = {
- var i = 0
- while (i < Runs) {
- i += 1
- A1 ! 1
- Thread.sleep(500)
- }
- //println("done sending to A1")
- }
-
-object A2 extends Actor {
- this.start()
- def act() {
- loop {
- react {
- case 'stop =>
- //println("A2 exiting")
- exit()
- case _ =>
- }
- }
- }
-}
-
-object A1 extends Actor {
- this.start()
- def act() {
- var i = 0
- loopWhile(i < Test.Runs) {
- i += 1
- react {
- case any =>
- A2 !? (500, any)
- if (i == Test.Runs)
- A2 ! 'stop
- }
- }
- }
-}
-}
diff --git a/test/files/jvm/actor-termination.check b/test/files/jvm/actor-termination.check
deleted file mode 100644
index e3f44d8b18..0000000000
--- a/test/files/jvm/actor-termination.check
+++ /dev/null
@@ -1,2 +0,0 @@
-I'm going to make you wait.
-Ok, I'm done.
diff --git a/test/files/jvm/actor-termination.scala b/test/files/jvm/actor-termination.scala
deleted file mode 100644
index 4a6bf92d48..0000000000
--- a/test/files/jvm/actor-termination.scala
+++ /dev/null
@@ -1,19 +0,0 @@
-
-/* Test that an actor that hasn't finished prevents termination */
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.Actor
- def main(args: Array[String]) {
- Actor.actor {
- try {
- println("I'm going to make you wait.")
- Thread.sleep(5000)
- println("Ok, I'm done.")
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-}
diff --git a/test/files/jvm/actor-uncaught-exception.check b/test/files/jvm/actor-uncaught-exception.check
deleted file mode 100644
index 2c94e48371..0000000000
--- a/test/files/jvm/actor-uncaught-exception.check
+++ /dev/null
@@ -1,2 +0,0 @@
-OK
-OK
diff --git a/test/files/jvm/actor-uncaught-exception.scala b/test/files/jvm/actor-uncaught-exception.scala
deleted file mode 100644
index c28ad2fa3c..0000000000
--- a/test/files/jvm/actor-uncaught-exception.scala
+++ /dev/null
@@ -1,64 +0,0 @@
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.{Actor, Exit}
-
-class MyException(msg: String) extends Exception(msg) {
- override def fillInStackTrace() = this
-}
-
-
- case object StartError extends Actor {
- def act() {
- try {
- throw new MyException("I don't want to run!")
- } catch {
- case e: Throwable if (!e.isInstanceOf[scala.util.control.ControlThrowable] &&
- !e.isInstanceOf[MyException]) =>
- e.printStackTrace()
- }
- }
- }
-
- case object MessageError extends Actor {
- def act() {
- try {
- react {
- case _ => throw new MyException("No message for me!")
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- case object Supervisor extends Actor {
- def act() {
- try {
- trapExit = true
- link(StartError)
- link(MessageError)
- StartError.start()
- MessageError.start()
-
- Actor.loop {
- react {
- case Exit(actor, reason) =>
- println("OK")
- if (actor == StartError)
- MessageError ! 'ping
- else
- exit()
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- def main(args: Array[String]) {
- Supervisor.start()
- }
-}
diff --git a/test/files/jvm/actor-uncaught-exception2.check b/test/files/jvm/actor-uncaught-exception2.check
deleted file mode 100644
index a54f374aed..0000000000
--- a/test/files/jvm/actor-uncaught-exception2.check
+++ /dev/null
@@ -1,2 +0,0 @@
-UncaughtException(StartError,None,None,Test$MyException: I don't want to run!)
-UncaughtException(MessageError,Some('ping),Some(Supervisor),Test$MyException: No message for me!)
diff --git a/test/files/jvm/actor-uncaught-exception2.scala b/test/files/jvm/actor-uncaught-exception2.scala
deleted file mode 100644
index 8327b4e19d..0000000000
--- a/test/files/jvm/actor-uncaught-exception2.scala
+++ /dev/null
@@ -1,63 +0,0 @@
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.{Actor, Exit, Debug}
-
-class MyException(msg: String) extends Exception(msg) {
- override def fillInStackTrace() = this
-}
-
- case object StartError extends Actor {
- def act() {
- try {
- throw new MyException("I don't want to run!")
- } catch {
- case e: Throwable if (!e.isInstanceOf[scala.util.control.ControlThrowable] &&
- !e.isInstanceOf[MyException]) =>
- e.printStackTrace()
- }
- }
- }
-
- case object MessageError extends Actor {
- def act() {
- try {
- react {
- case _ => throw new MyException("No message for me!")
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- case object Supervisor extends Actor {
- def act() {
- try {
- trapExit = true
- link(StartError)
- link(MessageError)
- StartError.start()
- MessageError.start()
-
- Actor.loop {
- react {
- case Exit(actor, reason) =>
- println(reason)
- if (actor == StartError)
- MessageError ! 'ping
- else
- exit()
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- def main(args: Array[String]) {
- Supervisor.start()
- }
-}
diff --git a/test/files/jvm/annotations.check b/test/files/jvm/annotations.check
index a8dc5ecdd1..43f85ca199 100644
--- a/test/files/jvm/annotations.check
+++ b/test/files/jvm/annotations.check
@@ -1,3 +1,6 @@
+annotations.scala:7: warning: class remote in package scala is deprecated (since 2.12.0): extend java.rmi.Remote instead and add @throws[java.rmi.RemoteException] to public methods
+ def foo: Unit = ()
+ ^
class java.rmi.RemoteException
class java.io.IOException
@java.lang.Deprecated()
diff --git a/test/files/jvm/annotations.flags b/test/files/jvm/annotations.flags
new file mode 100644
index 0000000000..c36e713ab8
--- /dev/null
+++ b/test/files/jvm/annotations.flags
@@ -0,0 +1 @@
+-deprecation \ No newline at end of file
diff --git a/test/files/jvm/bytecode-test-example.flags b/test/files/jvm/bytecode-test-example.flags
new file mode 100644
index 0000000000..213d7425d1
--- /dev/null
+++ b/test/files/jvm/bytecode-test-example.flags
@@ -0,0 +1 @@
+-opt:l:none
diff --git a/test/files/jvm/bytecode-test-example/Foo_1.flags b/test/files/jvm/bytecode-test-example/Foo_1.flags
deleted file mode 100644
index 49f2d2c4c8..0000000000
--- a/test/files/jvm/bytecode-test-example/Foo_1.flags
+++ /dev/null
@@ -1 +0,0 @@
--Ybackend:GenASM
diff --git a/test/files/jvm/constant-optimization/Foo_1.flags b/test/files/jvm/constant-optimization/Foo_1.flags
deleted file mode 100644
index 67a1dbe8da..0000000000
--- a/test/files/jvm/constant-optimization/Foo_1.flags
+++ /dev/null
@@ -1 +0,0 @@
--Ynooptimise -Yconst-opt -Ybackend:GenASM \ No newline at end of file
diff --git a/test/files/jvm/constant-optimization/Foo_1.scala b/test/files/jvm/constant-optimization/Foo_1.scala
deleted file mode 100644
index cb67ad4e90..0000000000
--- a/test/files/jvm/constant-optimization/Foo_1.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-class Foo_1 {
- def foo() {
- // constant optimization should eliminate all branches
- val i = 1
- val x = if (i != 1) null else "good"
- val y = if (x == null) "good" else x + ""
- println(y)
- }
-} \ No newline at end of file
diff --git a/test/files/jvm/constant-optimization/Test.scala b/test/files/jvm/constant-optimization/Test.scala
deleted file mode 100644
index dc0f8f6103..0000000000
--- a/test/files/jvm/constant-optimization/Test.scala
+++ /dev/null
@@ -1,27 +0,0 @@
-
-import scala.tools.partest.BytecodeTest
-import scala.tools.asm
-import asm.tree.InsnList
-import scala.collection.JavaConverters._
-
-object Test extends BytecodeTest {
- val comparisons = Set(asm.Opcodes.IF_ACMPEQ, asm.Opcodes.IF_ACMPNE, asm.Opcodes.IF_ICMPEQ, asm.Opcodes.IF_ICMPGE, asm.Opcodes.IF_ICMPGT, asm.Opcodes.IF_ICMPLE,
- asm.Opcodes.IF_ICMPLT, asm.Opcodes.IF_ICMPNE, asm.Opcodes.IFEQ, asm.Opcodes.IFGE, asm.Opcodes.IFGT, asm.Opcodes.IFLE, asm.Opcodes.IFLT,
- asm.Opcodes.IFNE, asm.Opcodes.IFNONNULL, asm.Opcodes.IFNULL)
-
- def show: Unit = {
- val classNode = loadClassNode("Foo_1")
- val methodNode = getMethod(classNode, "foo")
- // after optimization there should be no comparisons left
- val expected = 0
-
- val got = countComparisons(methodNode.instructions)
- assert(got == expected, s"expected $expected but got $got comparisons")
- }
-
- def countComparisons(insnList: InsnList): Int = {
- def isComparison(node: asm.tree.AbstractInsnNode): Boolean =
- (comparisons contains node.getOpcode)
- insnList.iterator.asScala count isComparison
- }
-} \ No newline at end of file
diff --git a/test/files/jvm/daemon-actor-termination.check b/test/files/jvm/daemon-actor-termination.check
deleted file mode 100644
index b2ff72fd0b..0000000000
--- a/test/files/jvm/daemon-actor-termination.check
+++ /dev/null
@@ -1,2 +0,0 @@
-MSG1
-MSG2
diff --git a/test/files/jvm/daemon-actor-termination.scala b/test/files/jvm/daemon-actor-termination.scala
deleted file mode 100644
index 9bac6340ba..0000000000
--- a/test/files/jvm/daemon-actor-termination.scala
+++ /dev/null
@@ -1,40 +0,0 @@
-
-/* Test that a daemon Actor that hasn't finished does not prevent termination */
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-
- import scala.actors.{Actor, DaemonActor}
- class MyDaemon extends DaemonActor {
- def act() {
- try {
- react {
- case 'hello =>
- println("MSG1")
- reply(())
- react {
- case 'bye =>
- println("done")
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- def main(args: Array[String]) {
- val daemon = new MyDaemon
- daemon.start()
- Actor.actor {
- try {
- daemon !? 'hello
- println("MSG2")
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-}
diff --git a/test/files/jvm/future-alarm.check b/test/files/jvm/future-alarm.check
deleted file mode 100644
index 01a87d1c4c..0000000000
--- a/test/files/jvm/future-alarm.check
+++ /dev/null
@@ -1,20 +0,0 @@
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
diff --git a/test/files/jvm/future-alarm.scala b/test/files/jvm/future-alarm.scala
deleted file mode 100644
index 3e71fa681c..0000000000
--- a/test/files/jvm/future-alarm.scala
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.Futures
- def main(args: Array[String]) {
- try {
- for (i <- 1 to 100000) {
- Futures.alarm(0)
- if (i % 10000 == 0)
- println("OK")
- }
- for (_ <- 1 to 10) {
- val ft = Futures.alarm(100)
- ft()
- println("OK")
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
diff --git a/test/files/jvm/future-awaitall-zero.check b/test/files/jvm/future-awaitall-zero.check
deleted file mode 100644
index d86bac9de5..0000000000
--- a/test/files/jvm/future-awaitall-zero.check
+++ /dev/null
@@ -1 +0,0 @@
-OK
diff --git a/test/files/jvm/future-awaitall-zero.scala b/test/files/jvm/future-awaitall-zero.scala
deleted file mode 100644
index 56f4bab16f..0000000000
--- a/test/files/jvm/future-awaitall-zero.scala
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.Futures._
- import scala.actors.Actor._
- def main(args: Array[String]) {
- try {
- val ft1 = future { reactWithin(10000) {
- case _ => println("FAIL")
- } }
-
- val ft2 = future { reactWithin(20000) {
- case _ => println("FAIL")
- } }
-
- val res = awaitAll(0, ft1, ft2)
- println("OK")
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
diff --git a/test/files/jvm/future-spec.check b/test/files/jvm/future-spec.check
index df1629dd7e..562d699bde 100644
--- a/test/files/jvm/future-spec.check
+++ b/test/files/jvm/future-spec.check
@@ -1 +1,3 @@
-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 19 deprecation warnings (since 2.12.0)
+warning: there were 20 deprecation warnings in total; re-run with -deprecation for details
diff --git a/test/files/jvm/future-spec/FutureTests.scala b/test/files/jvm/future-spec/FutureTests.scala
index efe9c59d7a..a1934efdd0 100644
--- a/test/files/jvm/future-spec/FutureTests.scala
+++ b/test/files/jvm/future-spec/FutureTests.scala
@@ -17,6 +17,19 @@ class FutureTests extends MinimalScalaTest {
case "NoReply" => Promise[String]().future
}
+ def fail(msg: String): Nothing = throw new AssertionError(msg)
+
+ def ECNotUsed[T](f: ExecutionContext => T): T = {
+ val p = Promise[Runnable]()
+ val unusedEC: ExecutionContext = new ExecutionContext {
+ def execute(r: Runnable) = p.success(r)
+ def reportFailure(t: Throwable): Unit = p.failure(t)
+ }
+ val t = f(unusedEC)
+ assert(p.future.value == None, "Future executed logic!")
+ t
+ }
+
val defaultTimeout = 5 seconds
/* future specification */
@@ -24,7 +37,7 @@ class FutureTests extends MinimalScalaTest {
"A future with custom ExecutionContext" should {
"shouldHandleThrowables" in {
val ms = new mutable.HashSet[Throwable] with mutable.SynchronizedSet[Throwable]
- implicit val ec = scala.concurrent.ExecutionContext.fromExecutorService(new scala.concurrent.forkjoin.ForkJoinPool(), {
+ implicit val ec = scala.concurrent.ExecutionContext.fromExecutor(new java.util.concurrent.ForkJoinPool(), {
t =>
ms += t
})
@@ -64,7 +77,61 @@ class FutureTests extends MinimalScalaTest {
Await.ready(waiting, 2000 millis)
ms.size mustBe (4)
- ec.shutdownNow()
+ //FIXME should check
+ }
+ }
+
+ "Futures" should {
+ "have proper toString representations" in {
+ import ExecutionContext.Implicits.global
+ val s = 5
+ val f = new Exception("foo")
+ val t = Try(throw f)
+
+ val expectFailureString = "Future(Failure("+f+"))"
+ val expectSuccessString = "Future(Success(5))"
+ val expectNotCompleteString = "Future(<not completed>)"
+
+ Future.successful(s).toString mustBe expectSuccessString
+ Future.failed(f).toString mustBe expectFailureString
+ Future.fromTry(t).toString mustBe expectFailureString
+ val p = Promise[Int]()
+ p.toString mustBe expectNotCompleteString
+ Promise[Int]().success(s).toString mustBe expectSuccessString
+ Promise[Int]().failure(f).toString mustBe expectFailureString
+ Await.ready(Future { throw f }, 2000 millis).toString mustBe expectFailureString
+ Await.ready(Future { s }, 2000 millis).toString mustBe expectSuccessString
+
+ Future.never.toString mustBe "Future(<never>)"
+ Future.unit.toString mustBe "Future(Success(()))"
+ }
+
+ "have proper const representation for success" in {
+ val s = "foo"
+ val f = Future.successful(s)
+
+ ECNotUsed(ec => f.onFailure({ case _ => fail("onFailure should not have been called") })(ec))
+ assert( ECNotUsed(ec => f.recover({ case _ => fail("recover should not have been called")})(ec)) eq f)
+ assert( ECNotUsed(ec => f.recoverWith({ case _ => fail("flatMap should not have been called")})(ec)) eq f)
+ assert(f.fallbackTo(f) eq f, "Future.fallbackTo must be the same instance as Future.fallbackTo")
+ }
+
+ "have proper const representation for failure" in {
+ val e = new Exception("foo")
+ val f = Future.failed[Future[String]](e)
+
+ assert(f.mapTo[String] eq f, "Future.mapTo must be the same instance as Future.mapTo")
+ assert(f.zip(f) eq f, "Future.zip must be the same instance as Future.zip")
+ assert(f.flatten eq f, "Future.flatten must be the same instance as Future.flatten")
+ assert(f.failed.value == Some(Success(e)), "Future.failed.failed must become successful") // SI-10034
+
+ ECNotUsed(ec => f.foreach(_ => fail("foreach should not have been called"))(ec))
+ ECNotUsed(ec => f.onSuccess({ case _ => fail("onSuccess should not have been called") })(ec))
+ assert( ECNotUsed(ec => f.map(_ => fail("map should not have been called"))(ec)) eq f)
+ assert( ECNotUsed(ec => f.flatMap(_ => fail("flatMap should not have been called"))(ec)) eq f)
+ assert( ECNotUsed(ec => f.filter(_ => fail("filter should not have been called"))(ec)) eq f)
+ assert( ECNotUsed(ec => f.collect({ case _ => fail("collect should not have been called")})(ec)) eq f)
+ assert( ECNotUsed(ec => f.zipWith(f)({ (_,_) => fail("zipWith should not have been called")})(ec)) eq f)
}
}
@@ -85,6 +152,49 @@ class FutureTests extends MinimalScalaTest {
Await.result(f, defaultTimeout) mustBe ("foo")
Await.result(p.future, defaultTimeout) mustBe (true)
}
+
+ "have a unit member representing an already completed Future containing Unit" in {
+ assert(Future.unit ne null, "Future.unit must not be null")
+ assert(Future.unit eq Future.unit, "Future.unit must be the same instance as Future.unit")
+ assert(Future.unit.isCompleted, "Future.unit must already be completed")
+ assert(Future.unit.value.get == Success(()), "Future.unit must contain a Success(())")
+ }
+
+ "have a never member representing a never completed Future of Nothing" in {
+
+ val test: Future[Nothing] = Future.never
+
+ //Verify stable identifier
+ test match {
+ case Future.`never` =>
+ case _ => fail("Future.never did not match Future.`never`")
+ }
+
+ assert(test eq Future.never, "Future.never must be the same instance as Future.never")
+ assert(test ne null, "Future.never must not be null")
+ assert(!test.isCompleted && test.value.isEmpty, "Future.never must never be completed")
+ assert(test.failed eq test)
+ assert(test.asInstanceOf[Future[Future[Nothing]]].flatten eq test)
+ assert(test.zip(test) eq test)
+ assert(test.fallbackTo(test) eq test)
+ assert(test.mapTo[String] eq test)
+
+ ECNotUsed(ec => test.foreach(_ => fail("foreach should not have been called"))(ec))
+ ECNotUsed(ec => test.onSuccess({ case _ => fail("onSuccess should not have been called") })(ec))
+ ECNotUsed(ec => test.onFailure({ case _ => fail("onFailure should not have been called") })(ec))
+ ECNotUsed(ec => test.onComplete({ case _ => fail("onComplete should not have been called") })(ec))
+ ECNotUsed(ec => test.transform(identity, identity)(ec) eq test)
+ ECNotUsed(ec => test.transform(identity)(ec) eq test)
+ ECNotUsed(ec => test.transformWith(_ => fail("transformWith should not have been called"))(ec) eq test)
+ ECNotUsed(ec => test.map(identity)(ec) eq test)
+ ECNotUsed(ec => test.flatMap(_ => fail("flatMap should not have been called"))(ec) eq test)
+ ECNotUsed(ec => test.filter(_ => fail("filter should not have been called"))(ec) eq test)
+ ECNotUsed(ec => test.collect({ case _ => fail("collect should not have been called")})(ec) eq test)
+ ECNotUsed(ec => test.recover({ case _ => fail("recover should not have been called")})(ec) eq test)
+ ECNotUsed(ec => test.recoverWith({ case _ => fail("recoverWith should not have been called")})(ec) eq test)
+ ECNotUsed(ec => test.andThen({ case _ => fail("andThen should not have been called")})(ec) eq test)
+ ECNotUsed(ec => test.zipWith(test)({ (_,_) => fail("zipWith should not have been called")})(ec) eq test)
+ }
}
"The default ExecutionContext" should {
@@ -128,7 +238,7 @@ class FutureTests extends MinimalScalaTest {
"support pattern matching within a for-comprehension" in {
case class Req[T](req: T)
case class Res[T](res: T)
- def async[T](req: Req[T]) = req match {
+ def async[T](req: Req[T]) = (req: @unchecked) match {
case Req(s: String) => Future { Res(s.length) }
case Req(i: Int) => Future { Res((i * 2).toString) }
}
@@ -218,6 +328,142 @@ class FutureTests extends MinimalScalaTest {
} mustBe (r)
}
+ "transform results to results" in {
+ val f1 = Future.successful("foo").transform(_.map(_.toUpperCase))
+ val f2 = Future("bar").transform(_.map(_.toUpperCase))
+ Await.result(f1, defaultTimeout) mustBe "FOO"
+ Await.result(f2, defaultTimeout) mustBe "BAR"
+ }
+
+ "transform failures to failures" in {
+ val initial = new Exception("Initial")
+ val expected1 = new Exception("Expected1")
+ val expected2 = new Exception("Expected2")
+ val f1 = Future(throw initial) transform {
+ case Failure(`initial`) => Failure(expected1)
+ case x => x
+ }
+ val f2 = Future.failed(initial) transform {
+ case Failure(`initial`) => Failure(expected2)
+ case x => x
+ }
+
+ intercept[Exception] { Await.result(f1, defaultTimeout) } mustBe expected1
+ intercept[Exception] { Await.result(f2, defaultTimeout) } mustBe expected2
+ }
+
+ "transform failures to results" in {
+ val initial1 = new Exception("Initial1")
+ val initial2 = new Exception("Initial2")
+ val f1 = Future.failed[String](initial1) transform {
+ case Failure(`initial1`) => Success("foo")
+ case x => x
+ }
+ val f2 = Future[String](throw initial2) transform {
+ case Failure(`initial2`) => Success("bar")
+ case x => x
+ }
+ Await.result(f1, defaultTimeout) mustBe "foo"
+ Await.result(f2, defaultTimeout) mustBe "bar"
+ }
+
+ "transform results to failures" in {
+ val expected1 = new Exception("Expected1")
+ val expected2 = new Exception("Expected2")
+ val expected3 = new Exception("Expected3")
+ val f1 = Future.successful("foo") transform {
+ case Success("foo") => Failure(expected1)
+ case x => x
+ }
+ val f2 = Future("bar") transform {
+ case Success("bar") => Failure(expected2)
+ case x => x
+ }
+ val f3 = Future("bar") transform {
+ case Success("bar") => throw expected3
+ case x => x
+ }
+ intercept[Exception] { Await.result(f1, defaultTimeout) } mustBe expected1
+ intercept[Exception] { Await.result(f2, defaultTimeout) } mustBe expected2
+ intercept[Exception] { Await.result(f3, defaultTimeout) } mustBe expected3
+ }
+
+ "transformWith results" in {
+ val f1 = Future.successful("foo").transformWith {
+ case Success(r) => Future(r.toUpperCase)
+ case f @ Failure(_) => Future.fromTry(f)
+ }
+ val f2 = Future("bar").transformWith {
+ case Success(r) => Future(r.toUpperCase)
+ case f @ Failure(_) => Future.fromTry(f)
+ }
+ Await.result(f1, defaultTimeout) mustBe "FOO"
+ Await.result(f2, defaultTimeout) mustBe "BAR"
+ }
+
+ "transformWith failures" in {
+ val initial = new Exception("Initial")
+ val expected1 = new Exception("Expected1")
+ val expected2 = new Exception("Expected2")
+ val expected3 = new Exception("Expected3")
+
+ val f1 = Future[Int](throw initial).transformWith {
+ case Failure(`initial`) => Future failed expected1
+ case x => Future fromTry x
+ }
+ val f2 = Future.failed[Int](initial).transformWith {
+ case Failure(`initial`) => Future failed expected2
+ case x => Future fromTry x
+ }
+ val f3 = Future[Int](throw initial).transformWith {
+ case Failure(`initial`) => throw expected3
+ case x => Future fromTry x
+ }
+
+ intercept[Exception] { Await.result(f1, defaultTimeout) } mustBe expected1
+ intercept[Exception] { Await.result(f2, defaultTimeout) } mustBe expected2
+ intercept[Exception] { Await.result(f3, defaultTimeout) } mustBe expected3
+ }
+
+ "transformWith failures to future success" in {
+ val initial = new Exception("Initial")
+ val f1 = Future.failed[String](initial).transformWith {
+ case Failure(`initial`) => Future("FOO")
+ case _ => Future failed initial
+ }
+ val f2 = Future[String](throw initial).transformWith {
+ case Failure(`initial`) => Future("BAR")
+ case _ => Future failed initial
+ }
+ Await.result(f1, defaultTimeout) mustBe "FOO"
+ Await.result(f2, defaultTimeout) mustBe "BAR"
+ }
+
+ "transformWith results to future failures" in {
+ val initial = new Exception("Initial")
+ val expected1 = new Exception("Expected1")
+ val expected2 = new Exception("Expected2")
+ val expected3 = new Exception("Expected3")
+
+ val f1 = Future[String]("FOO") transformWith {
+ case Success("FOO") => Future failed expected1
+ case _ => Future successful "FOO"
+ }
+ val f2 = Future.successful("FOO") transformWith {
+ case Success("FOO") => Future failed expected2
+ case _ => Future successful "FOO"
+ }
+ val f3 = Future.successful("FOO") transformWith {
+ case Success("FOO") => throw expected3
+ case _ => Future successful "FOO"
+ }
+
+
+ intercept[Exception] { Await.result(f1, defaultTimeout) } mustBe expected1
+ intercept[Exception] { Await.result(f2, defaultTimeout) } mustBe expected2
+ intercept[Exception] { Await.result(f3, defaultTimeout) } mustBe expected3
+ }
+
"andThen like a boss" in {
val q = new java.util.concurrent.LinkedBlockingQueue[Int]
for (i <- 1 to 1000) {
@@ -281,6 +527,33 @@ class FutureTests extends MinimalScalaTest {
Await.result(successful, timeout) mustBe (("foo", "foo"))
}
+ "zipWith" in {
+ val timeout = 10000 millis
+ val f = new IllegalStateException("test")
+ intercept[IllegalStateException] {
+ val failed = Future.failed[String](f).zipWith(Future.successful("foo")) { _ -> _ }
+ Await.result(failed, timeout)
+ } mustBe (f)
+
+ intercept[IllegalStateException] {
+ val failed = Future.successful("foo").zipWith(Future.failed[String](f)) { _ -> _ }
+ Await.result(failed, timeout)
+ } mustBe (f)
+
+ intercept[IllegalStateException] {
+ val failed = Future.failed[String](f).zipWith(Future.failed[String](f)) { _ -> _ }
+ Await.result(failed, timeout)
+ } mustBe (f)
+
+ val successful = Future.successful("foo").zipWith(Future.successful("foo")) { _ -> _ }
+ Await.result(successful, timeout) mustBe (("foo", "foo"))
+
+ val failure = Future.successful("foo").zipWith(Future.successful("foo")) { (_,_) => throw f }
+ intercept[IllegalStateException] {
+ Await.result(failure, timeout)
+ } mustBe (f)
+ }
+
"fold" in {
val timeout = 10000 millis
def async(add: Int, wait: Int) = Future {
@@ -543,22 +816,6 @@ class FutureTests extends MinimalScalaTest {
Await.ready(f, defaultTimeout).value.get.toString mustBe expected.toString
}
- "should have a decent toString representation" in {
- val i = scala.concurrent.forkjoin.ThreadLocalRandom.current.nextInt()
- val e = new Exception(i.toString)
- val successString = "Future(Success("+i+"))"
- val failureString = "Future(Failure("+e+"))"
- val notCompletedString = "Future(<not completed>)"
-
- Future.successful(i).toString mustBe successString
- Future.failed[Int](e).toString mustBe failureString
- Promise[Int]().toString mustBe notCompletedString
- Promise[Int]().success(i).toString mustBe successString
- Promise[Int]().failure(e).toString mustBe failureString
- Await.ready(Future(i)(ExecutionContext.global), defaultTimeout).toString mustBe successString
- Await.ready(Future(throw e)(ExecutionContext.global), defaultTimeout).toString mustBe failureString
- }
-
}
}
diff --git a/test/files/jvm/future-termination.check b/test/files/jvm/future-termination.check
deleted file mode 100644
index dc335465d4..0000000000
--- a/test/files/jvm/future-termination.check
+++ /dev/null
@@ -1 +0,0 @@
-I can't wait that long, bye.
diff --git a/test/files/jvm/future-termination.scala b/test/files/jvm/future-termination.scala
deleted file mode 100644
index 90ea336ce8..0000000000
--- a/test/files/jvm/future-termination.scala
+++ /dev/null
@@ -1,21 +0,0 @@
-
-/* Test that unevaluated futures do not prevent program termination */
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.Futures
- def main(args: Array[String]) {
- try {
- val meaningOfLife = Futures.future {
- Thread.sleep(5000) // pretend this is a harder problem than it is
- println("I have the answer!")
- 42
- }
- println("I can't wait that long, bye.")
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
diff --git a/test/files/jvm/innerClassAttribute.check b/test/files/jvm/innerClassAttribute.check
deleted file mode 100644
index 41448f359b..0000000000
--- a/test/files/jvm/innerClassAttribute.check
+++ /dev/null
@@ -1,54 +0,0 @@
-#partest !-Ydelambdafy:method
--- A4 --
-A4$$anonfun$f$1 / null / null / 17
-A4$$anonfun$f$1 / null / null / 17
-A4 / f / (Lscala/collection/immutable/List;)Lscala/collection/immutable/List;
--- A19 --
-A19$$anonfun$1 / null / null / 17
-A19$$anonfun$2 / null / null / 17
-A19$$anonfun$3 / null / null / 17
-A19$$anonfun$1 / null / null / 17
-A19$$anonfun$2 / null / null / 17
-A19$$anonfun$3 / null / null / 17
-A19 / null / null
-A19 / null / null
-A19 / null / null
--- A20 --
-A20$$anonfun$4 / null / null / 17
-fun1: attribute for itself and the two child closures `() => ()` and `() => () => 1`
-A20$$anonfun$4 / null / null / 17
-A20$$anonfun$4$$anonfun$apply$1 / null / null / 17
-A20$$anonfun$4$$anonfun$apply$2 / null / null / 17
-fun2 () => (): itself and the outer closure
-A20$$anonfun$4 / null / null / 17
-A20$$anonfun$4$$anonfun$apply$1 / null / null / 17
-fun3 () => () => (): itself, the outer closure and its child closure
-A20$$anonfun$4 / null / null / 17
-A20$$anonfun$4$$anonfun$apply$2 / null / null / 17
-A20$$anonfun$4$$anonfun$apply$2$$anonfun$apply$3 / null / null / 17
-fun4: () => 1: itself and the two outer closures
-A20$$anonfun$4 / null / null / 17
-A20$$anonfun$4$$anonfun$apply$2 / null / null / 17
-A20$$anonfun$4$$anonfun$apply$2$$anonfun$apply$3 / null / null / 17
-enclosing: nested closures have outer class defined, but no outer method
-A20 / null / null
-A20$$anonfun$4 / null / null
-A20$$anonfun$4 / null / null
-A20$$anonfun$4$$anonfun$apply$2 / null / null
-#partest -Ydelambdafy:method
--- A4 --
-null / null / null
--- A19 --
-null / null / null
-null / null / null
-null / null / null
--- A20 --
-fun1: attribute for itself and the two child closures `() => ()` and `() => () => 1`
-fun2 () => (): itself and the outer closure
-fun3 () => () => (): itself, the outer closure and its child closure
-fun4: () => 1: itself and the two outer closures
-enclosing: nested closures have outer class defined, but no outer method
-null / null / null
-null / null / null
-null / null / null
-null / null / null
diff --git a/test/files/jvm/innerClassAttribute/Classes_1.scala b/test/files/jvm/innerClassAttribute/Classes_1.scala
index 62c7d94d90..27f01a880a 100644
--- a/test/files/jvm/innerClassAttribute/Classes_1.scala
+++ b/test/files/jvm/innerClassAttribute/Classes_1.scala
@@ -13,7 +13,7 @@ object A3 {
class A4 {
def f(l: List[String]): List[String] = {
- l map (_ + "1")
+ l map (_ + "1") : @noinline // inlining adds a reference to the nested class scala/collection/generic/GenTraversableFactory$GenericCanBuildFrom
}
}
@@ -186,42 +186,31 @@ trait A24 extends A24Base {
}
}
-class SI_9105 {
- // the EnclosingMethod attributes depend on the delambdafy strategy (inline vs method)
-
- // outerClass-inline enclMeth-inline outerClass-method enclMeth-method
+class SI_9105 {
+ // outerClass enclMeth
val fun = (s: String) => {
- class A // closure null (*) SI_9105 null
- def m: Object = { class B; new B } // closure m$1 SI_9105 m$1
- val f: Object = { class C; new C } // closure null (*) SI_9105 null
+ class A // SI_9105 null
+ def m: Object = { class B; new B } // SI_9105 m$1
+ val f: Object = { class C; new C } // SI_9105 null
}
def met = (s: String) => {
- class D // closure null (*) SI_9105 met
- def m: Object = { class E; new E } // closure m$1 SI_9105 m$1
- val f: Object = { class F; new F } // closure null (*) SI_9105 met
+ class D // SI_9105 met
+ def m: Object = { class E; new E } // SI_9105 m$1
+ val f: Object = { class F; new F } // SI_9105 met
}
- // (*) the originalOwner chain of A (similar for D) is: SI_9105.fun.$anonfun-value.A
- // we can get to the anonfun-class (created by uncurry), but not to the apply method.
- //
- // for C and F, the originalOwner chain is fun.$anonfun-value.f.C. at later phases, the rawowner of f is
- // an apply$sp method of the closure class. we could use that as enclosing method, but it would be unsystematic
- // (A / D don't have an encl meth either), and also strange to use the $sp, which is a compilation artifact.
- // So using `null` looks more like the situation in the source code: C / F are nested classes of the anon-fun, and
- // there's no method in between.
-
def byName(op: => Any) = 0
val bnV = byName {
- class G // closure null (*) SI_9105 null
- def m: Object = { class H; new H } // closure m$1 SI_9105 m$1
- val f: Object = { class I; new I } // closure null (*) SI_9105 null
+ class G // SI_9105 null
+ def m: Object = { class H; new H } // SI_9105 m$1
+ val f: Object = { class I; new I } // SI_9105 null
""
}
def bnM = byName {
- class J // closure null (*) SI_9105 bnM
- def m: Object = { class K; new K } // closure m$1 SI_9105 m$1
- val f: Object = { class L; new L } // closure null (*) SI_9105 bnM
+ class J // SI_9105 bnM
+ def m: Object = { class K; new K } // SI_9105 m$1
+ val f: Object = { class L; new L } // SI_9105 bnM
""
}
}
@@ -233,7 +222,7 @@ trait SI_9124 {
def f = new A { def f2 = 0 } // enclosing method is f in the interface SI_9124
- private def g = new A { def f3 = 0 } // only encl class (SI_9124), encl meth is null because the interface SI_9124 doesn't have a method g
+ private def g: Object = new A { def f3 = 0 } // only encl class (SI_9124), encl meth can be g in 2.12 because the interface SI_9124 now has the method g
object O { // member, no encl meth attribute
new A { def f4 = 0 } // enclosing class is O$, no enclosing method
@@ -280,13 +269,30 @@ class SpecializedClassesAreTopLevel {
// }
}
+object AnonymousClassesMayBeNestedInSpecialized {
+ abstract class A
+ class C[@specialized(Int) T] {
+ def foo(t: T): A = new A { }
+ }
+
+ // specialization duplicates the anonymous class, one copy is nested in the specialized subclass of C
+
+ // class C$mcI$sp extends C[Int] {
+ // override def foo(t: Int): A = C$mcI$sp.this.foo$mcI$sp(t);
+ // override def foo$mcI$sp(t: Int): A = {
+ // final class $anon extends A { }
+ // new <$anon: A>()
+ // }
+ // }
+}
+
object NestedInValueClass {
// note that we can only test anonymous functions, nested classes are not allowed inside value classes
class A(val arg: String) extends AnyVal {
// A has InnerClass entries for the two closures (and for A and A$). not for B / C
def f = {
- def g = List().map(x => ((s: String) => x)) // outer class A, no outer method (g is moved to the companion, doesn't exist in A)
- g.map(x => ((s: String) => x)) // outer class A, outer method f
+ def g = List().map(x => ((s: String) => x)): @noinline // outer class A, no outer method (g is moved to the companion, doesn't exist in A)
+ g.map(x => ((s: String) => x)): @noinline // outer class A, outer method f
}
// statements and field declarations are not allowed in value classes
}
@@ -297,3 +303,40 @@ object NestedInValueClass {
def f = { class C; new C } // outer class A$, outer method f
}
}
+
+object LocalAndAnonymousInLazyInitializer {
+ abstract class A
+ class C {
+ lazy val a: A = new A { }
+ lazy val b: A = {
+ class AA extends A
+ new AA
+ }
+ lazy val c: A = {
+ object AA extends A
+ AA
+ }
+ }
+ object O {
+ lazy val a: A = new A { }
+ lazy val b: A = {
+ class AA extends A
+ new AA
+ }
+ lazy val c: A = {
+ object AA extends A
+ AA
+ }
+ }
+ trait T {
+ lazy val a: A = new A { }
+ lazy val b: A = {
+ class AA extends A
+ new AA
+ }
+ lazy val c: A = {
+ object AA extends A
+ AA
+ }
+ }
+} \ No newline at end of file
diff --git a/test/files/jvm/innerClassAttribute/Test.scala b/test/files/jvm/innerClassAttribute/Test.scala
index 3a6737ca46..288c6ee30f 100644
--- a/test/files/jvm/innerClassAttribute/Test.scala
+++ b/test/files/jvm/innerClassAttribute/Test.scala
@@ -23,7 +23,7 @@ object Test extends BytecodeTest {
def testInner(cls: String, fs: (InnerClassNode => Unit)*) = {
val ns = innerClassNodes(cls)
- assert(ns.length == fs.length, ns)
+ assert(ns.length == fs.length, ns.map(_.name))
(ns zip fs.toList) foreach { case (n, f) => f(n) }
}
@@ -78,9 +78,9 @@ object Test extends BytecodeTest {
println(s"${e.outerClass} / ${e.name} / ${e.descriptor}")
}
- def lambdaClass(anonfunName: String, lambdaName: String): String = {
- if (classpath.findClass(anonfunName).isDefined) anonfunName else lambdaName
- }
+
+ val methodHandlesLookup = assertMember(_: InnerClassNode, "java/lang/invoke/MethodHandles", "Lookup", flags = publicStatic | Flags.ACC_FINAL)
+
def testA1() = {
val List(b1) = innerClassNodes("A1")
@@ -109,11 +109,7 @@ object Test extends BytecodeTest {
}
def testA4() = {
- println("-- A4 --")
- printInnerClassNodes("A4")
- val fun = lambdaClass("A4$$anonfun$f$1", "A4$lambda$$f$1")
- printInnerClassNodes(fun)
- printEnclosingMethod(fun)
+ testInner("A4", methodHandlesLookup)
}
def testA5() = {
@@ -129,7 +125,6 @@ object Test extends BytecodeTest {
def testA6() = {
val List(tt1) = innerClassNodes("A6")
assertMember(tt1, "A6", "TT", flags = publicAbstractInterface)
- val List() = innerClassNodes("A6$class")
val List(tt2) = innerClassNodes("A6$TT")
assertMember(tt2, "A6", "TT", flags = publicAbstractInterface)
}
@@ -245,47 +240,11 @@ object Test extends BytecodeTest {
}
def testA19() = {
- println("-- A19 --")
-
- printInnerClassNodes("A19")
-
- val fun1 = lambdaClass("A19$$anonfun$1", "A19$lambda$1")
- val fun2 = lambdaClass("A19$$anonfun$2", "A19$lambda$2")
- val fun3 = lambdaClass("A19$$anonfun$3", "A19$lambda$3")
-
- printInnerClassNodes(fun1)
- printInnerClassNodes(fun2)
- printInnerClassNodes(fun3)
-
- printEnclosingMethod(fun1)
- printEnclosingMethod(fun2)
- printEnclosingMethod(fun3)
+ testInner("A19", methodHandlesLookup)
}
def testA20() = {
- println("-- A20 --")
-
- printInnerClassNodes("A20")
-
- val fun1 = lambdaClass("A20$$anonfun$4", "A20$lambda$1")
- val fun2 = lambdaClass("A20$$anonfun$4$$anonfun$apply$1", "A20$lambda$$$nestedInAnonfun$5$1")
- val fun3 = lambdaClass("A20$$anonfun$4$$anonfun$apply$2", "A20$lambda$$$nestedInAnonfun$5$2")
- val fun4 = lambdaClass("A20$$anonfun$4$$anonfun$apply$2$$anonfun$apply$3", "A20$lambda$$$nestedInAnonfun$7$1")
-
- println("fun1: attribute for itself and the two child closures `() => ()` and `() => () => 1`")
- printInnerClassNodes(fun1)
- println("fun2 () => (): itself and the outer closure")
- printInnerClassNodes(fun2)
- println("fun3 () => () => (): itself, the outer closure and its child closure")
- printInnerClassNodes(fun3)
- println("fun4: () => 1: itself and the two outer closures")
- printInnerClassNodes(fun4)
-
- println("enclosing: nested closures have outer class defined, but no outer method")
- printEnclosingMethod(fun1)
- printEnclosingMethod(fun2)
- printEnclosingMethod(fun3)
- printEnclosingMethod(fun4)
+ testInner("A20", methodHandlesLookup)
}
def testA21() = {
@@ -335,80 +294,40 @@ object Test extends BytecodeTest {
}
def testSI_9105() {
- val isDelambdafyMethod = classpath.findClass("SI_9105$lambda$1").isDefined
- if (isDelambdafyMethod) {
- assertEnclosingMethod ("SI_9105$A$3" , "SI_9105", null , null)
- assertEnclosingMethod ("SI_9105$B$5" , "SI_9105", "m$1", "()Ljava/lang/Object;")
- assertEnclosingMethod ("SI_9105$C$1" , "SI_9105", null , null)
- assertEnclosingMethod ("SI_9105$D$1" , "SI_9105", "met", "()Lscala/Function1;")
- assertEnclosingMethod ("SI_9105$E$1" , "SI_9105", "m$3", "()Ljava/lang/Object;")
- assertEnclosingMethod ("SI_9105$F$1" , "SI_9105", "met", "()Lscala/Function1;")
- assertNoEnclosingMethod("SI_9105$lambda$$met$1")
- assertNoEnclosingMethod("SI_9105$lambda$1")
- assertNoEnclosingMethod("SI_9105")
-
- assertLocal(innerClassNodes("SI_9105$A$3").head, "SI_9105$A$3", "A$3")
- assertLocal(innerClassNodes("SI_9105$B$5").head, "SI_9105$B$5", "B$5")
- assertLocal(innerClassNodes("SI_9105$C$1").head, "SI_9105$C$1", "C$1")
- assertLocal(innerClassNodes("SI_9105$D$1").head, "SI_9105$D$1", "D$1")
- assertLocal(innerClassNodes("SI_9105$E$1").head, "SI_9105$E$1", "E$1")
- assertLocal(innerClassNodes("SI_9105$F$1").head, "SI_9105$F$1", "F$1")
-
- // by-name
- assertEnclosingMethod("SI_9105$G$1", "SI_9105", null , null)
- assertEnclosingMethod("SI_9105$H$1", "SI_9105", "m$2", "()Ljava/lang/Object;")
- assertEnclosingMethod("SI_9105$I$1", "SI_9105", null , null)
- assertEnclosingMethod("SI_9105$J$1", "SI_9105", "bnM", "()I")
- assertEnclosingMethod("SI_9105$K$2", "SI_9105", "m$4", "()Ljava/lang/Object;")
- assertEnclosingMethod("SI_9105$L$1", "SI_9105", "bnM", "()I")
-
- assert(innerClassNodes("SI_9105$lambda$$met$1").isEmpty)
- assert(innerClassNodes("SI_9105$lambda$1").isEmpty)
- assert(innerClassNodes("SI_9105").length == 12) // the 12 local classes
- } else {
- // comment in innerClassAttribute/Classes_1.scala explains the difference between A / C and D / F.
- assertEnclosingMethod ("SI_9105$$anonfun$5$A$3" , "SI_9105$$anonfun$5" , null , null)
- assertEnclosingMethod ("SI_9105$$anonfun$5$B$5" , "SI_9105$$anonfun$5" , "m$1" , "()Ljava/lang/Object;")
- assertEnclosingMethod ("SI_9105$$anonfun$5$C$1" , "SI_9105$$anonfun$5" , null , null)
- assertEnclosingMethod ("SI_9105$$anonfun$met$1$D$1", "SI_9105$$anonfun$met$1", null , null)
- assertEnclosingMethod ("SI_9105$$anonfun$met$1$E$1", "SI_9105$$anonfun$met$1", "m$3" , "()Ljava/lang/Object;")
- assertEnclosingMethod ("SI_9105$$anonfun$met$1$F$1", "SI_9105$$anonfun$met$1", null , null)
- assertEnclosingMethod ("SI_9105$$anonfun$5" , "SI_9105" , null , null)
- assertEnclosingMethod ("SI_9105$$anonfun$met$1" , "SI_9105" , "met" , "()Lscala/Function1;")
- assertNoEnclosingMethod("SI_9105")
-
- assertLocal(ownInnerClassNode("SI_9105$$anonfun$5$A$3"), "SI_9105$$anonfun$5$A$3" , "A$3")
- assertLocal(ownInnerClassNode("SI_9105$$anonfun$5$B$5"), "SI_9105$$anonfun$5$B$5" , "B$5")
- assertLocal(ownInnerClassNode("SI_9105$$anonfun$5$C$1"), "SI_9105$$anonfun$5$C$1" , "C$1")
- assertLocal(ownInnerClassNode("SI_9105$$anonfun$met$1$D$1"), "SI_9105$$anonfun$met$1$D$1", "D$1")
- assertLocal(ownInnerClassNode("SI_9105$$anonfun$met$1$E$1"), "SI_9105$$anonfun$met$1$E$1", "E$1")
- assertLocal(ownInnerClassNode("SI_9105$$anonfun$met$1$F$1"), "SI_9105$$anonfun$met$1$F$1", "F$1")
-
- // by-name
- assertEnclosingMethod("SI_9105$$anonfun$6$G$1", "SI_9105$$anonfun$6", null, null)
- assertEnclosingMethod("SI_9105$$anonfun$6$H$1", "SI_9105$$anonfun$6", "m$2", "()Ljava/lang/Object;")
- assertEnclosingMethod("SI_9105$$anonfun$6$I$1", "SI_9105$$anonfun$6", null, null)
- assertEnclosingMethod("SI_9105$$anonfun$bnM$1$J$1", "SI_9105$$anonfun$bnM$1", null, null)
- assertEnclosingMethod("SI_9105$$anonfun$bnM$1$K$2", "SI_9105$$anonfun$bnM$1", "m$4", "()Ljava/lang/Object;")
- assertEnclosingMethod("SI_9105$$anonfun$bnM$1$L$1", "SI_9105$$anonfun$bnM$1", null, null)
-
- assertAnonymous(ownInnerClassNode("SI_9105$$anonfun$5"), "SI_9105$$anonfun$5")
- assertAnonymous(ownInnerClassNode("SI_9105$$anonfun$met$1"), "SI_9105$$anonfun$met$1")
-
- assert(innerClassNodes("SI_9105$$anonfun$5").length == 4) // itself and three of the local classes
- assert(innerClassNodes("SI_9105$$anonfun$met$1").length == 4) // itself and three of the local classes
- assert(innerClassNodes("SI_9105").length == 4) // the four anon funs
- }
+ assertEnclosingMethod ("SI_9105$A$3" , "SI_9105", null , null)
+ assertEnclosingMethod ("SI_9105$B$5" , "SI_9105", "m$1", "()Ljava/lang/Object;")
+ assertEnclosingMethod ("SI_9105$C$1" , "SI_9105", null , null)
+ assertEnclosingMethod ("SI_9105$D$1" , "SI_9105", "met", "()Lscala/Function1;")
+ assertEnclosingMethod ("SI_9105$E$1" , "SI_9105", "m$2", "()Ljava/lang/Object;")
+ assertEnclosingMethod ("SI_9105$F$1" , "SI_9105", "met", "()Lscala/Function1;")
+ assertNoEnclosingMethod("SI_9105")
+
+ assertLocal(innerClassNodes("SI_9105$A$3").head, "SI_9105$A$3", "A$3")
+ assertLocal(innerClassNodes("SI_9105$B$5").head, "SI_9105$B$5", "B$5")
+ assertLocal(innerClassNodes("SI_9105$C$1").head, "SI_9105$C$1", "C$1")
+ assertLocal(innerClassNodes("SI_9105$D$1").head, "SI_9105$D$1", "D$1")
+ assertLocal(innerClassNodes("SI_9105$E$1").head, "SI_9105$E$1", "E$1")
+ assertLocal(innerClassNodes("SI_9105$F$1").head, "SI_9105$F$1", "F$1")
+
+ // by-name
+ assertEnclosingMethod("SI_9105$G$1", "SI_9105", null , null)
+ assertEnclosingMethod("SI_9105$H$1", "SI_9105", "m$3", "()Ljava/lang/Object;")
+ assertEnclosingMethod("SI_9105$I$1", "SI_9105", null , null)
+ assertEnclosingMethod("SI_9105$J$1", "SI_9105", "bnM", "()I")
+ assertEnclosingMethod("SI_9105$K$2", "SI_9105", "m$4", "()Ljava/lang/Object;")
+ assertEnclosingMethod("SI_9105$L$1", "SI_9105", "bnM", "()I")
+
+ assert(innerClassNodes("SI_9105").length == 13) // the 12 local classes, plus MethodHandles$Lookup
}
def testSI_9124() {
val classes: Map[String, String] = {
List("SI_9124$$anon$10",
- "SI_9124$$anon$11",
"SI_9124$$anon$12",
+ "SI_9124$$anon$13",
"SI_9124$$anon$8",
"SI_9124$$anon$9",
- "SI_9124$O$$anon$13").map({ name =>
+ "SI_9124$O$$anon$11").map({ name =>
val node = loadClassNode(name)
val fMethod = node.methods.asScala.find(_.name.startsWith("f")).get.name
(fMethod, node.name)
@@ -420,7 +339,7 @@ object Test extends BytecodeTest {
assertNoEnclosingMethod("SI_9124$A")
assertEnclosingMethod(classes("f1"), "SI_9124", null, null)
assertEnclosingMethod(classes("f2"), "SI_9124", "f", "()LSI_9124$A;")
- assertEnclosingMethod(classes("f3"), "SI_9124", null, null)
+ assertEnclosingMethod(classes("f3"), "SI_9124", "g", "()Ljava/lang/Object;")
assertEnclosingMethod(classes("f4"), "SI_9124$O$", null, null)
assertEnclosingMethod(classes("f5"), "SI_9124", null, null)
assertEnclosingMethod(classes("f6"), "SI_9124", null, null)
@@ -431,25 +350,19 @@ object Test extends BytecodeTest {
assertMember(ownInnerClassNode("SI_9124$O$"), "SI_9124", "O$")
}
+ // Note: the new trait encoding removed impl classes, so this test name doesn't make sense.
+ // But I've left it here as there were some tests remaining that are still relevant.
def testImplClassesTopLevel() {
val classes = List(
"ImplClassesAreTopLevel$$anon$14",
"ImplClassesAreTopLevel$$anon$15",
"ImplClassesAreTopLevel$$anon$16",
- "ImplClassesAreTopLevel$B1$class",
"ImplClassesAreTopLevel$B1",
- "ImplClassesAreTopLevel$B2$1$class",
"ImplClassesAreTopLevel$B2$1",
- "ImplClassesAreTopLevel$B3$1$class",
"ImplClassesAreTopLevel$B3$1",
- "ImplClassesAreTopLevel$B4$class",
"ImplClassesAreTopLevel$B4$1",
- "ImplClassesAreTopLevel$class",
"ImplClassesAreTopLevel")
- classes.filter(_.endsWith("$class")).foreach(assertNoEnclosingMethod)
- classes.flatMap(innerClassNodes).foreach(icn => assert(!icn.name.endsWith("$class"), icn))
-
assertNoEnclosingMethod("ImplClassesAreTopLevel$B1") // member, no encl meth attr
// no encl meth, but encl class
@@ -467,21 +380,15 @@ object Test extends BytecodeTest {
val b3 = assertLocal(_ : InnerClassNode, "ImplClassesAreTopLevel$B3$1", "B3$1", flags = publicAbstractInterface)
val b4 = assertLocal(_ : InnerClassNode, "ImplClassesAreTopLevel$B4$1", "B4$1", flags = publicAbstractInterface)
- testInner("ImplClassesAreTopLevel$$anon$14", an14, b3)
- testInner("ImplClassesAreTopLevel$$anon$15", an15, b2)
+ testInner("ImplClassesAreTopLevel$$anon$14", an14, b2)
+ testInner("ImplClassesAreTopLevel$$anon$15", an15, b3)
testInner("ImplClassesAreTopLevel$$anon$16", an16, b4)
- testInner("ImplClassesAreTopLevel$B1$class", b1)
- testInner("ImplClassesAreTopLevel$B2$1$class", b2)
- testInner("ImplClassesAreTopLevel$B3$1$class", b3)
- testInner("ImplClassesAreTopLevel$B4$class", b4)
-
testInner("ImplClassesAreTopLevel$B1", b1)
testInner("ImplClassesAreTopLevel$B2$1", b2)
testInner("ImplClassesAreTopLevel$B3$1", b3)
testInner("ImplClassesAreTopLevel$B4$1", b4)
- testInner("ImplClassesAreTopLevel$class", an14, an15, an16)
testInner("ImplClassesAreTopLevel", an14, an15, an16, b1, b2, b3, b4)
}
@@ -507,6 +414,11 @@ object Test extends BytecodeTest {
List("SpecializedClassesAreTopLevel$T$", "SpecializedClassesAreTopLevel$T$B$mcI$sp", "SpecializedClassesAreTopLevel$T$B").foreach(testInner(_, t, b))
}
+ def testAnonymousClassesMayBeNestedInSpecialized() {
+ assertEnclosingMethod("AnonymousClassesMayBeNestedInSpecialized$C$$anon$17", "AnonymousClassesMayBeNestedInSpecialized$C", "foo", "(Ljava/lang/Object;)LAnonymousClassesMayBeNestedInSpecialized$A;")
+ assertEnclosingMethod("AnonymousClassesMayBeNestedInSpecialized$C$mcI$sp$$anon$21", "AnonymousClassesMayBeNestedInSpecialized$C$mcI$sp", "foo$mcI$sp", "(I)LAnonymousClassesMayBeNestedInSpecialized$A;")
+ }
+
def testNestedInValueClass() {
List(
"NestedInValueClass",
@@ -528,37 +440,22 @@ object Test extends BytecodeTest {
testInner("NestedInValueClass$A$B", am, b)
testInner("NestedInValueClass$A$C$2", am, c)
- val isDelambdafyMethod = classpath.findClass("NestedInValueClass$A$lambda$$f$extension$1").isDefined
- if (isDelambdafyMethod) {
- List(
- "NestedInValueClass$A$lambda$$g$2$1",
- "NestedInValueClass$A$lambda$$f$extension$1",
- "NestedInValueClass$A$lambda$$$nestedInAnonfun$13$1",
- "NestedInValueClass$A$lambda$$NestedInValueClass$A$$$nestedInAnonfun$15$1").foreach(assertNoEnclosingMethod)
- testInner("NestedInValueClass$A", a, am)
- testInner("NestedInValueClass$A$", a, am, b, c)
- testInner("NestedInValueClass$A$lambda$$g$2$1", am)
- testInner("NestedInValueClass$A$lambda$$f$extension$1", am)
- testInner("NestedInValueClass$A$lambda$$$nestedInAnonfun$13$1", am)
- testInner("NestedInValueClass$A$lambda$$NestedInValueClass$A$$$nestedInAnonfun$15$1", am)
- } else {
- assertEnclosingMethod("NestedInValueClass$A$$anonfun$g$2$1" , "NestedInValueClass$A" , null, null)
- assertEnclosingMethod("NestedInValueClass$A$$anonfun$g$2$1$$anonfun$apply$4" , "NestedInValueClass$A$$anonfun$g$2$1" , null, null)
- assertEnclosingMethod("NestedInValueClass$A$$anonfun$f$extension$1" , "NestedInValueClass$A" , "f", "()Lscala/collection/immutable/List;")
- assertEnclosingMethod("NestedInValueClass$A$$anonfun$f$extension$1$$anonfun$apply$5", "NestedInValueClass$A$$anonfun$f$extension$1", null, null)
-
- val gfun = assertAnonymous(_: I, "NestedInValueClass$A$$anonfun$g$2$1")
- val ffun = assertAnonymous(_: I, "NestedInValueClass$A$$anonfun$f$extension$1")
- val gfunfun = assertAnonymous(_: I, "NestedInValueClass$A$$anonfun$g$2$1$$anonfun$apply$4")
- val ffunfun = assertAnonymous(_: I, "NestedInValueClass$A$$anonfun$f$extension$1$$anonfun$apply$5")
-
- testInner("NestedInValueClass$A", a, am, ffun, gfun)
- testInner("NestedInValueClass$A$", a, am, ffun, gfun, b, c)
- testInner("NestedInValueClass$A$$anonfun$g$2$1", a, am, gfun, gfunfun)
- testInner("NestedInValueClass$A$$anonfun$g$2$1$$anonfun$apply$4", am, gfun, gfunfun)
- testInner("NestedInValueClass$A$$anonfun$f$extension$1", a, am, ffun, ffunfun)
- testInner("NestedInValueClass$A$$anonfun$f$extension$1$$anonfun$apply$5", am, ffun, ffunfun)
- }
+ testInner("NestedInValueClass$A", a, am)
+ testInner("NestedInValueClass$A$", a, am, b, c, methodHandlesLookup)
+ }
+
+ def testLocalAndAnonymousInLazyInitializer(): Unit = {
+ assertEnclosingMethod("LocalAndAnonymousInLazyInitializer$C$$anon$18", "LocalAndAnonymousInLazyInitializer$C", null, null)
+ assertEnclosingMethod("LocalAndAnonymousInLazyInitializer$C$AA$4", "LocalAndAnonymousInLazyInitializer$C", null, null)
+ assertEnclosingMethod("LocalAndAnonymousInLazyInitializer$C$AA$5$", "LocalAndAnonymousInLazyInitializer$C", null, null)
+
+ assertEnclosingMethod("LocalAndAnonymousInLazyInitializer$O$$anon$19", "LocalAndAnonymousInLazyInitializer$O$", null, null)
+ assertEnclosingMethod("LocalAndAnonymousInLazyInitializer$O$AA$6", "LocalAndAnonymousInLazyInitializer$O$", null, null)
+ assertEnclosingMethod("LocalAndAnonymousInLazyInitializer$O$AA$7$", "LocalAndAnonymousInLazyInitializer$O$", null, null)
+
+ assertEnclosingMethod("LocalAndAnonymousInLazyInitializer$T$$anon$20", "LocalAndAnonymousInLazyInitializer$T", null, null)
+ assertEnclosingMethod("LocalAndAnonymousInLazyInitializer$T$AA$8", "LocalAndAnonymousInLazyInitializer$T", null, null)
+ assertEnclosingMethod("LocalAndAnonymousInLazyInitializer$T$AA$9$", "LocalAndAnonymousInLazyInitializer$T", null, null)
}
def show(): Unit = {
@@ -588,6 +485,8 @@ object Test extends BytecodeTest {
testSI_9124()
testImplClassesTopLevel()
testSpecializedClassesTopLevel()
+ testAnonymousClassesMayBeNestedInSpecialized()
testNestedInValueClass()
+ testLocalAndAnonymousInLazyInitializer()
}
}
diff --git a/test/files/jvm/interpreter.check b/test/files/jvm/interpreter.check
index 9a2162a906..72d8d39fd0 100644
--- a/test/files/jvm/interpreter.check
+++ b/test/files/jvm/interpreter.check
@@ -93,7 +93,7 @@ scala> case class Bar(n: Int)
defined class Bar
scala> implicit def foo2bar(foo: Foo) = Bar(foo.n)
-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'
foo2bar: (foo: Foo)Bar
scala> val bar: Bar = Foo(3)
@@ -267,7 +267,7 @@ scala> xs map (x => x)
res6: Array[_] = Array(1, 2)
scala> xs map (x => (x, x))
-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'
res7: Array[(_$1, _$1)] forSome { type _$1 } = Array((1,1), (2,2))
scala>
diff --git a/test/files/jvm/javaReflection.check b/test/files/jvm/javaReflection.check
index 8180ecff8a..f3924940e9 100644
--- a/test/files/jvm/javaReflection.check
+++ b/test/files/jvm/javaReflection.check
@@ -1,97 +1,14 @@
-#partest !-Ydelambdafy:method
-A$$anonfun$$lessinit$greater$1 / null (canon) / $anonfun$$lessinit$greater$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / class A (cls) / public A(int) (constr) / null (meth)
-- properties : true (local) / false (member)
-A$$anonfun$$lessinit$greater$1$$anonfun$apply$1 / null (canon) / $anonfun$apply$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / class A$$anonfun$$lessinit$greater$1 (cls) / null (constr) / null (meth)
-- properties : true (local) / false (member)
-A$$anonfun$2 / null (canon) / $anonfun$2 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / class A (cls) / null (constr) / null (meth)
-- properties : true (local) / false (member)
-A$$anonfun$3 / null (canon) / $anonfun$3 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / class A (cls) / null (constr) / null (meth)
-- properties : true (local) / false (member)
-A$$anonfun$4 / null (canon) / $anonfun$4 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / class A (cls) / null (constr) / null (meth)
-- properties : true (local) / false (member)
-A$$anonfun$f$1 / null (canon) / $anonfun$f$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / class A (cls) / null (constr) / public java.lang.Object A.f() (meth)
-- properties : true (local) / false (member)
-A$$anonfun$f$2 / null (canon) / $anonfun$f$2 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / class A (cls) / null (constr) / public java.lang.Object A.f() (meth)
-- properties : true (local) / false (member)
-A$D$$anonfun$1 / null (canon) / anonfun$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / class A$D$ (cls) / null (constr) / null (meth)
-- properties : true (local) / false (member)
-AO$$anonfun$5 / null (canon) / anonfun$5 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / class AO$ (cls) / null (constr) / null (meth)
-- properties : true (local) / false (member)
-AT$$anonfun$6 / null (canon) / $anonfun$6 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / interface AT (cls) / null (constr) / null (meth)
-- properties : true (local) / false (member)
-#partest -Ydelambdafy:method
-A$D$lambda$1 / A$D$lambda$1 (canon) / A$D$lambda$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
-A$lambda$$$lessinit$greater$1 / A$lambda$$$lessinit$greater$1 (canon) / A$lambda$$$lessinit$greater$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
-A$lambda$$$nestedInAnonfun$7$1 / A$lambda$$$nestedInAnonfun$7$1 (canon) / A$lambda$$$nestedInAnonfun$7$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
-A$lambda$$f$1 / A$lambda$$f$1 (canon) / A$lambda$$f$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
-A$lambda$$f$2 / A$lambda$$f$2 (canon) / A$lambda$$f$2 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
-A$lambda$1 / A$lambda$1 (canon) / A$lambda$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
-A$lambda$2 / A$lambda$2 (canon) / A$lambda$2 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
-A$lambda$3 / A$lambda$3 (canon) / A$lambda$3 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
-AO$lambda$1 / AO$lambda$1 (canon) / AO$lambda$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
-AT$class$lambda$1 / AT$class$lambda$1 (canon) / AT$class$lambda$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
-#partest
A / A (canon) / A (simple)
- declared cls: List(class A$B, interface A$C, class A$D$)
- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
- properties : false (local) / false (member)
-A$$anon$1 / null (canon) / $anon$1 (simple)
+A$$anon$2 / null (canon) / $anon$2 (simple)
- declared cls: List()
- enclosing : null (declaring cls) / class A (cls) / null (constr) / null (meth)
- properties : true (local) / false (member)
A$$anon$3 / null (canon) / $anon$3 (simple)
- declared cls: List()
-- enclosing : null (declaring cls) / class A (cls) / null (constr) / null (meth)
+- enclosing : null (declaring cls) / class A (cls) / null (constr) / public java.lang.Object A.f() (meth)
- properties : true (local) / false (member)
A$$anon$4 / null (canon) / $anon$4 (simple)
- declared cls: List()
@@ -99,7 +16,7 @@ A$$anon$4 / null (canon) / $anon$4 (simple)
- properties : true (local) / false (member)
A$$anon$5 / null (canon) / $anon$5 (simple)
- declared cls: List()
-- enclosing : null (declaring cls) / class A (cls) / null (constr) / public java.lang.Object A.f() (meth)
+- enclosing : null (declaring cls) / class A (cls) / null (constr) / null (meth)
- properties : true (local) / false (member)
A$$anon$6 / null (canon) / $anon$6 (simple)
- declared cls: List()
@@ -121,7 +38,7 @@ A$D$ / A.D$ (canon) / D$ (simple)
- declared cls: List(class A$D$B, interface A$D$C, class A$D$D$)
- enclosing : class A (declaring cls) / class A (cls) / null (constr) / null (meth)
- properties : false (local) / true (member)
-A$D$$anon$2 / null (canon) / anon$2 (simple)
+A$D$$anon$1 / null (canon) / anon$1 (simple)
- declared cls: List()
- enclosing : null (declaring cls) / class A$D$ (cls) / null (constr) / null (meth)
- properties : true (local) / false (member)
@@ -245,15 +162,7 @@ AT$D$ / AT.D$ (canon) / D$ (simple)
- declared cls: List()
- enclosing : interface AT (declaring cls) / interface AT (cls) / null (constr) / null (meth)
- properties : false (local) / true (member)
-AT$class / AT$class (canon) / AT$class (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
T / T (canon) / T (simple)
- declared cls: List()
- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
- properties : false (local) / false (member)
-T$class / T$class (canon) / T$class (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
diff --git a/test/files/jvm/nooptimise/Foo_1.flags b/test/files/jvm/nooptimise/Foo_1.flags
deleted file mode 100644
index f493cf9f3f..0000000000
--- a/test/files/jvm/nooptimise/Foo_1.flags
+++ /dev/null
@@ -1 +0,0 @@
--Ybackend:GenASM -optimise -Ynooptimise \ No newline at end of file
diff --git a/test/files/jvm/nooptimise/Foo_1.scala b/test/files/jvm/nooptimise/Foo_1.scala
deleted file mode 100644
index 896d5695de..0000000000
--- a/test/files/jvm/nooptimise/Foo_1.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-class Foo_1 {
- def foo() {
- // optimization will remove this magic 3 from appearing in the source
- // so -Ynooptimize should prevent that
- val x = 3
-
- }
-}
diff --git a/test/files/jvm/nooptimise/Test.scala b/test/files/jvm/nooptimise/Test.scala
deleted file mode 100644
index 7b7ecd6dbd..0000000000
--- a/test/files/jvm/nooptimise/Test.scala
+++ /dev/null
@@ -1,23 +0,0 @@
-import scala.tools.partest.BytecodeTest
-import scala.tools.asm
-import asm.tree.InsnList
-import scala.collection.JavaConverters._
-
-object Test extends BytecodeTest {
- def show: Unit = {
- val classNode = loadClassNode("Foo_1")
- val methodNode = getMethod(classNode, "foo")
- // if optimization didn't run then
- // there should be some useless instructions
- // with the magic constant 3
- val expected = 1
- val got = countMagicThrees(methodNode.instructions)
- assert(got == expected, s"expected $expected but got $got magic threes")
- }
-
- def countMagicThrees(insnList: InsnList): Int = {
- def isMagicThree(node: asm.tree.AbstractInsnNode): Boolean =
- (node.getOpcode == asm.Opcodes.ICONST_3)
- insnList.iterator.asScala.count(isMagicThree)
- }
-}
diff --git a/test/files/jvm/patmat_opt_ignore_underscore.check b/test/files/jvm/patmat_opt_ignore_underscore.check
deleted file mode 100644
index 43f53aba12..0000000000
--- a/test/files/jvm/patmat_opt_ignore_underscore.check
+++ /dev/null
@@ -1 +0,0 @@
-bytecode identical
diff --git a/test/files/jvm/patmat_opt_ignore_underscore.flags b/test/files/jvm/patmat_opt_ignore_underscore.flags
deleted file mode 100644
index 2cd4b38726..0000000000
--- a/test/files/jvm/patmat_opt_ignore_underscore.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimize -Ybackend:GenASM \ No newline at end of file
diff --git a/test/files/jvm/patmat_opt_ignore_underscore/Analyzed_1.scala b/test/files/jvm/patmat_opt_ignore_underscore/Analyzed_1.scala
deleted file mode 100644
index b0506018f6..0000000000
--- a/test/files/jvm/patmat_opt_ignore_underscore/Analyzed_1.scala
+++ /dev/null
@@ -1,29 +0,0 @@
-// this class's bytecode, compiled under -optimize is analyzed by the test
-// method a's bytecode should be identical to method b's bytecode
-// this is not the best test for shielding against regressing on this particular issue,
-// but it sets the stage for checking the bytecode emitted by the pattern matcher and
-// comparing it to manually tuned code using if/then/else etc.
-class SameBytecode {
- case class Foo(x: Any, y: String)
-
- def a =
- Foo(1, "a") match {
- case Foo(_: String, y) => y
- }
-
- // this method's body holds the tree that should be generated by the pattern matcher for method a (-Xprint:patmat)
- // the test checks that bytecode for a and b is identical (modulo line numbers)
- // we can't diff trees as they are quite different (patmat uses jumps to labels that cannot be expressed in source, for example)
- // note that the actual tree is quite bad: we do an unnecessary null check, isInstanceOf and local val (x3)
- // some of these will be fixed soon (the initial null check is for the scrutinee, which is harder to fix in patmat)
- def b: String = {
- val x1 = Foo(1, "a")
- if (x1.ne(null)) {
- if (x1.x.isInstanceOf[String]) {
- return x1.y
- }
- }
-
- throw new MatchError(x1)
- }
-} \ No newline at end of file
diff --git a/test/files/jvm/patmat_opt_ignore_underscore/test.scala b/test/files/jvm/patmat_opt_ignore_underscore/test.scala
deleted file mode 100644
index 6179101a7e..0000000000
--- a/test/files/jvm/patmat_opt_ignore_underscore/test.scala
+++ /dev/null
@@ -1,15 +0,0 @@
-import scala.tools.partest.BytecodeTest
-
-import scala.tools.nsc.util.JavaClassPath
-import java.io.InputStream
-import scala.tools.asm
-import asm.ClassReader
-import asm.tree.{ClassNode, InsnList}
-import scala.collection.JavaConverters._
-
-object Test extends BytecodeTest {
- def show: Unit = {
- val classNode = loadClassNode("SameBytecode")
- sameBytecode(getMethod(classNode, "a"), getMethod(classNode, "b"))
- }
-}
diff --git a/test/files/jvm/patmat_opt_no_nullcheck.check b/test/files/jvm/patmat_opt_no_nullcheck.check
deleted file mode 100644
index 43f53aba12..0000000000
--- a/test/files/jvm/patmat_opt_no_nullcheck.check
+++ /dev/null
@@ -1 +0,0 @@
-bytecode identical
diff --git a/test/files/jvm/patmat_opt_no_nullcheck.flags b/test/files/jvm/patmat_opt_no_nullcheck.flags
deleted file mode 100644
index 2cd4b38726..0000000000
--- a/test/files/jvm/patmat_opt_no_nullcheck.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimize -Ybackend:GenASM \ No newline at end of file
diff --git a/test/files/jvm/patmat_opt_no_nullcheck/Analyzed_1.scala b/test/files/jvm/patmat_opt_no_nullcheck/Analyzed_1.scala
deleted file mode 100644
index 1e4d564cdf..0000000000
--- a/test/files/jvm/patmat_opt_no_nullcheck/Analyzed_1.scala
+++ /dev/null
@@ -1,24 +0,0 @@
-// this class's bytecode, compiled under -optimize is analyzed by the test
-// method a's bytecode should be identical to method b's bytecode
-case class Foo(x: Any)
-
-class SameBytecode {
- def a =
- (Foo(1): Any) match {
- case Foo(_: String) =>
- }
-
- // there's no null check
- def b: Unit = {
- val x1: Any = Foo(1)
- if (x1.isInstanceOf[Foo]) {
- val x3 = x1.asInstanceOf[Foo]
- if (x3.x.isInstanceOf[String]) {
- val x = ()
- return
- }
- }
-
- throw new MatchError(x1)
- }
-} \ No newline at end of file
diff --git a/test/files/jvm/patmat_opt_no_nullcheck/test.scala b/test/files/jvm/patmat_opt_no_nullcheck/test.scala
deleted file mode 100644
index 2927e763d5..0000000000
--- a/test/files/jvm/patmat_opt_no_nullcheck/test.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-import scala.tools.partest.BytecodeTest
-
-object Test extends BytecodeTest {
- def show: Unit = {
- val classNode = loadClassNode("SameBytecode")
- sameBytecode(getMethod(classNode, "a"), getMethod(classNode, "b"))
- }
-}
diff --git a/test/files/jvm/patmat_opt_primitive_typetest.check b/test/files/jvm/patmat_opt_primitive_typetest.check
deleted file mode 100644
index 43f53aba12..0000000000
--- a/test/files/jvm/patmat_opt_primitive_typetest.check
+++ /dev/null
@@ -1 +0,0 @@
-bytecode identical
diff --git a/test/files/jvm/patmat_opt_primitive_typetest.flags b/test/files/jvm/patmat_opt_primitive_typetest.flags
deleted file mode 100644
index b9bb09167e..0000000000
--- a/test/files/jvm/patmat_opt_primitive_typetest.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimize -Ybackend:GenASM
diff --git a/test/files/jvm/patmat_opt_primitive_typetest/Analyzed_1.scala b/test/files/jvm/patmat_opt_primitive_typetest/Analyzed_1.scala
deleted file mode 100644
index c961082fa7..0000000000
--- a/test/files/jvm/patmat_opt_primitive_typetest/Analyzed_1.scala
+++ /dev/null
@@ -1,24 +0,0 @@
-// this class's bytecode, compiled under -optimize is analyzed by the test
-// method a's bytecode should be identical to method b's bytecode
-class SameBytecode {
- case class Foo(x: Int, y: String)
-
- def a =
- Foo(1, "a") match {
- case Foo(_: Int, y) => y
- }
-
- // this method's body holds the tree that should be generated by the pattern matcher for method a (-Xprint:patmat)
- // the test checks that bytecode for a and b is identical (modulo line numbers)
- // we can't diff trees as they are quite different (patmat uses jumps to labels that cannot be expressed in source, for example)
- // note that the actual tree is quite bad: we do an unnecessary null check, and local val (x3)
- // some of these will be fixed soon (the initial null check is for the scrutinee, which is harder to fix in patmat)
- def b: String = {
- val x1 = Foo(1, "a")
- if (x1.ne(null)) {
- return x1.y
- }
-
- throw new MatchError(x1)
- }
-} \ No newline at end of file
diff --git a/test/files/jvm/patmat_opt_primitive_typetest/test.scala b/test/files/jvm/patmat_opt_primitive_typetest/test.scala
deleted file mode 100644
index 2927e763d5..0000000000
--- a/test/files/jvm/patmat_opt_primitive_typetest/test.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-import scala.tools.partest.BytecodeTest
-
-object Test extends BytecodeTest {
- def show: Unit = {
- val classNode = loadClassNode("SameBytecode")
- sameBytecode(getMethod(classNode, "a"), getMethod(classNode, "b"))
- }
-}
diff --git a/test/files/jvm/reactor-exceptionOnSend.check b/test/files/jvm/reactor-exceptionOnSend.check
deleted file mode 100644
index 45d62e26a7..0000000000
--- a/test/files/jvm/reactor-exceptionOnSend.check
+++ /dev/null
@@ -1,2 +0,0 @@
-receiver handles exception
-process
diff --git a/test/files/jvm/reactor-exceptionOnSend.scala b/test/files/jvm/reactor-exceptionOnSend.scala
deleted file mode 100644
index 6d79fc9d13..0000000000
--- a/test/files/jvm/reactor-exceptionOnSend.scala
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.Reactor
-import scala.actors.Actor._
-
-case class MyException(text: String) extends Exception(text)
-
-object A extends Reactor[Any] {
- override def exceptionHandler = {
- case MyException(text) =>
- println("receiver handles exception")
- }
-
- def guard(): Boolean =
- if (state == 0) {
- state = 1
- throw MyException("illegal state")
- } else
- true
-
- var state = 0
-
- def act() {
- try {
- loop {
- react {
- case 'hello if guard() =>
- println("process")
- exit()
- }
- }
- } catch {
- case e: Throwable if (!e.isInstanceOf[scala.util.control.ControlThrowable] &&
- !e.isInstanceOf[MyException]) =>
- e.printStackTrace()
- }
- }
-}
-
-object B extends Reactor[Any] {
- def act() {
- try {
- A.start()
- A ! 'hello
- A ! 'hello
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
- def main(args: Array[String]) {
- B.start()
- }
-}
diff --git a/test/files/jvm/reactor-producer-consumer.check b/test/files/jvm/reactor-producer-consumer.check
deleted file mode 100644
index d971cea19e..0000000000
--- a/test/files/jvm/reactor-producer-consumer.check
+++ /dev/null
@@ -1,10 +0,0 @@
-42
-42
-42
-42
-42
-42
-42
-42
-42
-42
diff --git a/test/files/jvm/reactor-producer-consumer.scala b/test/files/jvm/reactor-producer-consumer.scala
deleted file mode 100644
index ec34febe01..0000000000
--- a/test/files/jvm/reactor-producer-consumer.scala
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.Reactor
- case class Stop()
- case class Get(from: Reactor[Any])
- case class Put(x: Int)
-
- class UnboundedBuffer extends Reactor[Any] {
- def act() {
- try {
- react {
- case Stop() =>
- case Get(from) =>
- val consumer = from
- react {
- case msg @ Put(x) =>
- consumer ! x
- act()
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- class Producer(buf: UnboundedBuffer, n: Int, delay: Long, parent: Reactor[Any]) extends Reactor[Any] {
- def act() {
- try {
- var i = 0
- while (i < n) {
- i += 1
- if (delay > 0) Thread.sleep(delay)
- buf ! Put(42)
- }
- parent ! Stop()
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- class Consumer(buf: UnboundedBuffer, n: Int, delay: Long, parent: Reactor[Any]) extends Reactor[Any] {
- val step = n / 10
- var i = 0
- def act() {
- try {
- if (i < n) {
- i += 1
- if (delay > 0) Thread.sleep(delay)
- buf ! Get(this)
- react {
- case res =>
- if (i % step == 0)
- println(res)
- act()
- }
- } else {
- parent ! Stop()
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- def main(args: Array[String]) {
- val parent = new Reactor[Any] {
- def act() {
- try {
- val buffer = new UnboundedBuffer
- buffer.start()
- val producer = new Producer(buffer, 10000, 0, this)
- producer.start()
- val consumer = new Consumer(buffer, 10000, 0, this)
- consumer.start()
- react {
- case Stop() =>
- react {
- case Stop() =>
- buffer ! Stop()
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
- parent.start()
- }
-}
diff --git a/test/files/jvm/reactor.check b/test/files/jvm/reactor.check
deleted file mode 100644
index 7b16085797..0000000000
--- a/test/files/jvm/reactor.check
+++ /dev/null
@@ -1,22 +0,0 @@
-Pong: ping 0
-Ping: pong
-Pong: ping 10000
-Ping: pong
-Pong: ping 20000
-Ping: pong
-Pong: ping 30000
-Ping: pong
-Pong: ping 40000
-Ping: pong
-Pong: ping 50000
-Ping: pong
-Pong: ping 60000
-Ping: pong
-Pong: ping 70000
-Ping: pong
-Pong: ping 80000
-Ping: pong
-Pong: ping 90000
-Ping: pong
-Ping: stop
-Pong: stop
diff --git a/test/files/jvm/reactor.scala b/test/files/jvm/reactor.scala
deleted file mode 100644
index 91ded27f07..0000000000
--- a/test/files/jvm/reactor.scala
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Ping pong example for Reactor.
- *
- * @author Philipp Haller
- */
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-
-import scala.actors.Reactor
-
-case class Ping(from: Reactor[Any])
-case object Pong
-case object Stop
-
- def main(args: Array[String]) {
- val pong = new PongActor
- val ping = new PingActor(100000, pong)
- ping.start
- pong.start
- }
-
-class PingActor(count: Int, pong: Reactor[Any]) extends Reactor[Any] {
- def act() {
- try {
- var pingsLeft = count - 1
- pong ! Ping(this)
- loop {
- react {
- case Pong =>
- if (pingsLeft % 10000 == 0)
- println("Ping: pong")
- if (pingsLeft > 0) {
- pong ! Ping(this)
- pingsLeft -= 1
- } else {
- println("Ping: stop")
- pong ! Stop
- exit()
- }
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
-class PongActor extends Reactor[Any] {
- def act() {
- try {
- var pongCount = 0
- loop {
- react {
- case Ping(from) =>
- if (pongCount % 10000 == 0)
- println("Pong: ping "+pongCount)
- from ! Pong
- pongCount += 1
- case Stop =>
- println("Pong: stop")
- exit()
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-}
diff --git a/test/files/jvm/replyablereactor.check b/test/files/jvm/replyablereactor.check
deleted file mode 100644
index 0944b17279..0000000000
--- a/test/files/jvm/replyablereactor.check
+++ /dev/null
@@ -1,5 +0,0 @@
-'hello
-'hello
-'hello
-'hello
-'hello
diff --git a/test/files/jvm/replyablereactor.scala b/test/files/jvm/replyablereactor.scala
deleted file mode 100644
index 4c4e13d9ab..0000000000
--- a/test/files/jvm/replyablereactor.scala
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.ReplyReactor
-
-class MyActor extends ReplyReactor {
- def act() {
- try {
- loop {
- react {
- case 'hello =>
- sender ! 'hello
- case 'stop =>
- exit()
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
- def main(args: Array[String]) {
- val a = new MyActor
- a.start()
-
- val b = new ReplyReactor {
- def act() {
- try {
- react {
- case r: MyActor =>
- var i = 0
- loop {
- i += 1
- val ft = r !! 'hello
- ft.inputChannel.react {
- case msg =>
- if (i % 10000 == 0)
- println(msg)
- if (i >= 50000) {
- r ! 'stop
- exit()
- }
- }
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
- b.start()
-
- b ! a
- }
-}
diff --git a/test/files/jvm/replyablereactor2.check b/test/files/jvm/replyablereactor2.check
deleted file mode 100644
index 0944b17279..0000000000
--- a/test/files/jvm/replyablereactor2.check
+++ /dev/null
@@ -1,5 +0,0 @@
-'hello
-'hello
-'hello
-'hello
-'hello
diff --git a/test/files/jvm/replyablereactor2.scala b/test/files/jvm/replyablereactor2.scala
deleted file mode 100644
index 21f33cce56..0000000000
--- a/test/files/jvm/replyablereactor2.scala
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors._
-import scala.actors.Actor._
-
-class MyActor extends ReplyReactor {
- def act() {
- try {
- loop {
- react {
- case 'hello =>
- sender ! 'hello
- case 'stop =>
- exit()
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
- def main(args: Array[String]) {
- val a = new MyActor
- a.start()
-
- val b = new Reactor[Any] {
- def act() {
- try {
- react {
- case r: MyActor =>
- var i = 0
- loop {
- i += 1
- val ft = r !! 'hello
- val msg = ft()
- if (i % 10000 == 0)
- println(msg)
- if (i >= 50000) {
- r ! 'stop
- exit()
- }
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
- b.start()
-
- b ! a
- }
-}
diff --git a/test/files/jvm/replyablereactor3.check b/test/files/jvm/replyablereactor3.check
deleted file mode 100644
index 0944b17279..0000000000
--- a/test/files/jvm/replyablereactor3.check
+++ /dev/null
@@ -1,5 +0,0 @@
-'hello
-'hello
-'hello
-'hello
-'hello
diff --git a/test/files/jvm/replyablereactor3.scala b/test/files/jvm/replyablereactor3.scala
deleted file mode 100644
index 5810ed053f..0000000000
--- a/test/files/jvm/replyablereactor3.scala
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors._
-import scala.actors.Actor._
-
-class MyActor extends ReplyReactor {
- def act() {
- try {
- loop {
- react {
- case 'hello =>
- sender ! 'hello
- case 'stop =>
- exit()
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
- def main(args: Array[String]) {
- val a = new MyActor
- a.start()
-
- val b = new Reactor[Any] {
- def act() {
- try {
- react {
- case r: MyActor =>
- var i = 0
- loop {
- i += 1
- val msg = r !? 'hello
- if (i % 10000 == 0)
- println(msg)
- if (i >= 50000) {
- r ! 'stop
- exit()
- }
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
- b.start()
-
- b ! a
- }
-}
diff --git a/test/files/jvm/replyablereactor4.check b/test/files/jvm/replyablereactor4.check
deleted file mode 100644
index cac0fffe3b..0000000000
--- a/test/files/jvm/replyablereactor4.check
+++ /dev/null
@@ -1,5 +0,0 @@
-Some('hello)
-Some('hello)
-Some('hello)
-Some('hello)
-Some('hello)
diff --git a/test/files/jvm/replyablereactor4.scala b/test/files/jvm/replyablereactor4.scala
deleted file mode 100644
index 95d63684dd..0000000000
--- a/test/files/jvm/replyablereactor4.scala
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors._
-import scala.actors.Actor._
-
-class MyActor extends ReplyReactor {
- def act() {
- try {
- loop {
- react {
- case 'hello =>
- sender ! 'hello
- case 'stop =>
- exit()
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
- def main(args: Array[String]) {
- val a = new MyActor
- a.start()
-
- val b = new Reactor[Any] {
- def act() {
- try {
- react {
- case r: MyActor =>
- var i = 0
- loop {
- i += 1
- val msg = r !? (500, 'hello)
- if (i % 200000 == 0)
- println(msg)
- if (i >= 1000000) {
- r ! 'stop
- exit()
- }
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
- b.start()
-
- b ! a
- }
-}
diff --git a/test/files/jvm/replyreactor-react-sender.check b/test/files/jvm/replyreactor-react-sender.check
deleted file mode 100644
index d86bac9de5..0000000000
--- a/test/files/jvm/replyreactor-react-sender.check
+++ /dev/null
@@ -1 +0,0 @@
-OK
diff --git a/test/files/jvm/replyreactor-react-sender.scala b/test/files/jvm/replyreactor-react-sender.scala
deleted file mode 100644
index fdcea09035..0000000000
--- a/test/files/jvm/replyreactor-react-sender.scala
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.ReplyReactor
- import scala.actors.Actor._
-
- val NUM = 2000
-
- def main(args: Array[String]) {
- var b: ReplyReactor = null
-
- val a = new ReplyReactor {
- def act() {
- try {
- var i = 0
- loopWhile (i < NUM) {
- i += 1
- react {
- case 'hello if sender == this => b ! 'fail
- case 'hello if sender == b => // do nothing
- }
- } andThen {
- b ! 'ok
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
- a.start()
-
- b = new ReplyReactor {
- def act() {
- try {
- for (_ <- 0 until NUM)
- a ! 'hello
- react {
- case 'fail => println("FAIL")
- case 'ok => println("OK")
- case other => println(other)
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
- b.start()
- }
-
-}
diff --git a/test/files/jvm/replyreactor.check b/test/files/jvm/replyreactor.check
deleted file mode 100644
index 4b2fea867a..0000000000
--- a/test/files/jvm/replyreactor.check
+++ /dev/null
@@ -1 +0,0 @@
-'hello
diff --git a/test/files/jvm/replyreactor.scala b/test/files/jvm/replyreactor.scala
deleted file mode 100644
index 7512fb0eb2..0000000000
--- a/test/files/jvm/replyreactor.scala
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.ReplyReactor
- def main(args: Array[String]) {
- val a = new ReplyReactor {
- def act() {
- try {
- react {
- case 'hello =>
- sender ! 'hello
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
- a.start()
-
- val b = new ReplyReactor {
- def act() {
- try {
- react {
- case r: ReplyReactor =>
- r ! 'hello
- react {
- case any =>
- println(any)
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
- b.start()
-
- b ! a
- }
-}
diff --git a/test/files/jvm/scala-concurrent-tck.check b/test/files/jvm/scala-concurrent-tck.check
new file mode 100644
index 0000000000..88cff75abb
--- /dev/null
+++ b/test/files/jvm/scala-concurrent-tck.check
@@ -0,0 +1 @@
+warning: there were 75 deprecation warnings (since 2.12.0); re-run with -deprecation for details
diff --git a/test/files/jvm/scala-concurrent-tck.scala b/test/files/jvm/scala-concurrent-tck.scala
index ce86d4aef0..7197c1d853 100644
--- a/test/files/jvm/scala-concurrent-tck.scala
+++ b/test/files/jvm/scala-concurrent-tck.scala
@@ -90,6 +90,25 @@ trait FutureCallbacks extends TestBase {
promise.success(-1)
}
+ def stressTestNumberofCallbacks(): Unit = once {
+ done =>
+ val promise = Promise[Unit]
+ val otherPromise = Promise[Unit]
+ def attachMeaninglessCallbacksTo(f: Future[Any]): Unit = (1 to 1000).foreach(_ => f.onComplete(_ => ()))
+ attachMeaninglessCallbacksTo(promise.future)
+ val future = promise.future.flatMap { _ =>
+ attachMeaninglessCallbacksTo(otherPromise.future)
+ otherPromise.future
+ }
+ val numbers = new java.util.concurrent.ConcurrentHashMap[Int, Unit]()
+ (0 to 10000) foreach { x => numbers.put(x, ()) }
+ Future.sequence((0 to 10000) map { x => future.andThen({ case _ => numbers.remove(x) }) }) onComplete {
+ _ => done(numbers.isEmpty)
+ }
+ promise.success(())
+ otherPromise.success(())
+ }
+
testOnSuccess()
testOnSuccessWhenCompleted()
testOnSuccessWhenFailed()
@@ -100,6 +119,7 @@ trait FutureCallbacks extends TestBase {
//testOnFailureWhenSpecialThrowable(7, new InterruptedException)
testThatNestedCallbacksDoNotYieldStackOverflow()
testOnFailureWhenTimeoutException()
+ stressTestNumberofCallbacks()
}
@@ -165,6 +185,100 @@ def testTransformFailure(): Unit = once {
g onFailure { case e => done(e eq transformed) }
}
+ def testTransformResultToResult(): Unit = once {
+ done =>
+ Future("foo").transform {
+ case Success(s) => Success(s.toUpperCase)
+ case Failure(f) => throw new Exception("test failed")
+ } onComplete {
+ case Success("FOO") => done(true)
+ case _ => done(false)
+ }
+ }
+
+ def testTransformResultToFailure(): Unit = once {
+ done =>
+ val e = new Exception("expected")
+ Future("foo").transform {
+ case Success(s) => Failure(e)
+ case Failure(f) => throw new Exception("test failed")
+ } onComplete {
+ case Failure(`e`) => done(true)
+ case _ => done(false)
+ }
+ }
+
+ def testTransformFailureToResult(): Unit = once {
+ done =>
+ val e = "foo"
+ Future(throw new Exception("initial")).transform {
+ case Success(s) => throw new Exception("test failed")
+ case Failure(f) => Success(e)
+ } onComplete {
+ case Success(`e`) => done(true)
+ case _ => done(false)
+ }
+ }
+
+ def testTransformFailureToFailure(): Unit = once {
+ done =>
+ val e = new Exception("expected")
+ Future(throw new Exception("initial")).transform {
+ case Success(s) => throw new Exception("test failed")
+ case Failure(f) => Failure(e)
+ } onComplete {
+ case Failure(`e`) => done(true)
+ case _ => done(false)
+ }
+ }
+
+ def testTransformWithResultToResult(): Unit = once {
+ done =>
+ Future("foo").transformWith {
+ case Success(s) => Future(s.toUpperCase)
+ case Failure(f) => throw new Exception("test failed")
+ } onComplete {
+ case Success("FOO") => done(true)
+ case _ => done(false)
+ }
+ }
+
+ def testTransformWithResultToFailure(): Unit = once {
+ done =>
+ val e = new Exception("expected")
+ Future("foo").transformWith {
+ case Success(s) => Future(throw e)
+ case Failure(f) => throw new Exception("test failed")
+ } onComplete {
+ case Failure(`e`) => done(true)
+ case _ => done(false)
+ }
+ }
+
+ def testTransformWithFailureToResult(): Unit = once {
+ done =>
+ val e = "foo"
+ Future(throw new Exception("initial")).transformWith {
+ case Success(s) => throw new Exception("test failed")
+ case Failure(f) => Future(e)
+ } onComplete {
+ case Success(`e`) => done(true)
+ case _ => done(false)
+ }
+ }
+
+ def testTransformWithFailureToFailure(): Unit = once {
+ done =>
+ val e = new Exception("expected")
+ Future(throw new Exception("initial")).transformWith {
+ case Success(s) => throw new Exception("test failed")
+ case Failure(f) => Future(throw e)
+ } onComplete {
+ case Failure(`e`) => done(true)
+ case _ => done(false)
+ }
+ }
+
def testFoldFailure(): Unit = once {
done =>
val f = Future[Unit] { throw new Exception("expected") }
@@ -189,6 +303,16 @@ def testTransformFailure(): Unit = once {
g onFailure { case t => done(t.getMessage() == "expected") }
}
+ def testFlatMapDelayed(): Unit = once {
+ done =>
+ val f = Future { 5 }
+ val p = Promise[Int]
+ val g = f flatMap { _ => p.future }
+ g onSuccess { case x => done(x == 10) }
+ g onFailure { case _ => done(false) }
+ p.success(10)
+ }
+
def testFilterSuccess(): Unit = once {
done =>
val f = Future { 4 }
@@ -352,10 +476,19 @@ def testTransformFailure(): Unit = once {
h onFailure { case e => done(e eq cause) }
}
+ def testFallbackToThis(): Unit = {
+ def check(f: Future[Int]) = assert((f fallbackTo f) eq f)
+
+ check(Future { 1 })
+ check(Future.successful(1))
+ check(Future.failed[Int](new Exception))
+ }
+
testMapSuccess()
testMapFailure()
testFlatMapSuccess()
testFlatMapFailure()
+ testFlatMapDelayed()
testFilterSuccess()
testFilterFailure()
testCollectSuccess()
@@ -373,6 +506,16 @@ def testTransformFailure(): Unit = once {
testFallbackToFailure()
testTransformSuccess()
testTransformSuccessPF()
+ testTransformFailure()
+ testTransformFailurePF()
+ testTransformResultToResult()
+ testTransformResultToFailure()
+ testTransformFailureToResult()
+ testTransformFailureToFailure()
+ testTransformWithResultToResult()
+ testTransformWithResultToFailure()
+ testTransformWithFailureToResult()
+ testTransformWithFailureToFailure()
}
@@ -517,7 +660,7 @@ trait BlockContexts extends TestBase {
// test BlockContext in our default ExecutionContext
def testDefaultFJP(): Unit = {
val bc = getBlockContext(BlockContext.current)
- assert(bc.isInstanceOf[scala.concurrent.forkjoin.ForkJoinWorkerThread])
+ assert(bc.isInstanceOf[java.util.concurrent.ForkJoinWorkerThread])
}
// test BlockContext inside BlockContext.withBlockContext
@@ -593,6 +736,17 @@ trait Exceptions extends TestBase {
}
+trait GlobalExecutionContext extends TestBase {
+ def testNameOfGlobalECThreads(): Unit = once {
+ done => Future({
+ val expectedName = "scala-execution-context-global-"+ Thread.currentThread.getId
+ done(expectedName == Thread.currentThread.getName)
+ })(ExecutionContext.global)
+ }
+
+ testNameOfGlobalECThreads()
+}
+
trait CustomExecutionContext extends TestBase {
import scala.concurrent.{ ExecutionContext, Awaitable }
@@ -772,6 +926,7 @@ with FutureProjections
with Promises
with BlockContexts
with Exceptions
+with GlobalExecutionContext
with CustomExecutionContext
with ExecutionContextPrepare
{
diff --git a/test/files/jvm/scheduler-adapter.check b/test/files/jvm/scheduler-adapter.check
deleted file mode 100644
index b278674cf0..0000000000
--- a/test/files/jvm/scheduler-adapter.check
+++ /dev/null
@@ -1,6 +0,0 @@
-before
-before
-before
-Two: received msg
-before
-One: received msg
diff --git a/test/files/jvm/scheduler-adapter.scala b/test/files/jvm/scheduler-adapter.scala
deleted file mode 100644
index 1c9cfe7019..0000000000
--- a/test/files/jvm/scheduler-adapter.scala
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.{Actor, SchedulerAdapter}
-
-trait AdaptedActor extends Actor {
- override def scheduler =
- Test.adapted
-}
-
-object One extends AdaptedActor {
- def act() {
- try {
- Two.start()
- Two ! 'MsgForTwo
- react {
- case 'MsgForOne =>
- println("One: received msg")
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
-object Two extends AdaptedActor {
- def act() {
- try {
- react {
- case 'MsgForTwo =>
- println("Two: received msg")
- One ! 'MsgForOne
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
- val adapted =
- new SchedulerAdapter {
- def execute(block: => Unit) {
- println("before")
- block
- }
- }
-
- def main(args: Array[String]) {
- One.start()
- }
-}
diff --git a/test/files/jvm/serialization-new.check b/test/files/jvm/serialization-new.check
index cb26446f40..da41ba4bdd 100644
--- a/test/files/jvm/serialization-new.check
+++ b/test/files/jvm/serialization-new.check
@@ -1,4 +1,6 @@
-warning: there were three deprecation warnings; re-run with -deprecation for details
+warning: there were two deprecation warnings (since 2.11.0)
+warning: there were three deprecation warnings (since 2.12.0)
+warning: there were 5 deprecation warnings in total; re-run with -deprecation for details
a1 = Array[1,2,3]
_a1 = Array[1,2,3]
arrayEquals(a1, _a1): true
@@ -85,24 +87,24 @@ x = List((buffers,20), (layers,2), (title,3))
y = List((buffers,20), (layers,2), (title,3))
x equals y: true, y equals x: true
-x = Map(buffers -> 20, layers -> 2, title -> 3)
-y = Map(buffers -> 20, layers -> 2, title -> 3)
+x = ListMap(buffers -> 20, layers -> 2, title -> 3)
+y = ListMap(buffers -> 20, layers -> 2, title -> 3)
x equals y: true, y equals x: true
-x = ListSet(5, 3)
-y = ListSet(5, 3)
+x = ListSet(3, 5)
+y = ListSet(3, 5)
x equals y: true, y equals x: true
x = Queue(a, b, c)
y = Queue(a, b, c)
x equals y: true, y equals x: true
-x = Range(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
-y = Range(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
+x = Range 0 until 10
+y = Range 0 until 10
x equals y: true, y equals x: true
-x = NumericRange(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
-y = NumericRange(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
+x = NumericRange 0 until 10
+y = NumericRange 0 until 10
x equals y: true, y equals x: true
x = Map(1 -> A, 2 -> B, 3 -> C)
@@ -266,12 +268,12 @@ x = ParHashSet(1, 2, 3)
y = ParHashSet(1, 2, 3)
x equals y: true, y equals x: true
-x = ParRange(0, 1, 2, 3, 4)
-y = ParRange(0, 1, 2, 3, 4)
+x = ParRange 0 to 4
+y = ParRange 0 to 4
x equals y: true, y equals x: true
-x = ParRange(0, 1, 2, 3)
-y = ParRange(0, 1, 2, 3)
+x = ParRange 0 until 4
+y = ParRange 0 until 4
x equals y: true, y equals x: true
x = ParMap(5 -> 1, 10 -> 2)
diff --git a/test/files/jvm/serialization.check b/test/files/jvm/serialization.check
index cb26446f40..38017d829f 100644
--- a/test/files/jvm/serialization.check
+++ b/test/files/jvm/serialization.check
@@ -1,4 +1,6 @@
-warning: there were three deprecation warnings; re-run with -deprecation for details
+warning: there were two deprecation warnings (since 2.11.0)
+warning: there was one deprecation warning (since 2.12.0)
+warning: there were three deprecation warnings in total; re-run with -deprecation for details
a1 = Array[1,2,3]
_a1 = Array[1,2,3]
arrayEquals(a1, _a1): true
@@ -85,24 +87,24 @@ x = List((buffers,20), (layers,2), (title,3))
y = List((buffers,20), (layers,2), (title,3))
x equals y: true, y equals x: true
-x = Map(buffers -> 20, layers -> 2, title -> 3)
-y = Map(buffers -> 20, layers -> 2, title -> 3)
+x = ListMap(buffers -> 20, layers -> 2, title -> 3)
+y = ListMap(buffers -> 20, layers -> 2, title -> 3)
x equals y: true, y equals x: true
-x = ListSet(5, 3)
-y = ListSet(5, 3)
+x = ListSet(3, 5)
+y = ListSet(3, 5)
x equals y: true, y equals x: true
x = Queue(a, b, c)
y = Queue(a, b, c)
x equals y: true, y equals x: true
-x = Range(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
-y = Range(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
+x = Range 0 until 10
+y = Range 0 until 10
x equals y: true, y equals x: true
-x = NumericRange(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
-y = NumericRange(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
+x = NumericRange 0 until 10
+y = NumericRange 0 until 10
x equals y: true, y equals x: true
x = Map(1 -> A, 2 -> B, 3 -> C)
@@ -266,12 +268,12 @@ x = ParHashSet(1, 2, 3)
y = ParHashSet(1, 2, 3)
x equals y: true, y equals x: true
-x = ParRange(0, 1, 2, 3, 4)
-y = ParRange(0, 1, 2, 3, 4)
+x = ParRange 0 to 4
+y = ParRange 0 to 4
x equals y: true, y equals x: true
-x = ParRange(0, 1, 2, 3)
-y = ParRange(0, 1, 2, 3)
+x = ParRange 0 until 4
+y = ParRange 0 until 4
x equals y: true, y equals x: true
x = ParMap(5 -> 1, 10 -> 2)
diff --git a/test/files/jvm/t1449.scala b/test/files/jvm/t1449.scala
deleted file mode 100644
index 7917d6f6d5..0000000000
--- a/test/files/jvm/t1449.scala
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.Actor._
- import scala.actors.Future
- import scala.actors.Futures._
- def main(args: Array[String]) {
- val a = actor {
- try {
- react {
- case ft: Future[a] =>
- println(ft())
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- try {
- val ft = future { 42 }
- a ! ft
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
diff --git a/test/files/jvm/t1948.scala b/test/files/jvm/t1948.scala
deleted file mode 100644
index 95777b8037..0000000000
--- a/test/files/jvm/t1948.scala
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors._
- import scala.actors.Actor._
-
- def main (args: Array[String]) {
- val actors = (1 to 1000).toList map { x => actor {
- try {
- loop { react {
- case x: Array[Int] => reply ("OK"); exit }}
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- } }
- try {
- actors foreach { x => x !? new Array[Int] (1000000) }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-
-}
diff --git a/test/files/jvm/t2359.check b/test/files/jvm/t2359.check
deleted file mode 100644
index 8a1218a102..0000000000
--- a/test/files/jvm/t2359.check
+++ /dev/null
@@ -1,5 +0,0 @@
-1
-2
-3
-4
-5
diff --git a/test/files/jvm/t2359.scala b/test/files/jvm/t2359.scala
deleted file mode 100644
index 76b78d44f7..0000000000
--- a/test/files/jvm/t2359.scala
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.Futures._
- def main(args: Array[String]) {
- val x = future {
- try {
- System.out.println(1)
- future {
- try {
- System.out.println(2)
- future {
- try {
- System.out.println(3)
- future {
- try {
- System.out.println(4)
- future {
- try {
- System.out.println(5)
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }()
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }()
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }()
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }()
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }()
- }
-}
diff --git a/test/files/jvm/t2530.check b/test/files/jvm/t2530.check
deleted file mode 100644
index 0f1c02158d..0000000000
--- a/test/files/jvm/t2530.check
+++ /dev/null
@@ -1,21 +0,0 @@
- Iteration 1 succeeded
- Iteration 2 succeeded
- Iteration 3 succeeded
- Iteration 4 succeeded
- Iteration 5 succeeded
- Iteration 6 succeeded
- Iteration 7 succeeded
- Iteration 8 succeeded
- Iteration 9 succeeded
- Iteration 10 succeeded
- Iteration 11 succeeded
- Iteration 12 succeeded
- Iteration 13 succeeded
- Iteration 14 succeeded
- Iteration 15 succeeded
- Iteration 16 succeeded
- Iteration 17 succeeded
- Iteration 18 succeeded
- Iteration 19 succeeded
- Iteration 20 succeeded
-Test done with no deadlock. Try again, it will not occur...
diff --git a/test/files/jvm/t2530.scala b/test/files/jvm/t2530.scala
deleted file mode 100644
index b41661e623..0000000000
--- a/test/files/jvm/t2530.scala
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.{Future, Futures}
-
- def main(args:Array[String]) : Unit = {
- //scala.actors.Debug.level = 3
- val size = /*if (args.length > 0) Integer.parseInt(args(0)) else*/ 8
- val (m,n) = (size, size)
- def random = (for (i <- 0 until m*n) yield java.lang.Math.random).toArray
- val A = Matrix(m, n, random)
- val B = Matrix(m, n, random)
- val format = new java.text.DecimalFormat("000.00'ms'");
- var iter = 1
- val done = 21
- while (iter < done) {
- val start = System.nanoTime()
- val result = A * B
- val time = System.nanoTime() - start
- result match {
- case Some(result) => {
- printf(" Iteration %2d succeeded %n", iter/*, format.format(time / 1e6)*/)
- iter += 1
- }
- case None => {
- printf(">>>> Iteration %2d failed after %s <<<<< %n", iter, format.format(time / 1e6))
- iter = done
- }
- }
- }
- println("Test done with no deadlock. Try again, it will not occur...")
- }
-
-case class Matrix(numRows: Int, numCols: Int, values: Array[Double]) {
-
- def this(m:Int, n:Int) = this(m, n, new Array[Double](m*n))
-
- def offset(i:Int, j:Int) = i * numCols + j
- def apply(i:Int, j:Int) = values( offset(i,j) )
- def update(i:Int, j:Int, value:Double) = values(offset(i, j)) = value;
-
- def *(by:Matrix) = {
- val aM = numRows
- val aN = numCols
- assert(aM == by.numCols)
- assert(aN == by.numRows)
- val resultMatrix = new Matrix(aM, aM)
- val m = aM.asInstanceOf[Int]
- val n = aN.asInstanceOf[Int]
-
- val rows = for (j <- 0 until m) yield {
- Futures.future {
- try {
- val b_j = new Array[Double](n)
- var k = 0
- while (k < n) { // sadly, while loops are still faster than for loops
- b_j(k) = by(k,j)
- k += 1
- }
- var i = 0
- while (i < m) {
- var s = 0.0d;
- k = 0
- while (k < n) {
- s += Matrix.this(i,k) * b_j(k)
- k += 1
- }
- resultMatrix(i,j) = s
- i += 1
- }
- //printf("future %d of %d completed.%n", j, m)
- j
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- // rows.foreach { x=> x() } // This appears to force sequential execution, so use:
- // timeout is 10 years; see http://lampsvn.epfl.ch/trac/scala/ticket/2515
- val done: List[Option[Any]] = try {
- Futures.awaitAll(10*365*24*60*60*1000, rows.toArray : _*) // list to array, as varargs.
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- List()
- }
-
- if (done.contains(None))
- None
- else
- Some(resultMatrix)
- }
-
-}
-}
diff --git a/test/files/jvm/t3102.check b/test/files/jvm/t3102.check
deleted file mode 100644
index d705e0b20e..0000000000
--- a/test/files/jvm/t3102.check
+++ /dev/null
@@ -1,2 +0,0 @@
-42
-OK
diff --git a/test/files/jvm/t3102.scala b/test/files/jvm/t3102.scala
deleted file mode 100644
index d0e0704859..0000000000
--- a/test/files/jvm/t3102.scala
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.{Actor, TIMEOUT}
- import Actor._
-
- def main(args: Array[String]) {
- val a = actor {
- try {
- react {
- case 'hello =>
- reply(42)
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-
- val b = actor {
- try {
- self.trapExit = true
- val ft = a !! 'hello
- println(ft())
- // no message should be left over in mailbox
- reactWithin(0) {
- case TIMEOUT =>
- println("OK")
- case any =>
- println(any)
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-}
diff --git a/test/files/jvm/t3356.check b/test/files/jvm/t3356.check
deleted file mode 100644
index 25f47b70c9..0000000000
--- a/test/files/jvm/t3356.check
+++ /dev/null
@@ -1,3 +0,0 @@
-sending download requests
-Couldn't download image because of java.lang.Exception: no connection
-Couldn't download image because of java.lang.Exception: no connection
diff --git a/test/files/jvm/t3356.scala b/test/files/jvm/t3356.scala
deleted file mode 100644
index 53bfd737cd..0000000000
--- a/test/files/jvm/t3356.scala
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.{Actor, Exit, !, UncaughtException}
-import Actor._
-
-case class ImageInfo(text: String) {
- def downloadImage(): ImageData = {
- ImageData(text)
- }
-}
-
-case class ImageData(text: String)
-case class Download(info: ImageInfo)
-
-
- def scanForImageInfo(url: String): List[ImageInfo] =
- List(ImageInfo("A"), ImageInfo("B"))
-
- def renderImage(data: ImageData) {
- println("rendering image "+data.text)
- }
-
- def renderImages(url: String) {
- val imageInfos = scanForImageInfo(url)
- println("sending download requests")
- val dataFutures = for (info <- imageInfos) yield {
- val loader = link {
- react { case Download(info) =>
- throw new Exception("no connection")
- reply(info.downloadImage())
- }; {}
- }
- loader !! Download(info)
- }
- var i = 0
- loopWhile (i < imageInfos.size) {
- i += 1
- val FutureInput = dataFutures(i-1).inputChannel
- react {
- case FutureInput ! (data @ ImageData(_)) =>
- renderImage(data)
- case Exit(from, UncaughtException(_, Some(Download(info)), _, _, cause)) =>
- println("Couldn't download image because of "+cause)
- }
- }
- println("OK, all images rendered.")
- }
-
- def main(args: Array[String]) {
- actor {
- self.trapExit = true
- renderImages("panorama.epfl.ch")
- }
- }
-
-}
diff --git a/test/files/jvm/t3365.check b/test/files/jvm/t3365.check
deleted file mode 100644
index 0944b17279..0000000000
--- a/test/files/jvm/t3365.check
+++ /dev/null
@@ -1,5 +0,0 @@
-'hello
-'hello
-'hello
-'hello
-'hello
diff --git a/test/files/jvm/t3365.scala b/test/files/jvm/t3365.scala
deleted file mode 100644
index 8321428093..0000000000
--- a/test/files/jvm/t3365.scala
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.{ReplyReactor, Channel, Actor, Future}
-
-case class ChannelMsg(chan: Channel[Any])
-
-class MyActor extends Actor {
- def act() {
- try {
- val chan = new Channel[Any](this)
- loop {
- react {
- case other: ReplyReactor =>
- other ! ChannelMsg(chan)
- loop {
- chan.react {
- case 'hello =>
- reply('hello)
- case 'stop =>
- exit()
- }
- }
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
- def main(args: Array[String]) {
- val a = new MyActor
- a.start()
-
- val b = new Actor {
- def act() {
- try {
- react {
- case ChannelMsg(c) =>
- var i = 0
- loop {
- i += 1
- val ft: Future[Any] = c !! 'hello
- ft.inputChannel.react {
- case msg =>
- if (i % 10000 == 0)
- println(msg)
- if (i >= 50000) {
- c ! 'stop
- exit()
- }
- }
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
- b.start()
-
- a ! b
- }
-}
diff --git a/test/files/jvm/t3407.check b/test/files/jvm/t3407.check
deleted file mode 100644
index a133c88bbe..0000000000
--- a/test/files/jvm/t3407.check
+++ /dev/null
@@ -1,10 +0,0 @@
-result: 42
-result: 42
-result: 42
-result: 42
-result: 42
-result: 42
-result: 42
-result: 42
-result: 42
-result: 42
diff --git a/test/files/jvm/t3407.scala b/test/files/jvm/t3407.scala
deleted file mode 100644
index 757fa3a438..0000000000
--- a/test/files/jvm/t3407.scala
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors._, scala.actors.Actor._
-
- def main(args: Array[String]) {
- for (i <- 1 to 10) {
- val ft = Futures.future { 42 }
- println("result: " + ft())
- }
-
- for (i <- 1 to 10) {
- receiveWithin(0) {
- case TIMEOUT =>
- case msg => println("unexpected: " + msg)
- }
- }
- }
-
-}
diff --git a/test/files/jvm/t3412-channel.check b/test/files/jvm/t3412-channel.check
deleted file mode 100644
index 954c6e835d..0000000000
--- a/test/files/jvm/t3412-channel.check
+++ /dev/null
@@ -1,10 +0,0 @@
-6
-6
-6
-6
-6
-6
-6
-6
-6
-6
diff --git a/test/files/jvm/t3412-channel.scala b/test/files/jvm/t3412-channel.scala
deleted file mode 100644
index af319d2303..0000000000
--- a/test/files/jvm/t3412-channel.scala
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors._, scala.actors.Actor._, scala.actors.Futures._
-
- def main(args: Array[String]) {
-
- actor {
- val C: Channel[Int] = new Channel[Int](self)
-
- def respondAll(fts: List[Future[Int]], cnt: Int): Unit =
- fts match {
- case List() => C ! 0
- case ft :: rest =>
- if (cnt % 100 == 0)
- println(ft())
- respondAll(rest, cnt + 1)
- }
-
- actor {
- val fts = for (_ <- 1 to 1000)
- yield C !! (3, {case x: Int => x})
-
- actor {
- respondAll(fts.toList, 0)
- }
- }
-
- loop {
- C.react {
- case 0 => exit()
- case i => reply(i * 2)
- }
- }
- }
-
- }
-
-}
diff --git a/test/files/jvm/t3412.check b/test/files/jvm/t3412.check
deleted file mode 100644
index 954c6e835d..0000000000
--- a/test/files/jvm/t3412.check
+++ /dev/null
@@ -1,10 +0,0 @@
-6
-6
-6
-6
-6
-6
-6
-6
-6
-6
diff --git a/test/files/jvm/t3412.scala b/test/files/jvm/t3412.scala
deleted file mode 100644
index fde6c04cb7..0000000000
--- a/test/files/jvm/t3412.scala
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors._, scala.actors.Actor._, scala.actors.Futures._
-
- def main(args: Array[String]) {
-
- val a = actor {
- loop { react {
- case i: Int => reply(i * 2)
- case 'stop => exit()
- } }
- }
-
- val fts = for (_ <- 1 to 1000)
- yield a !! (3, {case x: Int => x})
-
- def respondAll(fts: List[Future[Int]], cnt: Int): Unit =
- fts match {
- case List() => a ! 'stop
- case ft :: rest =>
- if (cnt % 100 == 0)
- println(ft())
- respondAll(rest, cnt + 1)
- }
-
- actor {
- respondAll(fts.toList, 0)
- }
-
- }
-
-}
diff --git a/test/files/jvm/t3470.check b/test/files/jvm/t3470.check
deleted file mode 100644
index 94cb526756..0000000000
--- a/test/files/jvm/t3470.check
+++ /dev/null
@@ -1,3 +0,0 @@
-A: started: 1
-A: started: 2
-A: started: 3
diff --git a/test/files/jvm/t3470.scala b/test/files/jvm/t3470.scala
deleted file mode 100644
index bcb1d4f8de..0000000000
--- a/test/files/jvm/t3470.scala
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors._
-
- def expectActorState(a: Reactor[T] forSome { type T }, s: Actor.State.Value) {
- var done = false
- var i = 0
- while (!done) {
- i = i + 1
- if (i == 10) { // only wait for 2 seconds total
- println("FAIL ["+a+": expected "+s+"]")
- done = true
- }
-
- Thread.sleep(200)
- if (a.getState == s) // success
- done = true
- }
- }
-
- def main(args: Array[String]) {
- val a = new Actor { var c = 0; def act() = { c += 1; println("A: started: " + c) } }
- a.start()
- expectActorState(a, Actor.State.Terminated)
- a.restart()
- expectActorState(a, Actor.State.Terminated)
- a.restart()
- }
-
-}
diff --git a/test/files/jvm/t3838.check b/test/files/jvm/t3838.check
deleted file mode 100644
index 154227a350..0000000000
--- a/test/files/jvm/t3838.check
+++ /dev/null
@@ -1 +0,0 @@
-caught java.lang.RuntimeException: unhandled timeout
diff --git a/test/files/jvm/t3838.scala b/test/files/jvm/t3838.scala
deleted file mode 100644
index a1a71d1049..0000000000
--- a/test/files/jvm/t3838.scala
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.Actor._
- def main(args: Array[String]) {
- actor {
- try {
- receiveWithin(1) {
- case str: String => println(str)
- }
- } catch {
- case e: Exception => println("caught "+e)
- }
- }
- }
-}
diff --git a/test/files/jvm/t6941.check b/test/files/jvm/t6941.check
deleted file mode 100644
index 43f53aba12..0000000000
--- a/test/files/jvm/t6941.check
+++ /dev/null
@@ -1 +0,0 @@
-bytecode identical
diff --git a/test/files/jvm/t6941.flags b/test/files/jvm/t6941.flags
deleted file mode 100644
index 49d036a887..0000000000
--- a/test/files/jvm/t6941.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimize
diff --git a/test/files/jvm/t6941/Analyzed_1.flags b/test/files/jvm/t6941/Analyzed_1.flags
deleted file mode 100644
index ad51758c39..0000000000
--- a/test/files/jvm/t6941/Analyzed_1.flags
+++ /dev/null
@@ -1 +0,0 @@
--nowarn
diff --git a/test/files/jvm/t6941/Analyzed_1.scala b/test/files/jvm/t6941/Analyzed_1.scala
deleted file mode 100644
index b6951f71ee..0000000000
--- a/test/files/jvm/t6941/Analyzed_1.scala
+++ /dev/null
@@ -1,11 +0,0 @@
-// this class's bytecode, compiled under -optimize is analyzed by the test
-// method a's bytecode should be identical to method b's bytecode
-class SameBytecode {
- def a(xs: List[Int]) = xs match {
- case x :: _ => x
- }
-
- def b(xs: List[Int]) = xs match {
- case xs: ::[Int] => xs.head
- }
-} \ No newline at end of file
diff --git a/test/files/jvm/t6941/test.scala b/test/files/jvm/t6941/test.scala
deleted file mode 100644
index fceb54487f..0000000000
--- a/test/files/jvm/t6941/test.scala
+++ /dev/null
@@ -1,15 +0,0 @@
-import scala.tools.partest.{BytecodeTest, ASMConverters}
-
-import scala.tools.nsc.util.JavaClassPath
-import java.io.InputStream
-import scala.tools.asm
-import asm.ClassReader
-import asm.tree.{ClassNode, InsnList}
-import scala.collection.JavaConverters._
-
-object Test extends BytecodeTest {
- def show: Unit = {
- val classNode = loadClassNode("SameBytecode")
- similarBytecode(getMethod(classNode, "a"), getMethod(classNode, "b"), ASMConverters.equivalentBytecode(_, _))
- }
-}
diff --git a/test/files/jvm/t7006.check b/test/files/jvm/t7006.check
deleted file mode 100644
index 6294b14d62..0000000000
--- a/test/files/jvm/t7006.check
+++ /dev/null
@@ -1,29 +0,0 @@
-[running phase parser on Foo_1.scala]
-[running phase namer on Foo_1.scala]
-[running phase packageobjects on Foo_1.scala]
-[running phase typer on Foo_1.scala]
-[running phase patmat on Foo_1.scala]
-[running phase superaccessors on Foo_1.scala]
-[running phase extmethods on Foo_1.scala]
-[running phase pickler on Foo_1.scala]
-[running phase refchecks on Foo_1.scala]
-[running phase uncurry on Foo_1.scala]
-[running phase tailcalls on Foo_1.scala]
-[running phase specialize on Foo_1.scala]
-[running phase explicitouter on Foo_1.scala]
-[running phase erasure on Foo_1.scala]
-[running phase posterasure on Foo_1.scala]
-[running phase lazyvals on Foo_1.scala]
-[running phase lambdalift on Foo_1.scala]
-[running phase constructors on Foo_1.scala]
-[running phase flatten on Foo_1.scala]
-[running phase mixin on Foo_1.scala]
-[running phase cleanup on Foo_1.scala]
-[running phase delambdafy on Foo_1.scala]
-[running phase icode on Foo_1.scala]
-[running phase inliner on Foo_1.scala]
-[running phase inlinehandlers on Foo_1.scala]
-[running phase closelim on Foo_1.scala]
-[running phase constopt on Foo_1.scala]
-[running phase dce on Foo_1.scala]
-[running phase jvm on icode]
diff --git a/test/files/jvm/t7006/Foo_1.flags b/test/files/jvm/t7006/Foo_1.flags
deleted file mode 100644
index 29a9d424f0..0000000000
--- a/test/files/jvm/t7006/Foo_1.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimise -Ydebug -Xfatal-warnings -Ybackend:GenASM
diff --git a/test/files/jvm/t7006/Foo_1.scala b/test/files/jvm/t7006/Foo_1.scala
deleted file mode 100644
index 3985557d9f..0000000000
--- a/test/files/jvm/t7006/Foo_1.scala
+++ /dev/null
@@ -1,10 +0,0 @@
-class Foo_1 {
- def foo {
- try {
- val x = 3 // this will be optimized away, leaving a useless jump only block
- } finally {
- print("hello")
- }
- while(true){} // ensure infinite loop doesn't break the algorithm
- }
-}
diff --git a/test/files/jvm/t7006/Test.scala b/test/files/jvm/t7006/Test.scala
deleted file mode 100644
index 065a23510e..0000000000
--- a/test/files/jvm/t7006/Test.scala
+++ /dev/null
@@ -1,19 +0,0 @@
-import scala.tools.partest.BytecodeTest
-import scala.tools.asm
-import asm.tree.InsnList
-import scala.collection.JavaConverters._
-
-object Test extends BytecodeTest {
- def show: Unit = {
- val classNode = loadClassNode("Foo_1")
- val methodNode = getMethod(classNode, "foo")
- assert(count(methodNode.instructions, asm.Opcodes.NOP) == 0)
- assert(count(methodNode.instructions, asm.Opcodes.GOTO) == 1)
- }
-
- def count(insnList: InsnList, opcode: Int): Int = {
- def isNop(node: asm.tree.AbstractInsnNode): Boolean =
- (node.getOpcode == opcode)
- insnList.iterator.asScala.count(isNop)
- }
-}
diff --git a/test/files/jvm/t7146.check b/test/files/jvm/t7146.check
index 7c76040205..b2c6e444f7 100644
--- a/test/files/jvm/t7146.check
+++ b/test/files/jvm/t7146.check
@@ -1,5 +1,4 @@
-should be scala.concurrent.impl.ExecutionContextImpl == true
-should be scala.concurrent.forkjoin.ForkJoinPool == true
+ExecutionContext.global is a scala.concurrent.impl.ExecutionContextImpl.
should have non-null UncaughtExceptionHandler == true
-should be a scala.concurrent.impl.ExecutionContextImpl UncaughtExceptionHandler == true
-should just print out on uncaught == true
+ExecutionContext.global.executor.getUncaughtExceptionHandler is a scala.concurrent.impl.ExecutionContextImpl.
+should just print out on uncaught: true
diff --git a/test/files/jvm/t7146.scala b/test/files/jvm/t7146.scala
index aaa3dc7ca4..89030730a9 100644
--- a/test/files/jvm/t7146.scala
+++ b/test/files/jvm/t7146.scala
@@ -5,21 +5,21 @@ import scala.concurrent._
import scala.util.control.NoStackTrace
object Test {
- def main(args: Array[String]) {
- println("should be scala.concurrent.impl.ExecutionContextImpl == " +
- ExecutionContext.global.toString.startsWith("scala.concurrent.impl.ExecutionContextImpl"))
- val i = ExecutionContext.global.asInstanceOf[{ def executor: Executor }]
- println("should be scala.concurrent.forkjoin.ForkJoinPool == " +
- i.executor.toString.startsWith("scala.concurrent.forkjoin.ForkJoinPool"))
- val u = i.executor.
+ def main(args: Array[String]): Unit = {
+ val ec = ExecutionContext.global.toString
+ if (ec startsWith "scala.concurrent.impl.ExecutionContextImpl")
+ println("ExecutionContext.global is a scala.concurrent.impl.ExecutionContextImpl.")
+ else println(s"!! ExecutionContext.global == $ec")
+
+ val u = ExecutionContext.global.asInstanceOf[{ def executor: Executor }].executor.
asInstanceOf[{ def getUncaughtExceptionHandler: Thread.UncaughtExceptionHandler }].
getUncaughtExceptionHandler
- println("should have non-null UncaughtExceptionHandler == " + (u ne null))
- println("should be a scala.concurrent.impl.ExecutionContextImpl UncaughtExceptionHandler == " +
- u.toString.startsWith("scala.concurrent.impl.ExecutionContextImpl"))
- print("should just print out on uncaught == ")
- u.uncaughtException(Thread.currentThread, new Throwable {
- override def printStackTrace() { println("true") }
- })
+ println(s"should have non-null UncaughtExceptionHandler == ${u ne null}")
+ if (u.toString startsWith "scala.concurrent.impl.ExecutionContextImpl")
+ println("ExecutionContext.global.executor.getUncaughtExceptionHandler is a scala.concurrent.impl.ExecutionContextImpl.")
+ else println(s"!! ExecutionContext.global.executor.getUncaughtExceptionHandler == $u")
+
+ print("should just print out on uncaught: ")
+ u.uncaughtException(Thread.currentThread, new Throwable { override def printStackTrace() { println("true") } })
}
}
diff --git a/test/files/jvm/t8582.check b/test/files/jvm/t8582.check
index e388366270..0a23cb0c93 100644
--- a/test/files/jvm/t8582.check
+++ b/test/files/jvm/t8582.check
@@ -1,3 +1,6 @@
+t8582.scala:17: warning: class BeanInfo in package beans is deprecated (since 2.12.0): the generation of BeanInfo classes is no longer supported
+ class C1
+ ^
getClass on module gives module class
class p1.p2.Singleton$Singleton$
diff --git a/test/files/jvm/t8582.flags b/test/files/jvm/t8582.flags
new file mode 100644
index 0000000000..dcc59ebe32
--- /dev/null
+++ b/test/files/jvm/t8582.flags
@@ -0,0 +1 @@
+-deprecation
diff --git a/test/files/jvm/t8786-sig.scala b/test/files/jvm/t8786-sig.scala
index f22e400528..0745b650e6 100644
--- a/test/files/jvm/t8786-sig.scala
+++ b/test/files/jvm/t8786-sig.scala
@@ -23,7 +23,6 @@ object Test extends App {
def sig (method: String, tp: Class[_]) = a.getDeclaredMethod(method, tp).toString
def genSig(method: String, tp: Class[_]) = a.getDeclaredMethod(method, tp).toGenericString
- def isVarArgs(method: String, tp: Class[_]) = a.getDeclaredMethod(method, tp).isVarArgs
def bound (method: String, tp: Class[_]) = {
val m = a.getDeclaredMethod(method, tp)
m.getGenericParameterTypes.apply(0) match {
@@ -34,17 +33,8 @@ object Test extends App {
}
}
- def check(found: String, expected: String): Unit =
- assert(found == expected, s"found: $found\nexpected: $expected")
-
- def checkVarArgs(method: String, tp: Class[_])(expected: String): Unit = {
- assert(isVarArgs(method, tp), s"expected varargs for $method")
- val found = genSig(method, tp)
-
- def varArgsToBraces(sig: String) = sig.replaceAll("""\.\.\.""","[]")
- // Normalize sigs so that the tests works on Java 6 (where varargs are printed as [])
- // and above (where vargs are pretty printed using ...)
- assert(varArgsToBraces(found) == varArgsToBraces(expected), s"found: $found\nexpected: $expected (modulo `...` or `[]` as varargs suffix)")
+ def check(a: String, b: String) = {
+ assert(a == b, s"found: $a\nexpected: $b")
}
val sq = classOf[Seq[_]]
@@ -85,15 +75,15 @@ object Test extends App {
check(sig("m7", ai) , "public int A.m7(int[])")
check(sig("m8", ao) , "public java.lang.Object A.m8(java.lang.Object[])")
- checkVarArgs("m1", ao)("public <T> T A.m1(T...)")
- checkVarArgs("m2", ao)("public <T> T A.m2(T...)")
- checkVarArgs("m3", ao)("public <T> T A.m3(T...)")
+ check(genSig("m1", ao), "public <T> T A.m1(T...)")
+ check(genSig("m2", ao), "public <T> T A.m2(T...)")
+ check(genSig("m3", ao), "public <T> T A.m3(T...)")
// testing status quo: signature is wrong for T <: Int, SI-9846
- checkVarArgs("m4", ao)("public <T> T A.m4(T...)")
- checkVarArgs("m5", as)("public <T> T A.m5(T...)")
- checkVarArgs("m6", as)("public java.lang.String A.m6(java.lang.String...)")
- checkVarArgs("m7", ai)("public int A.m7(int...)")
- checkVarArgs("m8", ao)("public U A.m8(U...)")
+ check(genSig("m4", ao), "public <T> T A.m4(T...)")
+ check(genSig("m5", as), "public <T> T A.m5(T...)")
+ check(genSig("m6", as), "public java.lang.String A.m6(java.lang.String...)")
+ check(genSig("m7", ai), "public int A.m7(int...)")
+ check(genSig("m8", ao), "public U A.m8(U...)")
check(bound("m1", ao) , "class java.lang.Object")
check(bound("m2", ao) , "class java.lang.Object")
diff --git a/test/files/jvm/t8786/B_2.java b/test/files/jvm/t8786/B_2.java
index dc155a290f..ab5350b136 100644
--- a/test/files/jvm/t8786/B_2.java
+++ b/test/files/jvm/t8786/B_2.java
@@ -5,7 +5,7 @@ public class B_2 {
public static void m(String a) { res += 100; }
public static void m(Object a) { res += 1000; }
- public static <T> T foo(int a, T... b) { return b[0]; }
+ @SafeVarargs public static <T> T foo(int a, T... b) { return b[0]; }
public static <T> T bar(T b[]) { return b[0]; }
diff --git a/test/files/jvm/t9105.check b/test/files/jvm/t9105.check
index 34750833f1..9447e0cf29 100644
--- a/test/files/jvm/t9105.check
+++ b/test/files/jvm/t9105.check
@@ -1,18 +1,8 @@
-#partest !-Ydelambdafy:method
-(class C$$anonfun$1$A$1,class C$$anonfun$1,null)
-(class C$$anonfun$1$B$1,class C$$anonfun$1,private final java.lang.Object C$$anonfun$1.m$1())
-(class C$$anonfun$1$C$1,class C$$anonfun$1,null)
-(class C$$anonfun$1$$anonfun$2$D$1,class C$$anonfun$1$$anonfun$2,null)
-(class C$$anonfun$met$1$E$1,class C$$anonfun$met$1,null)
-(class C$$anonfun$met$1$F$1,class C$$anonfun$met$1,private final java.lang.Object C$$anonfun$met$1.m$2())
-(class C$$anonfun$met$1$G$1,class C$$anonfun$met$1,null)
-(class C$$anonfun$met$1$$anonfun$3$H$1,class C$$anonfun$met$1$$anonfun$3,null)
-#partest -Ydelambdafy:method
(class C$A$1,class C,null)
-(class C$B$1,class C,private final java.lang.Object C.m$1())
+(class C$B$1,class C,private static final java.lang.Object C.m$1())
(class C$C$1,class C,null)
(class C$D$1,class C,null)
(class C$E$1,class C,public scala.Function0 C.met())
-(class C$F$1,class C,private final java.lang.Object C.m$2())
+(class C$F$1,class C,private static final java.lang.Object C.m$2())
(class C$G$1,class C,public scala.Function0 C.met())
(class C$H$1,class C,public scala.Function0 C.met())
diff --git a/test/files/jvm/try-type-tests.scala b/test/files/jvm/try-type-tests.scala
index 962afbd30f..b3926020f0 100644
--- a/test/files/jvm/try-type-tests.scala
+++ b/test/files/jvm/try-type-tests.scala
@@ -118,6 +118,44 @@ trait TryStandard {
assert(f.transform(succ, fail).get == 0)
}
+ def testSuccessEither(): Unit = {
+ val t = Success(1)
+ assert(t.toEither.isRight)
+ }
+
+ def testFailureEither(): Unit = {
+ val t = Failure(new Exception("foo"))
+ assert(t.toEither.isLeft)
+ }
+
+ def testFoldSuccess(): Unit = {
+ val t = Success(1)
+ val res = t.fold("Throws " + _, "Returns " + _)
+ assert(res == "Returns 1")
+ }
+
+ def testFoldFailure(): Unit = {
+ val t = Failure(new Exception("foo"))
+ val res = t.fold("Throws " + _, "Returns " + _)
+ assert(res == "Throws java.lang.Exception: foo")
+ }
+
+ def testFoldSuccessFailure(): Unit = {
+ val t = Success(1)
+ val res = t.fold("Throws " + _, _ => throw new Exception("foo"))
+ assert(res == "Throws java.lang.Exception: foo")
+ }
+
+ def testFoldFailureFailure(): Unit = {
+ val t = Failure(new Exception("foo"))
+ val res = try {
+ t.fold(_ => throw new Exception("bar"), "Returns " + _)
+ } catch {
+ case e: Throwable => "Throws " + e
+ }
+ assert(res == "Throws java.lang.Exception: bar")
+ }
+
testForeachSuccess()
testForeachFailure()
testFlatMapSuccess()
@@ -136,6 +174,11 @@ trait TryStandard {
testFailedFailure()
testSuccessTransform()
testFailureTransform()
+ testSuccessEither()
+ testFailureEither()
+ testFoldSuccess()
+ testFoldFailure()
+ testFoldSuccessFailure()
}
object Test
diff --git a/test/files/run/reflection-attachments.check b/test/files/jvm/unreachable.check
index e69de29bb2..e69de29bb2 100644
--- a/test/files/run/reflection-attachments.check
+++ b/test/files/jvm/unreachable.check
diff --git a/test/files/jvm/unreachable/Foo_1.flags b/test/files/jvm/unreachable/Foo_1.flags
index ce6e93b3da..d0a417b3c8 100644
--- a/test/files/jvm/unreachable/Foo_1.flags
+++ b/test/files/jvm/unreachable/Foo_1.flags
@@ -1 +1 @@
--Ynooptimise \ No newline at end of file
+-opt:l:default \ No newline at end of file
diff --git a/test/files/jvm/varargs/JavaClass.java b/test/files/jvm/varargs/JavaClass.java
index 0cc3587c5e..35adcff850 100644
--- a/test/files/jvm/varargs/JavaClass.java
+++ b/test/files/jvm/varargs/JavaClass.java
@@ -1,5 +1,5 @@
public class JavaClass {
- public static <T> void varargz(int i, T... v) { }
+ @SafeVarargs public static <T> void varargz(int i, T... v) { }
public static void callSomeAnnotations() {
VaClass va = new VaClass();
diff --git a/test/files/neg/abstract-inaccessible.check b/test/files/neg/abstract-inaccessible.check
index d56f5691be..739620a4ce 100644
--- a/test/files/neg/abstract-inaccessible.check
+++ b/test/files/neg/abstract-inaccessible.check
@@ -8,7 +8,7 @@ Classes which cannot access Bippy may be unable to override overrideMe.
^
abstract-inaccessible.scala:7: warning: method overrideMeAlso in trait YourTrait references private[foo] trait Bippy.
Classes which cannot access Bippy may be unable to override overrideMeAlso.
- def overrideMeAlso(x: Map[Int, Set[Bippy]]) = 5
+ def overrideMeAlso(x: Map[Int, Set[Bippy]]) = x.keys.head
^
error: No warnings can be incurred under -Xfatal-warnings.
three warnings found
diff --git a/test/files/neg/abstract-inaccessible.flags b/test/files/neg/abstract-inaccessible.flags
index 6c1dd108ae..ea7773e255 100644
--- a/test/files/neg/abstract-inaccessible.flags
+++ b/test/files/neg/abstract-inaccessible.flags
@@ -1 +1 @@
--Xfatal-warnings -Xlint \ No newline at end of file
+-Xfatal-warnings -Xlint:inaccessible
diff --git a/test/files/neg/abstract-inaccessible.scala b/test/files/neg/abstract-inaccessible.scala
index 3c80f30522..02b458016f 100644
--- a/test/files/neg/abstract-inaccessible.scala
+++ b/test/files/neg/abstract-inaccessible.scala
@@ -4,6 +4,6 @@ package foo {
trait YourTrait {
def implementMe(f: Int => (String, Bippy)): Unit
def overrideMe[T <: Bippy](x: T): T = x
- def overrideMeAlso(x: Map[Int, Set[Bippy]]) = 5
+ def overrideMeAlso(x: Map[Int, Set[Bippy]]) = x.keys.head
}
}
diff --git a/test/files/neg/ambiguous-same.check b/test/files/neg/ambiguous-same.check
new file mode 100644
index 0000000000..58f4e60ece
--- /dev/null
+++ b/test/files/neg/ambiguous-same.check
@@ -0,0 +1,6 @@
+ambiguous-same.scala:13: error: reference to x is ambiguous;
+it is both defined in object X and imported subsequently by
+import X.x
+ x
+ ^
+one error found
diff --git a/test/files/neg/ambiguous-same.scala b/test/files/neg/ambiguous-same.scala
new file mode 100644
index 0000000000..50dba71f67
--- /dev/null
+++ b/test/files/neg/ambiguous-same.scala
@@ -0,0 +1,15 @@
+
+// When faced with ambiguities between imports,
+// an attempt is made to see if the imports intend
+// identical types.
+//
+// Here, no attempt is made to notice that x
+// names the same thing.
+//
+object X {
+ val x = 42
+ def f = {
+ import X.x
+ x
+ }
+}
diff --git a/test/files/neg/anytrait.check b/test/files/neg/anytrait.check
index fabe74d379..6d9d681d60 100644
--- a/test/files/neg/anytrait.check
+++ b/test/files/neg/anytrait.check
@@ -4,4 +4,7 @@ anytrait.scala:3: error: field definition is not allowed in universal trait exte
anytrait.scala:5: error: this statement is not allowed in universal trait extending from class Any
{ x += 1 }
^
-two errors found
+anytrait.scala:9: error: field definition is not allowed in universal trait extending from class Any
+ val y: T
+ ^
+three errors found
diff --git a/test/files/neg/beanInfoDeprecation.check b/test/files/neg/beanInfoDeprecation.check
new file mode 100644
index 0000000000..a91cdabae2
--- /dev/null
+++ b/test/files/neg/beanInfoDeprecation.check
@@ -0,0 +1,6 @@
+beanInfoDeprecation.scala:2: warning: class BeanInfo in package beans is deprecated (since 2.12.0): the generation of BeanInfo classes is no longer supported
+class C
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/beanInfoDeprecation.flags b/test/files/neg/beanInfoDeprecation.flags
new file mode 100644
index 0000000000..c6bfaf1f64
--- /dev/null
+++ b/test/files/neg/beanInfoDeprecation.flags
@@ -0,0 +1 @@
+-deprecation -Xfatal-warnings
diff --git a/test/files/neg/beanInfoDeprecation.scala b/test/files/neg/beanInfoDeprecation.scala
new file mode 100644
index 0000000000..c7e3a86202
--- /dev/null
+++ b/test/files/neg/beanInfoDeprecation.scala
@@ -0,0 +1,2 @@
+@scala.beans.BeanInfo
+class C
diff --git a/test/files/neg/case-collision.check b/test/files/neg/case-collision.check
index 22cf105a4f..7360833a7d 100644
--- a/test/files/neg/case-collision.check
+++ b/test/files/neg/case-collision.check
@@ -1,12 +1,12 @@
case-collision.scala:5: warning: Class foo.BIPPY differs only in case from foo.Bippy. Such classes will overwrite one another on case-insensitive filesystems.
class BIPPY
^
-case-collision.scala:11: warning: Class foo.HyRaX$ differs only in case from foo.Hyrax$. Such classes will overwrite one another on case-insensitive filesystems.
-object HyRaX
- ^
case-collision.scala:8: warning: Class foo.DINGO$ differs only in case from foo.Dingo$. Such classes will overwrite one another on case-insensitive filesystems.
object DINGO
^
+case-collision.scala:11: warning: Class foo.HyRaX$ differs only in case from foo.Hyrax$. Such classes will overwrite one another on case-insensitive filesystems.
+object HyRaX
+ ^
error: No warnings can be incurred under -Xfatal-warnings.
three warnings found
one error found
diff --git a/test/files/neg/case-collision.flags b/test/files/neg/case-collision.flags
index 14c1069dee..85d8eb2ba2 100644
--- a/test/files/neg/case-collision.flags
+++ b/test/files/neg/case-collision.flags
@@ -1 +1 @@
--Ybackend:GenASM -Xfatal-warnings
+-Xfatal-warnings
diff --git a/test/files/neg/case-collision2.flags b/test/files/neg/case-collision2.flags
index bea46902c9..85d8eb2ba2 100644
--- a/test/files/neg/case-collision2.flags
+++ b/test/files/neg/case-collision2.flags
@@ -1 +1 @@
--Ybackend:GenBCode -Xfatal-warnings
+-Xfatal-warnings
diff --git a/test/files/neg/checksensible.check b/test/files/neg/checksensible.check
index 7de22fef54..a6e9176c69 100644
--- a/test/files/neg/checksensible.check
+++ b/test/files/neg/checksensible.check
@@ -97,7 +97,7 @@ checksensible.scala:84: warning: comparing values of types EqEqRefTest.this.C3 a
checksensible.scala:95: warning: comparing values of types Unit and Int using `!=' will always yield true
while ((c = in.read) != -1)
^
-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
error: No warnings can be incurred under -Xfatal-warnings.
34 warnings found
one error found
diff --git a/test/files/neg/choices.check b/test/files/neg/choices.check
index df4f23461f..2449cadcd6 100644
--- a/test/files/neg/choices.check
+++ b/test/files/neg/choices.check
@@ -1,5 +1,4 @@
-error: Usage: -Yresolve-term-conflict:<strategy>
- where <strategy> choices are package, object, error (default: error)
+error: Usage: -Yresolve-term-conflict:<strategy> where <strategy> choices are package, object, error (default: error).
error: bad option: '-Yresolve-term-conflict'
error: bad options: -Yresolve-term-conflict
error: flags file may only contain compiler options, found: -Yresolve-term-conflict
diff --git a/test/files/neg/classmanifests_new_deprecations.check b/test/files/neg/classmanifests_new_deprecations.check
index fd1e2728c3..ed6f42d00c 100644
--- a/test/files/neg/classmanifests_new_deprecations.check
+++ b/test/files/neg/classmanifests_new_deprecations.check
@@ -1,25 +1,25 @@
-classmanifests_new_deprecations.scala:2: warning: type ClassManifest in object Predef is deprecated: Use `scala.reflect.ClassTag` instead
+classmanifests_new_deprecations.scala:2: warning: type ClassManifest in object Predef is deprecated (since 2.10.0): use `scala.reflect.ClassTag` instead
def cm1[T: ClassManifest] = ???
^
-classmanifests_new_deprecations.scala:3: warning: type ClassManifest in object Predef is deprecated: Use `scala.reflect.ClassTag` instead
+classmanifests_new_deprecations.scala:3: warning: type ClassManifest in object Predef is deprecated (since 2.10.0): use `scala.reflect.ClassTag` instead
def cm2[T](implicit evidence$1: ClassManifest[T]) = ???
^
-classmanifests_new_deprecations.scala:4: warning: type ClassManifest in object Predef is deprecated: Use `scala.reflect.ClassTag` instead
+classmanifests_new_deprecations.scala:4: warning: type ClassManifest in object Predef is deprecated (since 2.10.0): use `scala.reflect.ClassTag` instead
val cm3: ClassManifest[Int] = null
^
-classmanifests_new_deprecations.scala:6: warning: type ClassManifest in package reflect is deprecated: Use scala.reflect.ClassTag instead
+classmanifests_new_deprecations.scala:6: warning: type ClassManifest in package reflect is deprecated (since 2.10.0): use scala.reflect.ClassTag instead
def rcm1[T: scala.reflect.ClassManifest] = ???
^
-classmanifests_new_deprecations.scala:7: warning: type ClassManifest in package reflect is deprecated: Use scala.reflect.ClassTag instead
+classmanifests_new_deprecations.scala:7: warning: type ClassManifest in package reflect is deprecated (since 2.10.0): use scala.reflect.ClassTag instead
def rcm2[T](implicit evidence$1: scala.reflect.ClassManifest[T]) = ???
^
-classmanifests_new_deprecations.scala:8: warning: type ClassManifest in package reflect is deprecated: Use scala.reflect.ClassTag instead
+classmanifests_new_deprecations.scala:8: warning: type ClassManifest in package reflect is deprecated (since 2.10.0): use scala.reflect.ClassTag instead
val rcm3: scala.reflect.ClassManifest[Int] = null
^
-classmanifests_new_deprecations.scala:10: warning: type ClassManifest in object Predef is deprecated: Use `scala.reflect.ClassTag` instead
+classmanifests_new_deprecations.scala:10: warning: type ClassManifest in object Predef is deprecated (since 2.10.0): use `scala.reflect.ClassTag` instead
type CM[T] = ClassManifest[T]
^
-classmanifests_new_deprecations.scala:15: warning: type ClassManifest in package reflect is deprecated: Use scala.reflect.ClassTag instead
+classmanifests_new_deprecations.scala:15: warning: type ClassManifest in package reflect is deprecated (since 2.10.0): use scala.reflect.ClassTag instead
type RCM[T] = scala.reflect.ClassManifest[T]
^
error: No warnings can be incurred under -Xfatal-warnings.
diff --git a/test/files/neg/compile-time-only-a.check b/test/files/neg/compile-time-only-a.check
index b1ed1d24c2..a10f8b6489 100644
--- a/test/files/neg/compile-time-only-a.check
+++ b/test/files/neg/compile-time-only-a.check
@@ -13,9 +13,15 @@ compile-time-only-a.scala:36: error: C2
compile-time-only-a.scala:38: error: C3
new C3(2)
^
+compile-time-only-a.scala:39: error: C3
+ C3(2)
+ ^
compile-time-only-a.scala:41: error: C4
new C4(2)
^
+compile-time-only-a.scala:42: error: C4
+ C4(2)
+ ^
compile-time-only-a.scala:45: error: C5
2.ext
^
@@ -73,4 +79,4 @@ compile-time-only-a.scala:75: error: placebo
compile-time-only-a.scala:75: error: placebo
@placebo def x = (2: @placebo)
^
-25 errors found
+27 errors found
diff --git a/test/files/neg/constrs.check b/test/files/neg/constrs.check
index 4f4a12bc13..8a5bd97ae3 100644
--- a/test/files/neg/constrs.check
+++ b/test/files/neg/constrs.check
@@ -7,7 +7,7 @@ constrs.scala:6: error: value u is not a member of object test
constrs.scala:10: error: called constructor's definition must precede calling constructor's definition
def this() = this("abc")
^
-constrs.scala:12: error: called constructor's definition must precede calling constructor's definition
+constrs.scala:12: error: constructor invokes itself
def this(x: Boolean) = this(x)
^
constrs.scala:16: error: type mismatch;
diff --git a/test/files/neg/delayed-init-ref.check b/test/files/neg/delayed-init-ref.check
index 90bc027969..2913b1858f 100644
--- a/test/files/neg/delayed-init-ref.check
+++ b/test/files/neg/delayed-init-ref.check
@@ -4,8 +4,7 @@ delayed-init-ref.scala:17: warning: Selecting value vall from object O, which ex
delayed-init-ref.scala:19: warning: Selecting value vall from object O, which extends scala.DelayedInit, is likely to yield an uninitialized value
println(vall) // warn
^
-delayed-init-ref.scala:28: warning: trait DelayedInit in package scala is deprecated: DelayedInit semantics can be surprising. Support for `App` will continue.
-See the release notes for more details: https://github.com/scala/scala/releases/tag/v2.11.0-RC1
+delayed-init-ref.scala:28: warning: trait DelayedInit in package scala is deprecated (since 2.11.0): DelayedInit semantics can be surprising. Support for `App` will continue. See the release notes for more details: https://github.com/scala/scala/releases/tag/v2.11.0-RC1
trait Before extends DelayedInit {
^
delayed-init-ref.scala:40: warning: Selecting value foo from trait UserContext, which extends scala.DelayedInit, is likely to yield an uninitialized value
diff --git a/test/files/neg/deprecated-target.check b/test/files/neg/deprecated-target.check
new file mode 100644
index 0000000000..307d3d25ab
--- /dev/null
+++ b/test/files/neg/deprecated-target.check
@@ -0,0 +1,4 @@
+warning: -target is deprecated: -target:jvm-1.7 is deprecated, forcing use of jvm-1.8
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/deprecated-target.flags b/test/files/neg/deprecated-target.flags
new file mode 100644
index 0000000000..458ded8123
--- /dev/null
+++ b/test/files/neg/deprecated-target.flags
@@ -0,0 +1 @@
+-target:jvm-1.7 -deprecation -Xfatal-warnings
diff --git a/test/files/neg/deprecated-target.scala b/test/files/neg/deprecated-target.scala
new file mode 100644
index 0000000000..9dccdd5e59
--- /dev/null
+++ b/test/files/neg/deprecated-target.scala
@@ -0,0 +1 @@
+class C \ No newline at end of file
diff --git a/test/files/neg/eta-expand-star-deprecation.check b/test/files/neg/eta-expand-star-deprecation.check
deleted file mode 100644
index a79f0df76c..0000000000
--- a/test/files/neg/eta-expand-star-deprecation.check
+++ /dev/null
@@ -1,4 +0,0 @@
-warning: -Yeta-expand-keeps-star 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.
-error: No warnings can be incurred under -Xfatal-warnings.
-one warning found
-one error found
diff --git a/test/files/neg/eta-expand-star-deprecation.flags b/test/files/neg/eta-expand-star-deprecation.flags
deleted file mode 100644
index 5ac8b638e4..0000000000
--- a/test/files/neg/eta-expand-star-deprecation.flags
+++ /dev/null
@@ -1 +0,0 @@
--Yeta-expand-keeps-star -deprecation -Xfatal-warnings
diff --git a/test/files/neg/eta-expand-star-deprecation.scala b/test/files/neg/eta-expand-star-deprecation.scala
deleted file mode 100644
index 5749692522..0000000000
--- a/test/files/neg/eta-expand-star-deprecation.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-object Test {
- def f[T](xs: T*): Unit = ()
- def g[T] = f[T] _
-
- def main(args: Array[String]): Unit = {
- g(1, 2)
- }
-}
diff --git a/test/files/neg/eta-expand-star.check b/test/files/neg/eta-expand-star.check
index 6765d504fc..eba1721014 100644
--- a/test/files/neg/eta-expand-star.check
+++ b/test/files/neg/eta-expand-star.check
@@ -1,4 +1,4 @@
-eta-expand-star.scala:6: error: too many arguments for method apply: (v1: Seq[T])Unit in trait Function1
+eta-expand-star.scala:6: error: too many arguments (2) for method apply: (v1: Seq[T])Unit in trait Function1
g(1, 2)
- ^
+ ^
one error found
diff --git a/test/files/neg/forgot-interpolator.flags b/test/files/neg/forgot-interpolator.flags
index 7949c2afa2..b0d7bc25cb 100644
--- a/test/files/neg/forgot-interpolator.flags
+++ b/test/files/neg/forgot-interpolator.flags
@@ -1 +1 @@
--Xlint -Xfatal-warnings
+-Xlint:missing-interpolator -Xfatal-warnings
diff --git a/test/files/neg/hkgadt.check b/test/files/neg/hkgadt.check
new file mode 100644
index 0000000000..ef302a9abf
--- /dev/null
+++ b/test/files/neg/hkgadt.check
@@ -0,0 +1,31 @@
+hkgadt.scala:7: error: type mismatch;
+ found : scala.collection.immutable.Set[Int]
+ required: F[Int]
+ case Bar() => Set(1)
+ ^
+hkgadt.scala:13: error: type mismatch;
+ found : Boolean(true)
+ required: A
+ case Bar1() => true
+ ^
+hkgadt.scala:24: error: type mismatch;
+ found : scala.collection.immutable.Set[Int]
+ required: F[Int]
+ case Bar() => Set(1)
+ ^
+hkgadt.scala:25: error: type mismatch;
+ found : List[Int]
+ required: F[Int]
+ case Baz() => List(1)
+ ^
+hkgadt.scala:32: error: type mismatch;
+ found : Boolean(true)
+ required: A
+ case Bar1() => true
+ ^
+hkgadt.scala:33: error: type mismatch;
+ found : Int(1)
+ required: A
+ case Baz1() => 1
+ ^
+6 errors found
diff --git a/test/files/neg/hkgadt.scala b/test/files/neg/hkgadt.scala
new file mode 100644
index 0000000000..0107d2bdde
--- /dev/null
+++ b/test/files/neg/hkgadt.scala
@@ -0,0 +1,35 @@
+object HKGADT {
+ sealed trait Foo[F[_]]
+ final case class Bar() extends Foo[List]
+
+ def frob[F[_]](foo: Foo[F]): F[Int] =
+ foo match {
+ case Bar() => Set(1)
+ }
+
+ sealed trait Foo1[F]
+ final case class Bar1() extends Foo1[Int]
+ def frob1[A](foo: Foo1[A]): A = foo match {
+ case Bar1() => true
+ }
+}
+
+object HKGADT2 {
+ sealed trait Foo[F[_]]
+ final case class Bar() extends Foo[List]
+ final case class Baz() extends Foo[Set]
+
+ def frob[F[_]](foo: Foo[F]): F[Int] =
+ foo match {
+ case Bar() => Set(1)
+ case Baz() => List(1)
+ }
+
+ sealed trait Foo1[F]
+ final case class Bar1() extends Foo1[Int]
+ final case class Baz1() extends Foo1[Boolean]
+ def frob1[A](foo: Foo1[A]): A = foo match {
+ case Bar1() => true
+ case Baz1() => 1
+ }
+}
diff --git a/test/files/neg/implicit-ambiguous-2.check b/test/files/neg/implicit-ambiguous-2.check
new file mode 100644
index 0000000000..4a10b0dd65
--- /dev/null
+++ b/test/files/neg/implicit-ambiguous-2.check
@@ -0,0 +1,4 @@
+implicit-ambiguous-2.scala:10: error: Could not prove Int =!= Int
+ implicitly[Int =!= Int]
+ ^
+one error found
diff --git a/test/files/neg/implicit-ambiguous-2.scala b/test/files/neg/implicit-ambiguous-2.scala
new file mode 100644
index 0000000000..563c8c583f
--- /dev/null
+++ b/test/files/neg/implicit-ambiguous-2.scala
@@ -0,0 +1,11 @@
+object Test {
+ trait =!=[C, D]
+
+ implicit def neq[E, F] : E =!= F = null
+
+ implicit def neqAmbig1[G, H, J] : J =!= J = null
+ @annotation.implicitAmbiguous("Could not prove ${I} =!= ${I}")
+ implicit def neqAmbig2[I] : I =!= I = null
+
+ implicitly[Int =!= Int]
+}
diff --git a/test/files/neg/implicit-ambiguous-invalid.check b/test/files/neg/implicit-ambiguous-invalid.check
new file mode 100644
index 0000000000..68b607c4c2
--- /dev/null
+++ b/test/files/neg/implicit-ambiguous-invalid.check
@@ -0,0 +1,7 @@
+implicit-ambiguous-invalid.scala:5: warning: Invalid implicitAmbiguous message for method neqAmbig1 in object Test:
+The type parameter B referenced in the message of the @implicitAmbiguous annotation is not defined by method neqAmbig1.
+ implicit def neqAmbig1[A] : A =!= A = null
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/t6375.flags b/test/files/neg/implicit-ambiguous-invalid.flags
index 85d8eb2ba2..85d8eb2ba2 100644
--- a/test/files/neg/t6375.flags
+++ b/test/files/neg/implicit-ambiguous-invalid.flags
diff --git a/test/files/neg/implicit-ambiguous-invalid.scala b/test/files/neg/implicit-ambiguous-invalid.scala
new file mode 100644
index 0000000000..f8f9da655f
--- /dev/null
+++ b/test/files/neg/implicit-ambiguous-invalid.scala
@@ -0,0 +1,6 @@
+object Test {
+ trait =!=[C, D]
+
+ @annotation.implicitAmbiguous("Could not prove ${A} =!= ${B}")
+ implicit def neqAmbig1[A] : A =!= A = null
+}
diff --git a/test/files/neg/implicit-ambiguous.check b/test/files/neg/implicit-ambiguous.check
new file mode 100644
index 0000000000..0b3cebcb6f
--- /dev/null
+++ b/test/files/neg/implicit-ambiguous.check
@@ -0,0 +1,4 @@
+implicit-ambiguous.scala:10: error: Could not prove Int =!= Int
+ implicitly[Int =!= Int]
+ ^
+one error found
diff --git a/test/files/neg/implicit-ambiguous.scala b/test/files/neg/implicit-ambiguous.scala
new file mode 100644
index 0000000000..79b1297915
--- /dev/null
+++ b/test/files/neg/implicit-ambiguous.scala
@@ -0,0 +1,11 @@
+object Test {
+ trait =!=[C, D]
+
+ implicit def neq[E, F] : E =!= F = null
+
+ @annotation.implicitAmbiguous("Could not prove ${J} =!= ${J}")
+ implicit def neqAmbig1[G, H, J] : J =!= J = null
+ implicit def neqAmbig2[I] : I =!= I = null
+
+ implicitly[Int =!= Int]
+}
diff --git a/test/files/neg/inlineIndyLambdaPrivate.check b/test/files/neg/inlineIndyLambdaPrivate.check
new file mode 100644
index 0000000000..dbd142f59e
--- /dev/null
+++ b/test/files/neg/inlineIndyLambdaPrivate.check
@@ -0,0 +1,16 @@
+Test_2.scala:2: warning: A_1::test()Ljava/lang/String; could not be inlined:
+The callee A_1::test()Ljava/lang/String; contains the instruction INVOKEDYNAMIC m()LA_1$Fun; [
+ // handle kind 0x6 : INVOKESTATIC
+ java/lang/invoke/LambdaMetafactory.metafactory(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)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;
+ ]
+that would cause an IllegalAccessError when inlined into class Test.
+ def foo = A_1.test
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/inlineIndyLambdaPrivate.flags b/test/files/neg/inlineIndyLambdaPrivate.flags
new file mode 100644
index 0000000000..b38f5b8411
--- /dev/null
+++ b/test/files/neg/inlineIndyLambdaPrivate.flags
@@ -0,0 +1 @@
+-opt:l:classpath -Yopt-inline-heuristics:everything -opt-warnings:_ -Xfatal-warnings \ No newline at end of file
diff --git a/test/files/neg/inlineIndyLambdaPrivate/A_1.java b/test/files/neg/inlineIndyLambdaPrivate/A_1.java
new file mode 100644
index 0000000000..a9144a9fa6
--- /dev/null
+++ b/test/files/neg/inlineIndyLambdaPrivate/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/neg/inlineIndyLambdaPrivate/Test_2.scala b/test/files/neg/inlineIndyLambdaPrivate/Test_2.scala
new file mode 100644
index 0000000000..dd59c05176
--- /dev/null
+++ b/test/files/neg/inlineIndyLambdaPrivate/Test_2.scala
@@ -0,0 +1,3 @@
+class Test {
+ def foo = A_1.test
+}
diff --git a/test/files/neg/inlineMaxSize.flags b/test/files/neg/inlineMaxSize.flags
index 9c6b811622..e765b66af2 100644
--- a/test/files/neg/inlineMaxSize.flags
+++ b/test/files/neg/inlineMaxSize.flags
@@ -1 +1 @@
--Ybackend:GenBCode -Ydelambdafy:method -Yopt:l:classpath -Yopt-warnings -Xfatal-warnings \ No newline at end of file
+-Ydelambdafy:method -opt:l:classpath -opt-warnings -Xfatal-warnings \ No newline at end of file
diff --git a/test/files/neg/literals.check b/test/files/neg/literals.check
index 148a9346c5..79b6d47782 100644
--- a/test/files/neg/literals.check
+++ b/test/files/neg/literals.check
@@ -19,6 +19,18 @@ literals.scala:23: error: missing integer number
literals.scala:27: error: Decimal integer literals may not have a leading zero. (Octal syntax is obsolete.)
def tooManyZeros: Int = 00 // line 26: no leading zero
^
+literals.scala:40: error: floating point number too small
+ def tooTiny: Float = { 0.7e-45f } // floating point number too small
+ ^
+literals.scala:42: error: double precision floating point number too small
+ def twoTiny: Double = { 2.0e-324 } // double precision floating point number too small
+ ^
+literals.scala:44: error: floating point number too large
+ def tooHuge: Float = { 3.4028236E38f } // floating point number too large
+ ^
+literals.scala:46: error: double precision floating point number too large
+ def twoHuge: Double = { 1.7976931348623159e308 } // double precision floating point number too large
+ ^
literals.scala:14: error: identifier expected but '}' found.
def orphanDot: Int = { 9. } // line 12: ident expected
^
@@ -37,4 +49,4 @@ literals.scala:29: error: ';' expected but 'def' found.
literals.scala:33: error: identifier expected but 'def' found.
def zeroOfNineDot: Int = 09. // line 32: malformed integer, ident expected
^
-13 errors found
+17 errors found
diff --git a/test/files/neg/literals.scala b/test/files/neg/literals.scala
index 3df7f0b408..22d5d9acd1 100644
--- a/test/files/neg/literals.scala
+++ b/test/files/neg/literals.scala
@@ -1,6 +1,6 @@
/* This took me literally all day.
-*/
+ */
trait RejectedLiterals {
def missingHex: Int = { 0x } // line 4: was: not reported, taken as zero
@@ -34,3 +34,14 @@ trait Braceless {
def noHexFloat: Double = 0x1.2 // line 34: ';' expected but double literal found.
}
+
+trait MoreSadness {
+
+ def tooTiny: Float = { 0.7e-45f } // floating point number too small
+
+ def twoTiny: Double = { 2.0e-324 } // double precision floating point number too small
+
+ def tooHuge: Float = { 3.4028236E38f } // floating point number too large
+
+ def twoHuge: Double = { 1.7976931348623159e308 } // double precision floating point number too large
+}
diff --git a/test/files/neg/logImplicits.check b/test/files/neg/logImplicits.check
index 270882b71a..913b116ac3 100644
--- a/test/files/neg/logImplicits.check
+++ b/test/files/neg/logImplicits.check
@@ -1,10 +1,10 @@
-logImplicits.scala:2: applied implicit conversion from xs.type to ?{def size: ?} = implicit def byteArrayOps(xs: Array[Byte]): scala.collection.mutable.ArrayOps[Byte]
+logImplicits.scala:2: applied implicit conversion from xs.type to ?{def size: ?} = implicit def byteArrayOps(xs: Array[Byte]): scala.collection.mutable.ArrayOps.ofByte
def f(xs: Array[Byte]) = xs.size
^
logImplicits.scala:7: applied implicit conversion from String("abc") to ?{def map: ?} = implicit def augmentString(x: String): scala.collection.immutable.StringOps
def f = "abc" map (_ + 1)
^
-logImplicits.scala:15: inferred view from String("abc") to Int = C.this.convert:(p: String("abc"))Int
+logImplicits.scala:15: inferred view from String("abc") to Int via C.this.convert: (p: String)Int
math.max(122, x: Int)
^
logImplicits.scala:19: applied implicit conversion from Int(1) to ?{def ->: ?} = implicit def ArrowAssoc[A](self: A): ArrowAssoc[A]
diff --git a/test/files/neg/lub-from-hell-2.check b/test/files/neg/lub-from-hell-2.check
new file mode 100644
index 0000000000..3ef935f93b
--- /dev/null
+++ b/test/files/neg/lub-from-hell-2.check
@@ -0,0 +1,7 @@
+lub-from-hell-2.scala:3: error: type arguments [Any,Iterable[Any] with Int => Any with scala.collection.generic.Subtractable[Any,Iterable[Any] with Int => Any with scala.collection.generic.Subtractable[Any,Iterable[Any] with Int => Any]{def seq: Iterable[Any] with Int => Any}]{def seq: Iterable[Any] with Int => Any{def seq: Iterable[Any] with Int => Any}}] do not conform to trait Subtractable's type parameter bounds [A,+Repr <: scala.collection.generic.Subtractable[A,Repr]]
+ def foo(a: Boolean, b: collection.mutable.Set[Any], c: collection.mutable.ListBuffer[Any]) = if (a) b else c
+ ^
+lub-from-hell-2.scala:4: error: type arguments [Any,scala.collection.mutable.Iterable[Any] with scala.collection.mutable.Cloneable[scala.collection.mutable.Iterable[Any] with scala.collection.mutable.Cloneable[scala.collection.mutable.Iterable[Any] with Cloneable with Int => Any] with Int => Any{def seq: scala.collection.mutable.Iterable[Any] with Cloneable with Int => Any}] with scala.collection.generic.Growable[Any] with Int => Any with scala.collection.generic.Shrinkable[Any] with scala.collection.generic.Subtractable[Any,Iterable[Any] with Int => Any with scala.collection.generic.Subtractable[Any,Iterable[Any] with Int => Any]{def seq: Iterable[Any] with Int => Any}] with scala.collection.script.Scriptable[Any]] do not conform to trait Subtractable's type parameter bounds [A,+Repr <: scala.collection.generic.Subtractable[A,Repr]]
+ def bar(a: Boolean, b: scala.collection.mutable.SetLike[Any,scala.collection.mutable.Set[Any]], c: scala.collection.mutable.Buffer[Any]) = if (a) b else c
+ ^
+two errors found
diff --git a/test/files/neg/lub-from-hell-2.scala b/test/files/neg/lub-from-hell-2.scala
new file mode 100644
index 0000000000..18c99dfada
--- /dev/null
+++ b/test/files/neg/lub-from-hell-2.scala
@@ -0,0 +1,13 @@
+class Test {
+ trait Tree
+ def foo(a: Boolean, b: collection.mutable.Set[Any], c: collection.mutable.ListBuffer[Any]) = if (a) b else c
+ def bar(a: Boolean, b: scala.collection.mutable.SetLike[Any,scala.collection.mutable.Set[Any]], c: scala.collection.mutable.Buffer[Any]) = if (a) b else c
+ // bar produces an ill-bounded LUB in 2.11.8. After this commit, which fixes a bug in existential+refinement lubs, foo also fails.
+}
+// This test case minimizes a case that stated to fail compile after my fixes in SI-5294.
+// `foo` used to compile for the wrong reason, `mergePrefixAndArgs` failed to transpose a
+// ragged matrix and skipped to the next level of the base type sequences to find a common type symbol.
+//
+// My changes fixed the root cause of the ragged matrix, which uncovered the latent bug.
+// For comparison, `bar` failed to compile before _and_ after my changes for the same reason:
+// f-bounded types involved in LUBs can sometimes produce an ill-bounded LUB.
diff --git a/test/files/neg/macro-invalidret.check b/test/files/neg/macro-invalidret.check
index ebdc8ec7da..a4d4fc6f34 100644
--- a/test/files/neg/macro-invalidret.check
+++ b/test/files/neg/macro-invalidret.check
@@ -27,7 +27,7 @@ java.lang.NullPointerException
Macros_Test_2.scala:15: error: macro implementation is missing
foo4
^
-Macros_Test_2.scala:17: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+Macros_Test_2.scala:17: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
foo6
^
two warnings found
diff --git a/test/files/neg/macro-invalidusage-badargs.check b/test/files/neg/macro-invalidusage-badargs.check
index 19ac6528d3..ee549c45cb 100644
--- a/test/files/neg/macro-invalidusage-badargs.check
+++ b/test/files/neg/macro-invalidusage-badargs.check
@@ -13,7 +13,7 @@ Macros_Test_2.scala:8: error: not enough arguments for macro method foo: (x: Int
Unspecified value parameter x.
foo()
^
-Macros_Test_2.scala:9: error: too many arguments for macro method foo: (x: Int)Int
+Macros_Test_2.scala:9: error: too many arguments (2) for macro method foo: (x: Int)Int
foo(4, 2)
- ^
+ ^
5 errors found
diff --git a/test/files/neg/maxerrs.check b/test/files/neg/maxerrs.check
new file mode 100644
index 0000000000..5eaedad487
--- /dev/null
+++ b/test/files/neg/maxerrs.check
@@ -0,0 +1,16 @@
+maxerrs.scala:22: error: type mismatch;
+ found : String("")
+ required: Int
+ def F = f("")
+ ^
+maxerrs.scala:24: error: type mismatch;
+ found : String("")
+ required: Int
+ def g = f("")
+ ^
+maxerrs.scala:26: error: type mismatch;
+ found : String("")
+ required: Int
+ def h = f("")
+ ^
+5 errors found
diff --git a/test/files/neg/maxerrs.flags b/test/files/neg/maxerrs.flags
new file mode 100644
index 0000000000..6629ef62b6
--- /dev/null
+++ b/test/files/neg/maxerrs.flags
@@ -0,0 +1 @@
+-Xmaxerrs 3 -Xfatal-warnings -deprecation
diff --git a/test/files/neg/maxerrs.scala b/test/files/neg/maxerrs.scala
new file mode 100644
index 0000000000..43b725de7a
--- /dev/null
+++ b/test/files/neg/maxerrs.scala
@@ -0,0 +1,32 @@
+
+object X {
+ @deprecated("just to annoy people", since="forever")
+ def x = 42
+
+ def f(i: Int) = i
+}
+
+trait T {
+ import X._
+
+ def a = x
+
+ def b = x
+
+ def c = x
+
+ def d = x
+
+ def e = x
+
+ def F = f("")
+
+ def g = f("")
+
+ def h = f("")
+
+ def i = f("")
+
+ def j = f("")
+}
+
diff --git a/test/files/neg/maxwarns.check b/test/files/neg/maxwarns.check
new file mode 100644
index 0000000000..f4c8d907bd
--- /dev/null
+++ b/test/files/neg/maxwarns.check
@@ -0,0 +1,12 @@
+maxwarns.scala:12: warning: method x in object X is deprecated (since forever): just to annoy people
+ def a = x
+ ^
+maxwarns.scala:14: warning: method x in object X is deprecated (since forever): just to annoy people
+ def b = x
+ ^
+maxwarns.scala:16: warning: method x in object X is deprecated (since forever): just to annoy people
+ def c = x
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+5 warnings found
+one error found
diff --git a/test/files/neg/maxwarns.flags b/test/files/neg/maxwarns.flags
new file mode 100644
index 0000000000..d5d6e533e9
--- /dev/null
+++ b/test/files/neg/maxwarns.flags
@@ -0,0 +1 @@
+-Xmaxwarns 3 -Xfatal-warnings -deprecation
diff --git a/test/files/neg/maxwarns.scala b/test/files/neg/maxwarns.scala
new file mode 100644
index 0000000000..decb8a7866
--- /dev/null
+++ b/test/files/neg/maxwarns.scala
@@ -0,0 +1,32 @@
+
+object X {
+ @deprecated("just to annoy people", since="forever")
+ def x = 42
+
+ def f(i: String) = i
+}
+
+trait T {
+ import X._
+
+ def a = x
+
+ def b = x
+
+ def c = x
+
+ def d = x
+
+ def e = x
+
+ def F = f("")
+
+ def g = f("")
+
+ def h = f("")
+
+ def i = f("")
+
+ def j = f("")
+}
+
diff --git a/test/files/neg/missing-arg-list.check b/test/files/neg/missing-arg-list.check
index 5a011c36f2..229baac177 100644
--- a/test/files/neg/missing-arg-list.check
+++ b/test/files/neg/missing-arg-list.check
@@ -18,4 +18,9 @@ Unapplied methods are only converted to functions when a function type is expect
You can make this conversion explicit by writing `h _` or `h(_,_,_)(_)` instead of `h`.
val z = h
^
-four errors found
+missing-arg-list.scala:15: error: missing argument list for method + in trait T
+Unapplied methods are only converted to functions when a function type is expected.
+You can make this conversion explicit by writing `+ _` or `+(_)` instead of `+`.
+ val p = +
+ ^
+5 errors found
diff --git a/test/files/neg/missing-arg-list.scala b/test/files/neg/missing-arg-list.scala
index c422dd32fe..44b83e429d 100644
--- a/test/files/neg/missing-arg-list.scala
+++ b/test/files/neg/missing-arg-list.scala
@@ -10,4 +10,7 @@ trait T {
val x = f
val y = g
val z = h
+
+ def +(i: Int) = i + 42
+ val p = +
}
diff --git a/test/files/neg/multi-array.check b/test/files/neg/multi-array.check
index 511caa126f..06ffdc9fbc 100644
--- a/test/files/neg/multi-array.check
+++ b/test/files/neg/multi-array.check
@@ -1,4 +1,4 @@
-multi-array.scala:7: error: too many arguments for constructor Array: (_length: Int)Array[T]
+multi-array.scala:7: error: too many arguments (2) for constructor Array: (_length: Int)Array[T]
val a: Array[Int] = new Array(10, 10)
- ^
+ ^
one error found
diff --git a/test/files/neg/names-defaults-neg-warn.check b/test/files/neg/names-defaults-neg-warn.check
index 0f4edef84e..3ff7d67cc3 100644
--- a/test/files/neg/names-defaults-neg-warn.check
+++ b/test/files/neg/names-defaults-neg-warn.check
@@ -1,7 +1,7 @@
-names-defaults-neg-warn.scala:11: warning: the parameter name s has been deprecated. Use x instead.
+names-defaults-neg-warn.scala:11: warning: the parameter name s is deprecated: use x instead
deprNam2.f(s = "dlfkj")
^
-names-defaults-neg-warn.scala:12: warning: the parameter name x has been deprecated. Use s instead.
+names-defaults-neg-warn.scala:12: warning: the parameter name x is deprecated: use s instead
deprNam2.g(x = "dlkjf")
^
error: No warnings can be incurred under -Xfatal-warnings.
diff --git a/test/files/neg/names-defaults-neg.check b/test/files/neg/names-defaults-neg.check
index a43bf66811..af164d90ea 100644
--- a/test/files/neg/names-defaults-neg.check
+++ b/test/files/neg/names-defaults-neg.check
@@ -1,7 +1,3 @@
-names-defaults-neg.scala:65: error: not enough arguments for method apply: (a: Int, b: String)(c: Int*)Fact in object Fact.
-Unspecified value parameter b.
- val fac = Fact(1)(2, 3)
- ^
names-defaults-neg.scala:5: error: type mismatch;
found : String("#")
required: Int
@@ -81,6 +77,10 @@ and method f in object t8 of type (a: Int, b: Object)String
match argument types (a: Int,b: String) and expected result type Any
println(t8.f(a = 0, b = "1")) // ambiguous reference
^
+names-defaults-neg.scala:65: error: not enough arguments for method apply: (a: Int, b: String)(c: Int*)Fact in object Fact.
+Unspecified value parameter b.
+ val fac = Fact(1)(2, 3)
+ ^
names-defaults-neg.scala:69: error: wrong number of arguments for pattern A1(x: Int,y: String)
A1() match { case A1(_) => () }
^
@@ -112,74 +112,80 @@ names-defaults-neg.scala:90: error: deprecated parameter name x has to be distin
names-defaults-neg.scala:91: error: deprecated parameter name a has to be distinct from any other parameter name (deprecated or not).
def deprNam2(a: String)(@deprecatedName('a) b: Int) = 1
^
-names-defaults-neg.scala:93: warning: the parameter name y has been deprecated. Use b instead.
+names-defaults-neg.scala:93: warning: the parameter name y is deprecated: use b instead
deprNam3(y = 10, b = 2)
^
names-defaults-neg.scala:93: error: parameter 'b' is already specified at parameter position 1
deprNam3(y = 10, b = 2)
^
-names-defaults-neg.scala:98: error: unknown parameter name: m
+names-defaults-neg.scala:96: warning: naming parameter deprNam4Arg is deprecated.
+ deprNam4(deprNam4Arg = null)
+ ^
+names-defaults-neg.scala:98: warning: naming parameter deprNam5Arg is deprecated.
+ deprNam5(deprNam5Arg = null)
+ ^
+names-defaults-neg.scala:102: error: unknown parameter name: m
f3818(y = 1, m = 1)
^
-names-defaults-neg.scala:131: error: reference to var2 is ambiguous; it is both a method parameter and a variable in scope.
+names-defaults-neg.scala:135: error: reference to var2 is ambiguous; it is both a method parameter and a variable in scope.
delay(var2 = 40)
^
-names-defaults-neg.scala:134: error: missing parameter type for expanded function ((x$1) => a = x$1)
+names-defaults-neg.scala:138: error: missing parameter type for expanded function ((x$1: <error>) => a = x$1)
val taf2: Int => Unit = testAnnFun(a = _, b = get("+"))
^
-names-defaults-neg.scala:134: error: not found: value a
+names-defaults-neg.scala:138: error: not found: value a
val taf2: Int => Unit = testAnnFun(a = _, b = get("+"))
^
-names-defaults-neg.scala:134: error: not found: value get
+names-defaults-neg.scala:138: error: not found: value get
val taf2: Int => Unit = testAnnFun(a = _, b = get("+"))
^
-names-defaults-neg.scala:135: error: parameter 'a' is already specified at parameter position 1
+names-defaults-neg.scala:139: error: parameter 'a' is already specified at parameter position 1
val taf3 = testAnnFun(b = _: String, a = get(8))
^
-names-defaults-neg.scala:136: error: missing parameter type for expanded function ((x$3) => testAnnFun(x$3, ((x$4) => b = x$4)))
+names-defaults-neg.scala:140: error: missing parameter type for expanded function ((x$3: <error>) => testAnnFun(x$3, ((x$4) => b = x$4)))
val taf4: (Int, String) => Unit = testAnnFun(_, b = _)
^
-names-defaults-neg.scala:136: error: missing parameter type for expanded function ((x$4) => b = x$4)
+names-defaults-neg.scala:140: error: missing parameter type for expanded function ((x$4: <error>) => b = x$4)
val taf4: (Int, String) => Unit = testAnnFun(_, b = _)
^
-names-defaults-neg.scala:136: error: not found: value b
+names-defaults-neg.scala:140: error: not found: value b
val taf4: (Int, String) => Unit = testAnnFun(_, b = _)
^
-names-defaults-neg.scala:144: error: variable definition needs type because 'x' is used as a named argument in its body.
+names-defaults-neg.scala:148: error: variable definition needs type because 'x' is used as a named argument in its body.
def t3 { var x = t.f(x = 1) }
^
-names-defaults-neg.scala:147: error: variable definition needs type because 'x' is used as a named argument in its body.
+names-defaults-neg.scala:151: error: variable definition needs type because 'x' is used as a named argument in its body.
object t6 { var x = t.f(x = 1) }
^
-names-defaults-neg.scala:147: warning: failed to determine if 'x = ...' is a named argument or an assignment expression.
+names-defaults-neg.scala:151: warning: failed to determine if 'x = ...' is a named argument or an assignment expression.
an explicit type is required for the definition mentioned in the error message above.
object t6 { var x = t.f(x = 1) }
^
-names-defaults-neg.scala:150: error: variable definition needs type because 'x' is used as a named argument in its body.
+names-defaults-neg.scala:154: error: variable definition needs type because 'x' is used as a named argument in its body.
class t9 { var x = t.f(x = 1) }
^
-names-defaults-neg.scala:150: warning: failed to determine if 'x = ...' is a named argument or an assignment expression.
+names-defaults-neg.scala:154: warning: failed to determine if 'x = ...' is a named argument or an assignment expression.
an explicit type is required for the definition mentioned in the error message above.
class t9 { var x = t.f(x = 1) }
^
-names-defaults-neg.scala:164: error: variable definition needs type because 'x' is used as a named argument in its body.
+names-defaults-neg.scala:168: error: variable definition needs type because 'x' is used as a named argument in its body.
def u3 { var x = u.f(x = 1) }
^
-names-defaults-neg.scala:167: error: variable definition needs type because 'x' is used as a named argument in its body.
+names-defaults-neg.scala:171: error: variable definition needs type because 'x' is used as a named argument in its body.
def u6 { var x = u.f(x = "32") }
^
-names-defaults-neg.scala:170: error: reference to x is ambiguous; it is both a method parameter and a variable in scope.
+names-defaults-neg.scala:174: error: reference to x is ambiguous; it is both a method parameter and a variable in scope.
def u9 { var x: Int = u.f(x = 1) }
^
-names-defaults-neg.scala:177: error: variable definition needs type because 'x' is used as a named argument in its body.
+names-defaults-neg.scala:181: error: variable definition needs type because 'x' is used as a named argument in its body.
class u15 { var x = u.f(x = 1) }
^
-names-defaults-neg.scala:177: warning: failed to determine if 'x = ...' is a named argument or an assignment expression.
+names-defaults-neg.scala:181: warning: failed to determine if 'x = ...' is a named argument or an assignment expression.
an explicit type is required for the definition mentioned in the error message above.
class u15 { var x = u.f(x = 1) }
^
-names-defaults-neg.scala:180: error: reference to x is ambiguous; it is both a method parameter and a variable in scope.
+names-defaults-neg.scala:184: error: reference to x is ambiguous; it is both a method parameter and a variable in scope.
class u18 { var x: Int = u.f(x = 1) }
^
-four warnings found
+6 warnings found
46 errors found
diff --git a/test/files/neg/names-defaults-neg.scala b/test/files/neg/names-defaults-neg.scala
index a97b590bf2..b326d3b5bd 100644
--- a/test/files/neg/names-defaults-neg.scala
+++ b/test/files/neg/names-defaults-neg.scala
@@ -92,6 +92,10 @@ object Test extends App {
def deprNam3(@deprecatedName('x) a: Int, @deprecatedName('y) b: Int) = a + b
deprNam3(y = 10, b = 2)
+ def deprNam4(@deprecatedName('deprNam4Arg) deprNam4Arg: String) = 0
+ deprNam4(deprNam4Arg = null)
+ def deprNam5(@deprecatedName deprNam5Arg: String) = 0
+ deprNam5(deprNam5Arg = null)
// t3818
def f3818(x: Int = 1, y: Int, z: Int = 1) = 0
diff --git a/test/files/neg/nested-fn-print.check b/test/files/neg/nested-fn-print.check
index ea278554d4..feeac0733f 100644
--- a/test/files/neg/nested-fn-print.check
+++ b/test/files/neg/nested-fn-print.check
@@ -1,4 +1,4 @@
-nested-fn-print.scala:4: error: only classes can have declared but undefined members
+nested-fn-print.scala:4: error: only traits and abstract classes can have declared but undefined members
(Note that variables need to be initialized to be defined)
var x3: Int => Double
^
diff --git a/test/files/neg/no-predef.check b/test/files/neg/no-predef.check
index a63d8c5ba5..f5c2e82fe1 100644
--- a/test/files/neg/no-predef.check
+++ b/test/files/neg/no-predef.check
@@ -1,11 +1,11 @@
no-predef.scala:2: error: type mismatch;
- found : scala.Long(5L)
- required: java.lang.Long
+ found : Long (in scala)
+ required: Long (in java.lang)
def f1 = 5L: java.lang.Long
^
no-predef.scala:3: error: type mismatch;
- found : java.lang.Long
- required: scala.Long
+ found : Long (in java.lang)
+ required: Long (in scala)
def f2 = new java.lang.Long(5) : Long
^
no-predef.scala:4: error: value map is not a member of String
diff --git a/test/files/neg/optimiseDeprecated.check b/test/files/neg/optimiseDeprecated.check
new file mode 100644
index 0000000000..16ab3bbf1a
--- /dev/null
+++ b/test/files/neg/optimiseDeprecated.check
@@ -0,0 +1,4 @@
+warning: -optimise is deprecated: In 2.12, -optimise enables -opt:l:classpath. Check -opt:help for using the Scala 2.12 optimizer.
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/optimiseDeprecated.flags b/test/files/neg/optimiseDeprecated.flags
new file mode 100644
index 0000000000..42fca6d836
--- /dev/null
+++ b/test/files/neg/optimiseDeprecated.flags
@@ -0,0 +1 @@
+-optimise -deprecation -Xfatal-warnings
diff --git a/test/files/neg/optimiseDeprecated.scala b/test/files/neg/optimiseDeprecated.scala
new file mode 100644
index 0000000000..826a1a5bc2
--- /dev/null
+++ b/test/files/neg/optimiseDeprecated.scala
@@ -0,0 +1 @@
+class C
diff --git a/test/files/neg/outer-ref-checks.check b/test/files/neg/outer-ref-checks.check
new file mode 100644
index 0000000000..bba7118d79
--- /dev/null
+++ b/test/files/neg/outer-ref-checks.check
@@ -0,0 +1,24 @@
+outer-ref-checks.scala:5: warning: The outer reference in this type test cannot be checked at run time.
+ final case class Inner(val s: String) // unchecked warning
+ ^
+outer-ref-checks.scala:8: warning: The outer reference in this type test cannot be checked at run time.
+ case Inner(s) => // unchecked warning
+ ^
+outer-ref-checks.scala:18: warning: The outer reference in this type test cannot be checked at run time.
+ case Inner(s) => // unchecked warning
+ ^
+outer-ref-checks.scala:19: warning: The outer reference in this type test cannot be checked at run time.
+ case O.Inner(s) => // unchecked warning
+ ^
+outer-ref-checks.scala:41: warning: The outer reference in this type test cannot be checked at run time.
+ case Inner(s) => // unchecked warning
+ ^
+outer-ref-checks.scala:46: warning: The outer reference in this type test cannot be checked at run time.
+ case _: Inner => // unchecked warning
+ ^
+outer-ref-checks.scala:56: warning: The outer reference in this type test cannot be checked at run time.
+ case _: (Inner @uncheckedVariance) => // unchecked warning
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+7 warnings found
+one error found
diff --git a/test/files/neg/outer-ref-checks.flags b/test/files/neg/outer-ref-checks.flags
new file mode 100644
index 0000000000..464cc20ea6
--- /dev/null
+++ b/test/files/neg/outer-ref-checks.flags
@@ -0,0 +1 @@
+-Xfatal-warnings -unchecked \ No newline at end of file
diff --git a/test/files/neg/outer-ref-checks.scala b/test/files/neg/outer-ref-checks.scala
new file mode 100644
index 0000000000..35983fe92b
--- /dev/null
+++ b/test/files/neg/outer-ref-checks.scala
@@ -0,0 +1,106 @@
+import scala.annotation.unchecked.uncheckedVariance
+
+class Outer {
+ // A final class gets no outer ref, so we expect to see warnings where an outer ref check should be performed
+ final case class Inner(val s: String) // unchecked warning
+
+ def belongs(a: Any): Unit = a match {
+ case Inner(s) => // unchecked warning
+ case _ =>
+ }
+
+ def belongsStaticSameOuter(a: Inner): Unit = a match {
+ case Inner(s) => // no need for outer check
+ // match is exhaustive, no default case needed
+ }
+
+ def belongsOtherOuter(a: Outer#Inner): Unit = a match {
+ case Inner(s) => // unchecked warning
+ case O.Inner(s) => // unchecked warning
+ case _ =>
+ }
+}
+
+object O extends Outer {
+ def belongsStaticSameOuter2(a: Inner): Unit = a match {
+ case Inner(s) => // no need for outer check
+ // match is exhaustive, no default case needed
+ }
+
+ def belongsStaticSameOuter3(a: Inner): Unit = a match {
+ case _: Inner => // no need for outer check
+ // match is exhaustive, no default case needed
+ }
+
+ def belongsStaticSameOuter4(a: Inner): Unit = a match {
+ case _: (Inner @uncheckedVariance) => // no need for outer check
+ // match is exhaustive, no default case needed
+ }
+
+ def belongsOtherOuter2(a: Outer#Inner): Unit = a match {
+ case Inner(s) => // unchecked warning
+ case _ =>
+ }
+
+ def belongsOtherOuter3(a: Outer#Inner): Unit = a match {
+ case _: Inner => // unchecked warning
+ case _ =>
+ }
+
+ def belongsOtherOuter4(a: Outer#Inner): Unit = a match {
+ case _: (Inner @unchecked) => // warning supressed
+ case _ =>
+ }
+
+ def belongsOtherOuter5(a: Outer#Inner): Unit = a match {
+ case _: (Inner @uncheckedVariance) => // unchecked warning
+ case _ =>
+ }
+
+ def nested: Unit = {
+ final case class I(s: String)
+
+ def check1(a: Any): Unit = a match {
+ case I(s) => // no need for outer check
+ case _ =>
+ }
+
+ def check2(a: I): Unit = a match {
+ case I(s) => // no need for outer check
+ // match is exhaustive, no default case needed
+ }
+ }
+}
+
+class O2 {
+ def nested: Unit = {
+ final case class I(s: String)
+
+ def check1(a: Any): Unit = a match {
+ case I(s) => // no need for outer check (is this correct?)
+ case _ =>
+ }
+
+ def check2(a: I): Unit = a match {
+ case I(s) => // no need for outer check (is this correct?)
+ // match is exhaustive, no default case needed
+ }
+ }
+}
+
+package p {
+ object T {
+ case class C(x: Int)
+ }
+}
+
+object U {
+ val T = p.T
+}
+
+class Test {
+ def m(a: Any) = a match {
+ case U.T.C(1) => 1 // used to warn
+ case _ => 1
+ }
+}
diff --git a/test/files/neg/overloaded-implicit.flags b/test/files/neg/overloaded-implicit.flags
index 9c1e74e4ef..e04a4228ba 100644
--- a/test/files/neg/overloaded-implicit.flags
+++ b/test/files/neg/overloaded-implicit.flags
@@ -1 +1 @@
--Xlint -Xfatal-warnings -Xdev
+-Xlint:poly-implicit-overload -Xfatal-warnings -Xdev
diff --git a/test/files/neg/overloaded-unapply.check b/test/files/neg/overloaded-unapply.check
index 68a826bac2..3951166de5 100644
--- a/test/files/neg/overloaded-unapply.check
+++ b/test/files/neg/overloaded-unapply.check
@@ -7,8 +7,8 @@ match argument types (List[a])
overloaded-unapply.scala:22: error: cannot resolve overloaded unapply
case List(x, xs) => 7
^
-overloaded-unapply.scala:12: error: method unapply is defined twice
- conflicting symbols both originated in file 'overloaded-unapply.scala'
+overloaded-unapply.scala:12: error: method unapply is defined twice;
+ the conflicting method unapply was defined at line 7:7
def unapply[a](xs: List[a]): Option[Null] = xs match {
^
three errors found
diff --git a/test/files/neg/override-object-no.check b/test/files/neg/override-object-no.check
index 9cfda80fc3..972a719b3b 100644
--- a/test/files/neg/override-object-no.check
+++ b/test/files/neg/override-object-no.check
@@ -20,4 +20,12 @@ an overriding object must conform to the overridden object's class bound;
required: case2.Bar[Traversable[String]]
override object A extends Bar[List[String]] // err
^
-four errors found
+override-object-no.scala:52: error: overriding method x in trait A of type => SI9574.Foo.type;
+ method x has incompatible type
+ trait B extends A { def x: Bar.type } // should not compile (SI-9574)
+ ^
+override-object-no.scala:53: error: overriding method x in trait A of type => SI9574.Foo.type;
+ object x has incompatible type
+ trait C extends A { override object x }
+ ^
+6 errors found
diff --git a/test/files/neg/override-object-no.scala b/test/files/neg/override-object-no.scala
index 745cdb2332..517408886d 100644
--- a/test/files/neg/override-object-no.scala
+++ b/test/files/neg/override-object-no.scala
@@ -43,3 +43,14 @@ package case2 {
override object A extends Bar[List[String]] // err
}
}
+
+// Both overridden and overriding members must be objects, not vals with a module type
+object SI9574 {
+ object Foo
+ object Bar
+ trait A { def x: Foo.type }
+ trait B extends A { def x: Bar.type } // should not compile (SI-9574)
+ trait C extends A { override object x }
+ trait D { object x; def y = x }
+ trait E extends D { override val x: super.x.type = y } // OK but doesn't need object subtyping exception
+}
diff --git a/test/files/neg/partestInvalidFlag.check b/test/files/neg/partestInvalidFlag.check
index 812191dc22..7a54e3aa43 100644
--- a/test/files/neg/partestInvalidFlag.check
+++ b/test/files/neg/partestInvalidFlag.check
@@ -1,4 +1,4 @@
error: bad option: '-badCompilerFlag'
-error: bad options: -badCompilerFlag notAFlag -Yopt:badChoice
-error: flags file may only contain compiler options, found: -badCompilerFlag notAFlag -Yopt:badChoice
+error: bad options: -badCompilerFlag notAFlag -opt:badChoice
+error: flags file may only contain compiler options, found: -badCompilerFlag notAFlag -opt:badChoice
three errors found
diff --git a/test/files/neg/partestInvalidFlag.flags b/test/files/neg/partestInvalidFlag.flags
index 68884532b9..d45fd31809 100644
--- a/test/files/neg/partestInvalidFlag.flags
+++ b/test/files/neg/partestInvalidFlag.flags
@@ -1 +1 @@
--badCompilerFlag notAFlag -Yopt:badChoice
+-badCompilerFlag notAFlag -opt:badChoice
diff --git a/test/files/neg/protected-constructors.check b/test/files/neg/protected-constructors.check
index f44d7db9b9..4f076ec993 100644
--- a/test/files/neg/protected-constructors.check
+++ b/test/files/neg/protected-constructors.check
@@ -1,6 +1,15 @@
-protected-constructors.scala:17: error: too many arguments for constructor Foo1: ()dingus.Foo1
+protected-constructors.scala:15: error: class Foo3 in object Ding cannot be accessed in object dingus.Ding
+ Access to protected class Foo3 not permitted because
+ enclosing object P in package hungus is not a subclass of
+ object Ding in package dingus where target is defined
+ class Bar3 extends Ding.Foo3("abc")
+ ^
+protected-constructors.scala:15: error: no arguments allowed for nullary constructor Object: ()Object
+ class Bar3 extends Ding.Foo3("abc")
+ ^
+protected-constructors.scala:17: error: no arguments allowed for nullary constructor Foo1: ()dingus.Foo1
val foo1 = new Foo1("abc")
- ^
+ ^
protected-constructors.scala:18: error: constructor Foo2 in class Foo2 cannot be accessed in object P
Access to protected constructor Foo2 not permitted because
enclosing object P in package hungus is not a subclass of
@@ -13,10 +22,4 @@ protected-constructors.scala:19: error: class Foo3 in object Ding cannot be acce
object Ding in package dingus where target is defined
val foo3 = new Ding.Foo3("abc")
^
-protected-constructors.scala:15: error: class Foo3 in object Ding cannot be accessed in object dingus.Ding
- Access to protected class Foo3 not permitted because
- enclosing object P in package hungus is not a subclass of
- object Ding in package dingus where target is defined
- class Bar3 extends Ding.Foo3("abc")
- ^
-four errors found
+5 errors found
diff --git a/test/files/neg/quasiquotes-syntax-error-position.check b/test/files/neg/quasiquotes-syntax-error-position.check
index 9fd6ce0417..b12a7d13d6 100644
--- a/test/files/neg/quasiquotes-syntax-error-position.check
+++ b/test/files/neg/quasiquotes-syntax-error-position.check
@@ -16,8 +16,7 @@ quasiquotes-syntax-error-position.scala:9: error: '{' expected but end of quote
quasiquotes-syntax-error-position.scala:10: error: ';' expected but '@' found.
q"foo@$a"
^
-quasiquotes-syntax-error-position.scala:11: error: case classes without a parameter list are not allowed;
-use either case objects or case classes with an explicit `()' as a parameter list.
+quasiquotes-syntax-error-position.scala:11: error: case classes must have a parameter list; try 'case class A()' or 'case object A'
q"case class A"
^
quasiquotes-syntax-error-position.scala:12: error: identifier expected but ']' found.
diff --git a/test/files/neg/sabin2.check b/test/files/neg/sabin2.check
index 8a09361069..cd6fde4608 100644
--- a/test/files/neg/sabin2.check
+++ b/test/files/neg/sabin2.check
@@ -1,6 +1,6 @@
sabin2.scala:22: error: type mismatch;
found : Test.Base#T
- required: _7.T where val _7: Test.Base
+ required: _1.T where val _1: Test.Base
a.set(b.get()) // Error
^
one error found
diff --git a/test/files/neg/saferJavaConversions.scala b/test/files/neg/saferJavaConversions.scala
index f0611204e6..b70a918404 100644
--- a/test/files/neg/saferJavaConversions.scala
+++ b/test/files/neg/saferJavaConversions.scala
@@ -3,17 +3,17 @@ case class Foo(s: String)
object Test {
def f1 = {
- import scala.collection.JavaConversions._
+ import scala.collection.convert.ImplicitConversions._
val map: Map[Foo, String] = Map(Foo("a") -> "a", Foo("b") -> "b")
val v = map.get("a") // should be a type error, actually returns null
}
def f2 = {
- import scala.collection.convert.wrapAsScala._
+ import scala.collection.convert.ImplicitConversionsToScala._
val map: Map[Foo, String] = Map(Foo("a") -> "a", Foo("b") -> "b")
val v = map.get("a") // now this is a type error
}
def f3 = {
- import scala.collection.convert.wrapAsJava._
+ import scala.collection.convert.ImplicitConversionsToJava._
val map: Map[Foo, String] = Map(Foo("a") -> "a", Foo("b") -> "b")
val v = map.get("a")
}
diff --git a/test/files/neg/sammy_disabled.check b/test/files/neg/sammy_disabled.check
new file mode 100644
index 0000000000..66db9dd5f2
--- /dev/null
+++ b/test/files/neg/sammy_disabled.check
@@ -0,0 +1,4 @@
+sammy_disabled.scala:3: error: missing parameter type
+class C { val f: F = x => "a" }
+ ^
+one error found
diff --git a/test/files/neg/sammy_disabled.flags b/test/files/neg/sammy_disabled.flags
new file mode 100644
index 0000000000..cf42e9f940
--- /dev/null
+++ b/test/files/neg/sammy_disabled.flags
@@ -0,0 +1 @@
+-Xsource:2.11
diff --git a/test/files/neg/sammy_disabled.scala b/test/files/neg/sammy_disabled.scala
new file mode 100644
index 0000000000..12000a3e12
--- /dev/null
+++ b/test/files/neg/sammy_disabled.scala
@@ -0,0 +1,3 @@
+trait F { def apply(x: Int): String }
+
+class C { val f: F = x => "a" }
diff --git a/test/files/neg/sammy_error.check b/test/files/neg/sammy_error.check
new file mode 100644
index 0000000000..f14ac7e3a2
--- /dev/null
+++ b/test/files/neg/sammy_error.check
@@ -0,0 +1,4 @@
+sammy_error.scala:6: error: missing parameter type
+ foo(x => x) // should result in only one error (the second one stemmed from adapting to SAM when the tree was erroneous)
+ ^
+one error found
diff --git a/test/files/neg/sammy_error.scala b/test/files/neg/sammy_error.scala
new file mode 100644
index 0000000000..dbddebf325
--- /dev/null
+++ b/test/files/neg/sammy_error.scala
@@ -0,0 +1,7 @@
+trait F1[A, B] { def apply(a: A): B }
+
+class Test {
+ def foo[A](f1: F1[A, A]) = f1
+
+ foo(x => x) // should result in only one error (the second one stemmed from adapting to SAM when the tree was erroneous)
+}
diff --git a/test/files/neg/sammy_error_exist_no_crash.check b/test/files/neg/sammy_error_exist_no_crash.check
index a0d2237ce0..944b6471fd 100644
--- a/test/files/neg/sammy_error_exist_no_crash.check
+++ b/test/files/neg/sammy_error_exist_no_crash.check
@@ -1,6 +1,4 @@
-sammy_error_exist_no_crash.scala:5: error: Could not derive subclass of F[? >: String]
- (with SAM `def method apply(s: String)Int`)
- based on: ((x$1: String) => x$1.<parseInt: error>).
+sammy_error_exist_no_crash.scala:5: error: value parseInt is not a member of String
bar(_.parseInt)
^
one error found
diff --git a/test/files/neg/sammy_error_exist_no_crash.flags b/test/files/neg/sammy_error_exist_no_crash.flags
deleted file mode 100644
index e1b37447c9..0000000000
--- a/test/files/neg/sammy_error_exist_no_crash.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xexperimental \ No newline at end of file
diff --git a/test/files/neg/sammy_error_exist_no_crash.scala b/test/files/neg/sammy_error_exist_no_crash.scala
index da7e47206f..667b4db763 100644
--- a/test/files/neg/sammy_error_exist_no_crash.scala
+++ b/test/files/neg/sammy_error_exist_no_crash.scala
@@ -1,6 +1,6 @@
-abstract class F[T] { def apply(s: T): Int }
+trait F[T] { def apply(s: T): Int }
object NeedsNiceError {
def bar(x: F[_ >: String]) = ???
bar(_.parseInt)
-} \ No newline at end of file
+}
diff --git a/test/files/neg/sammy_expected.check b/test/files/neg/sammy_expected.check
new file mode 100644
index 0000000000..3b76aabdd2
--- /dev/null
+++ b/test/files/neg/sammy_expected.check
@@ -0,0 +1,6 @@
+sammy_expected.scala:4: error: type mismatch;
+ found : String => Int
+ required: F[Object,Int]
+ def wrong: F[Object, Int] = (x: String) => 1
+ ^
+one error found
diff --git a/test/files/neg/sammy_expected.scala b/test/files/neg/sammy_expected.scala
new file mode 100644
index 0000000000..8fc1f66ff7
--- /dev/null
+++ b/test/files/neg/sammy_expected.scala
@@ -0,0 +1,5 @@
+trait F[A, B] { def apply(x: A): B }
+
+class MustMeetExpected {
+ def wrong: F[Object, Int] = (x: String) => 1
+} \ No newline at end of file
diff --git a/test/files/neg/sammy_overload.check b/test/files/neg/sammy_overload.check
new file mode 100644
index 0000000000..87b198f4f0
--- /dev/null
+++ b/test/files/neg/sammy_overload.check
@@ -0,0 +1,7 @@
+sammy_overload.scala:14: error: overloaded method value m with alternatives:
+ (x: ToString)Int <and>
+ (x: Int => String)Int
+ cannot be applied to (Int => Int)
+ O.m(x => x) // error expected: m cannot be applied to Int => Int
+ ^
+one error found
diff --git a/test/files/neg/sammy_overload.scala b/test/files/neg/sammy_overload.scala
new file mode 100644
index 0000000000..548e9d2d2e
--- /dev/null
+++ b/test/files/neg/sammy_overload.scala
@@ -0,0 +1,15 @@
+trait ToString { def convert(x: Int): String }
+
+class ExplicitSamType {
+ object O {
+ def m(x: Int => String): Int = 0 // (1)
+ def m(x: ToString): Int = 1 // (2)
+ }
+
+ O.m((x: Int) => x.toString) // ok, function type takes precedence, because (1) is more specific than (2),
+ // because (1) is as specific as (2): (2) can be applied to a value of type Int => String (well, assuming it's a function literal)
+ // but (2) is not as specific as (1): (1) cannot be applied to a value of type ToString
+
+ O.m(_.toString) // ok: overloading resolution pushes through `Int` as the argument type, so this type checks
+ O.m(x => x) // error expected: m cannot be applied to Int => Int
+}
diff --git a/test/files/neg/sammy_restrictions.check b/test/files/neg/sammy_restrictions.check
index 8cc49f9aa9..0225c61ac1 100644
--- a/test/files/neg/sammy_restrictions.check
+++ b/test/files/neg/sammy_restrictions.check
@@ -1,49 +1,62 @@
-sammy_restrictions.scala:31: error: type mismatch;
+sammy_restrictions.scala:38: error: type mismatch;
found : () => Int
required: NoAbstract
(() => 0) : NoAbstract
^
-sammy_restrictions.scala:32: error: type mismatch;
+sammy_restrictions.scala:39: error: type mismatch;
found : Int => Int
required: TwoAbstract
((x: Int) => 0): TwoAbstract
^
-sammy_restrictions.scala:34: error: class type required but DerivedOneAbstract with OneAbstract found
- ((x: Int) => 0): NonClassType // "class type required". I think we should avoid SAM translation here.
- ^
-sammy_restrictions.scala:35: error: type mismatch;
+sammy_restrictions.scala:40: error: type mismatch;
found : Int => Int
required: NoEmptyConstructor
((x: Int) => 0): NoEmptyConstructor
^
-sammy_restrictions.scala:37: error: type mismatch;
- found : Int => Int
- required: OneEmptySecondaryConstructor
- ((x: Int) => 0): OneEmptySecondaryConstructor // derived class must have an empty *primary* to call.
- ^
-sammy_restrictions.scala:38: error: type mismatch;
+sammy_restrictions.scala:41: error: type mismatch;
found : Int => Int
required: MultipleConstructorLists
((x: Int) => 0): MultipleConstructorLists
^
-sammy_restrictions.scala:39: error: type mismatch;
+sammy_restrictions.scala:42: error: type mismatch;
+ found : Int => Int
+ required: OneEmptySecondaryConstructor
+ ((x: Int) => 0): OneEmptySecondaryConstructor // derived class must have an empty *primary* to call.
+ ^
+sammy_restrictions.scala:43: error: type mismatch;
found : Int => Int
required: MultipleMethodLists
((x: Int) => 0): MultipleMethodLists
^
-sammy_restrictions.scala:40: error: type mismatch;
+sammy_restrictions.scala:44: error: type mismatch;
found : Int => Int
required: ImplicitConstructorParam
((x: Int) => 0): ImplicitConstructorParam
^
-sammy_restrictions.scala:41: error: type mismatch;
+sammy_restrictions.scala:45: error: type mismatch;
found : Int => Int
required: ImplicitMethodParam
((x: Int) => 0): ImplicitMethodParam
^
-sammy_restrictions.scala:44: error: type mismatch;
+sammy_restrictions.scala:46: error: type mismatch;
found : Int => Int
required: PolyMethod
((x: Int) => 0): PolyMethod
^
-10 errors found
+sammy_restrictions.scala:47: error: type mismatch;
+ found : Int => Int
+ required: SelfTp
+ ((x: Int) => 0): SelfTp
+ ^
+sammy_restrictions.scala:48: error: type mismatch;
+ found : Int => Int
+ required: T1 with U1
+ ((x: Int) => 0): T1 with U1
+ ^
+sammy_restrictions.scala:49: error: type mismatch;
+ found : Int => Int
+ required: Test.NonClassTypeRefinement
+ (which expands to) DerivedOneAbstract with OneAbstract
+ ((x: Int) => 0): NonClassTypeRefinement
+ ^
+12 errors found
diff --git a/test/files/neg/sammy_restrictions.scala b/test/files/neg/sammy_restrictions.scala
index d003cfaf36..dee4f1f247 100644
--- a/test/files/neg/sammy_restrictions.scala
+++ b/test/files/neg/sammy_restrictions.scala
@@ -24,22 +24,34 @@ abstract class PolyMethod { def ap[T](a: T): T }
abstract class OneAbstract { def ap(a: Int): Any }
abstract class DerivedOneAbstract extends OneAbstract
+abstract class SelfTp { self: NoAbstract => def ap(a: Int): Any }
+abstract class SelfVar { self => def ap(a: Int): Any }
+
+trait T1 { def t(a: Int): Int }; trait U1
+
object Test {
implicit val s: String = ""
- type NonClassType = DerivedOneAbstract with OneAbstract
+ type NonClassTypeRefinement = DerivedOneAbstract with OneAbstract
+ type NonClassType = DerivedOneAbstract
+ // errors:
(() => 0) : NoAbstract
((x: Int) => 0): TwoAbstract
- ((x: Int) => 0): DerivedOneAbstract // okay
- ((x: Int) => 0): NonClassType // "class type required". I think we should avoid SAM translation here.
((x: Int) => 0): NoEmptyConstructor
- ((x: Int) => 0): OneEmptyConstructor // okay
- ((x: Int) => 0): OneEmptySecondaryConstructor // derived class must have an empty *primary* to call.
((x: Int) => 0): MultipleConstructorLists
+ ((x: Int) => 0): OneEmptySecondaryConstructor // derived class must have an empty *primary* to call.
((x: Int) => 0): MultipleMethodLists
((x: Int) => 0): ImplicitConstructorParam
((x: Int) => 0): ImplicitMethodParam
-
- ((x: Int) => 0): PolyClass[Int] // okay
((x: Int) => 0): PolyMethod
+ ((x: Int) => 0): SelfTp
+ ((x: Int) => 0): T1 with U1
+ ((x: Int) => 0): NonClassTypeRefinement
+
+ // allowed:
+ ((x: Int) => 0): OneEmptyConstructor
+ ((x: Int) => 0): DerivedOneAbstract
+ ((x: Int) => 0): NonClassType // we also allow type aliases in instantiation expressions, if they resolve to a class type
+ ((x: Int) => 0): PolyClass[Int]
+ ((x: Int) => 0): SelfVar
}
diff --git a/test/files/neg/scopes.check b/test/files/neg/scopes.check
index f8e8c3758a..2db9678185 100644
--- a/test/files/neg/scopes.check
+++ b/test/files/neg/scopes.check
@@ -7,7 +7,7 @@ scopes.scala:5: error: x is already defined as value x
scopes.scala:8: error: y is already defined as value y
val y: Float = .0f
^
-scopes.scala:6: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+scopes.scala:6: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
{
^
scopes.scala:11: error: x is already defined as value x
diff --git a/test/files/neg/sd128.check b/test/files/neg/sd128.check
new file mode 100644
index 0000000000..8f6fcb1213
--- /dev/null
+++ b/test/files/neg/sd128.check
@@ -0,0 +1,17 @@
+Test.scala:4: error: class C1 inherits conflicting members:
+ method f in trait A of type ()Int and
+ method f in trait T of type => Int
+(Note: this can be resolved by declaring an override in class C1.)
+class C1 extends A with T // error
+ ^
+Test.scala:5: error: class C2 inherits conflicting members:
+ method f in trait T of type => Int and
+ method f in trait A of type ()Int
+(Note: this can be resolved by declaring an override in class C2.)
+class C2 extends T with A // error
+ ^
+Test.scala:14: error: overriding method f in trait A of type ()Int;
+ method f needs `override' modifier
+ def f() = 9999 // need override modifier
+ ^
+three errors found
diff --git a/test/files/neg/sd128/A.java b/test/files/neg/sd128/A.java
new file mode 100644
index 0000000000..6774deba2e
--- /dev/null
+++ b/test/files/neg/sd128/A.java
@@ -0,0 +1,3 @@
+interface A {
+ default int f() { return -10; }
+}
diff --git a/test/files/neg/sd128/Test.scala b/test/files/neg/sd128/Test.scala
new file mode 100644
index 0000000000..66ca3d0940
--- /dev/null
+++ b/test/files/neg/sd128/Test.scala
@@ -0,0 +1,19 @@
+trait T {
+ def f = 99
+}
+class C1 extends A with T // error
+class C2 extends T with A // error
+
+trait U extends A {
+ override def f = 999
+}
+class D1 extends A with U // OK
+class D2 extends U with A // OK
+
+class E1 extends A {
+ def f() = 9999 // need override modifier
+}
+
+class E2 extends A {
+ override def f() = 9999 // OK
+}
diff --git a/test/files/neg/sealed-final-neg.check b/test/files/neg/sealed-final-neg.check
index 500d23f49a..5e47c69ed8 100644
--- a/test/files/neg/sealed-final-neg.check
+++ b/test/files/neg/sealed-final-neg.check
@@ -1,4 +1,11 @@
-sealed-final-neg.scala:41: error: expected class or object definition
-"Due to SI-6142 this emits no warnings, so we'll just break it until that's fixed."
-^
+sealed-final-neg.scala:17: warning: neg1/Foo::bar(I)I is annotated @inline but could not be inlined:
+The method is not final and may be overridden.
+ def f = Foo.mkFoo() bar 10
+ ^
+sealed-final-neg.scala:37: warning: neg2/Foo::bar(I)I is annotated @inline but could not be inlined:
+The method is not final and may be overridden.
+ def f = Foo.mkFoo() bar 10
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+two warnings found
one error found
diff --git a/test/files/neg/sealed-final-neg.flags b/test/files/neg/sealed-final-neg.flags
index cfabf7a5b4..f2f36c1771 100644
--- a/test/files/neg/sealed-final-neg.flags
+++ b/test/files/neg/sealed-final-neg.flags
@@ -1 +1 @@
--Xfatal-warnings -Yinline-warnings -optimise \ No newline at end of file
+-Xfatal-warnings -opt:l:project -opt-warnings \ No newline at end of file
diff --git a/test/files/neg/sealed-final-neg.scala b/test/files/neg/sealed-final-neg.scala
index bc25330e13..ec3b199819 100644
--- a/test/files/neg/sealed-final-neg.scala
+++ b/test/files/neg/sealed-final-neg.scala
@@ -37,5 +37,3 @@ package neg2 {
def f = Foo.mkFoo() bar 10
}
}
-
-"Due to SI-6142 this emits no warnings, so we'll just break it until that's fixed."
diff --git a/test/files/neg/specification-scopes.check b/test/files/neg/specification-scopes.check
index ab986135e5..49cdbf9232 100644
--- a/test/files/neg/specification-scopes.check
+++ b/test/files/neg/specification-scopes.check
@@ -1,12 +1,12 @@
-P_2.scala:14: error: reference to x is ambiguous;
-it is both defined in object C and imported subsequently by
-import Q.X._
- println("L14: "+x) // reference to 'x' is ambiguous here
- ^
-P_2.scala:19: error: reference to y is ambiguous;
+P_2.scala:15: error: reference to x is ambiguous;
+it is both defined in value <local Y> and imported subsequently by
+import q.X._
+ println(s"L15: $x") // reference to `x' is ambiguous here
+ ^
+P_2.scala:21: error: reference to y is ambiguous;
it is imported twice in the same scope by
-import P.X._
+import p.X._
and import X.y
- println("L19: "+y) // reference to 'y' is ambiguous here
- ^
+ println(s"L21: $y") // reference to `y' is ambiguous here
+ ^
two errors found
diff --git a/test/files/neg/specification-scopes/P_1.scala b/test/files/neg/specification-scopes/P_1.scala
index 3b11f1167d..50c306fd67 100644
--- a/test/files/neg/specification-scopes/P_1.scala
+++ b/test/files/neg/specification-scopes/P_1.scala
@@ -1,6 +1,7 @@
-package P {
- object X { val x = 1; val y = 2; }
+package p {
+ object X { val x = 1; val y = 2 }
}
-package Q {
- object X { val x = true; val y = "" }
+
+package q {
+ object X { val x = true; val y = false }
}
diff --git a/test/files/neg/specification-scopes/P_2.scala b/test/files/neg/specification-scopes/P_2.scala
index d59f82e90d..856e58c6fb 100644
--- a/test/files/neg/specification-scopes/P_2.scala
+++ b/test/files/neg/specification-scopes/P_2.scala
@@ -1,21 +1,24 @@
-package P { // 'X' bound by package clause
- import Console._ // 'println' bound by wildcard import
- object A {
- println("L4: "+X) // 'X' refers to 'P.X' here
- object B {
- import Q._ // 'X' bound by wildcard import
- println("L7: "+X) // 'X' refers to 'Q.X' here
- import X._ // 'x' and 'y' bound by wildcard import
- println("L8: "+x) // 'x' refers to 'Q.X.x' here
- object C {
- val x = 3 // 'x' bound by local definition
- println("L12: "+x); // 'x' refers to constant '3' here
- { import Q.X._ // 'x' and 'y' bound by wildcard
- println("L14: "+x) // reference to 'x' is ambiguous here
- import X.y // 'y' bound by explicit import
- println("L16: "+y); // 'y' refers to 'Q.X.y' here
- { val x = "abc" // 'x' bound by local definition
- import P.X._ // 'x' and 'y' bound by wildcard
- println("L19: "+y) // reference to 'y' is ambiguous here
- println("L20: "+x) // 'x' refers to string ''abc'' here
+package p { // `X' bound by package clause
+import Console._ // `println' bound by wildcard import
+object Y {
+ println(s"L4: $X") // `X' refers to `p.X' here
+ locally {
+ import q._ // `X' bound by wildcard import
+ println(s"L7: $X") // `X' refers to `q.X' here
+ import X._ // `x' and `y' bound by wildcard import
+ println(s"L9: $x") // `x' refers to `q.X.x' here
+ locally {
+ val x = 3 // `x' bound by local definition
+ println(s"L12: $x") // `x' refers to constant `3' here
+ locally {
+ import q.X._ // `x' and `y' bound by wildcard import
+ println(s"L15: $x") // reference to `x' is ambiguous here
+ import X.y // `y' bound by explicit import
+ println(s"L17: $y") // `y' refers to `q.X.y' here
+ locally {
+ val x = "abc" // `x' bound by local definition
+ import p.X._ // `x' and `y' bound by wildcard import
+ println(s"L21: $y") // reference to `y' is ambiguous here
+ println(s"L22: $x") // `x' refers to string "abc" here
}}}}}}
+
diff --git a/test/files/neg/stmt-expr-discard.check b/test/files/neg/stmt-expr-discard.check
index 1207e6da50..4a80765365 100644
--- a/test/files/neg/stmt-expr-discard.check
+++ b/test/files/neg/stmt-expr-discard.check
@@ -1,7 +1,7 @@
-stmt-expr-discard.scala:3: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+stmt-expr-discard.scala:3: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
+ 2
^
-stmt-expr-discard.scala:4: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+stmt-expr-discard.scala:4: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
- 4
^
error: No warnings can be incurred under -Xfatal-warnings.
diff --git a/test/files/neg/t10066.check b/test/files/neg/t10066.check
new file mode 100644
index 0000000000..3555205d83
--- /dev/null
+++ b/test/files/neg/t10066.check
@@ -0,0 +1,7 @@
+t10066.scala:33: error: could not find implicit value for parameter extractor: dynamicrash.Extractor[String]
+ println(storage.foo[String])
+ ^
+t10066.scala:37: error: could not find implicit value for parameter extractor: dynamicrash.Extractor[A]
+ println(storage.foo)
+ ^
+two errors found
diff --git a/test/files/neg/t10066.scala b/test/files/neg/t10066.scala
new file mode 100644
index 0000000000..ef52f333dd
--- /dev/null
+++ b/test/files/neg/t10066.scala
@@ -0,0 +1,38 @@
+package dynamicrash
+
+import scala.language.dynamics
+
+class Config
+
+trait Extractor[A] {
+ def extract(config: Config, name: String): A
+}
+
+object Extractor {
+ // note missing "implicit"
+ val stringExtractor = new Extractor[String] {
+ override def extract(config: Config, name: String): String = ???
+ }
+}
+
+class Workspace extends Dynamic {
+ val config: Config = new Config
+
+ def selectDynamic[A](name: String)(implicit extractor: Extractor[A]): A =
+ extractor.extract(config, name)
+}
+
+object Main {
+ val storage = new Workspace
+
+ // this line works fine
+ // val a = storage.foo
+
+ // this line crashes the compiler ("head of empty list")
+ // in ContextErrors$InferencerContextErrors$InferErrorGen$.NotWithinBoundsErrorMessage
+ println(storage.foo[String])
+
+ // this line crashes the compiler in different way ("unknown type")
+ // in the backend, warning: an unexpected type representation reached the compiler backend while compiling Test.scala: <error>
+ println(storage.foo)
+}
diff --git a/test/files/neg/t10068.check b/test/files/neg/t10068.check
new file mode 100644
index 0000000000..2bb27c4fd8
--- /dev/null
+++ b/test/files/neg/t10068.check
@@ -0,0 +1,13 @@
+t10068.scala:5: error: i : Only methods can be marked @elidable.
+ @elidable(INFO) val i: Int = 42
+ ^
+t10068.scala:6: error: j: Only methods can be marked @elidable.
+ @elidable(INFO) lazy val j: Int = 42
+ ^
+t10068.scala:7: error: k : Only methods can be marked @elidable.
+ @elidable(INFO) var k: Int = 42
+ ^
+t10068.scala:9: error: D: Only methods can be marked @elidable.
+@elidable(INFO) class D
+ ^
+four errors found
diff --git a/test/files/neg/t10068.flags b/test/files/neg/t10068.flags
new file mode 100644
index 0000000000..2b18795468
--- /dev/null
+++ b/test/files/neg/t10068.flags
@@ -0,0 +1 @@
+-Xelide-below WARNING -Xsource:2.13
diff --git a/test/files/neg/t10068.scala b/test/files/neg/t10068.scala
new file mode 100644
index 0000000000..a45ee5dac4
--- /dev/null
+++ b/test/files/neg/t10068.scala
@@ -0,0 +1,9 @@
+
+import annotation._, elidable._
+
+class C {
+ @elidable(INFO) val i: Int = 42
+ @elidable(INFO) lazy val j: Int = 42
+ @elidable(INFO) var k: Int = 42
+}
+@elidable(INFO) class D
diff --git a/test/files/neg/t10097.check b/test/files/neg/t10097.check
new file mode 100644
index 0000000000..1f70546b57
--- /dev/null
+++ b/test/files/neg/t10097.check
@@ -0,0 +1,10 @@
+t10097.scala:2: error: case classes must have a non-implicit parameter list; try 'case class C()(...)'
+case class C(implicit val c: Int)
+ ^
+t10097.scala:4: error: case classes must have a non-implicit parameter list; try 'case class D()(...)(...)'
+case class D(implicit c: Int)(s: String)
+ ^
+t10097.scala:4: error: an implicit parameter section must be last
+case class D(implicit c: Int)(s: String)
+ ^
+three errors found
diff --git a/test/files/neg/t10097.flags b/test/files/neg/t10097.flags
new file mode 100644
index 0000000000..714bbf5125
--- /dev/null
+++ b/test/files/neg/t10097.flags
@@ -0,0 +1 @@
+-Xsource:2.13
diff --git a/test/files/neg/t10097.scala b/test/files/neg/t10097.scala
new file mode 100644
index 0000000000..b2f05e2972
--- /dev/null
+++ b/test/files/neg/t10097.scala
@@ -0,0 +1,4 @@
+
+case class C(implicit val c: Int)
+
+case class D(implicit c: Int)(s: String)
diff --git a/test/files/neg/t10097b.check b/test/files/neg/t10097b.check
new file mode 100644
index 0000000000..14535fee34
--- /dev/null
+++ b/test/files/neg/t10097b.check
@@ -0,0 +1,6 @@
+t10097b.scala:2: warning: case classes should have a non-implicit parameter list; adapting to 'case class C()(...)'
+case class C(implicit val c: Int)
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/t10097b.flags b/test/files/neg/t10097b.flags
new file mode 100644
index 0000000000..c6bfaf1f64
--- /dev/null
+++ b/test/files/neg/t10097b.flags
@@ -0,0 +1 @@
+-deprecation -Xfatal-warnings
diff --git a/test/files/neg/t10097b.scala b/test/files/neg/t10097b.scala
new file mode 100644
index 0000000000..f166db6792
--- /dev/null
+++ b/test/files/neg/t10097b.scala
@@ -0,0 +1,3 @@
+
+case class C(implicit val c: Int)
+
diff --git a/test/files/neg/t1010.check b/test/files/neg/t1010.check
index 2cc8f9d986..d412d8ac1e 100644
--- a/test/files/neg/t1010.check
+++ b/test/files/neg/t1010.check
@@ -1,6 +1,6 @@
t1010.scala:14: error: type mismatch;
found : MailBox#Message
- required: _3.in.Message where val _3: Actor
+ required: _1.in.Message where val _1: Actor
unstable.send(msg) // in.Message becomes unstable.Message, but that's ok since Message is a concrete type member
^
one error found
diff --git a/test/files/neg/t10207.check b/test/files/neg/t10207.check
new file mode 100755
index 0000000000..3330db44a5
--- /dev/null
+++ b/test/files/neg/t10207.check
@@ -0,0 +1,4 @@
+t10207.scala:14: error: too many arguments (2) for method apply: (key: Int)scala.collection.mutable.ArrayBuffer[String] in trait MapLike
+ m(1, (_ => empty)) ++= AB("eins", "uno")
+ ^
+one error found
diff --git a/test/files/neg/t10207.scala b/test/files/neg/t10207.scala
new file mode 100644
index 0000000000..2dfc5d75c9
--- /dev/null
+++ b/test/files/neg/t10207.scala
@@ -0,0 +1,16 @@
+
+// Was:
+// warning: an unexpected type representation reached the compiler backend
+// Now:
+// error: too many arguments (2) for method apply: (key: Int)scala.collection.mutable.ArrayBuffer[String] in trait MapLike
+
+trait Test {
+ import collection.mutable.{Map=>MMap, ArrayBuffer=>AB}
+
+ val m = MMap((1 -> AB("one")))
+
+ val empty = AB[String]()
+
+ m(1, (_ => empty)) ++= AB("eins", "uno")
+}
+
diff --git a/test/files/neg/t1112.check b/test/files/neg/t1112.check
index 5e3821b153..e6058bf176 100644
--- a/test/files/neg/t1112.check
+++ b/test/files/neg/t1112.check
@@ -1,4 +1,4 @@
-t1112.scala:12: error: too many arguments for method call: (p: Int)(f: => Test.this.Type1)Unit
+t1112.scala:12: error: too many arguments (2) for method call: (p: Int)(f: => Test.this.Type1)Unit
call(0,() => System.out.println("here we are"))
- ^
+ ^
one error found
diff --git a/test/files/neg/t1181.check b/test/files/neg/t1181.check
index 13b73d5381..a9c102853d 100644
--- a/test/files/neg/t1181.check
+++ b/test/files/neg/t1181.check
@@ -1,10 +1,10 @@
-t1181.scala:8: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
- case (Nil, Nil) => map
- ^
t1181.scala:9: error: type mismatch;
found : scala.collection.immutable.Map[Symbol,Symbol]
required: Symbol
_ => buildMap(map.updated(keyList.head, valueList.head), keyList.tail, valueList.tail)
^
+t1181.scala:8: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
+ case (Nil, Nil) => map
+ ^
one warning found
one error found
diff --git a/test/files/neg/t1523.check b/test/files/neg/t1523.check
index d2489f2602..273d0f8cf7 100644
--- a/test/files/neg/t1523.check
+++ b/test/files/neg/t1523.check
@@ -1,4 +1,4 @@
-t1523.scala:4: error: too many arguments for method bug: (x: Any)Any
+t1523.scala:4: error: 25 more arguments than can be applied to method bug: (x: Any)Any
def go() = bug("a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a")
- ^
+ ^
one error found
diff --git a/test/files/neg/t1838.check b/test/files/neg/t1838.check
index a476158c7b..af811a3810 100644
--- a/test/files/neg/t1838.check
+++ b/test/files/neg/t1838.check
@@ -1,7 +1,7 @@
-t1838.scala:6: error: `sealed' modifier can be used only for classes
- sealed val v = 0
- ^
t1838.scala:5: error: `sealed' modifier can be used only for classes
sealed def f = 0
^
+t1838.scala:6: error: `sealed' modifier can be used only for classes
+ sealed val v = 0
+ ^
two errors found
diff --git a/test/files/neg/t1960.check b/test/files/neg/t1960.check
index 5238141c4e..bb6d3d3548 100644
--- a/test/files/neg/t1960.check
+++ b/test/files/neg/t1960.check
@@ -1,4 +1,7 @@
-t1960.scala:5: error: parameter 'p' requires field but conflicts with method p in trait TBase
-class Aclass (p: Int) extends TBase { def g() { f(p) } }
- ^
-one error found
+t1960.scala:2: error: parameter 'vr' requires field but conflicts with variable vr in trait T
+class C(vr: Int, vl: Int) extends T { def ref = vr + vl }
+ ^
+t1960.scala:2: error: parameter 'vl' requires field but conflicts with value vl in trait T
+class C(vr: Int, vl: Int) extends T { def ref = vr + vl }
+ ^
+two errors found
diff --git a/test/files/neg/t1960.scala b/test/files/neg/t1960.scala
index 5311940b5a..f4fdb341c6 100644
--- a/test/files/neg/t1960.scala
+++ b/test/files/neg/t1960.scala
@@ -1,5 +1,2 @@
-object ClassFormatErrorExample extends App { new Aclass(1) }
-
-trait TBase { var p:Int = 0; def f(p1: Int) {} }
-
-class Aclass (p: Int) extends TBase { def g() { f(p) } }
+trait T { var vr: Int = 0 ; val vl: Int = 0 }
+class C(vr: Int, vl: Int) extends T { def ref = vr + vl }
diff --git a/test/files/neg/t1980.flags b/test/files/neg/t1980.flags
index 7949c2afa2..cdc464a47d 100644
--- a/test/files/neg/t1980.flags
+++ b/test/files/neg/t1980.flags
@@ -1 +1 @@
--Xlint -Xfatal-warnings
+-Xlint:by-name-right-associative -Xfatal-warnings
diff --git a/test/files/neg/t200.check b/test/files/neg/t200.check
index b6b1a32267..f0c5e77772 100644
--- a/test/files/neg/t200.check
+++ b/test/files/neg/t200.check
@@ -1,5 +1,5 @@
-t200.scala:7: error: method foo is defined twice
- conflicting symbols both originated in file 't200.scala'
+t200.scala:7: error: method foo is defined twice;
+ the conflicting method foo was defined at line 6:7
def foo: Int;
^
one error found
diff --git a/test/files/neg/t2102.check b/test/files/neg/t2102.check
index b4f91a5319..6f70839d22 100644
--- a/test/files/neg/t2102.check
+++ b/test/files/neg/t2102.check
@@ -1,6 +1,6 @@
t2102.scala:2: error: type mismatch;
- found : java.util.Iterator[Int]
- required: scala.collection.Iterator[_]
+ found : Iterator[Int] (in java.util)
+ required: Iterator[_] (in scala.collection)
val x: Iterator[_] = new java.util.ArrayList[Int]().iterator
^
one error found
diff --git a/test/files/neg/t2712.flags b/test/files/neg/t2712.flags
deleted file mode 100644
index 41565c7e32..0000000000
--- a/test/files/neg/t2712.flags
+++ /dev/null
@@ -1 +0,0 @@
--Ypartial-unification
diff --git a/test/files/neg/t2779.check b/test/files/neg/t2779.check
index 0ab4c50d0f..9881d5182c 100644
--- a/test/files/neg/t2779.check
+++ b/test/files/neg/t2779.check
@@ -1,5 +1,5 @@
-t2779.scala:16: error: method f is defined twice
- conflicting symbols both originated in file 't2779.scala'
+t2779.scala:16: error: method f is defined twice;
+ the conflicting method f was defined at line 15:18
override def f = List(M1)
^
one error found
diff --git a/test/files/neg/t278.check b/test/files/neg/t278.check
index 405f7d225c..940b8edcef 100644
--- a/test/files/neg/t278.check
+++ b/test/files/neg/t278.check
@@ -4,8 +4,8 @@ t278.scala:5: error: overloaded method value a with alternatives:
does not take type parameters
println(a[A])
^
-t278.scala:4: error: method a is defined twice
- conflicting symbols both originated in file 't278.scala'
+t278.scala:4: error: method a is defined twice;
+ the conflicting method a was defined at line 3:7
def a = (p:A) => ()
^
two errors found
diff --git a/test/files/neg/t3234.check b/test/files/neg/t3234.check
deleted file mode 100644
index 8f0d624ed9..0000000000
--- a/test/files/neg/t3234.check
+++ /dev/null
@@ -1,6 +0,0 @@
-t3234.scala:17: warning: At the end of the day, could not inline @inline-marked method foo3
- println(foo(42) + foo2(11) + foo3(2))
- ^
-error: No warnings can be incurred under -Xfatal-warnings.
-one warning found
-one error found
diff --git a/test/files/neg/t3234.flags b/test/files/neg/t3234.flags
deleted file mode 100644
index 406231bd96..0000000000
--- a/test/files/neg/t3234.flags
+++ /dev/null
@@ -1 +0,0 @@
--Yinline -Yinline-warnings -Xfatal-warnings -Ybackend:GenASM
diff --git a/test/files/neg/t3772.check b/test/files/neg/t3772.check
new file mode 100644
index 0000000000..d1ed39d8b6
--- /dev/null
+++ b/test/files/neg/t3772.check
@@ -0,0 +1,7 @@
+t3772.scala:7: error: value inner is not a member of object CC
+ CC.inner
+ ^
+t3772.scala:14: error: value outer is not a member of object CC
+ CC.outer
+ ^
+two errors found
diff --git a/test/files/neg/t3772.scala b/test/files/neg/t3772.scala
new file mode 100644
index 0000000000..cac4932d4a
--- /dev/null
+++ b/test/files/neg/t3772.scala
@@ -0,0 +1,17 @@
+class Test {
+ def m = {
+ case class CC(c: Int)
+ if ("".isEmpty) {
+ object CC { def inner = 42}
+ }
+ CC.inner
+ }
+ def n = {
+ object CC { val outer = 42 }
+ if ("".isEmpty) {
+ case class CC(c: Int)
+ CC(0).c
+ CC.outer
+ }
+ }
+}
diff --git a/test/files/neg/t3871.check b/test/files/neg/t3871.check
index b920357ee6..c9667abfb6 100644
--- a/test/files/neg/t3871.check
+++ b/test/files/neg/t3871.check
@@ -1,5 +1,5 @@
t3871.scala:4: error: variable foo in class Sub2 cannot be accessed in Sub2
- Access to protected method foo not permitted because
+ Access to protected variable foo not permitted because
enclosing class Base is not a subclass of
class Sub2 where target is defined
s.foo = true
diff --git a/test/files/neg/t4158.check b/test/files/neg/t4158.check
index af281c52cd..7bac6558f7 100644
--- a/test/files/neg/t4158.check
+++ b/test/files/neg/t4158.check
@@ -1,7 +1,7 @@
-t4158.scala:3: error: an expression of type Null is ineligible for implicit conversion
- var y = null: Int
- ^
t4158.scala:2: error: an expression of type Null is ineligible for implicit conversion
var x: Int = null
^
+t4158.scala:3: error: an expression of type Null is ineligible for implicit conversion
+ var y = null: Int
+ ^
two errors found
diff --git a/test/files/neg/t4425.flags b/test/files/neg/t4425.flags
deleted file mode 100644
index 1182725e86..0000000000
--- a/test/files/neg/t4425.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimize \ No newline at end of file
diff --git a/test/files/neg/t4460a.check b/test/files/neg/t4460a.check
index b711e7acb1..7a7618a114 100644
--- a/test/files/neg/t4460a.check
+++ b/test/files/neg/t4460a.check
@@ -1,4 +1,4 @@
-t4460a.scala:6: error: called constructor's definition must precede calling constructor's definition
+t4460a.scala:6: error: constructor invokes itself
def this() = this() // was binding to Predef.<init> !!
^
one error found
diff --git a/test/files/neg/t4460b.check b/test/files/neg/t4460b.check
index f0e703fd10..9a621dbd5c 100644
--- a/test/files/neg/t4460b.check
+++ b/test/files/neg/t4460b.check
@@ -1,4 +1,4 @@
-t4460b.scala:7: error: called constructor's definition must precede calling constructor's definition
+t4460b.scala:7: error: constructor invokes itself
def this() = this() // was binding to Predef.<init> !!
^
one error found
diff --git a/test/files/neg/t4541.check b/test/files/neg/t4541.check
index 7bd8ff78f9..7ee0cc6414 100644
--- a/test/files/neg/t4541.check
+++ b/test/files/neg/t4541.check
@@ -1,5 +1,5 @@
t4541.scala:11: error: variable data in class Sparse cannot be accessed in Sparse[Int]
- Access to protected method data not permitted because
+ Access to protected variable data not permitted because
prefix type Sparse[Int] does not conform to
class Sparse$mcI$sp where the access take place
that.data
diff --git a/test/files/neg/t4541b.check b/test/files/neg/t4541b.check
index 8a52fd97f4..2aae95f6b9 100644
--- a/test/files/neg/t4541b.check
+++ b/test/files/neg/t4541b.check
@@ -1,5 +1,5 @@
t4541b.scala:13: error: variable data in class SparseArray cannot be accessed in SparseArray[Int]
- Access to protected method data not permitted because
+ Access to protected variable data not permitted because
prefix type SparseArray[Int] does not conform to
class SparseArray$mcI$sp where the access take place
use(that.data.clone)
diff --git a/test/files/neg/t4851.check b/test/files/neg/t4851.check
index d5711a889b..721923e0ba 100644
--- a/test/files/neg/t4851.check
+++ b/test/files/neg/t4851.check
@@ -1,10 +1,10 @@
-S.scala:2: warning: Adaptation of argument list by inserting () has been deprecated: leaky (Object-receiving) target makes this especially dangerous.
+S.scala:2: warning: Adaptation of argument list by inserting () is deprecated: leaky (Object-receiving) target makes this especially dangerous.
signature: J(x: Any): J
given arguments: <none>
after adaptation: new J((): Unit)
val x1 = new J
^
-S.scala:3: warning: Adaptation of argument list by inserting () has been deprecated: leaky (Object-receiving) target makes this especially dangerous.
+S.scala:3: warning: Adaptation of argument list by inserting () is deprecated: leaky (Object-receiving) target makes this especially dangerous.
signature: J(x: Any): J
given arguments: <none>
after adaptation: new J((): Unit)
@@ -17,24 +17,24 @@ S.scala:4: warning: Adapting argument list by creating a 5-tuple: this may not b
val x3 = new J(1, 2, 3, 4, 5)
^
S.scala:6: warning: Adapting argument list by creating a 3-tuple: this may not be what you want.
- signature: Some.apply[A](x: A): Some[A]
+ signature: Some.apply[A](value: A): Some[A]
given arguments: 1, 2, 3
after adaptation: Some((1, 2, 3): (Int, Int, Int))
val y1 = Some(1, 2, 3)
^
S.scala:7: warning: Adapting argument list by creating a 3-tuple: this may not be what you want.
- signature: Some(x: A): Some[A]
+ signature: Some(value: A): Some[A]
given arguments: 1, 2, 3
after adaptation: new Some((1, 2, 3): (Int, Int, Int))
val y2 = new Some(1, 2, 3)
^
-S.scala:9: warning: Adaptation of argument list by inserting () has been deprecated: this is unlikely to be what you want.
+S.scala:9: warning: Adaptation of argument list by inserting () is deprecated: this is unlikely to be what you want.
signature: J2(x: T): J2[T]
given arguments: <none>
after adaptation: new J2((): Unit)
val z1 = new J2
^
-S.scala:10: warning: Adaptation of argument list by inserting () has been deprecated: this is unlikely to be what you want.
+S.scala:10: warning: Adaptation of argument list by inserting () is deprecated: this is unlikely to be what you want.
signature: J2(x: T): J2[T]
given arguments: <none>
after adaptation: new J2((): Unit)
diff --git a/test/files/neg/t4877.flags b/test/files/neg/t4877.flags
deleted file mode 100644
index 7ccd56103a..0000000000
--- a/test/files/neg/t4877.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xlint \ No newline at end of file
diff --git a/test/files/neg/t5120.check b/test/files/neg/t5120.check
index 34d4ebde31..b6a3cb96aa 100644
--- a/test/files/neg/t5120.check
+++ b/test/files/neg/t5120.check
@@ -6,7 +6,7 @@ t5120.scala:11: error: type mismatch;
t5120.scala:25: error: type mismatch;
found : Thread
required: h.T
- (which expands to) _2
+ (which expands to) _1
List(str, num).foreach(h => h.f1 = new Thread())
^
two errors found
diff --git a/test/files/neg/t5148.check b/test/files/neg/t5148.check
index da0ef0fc2e..8c895d7b47 100644
--- a/test/files/neg/t5148.check
+++ b/test/files/neg/t5148.check
@@ -1,7 +1,13 @@
+t5148.scala:4: error: Symbol 'term scala.tools.nsc.interpreter.IMain.memberHandlers' is missing from the classpath.
+This symbol is required by 'method scala.tools.nsc.interpreter.Imports.allReqAndHandlers'.
+Make sure that term memberHandlers is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
+A full rebuild may help if 'Imports.class' was compiled against an incompatible version of scala.tools.nsc.interpreter.IMain.
+class IMain extends Imports
+ ^
t5148.scala:4: error: Symbol 'type <none>.Request.Wrapper' is missing from the classpath.
This symbol is required by 'value scala.tools.nsc.interpreter.Imports.wrapper'.
Make sure that type Wrapper is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
A full rebuild may help if 'Imports.class' was compiled against an incompatible version of <none>.Request.
class IMain extends Imports
- ^
-one error found
+ ^
+two errors found
diff --git a/test/files/neg/t5429.check b/test/files/neg/t5429.check
index 4350696bc8..fb2d9c2e47 100644
--- a/test/files/neg/t5429.check
+++ b/test/files/neg/t5429.check
@@ -134,7 +134,7 @@ t5429.scala:87: error: overriding value value in class A0 of type Any;
lazy value value cannot override a concrete non-lazy value
override lazy val value = 0 // fail (strict over lazy)
^
-t5429.scala:91: error: value oneArg overrides nothing.
+t5429.scala:91: error: lazy value oneArg overrides nothing.
Note: the super classes of class F0 contain the following, non final members named oneArg:
def oneArg(x: String): Any
override lazy val oneArg = 15 // fail
diff --git a/test/files/neg/t5580b.scala b/test/files/neg/t5580b.scala
index 2161da4584..98b493e803 100644
--- a/test/files/neg/t5580b.scala
+++ b/test/files/neg/t5580b.scala
@@ -1,5 +1,5 @@
import scala.collection.mutable.WeakHashMap
-import scala.collection.JavaConversions._
+import scala.collection.JavaConverters._
class bar { }
diff --git a/test/files/neg/t5639b.flags b/test/files/neg/t5639b.flags
new file mode 100644
index 0000000000..90b87663af
--- /dev/null
+++ b/test/files/neg/t5639b.flags
@@ -0,0 +1 @@
+-Xsource:2.11 \ No newline at end of file
diff --git a/test/files/neg/t565.check b/test/files/neg/t565.check
index 136cc94b6f..d7657c0f5d 100644
--- a/test/files/neg/t565.check
+++ b/test/files/neg/t565.check
@@ -1,4 +1,4 @@
-t565.scala:2: error: only classes can have declared but undefined members
+t565.scala:2: error: only traits and abstract classes can have declared but undefined members
(Note that variables need to be initialized to be defined)
var s0: String
^
diff --git a/test/files/neg/t5761.check b/test/files/neg/t5761.check
index 2d66af26f6..15c0bc7634 100644
--- a/test/files/neg/t5761.check
+++ b/test/files/neg/t5761.check
@@ -13,7 +13,7 @@ Unspecified value parameter x.
t5761.scala:13: error: not found: type Tread
new Tread("sth") { }.run()
^
-t5761.scala:13: error: value run is not a member of AnyRef
+t5761.scala:13: error: value run is not a member of <error>
new Tread("sth") { }.run()
^
5 errors found
diff --git a/test/files/neg/t591.check b/test/files/neg/t591.check
index d33f6d7a2f..c0bade0814 100644
--- a/test/files/neg/t591.check
+++ b/test/files/neg/t591.check
@@ -1,5 +1,5 @@
-t591.scala:38: error: method input_= is defined twice
- conflicting symbols both originated in file 't591.scala'
+t591.scala:40: error: method input_= is defined twice;
+ the conflicting variable input was defined at line 35:18
def input_=(in : Input) = {}
^
one error found
diff --git a/test/files/neg/t591.scala b/test/files/neg/t591.scala
index 0f0b02395c..14fb256a69 100644
--- a/test/files/neg/t591.scala
+++ b/test/files/neg/t591.scala
@@ -35,7 +35,8 @@ trait BaseFlow extends BaseList {
private var input : Input = _;
private var output : Output = _;
+ // the error message is a bit confusing, as it points here,
+ // but the symbol it reports is `input`'s actual setter (the one we synthesized)
def input_=(in : Input) = {}
-
}
}
diff --git a/test/files/neg/t6120.check b/test/files/neg/t6120.check
index f432fde32f..b7a5d8bf17 100644
--- a/test/files/neg/t6120.check
+++ b/test/files/neg/t6120.check
@@ -6,13 +6,13 @@ See the Scaladoc for value scala.language.postfixOps for a discussion
why the feature should be explicitly enabled.
def f = null == null bippy
^
-t6120.scala:5: warning: method bippy in class BooleanOps is deprecated: bobo
+t6120.scala:5: warning: method bippy in class BooleanOps is deprecated (since 2.11.0): bobo
def f = null == null bippy
^
t6120.scala:5: warning: comparing values of types Null and Null using `==' will always yield true
def f = null == null bippy
^
-t6120.scala:6: warning: method bippy in class BooleanOps is deprecated: bobo
+t6120.scala:6: warning: method bippy in class BooleanOps is deprecated (since 2.11.0): bobo
def g = true.bippy
^
error: No warnings can be incurred under -Xfatal-warnings.
diff --git a/test/files/neg/t6162-inheritance.check b/test/files/neg/t6162-inheritance.check
index c9f4ddaec1..9b0a8990da 100644
--- a/test/files/neg/t6162-inheritance.check
+++ b/test/files/neg/t6162-inheritance.check
@@ -1,4 +1,4 @@
-usage.scala:3: warning: inheritance from class Foo in package t6126 is deprecated: `Foo` will be made final in a future version.
+usage.scala:3: warning: inheritance from class Foo in package t6126 is deprecated (since 2.10.0): `Foo` will be made final in a future version.
class SubFoo extends Foo
^
usage.scala:5: warning: inheritance from trait T in package t6126 is deprecated
diff --git a/test/files/neg/t6162-overriding.check b/test/files/neg/t6162-overriding.check
index 6bff75d88d..586bfb4b35 100644
--- a/test/files/neg/t6162-overriding.check
+++ b/test/files/neg/t6162-overriding.check
@@ -1,4 +1,4 @@
-t6162-overriding.scala:14: warning: overriding method bar in class Bar is deprecated: `bar` will be made private in a future version.
+t6162-overriding.scala:14: warning: overriding method bar in class Bar is deprecated (since 2.10.0): `bar` will be made private in a future version.
override def bar = 43
^
t6162-overriding.scala:15: warning: overriding method baz in class Bar is deprecated
diff --git a/test/files/neg/t6214.check b/test/files/neg/t6214.check
index 6349a3e71c..9d746351d1 100644
--- a/test/files/neg/t6214.check
+++ b/test/files/neg/t6214.check
@@ -1,4 +1,7 @@
-t6214.scala:5: error: missing parameter type
+t6214.scala:5: error: ambiguous reference to overloaded definition,
+both method m in object Test of type (f: Int => Unit)Int
+and method m in object Test of type (f: String => Unit)Int
+match argument types (Any => Unit)
m { s => case class Foo() }
- ^
+ ^
one error found
diff --git a/test/files/neg/t6289.check b/test/files/neg/t6289.check
index 989932750f..7b2b4b2d32 100644
--- a/test/files/neg/t6289.check
+++ b/test/files/neg/t6289.check
@@ -1,9 +1,3 @@
-#partest java6
-t6289/J.java:2: method does not override or implement a method from a supertype
- @Override public void foo() { }
- ^
-1 error
-#partest !java6
t6289/J.java:2: error: method does not override or implement a method from a supertype
@Override public void foo() { }
^
diff --git a/test/files/neg/t6323a.check b/test/files/neg/t6323a.check
index 261a60ef3c..c4e92d93f0 100644
--- a/test/files/neg/t6323a.check
+++ b/test/files/neg/t6323a.check
@@ -1,10 +1,10 @@
-t6323a.scala:10: materializing requested scala.reflect.type.ClassTag[Test] using `package`.this.materializeClassTag[Test]()
+t6323a.scala:10: materializing requested scala.reflect.type.ClassTag[Test] using scala.reflect.`package`.materializeClassTag[Test]()
val lookAtMe = m.reflect(Test("a",List(5)))
^
-t6323a.scala:11: materializing requested reflect.runtime.universe.type.TypeTag[Test] using `package`.this.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe)
+t6323a.scala:11: materializing requested reflect.runtime.universe.type.TypeTag[Test] using scala.reflect.api.`package`.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe)
val value = u.typeOf[Test]
^
-t6323a.scala:11: `package`.this.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe) is not a valid implicit value for reflect.runtime.universe.TypeTag[Test] because:
+t6323a.scala:11: scala.reflect.api.`package`.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe) is not a valid implicit value for reflect.runtime.universe.TypeTag[Test] because:
failed to typecheck the materialized tag:
cannot create a TypeTag referring to class Test.Test local to the reifee: use WeakTypeTag instead
val value = u.typeOf[Test]
diff --git a/test/files/neg/t6335.check b/test/files/neg/t6335.check
index 1727a05eb2..d118440f75 100644
--- a/test/files/neg/t6335.check
+++ b/test/files/neg/t6335.check
@@ -1,9 +1,9 @@
-t6335.scala:6: error: method Z is defined twice
- conflicting symbols both originated in file 't6335.scala'
+t6335.scala:6: error: method Z is defined twice;
+ the conflicting method Z was defined at line 5:7
implicit class Z[A](val i: A) { def zz = i }
^
-t6335.scala:3: error: method X is defined twice
- conflicting symbols both originated in file 't6335.scala'
+t6335.scala:3: error: method X is defined twice;
+ the conflicting method X was defined at line 2:7
implicit class X(val x: Int) { def xx = x }
^
two errors found
diff --git a/test/files/neg/t6375.check b/test/files/neg/t6375.check
deleted file mode 100644
index 89d7d8060f..0000000000
--- a/test/files/neg/t6375.check
+++ /dev/null
@@ -1,27 +0,0 @@
-t6375.scala:6: warning: no valid targets for annotation on value x1 - it is discarded unused. You may specify targets with meta-annotations, e.g. @(Bippy @getter)
- @Bippy val x1: Int // warn
- ^
-t6375.scala:7: warning: no valid targets for annotation on value x2 - it is discarded unused. You may specify targets with meta-annotations, e.g. @(Bippy @scala.annotation.meta.field @getter)
- @(Bippy @field) val x2: Int // warn
- ^
-t6375.scala:9: warning: no valid targets for annotation on value x4 - it is discarded unused. You may specify targets with meta-annotations, e.g. @(Bippy @scala.annotation.meta.setter @getter)
- @(Bippy @setter) val x4: Int // warn
- ^
-t6375.scala:10: warning: no valid targets for annotation on value x5 - it is discarded unused. You may specify targets with meta-annotations, e.g. @(Bippy @scala.annotation.meta.param @getter)
- @(Bippy @param) val x5: Int // warn
- ^
-t6375.scala:20: warning: no valid targets for annotation on value q1 - it is discarded unused. You may specify targets with meta-annotations, e.g. @(Bippy @scala.annotation.meta.getter @field)
- @(Bippy @getter) private[this] val q1: Int = 1 // warn
- ^
-t6375.scala:40: warning: no valid targets for annotation on value p2 - it is discarded unused. You may specify targets with meta-annotations, e.g. @(Bippy @scala.annotation.meta.getter @param)
- @(Bippy @getter) p2: Int, // warn
- ^
-t6375.scala:41: warning: no valid targets for annotation on value p3 - it is discarded unused. You may specify targets with meta-annotations, e.g. @(Bippy @scala.annotation.meta.setter @param)
- @(Bippy @setter) p3: Int, // warn
- ^
-t6375.scala:42: warning: no valid targets for annotation on value p4 - it is discarded unused. You may specify targets with meta-annotations, e.g. @(Bippy @scala.annotation.meta.field @param)
- @(Bippy @field) p4: Int // warn
- ^
-error: No warnings can be incurred under -Xfatal-warnings.
-8 warnings found
-one error found
diff --git a/test/files/neg/t6375.scala b/test/files/neg/t6375.scala
deleted file mode 100644
index 21634df688..0000000000
--- a/test/files/neg/t6375.scala
+++ /dev/null
@@ -1,67 +0,0 @@
-import scala.annotation.meta._
-
-class Bippy extends scala.annotation.StaticAnnotation
-
-abstract class Foo {
- @Bippy val x1: Int // warn
- @(Bippy @field) val x2: Int // warn
- @(Bippy @getter) val x3: Int // no warn
- @(Bippy @setter) val x4: Int // warn
- @(Bippy @param) val x5: Int // warn
-}
-
-object Bar extends Foo {
- val x1 = 1
- val x2 = 2
- val x3 = 3
- val x4 = 4
- val x5 = 5
-
- @(Bippy @getter) private[this] val q1: Int = 1 // warn
- @(Bippy @getter) private val q2: Int = 1 // no warn
-
- def f1(@(Bippy @param) x: Int): Int = 0 // no warn
- def f2(@(Bippy @getter) x: Int): Int = 0 // warn - todo
- def f3(@(Bippy @setter) x: Int): Int = 0 // warn - todo
- def f4(@(Bippy @field) x: Int): Int = 0 // warn - todo
- def f5(@Bippy x: Int): Int = 0 // no warn
-
- @(Bippy @companionClass) def g1(x: Int): Int = 0 // warn - todo
- @(Bippy @companionObject) def g2(x: Int): Int = 0 // warn - todo
- @(Bippy @companionMethod) def g3(x: Int): Int = 0 // no warn
- @Bippy def g4(x: Int): Int = 0 // no warn
-
- @(Bippy @companionObject @companionMethod) def g5(x: Int): Int = 0 // no warn
-}
-
-class Dingo(
- @Bippy p0: Int, // no warn
- @(Bippy @param) p1: Int, // no warn
- @(Bippy @getter) p2: Int, // warn
- @(Bippy @setter) p3: Int, // warn
- @(Bippy @field) p4: Int // warn
-)
-
-class ValDingo(
- @Bippy val p0: Int, // no warn
- @(Bippy @param) val p1: Int, // no warn
- @(Bippy @getter) val p2: Int, // no warn
- @(Bippy @setter) val p3: Int, // warn - todo
- @(Bippy @field) val p4: Int // no warn
-)
-
-class VarDingo(
- @Bippy var p0: Int, // no warn
- @(Bippy @param) var p1: Int, // no warn
- @(Bippy @getter) var p2: Int, // no warn
- @(Bippy @setter) var p3: Int, // no warn
- @(Bippy @field) var p4: Int // no warn
-)
-
-case class CaseDingo(
- @Bippy p0: Int, // no warn
- @(Bippy @param) p1: Int, // no warn
- @(Bippy @getter) p2: Int, // no warn
- @(Bippy @setter) p3: Int, // warn - todo
- @(Bippy @field) p4: Int // no warn
-)
diff --git a/test/files/neg/t6406-regextract.check b/test/files/neg/t6406-regextract.check
index 19425a68b0..41b362f455 100644
--- a/test/files/neg/t6406-regextract.check
+++ b/test/files/neg/t6406-regextract.check
@@ -1,4 +1,4 @@
-t6406-regextract.scala:4: warning: method unapplySeq in class Regex is deprecated: Extracting a match result from anything but a CharSequence or Match is deprecated
+t6406-regextract.scala:4: warning: method unapplySeq in class Regex is deprecated (since 2.11.0): extracting a match result from anything but a CharSequence or Match is deprecated
List(1) collect { case r(i) => i }
^
error: No warnings can be incurred under -Xfatal-warnings.
diff --git a/test/files/neg/t6446-additional.check b/test/files/neg/t6446-additional.check
index a87af2f1e5..9d4af37b98 100644
--- a/test/files/neg/t6446-additional.check
+++ b/test/files/neg/t6446-additional.check
@@ -10,30 +10,18 @@ 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
-#partest -optimise
- inliner 24 optimization: do inlining
-inlinehandlers 25 optimization: inline exception handlers
- closelim 26 optimization: eliminate uncalled closures
- constopt 27 optimization: optimize null and other constants
- dce 28 optimization: eliminate dead code
- jvm 29 generate JVM bytecode
- ploogin 30 A sample phase that does so many things it's kind of hard...
- terminal 31 the last phase during a compilation run
-#partest !-optimise
- jvm 24 generate JVM bytecode
- ploogin 25 A sample phase that does so many things it's kind of hard...
- terminal 26 the last phase during a compilation run
-#partest
+ jvm 23 generate JVM bytecode
+ ploogin 24 A sample phase that does so many things it's kind of hard...
+ terminal 25 the last phase during a compilation run
diff --git a/test/files/neg/t6446-missing.check b/test/files/neg/t6446-missing.check
index 029c8057c3..65b5e5dc09 100644
--- a/test/files/neg/t6446-missing.check
+++ b/test/files/neg/t6446-missing.check
@@ -11,28 +11,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
-#partest !-optimise
- jvm 24 generate JVM bytecode
- terminal 25 the last phase during a compilation run
-#partest -optimise
- inliner 24 optimization: do inlining
-inlinehandlers 25 optimization: inline exception handlers
- closelim 26 optimization: eliminate uncalled closures
- constopt 27 optimization: optimize null and other constants
- dce 28 optimization: eliminate dead code
- jvm 29 generate JVM bytecode
- terminal 30 the last phase during a compilation run
-#partest
+ jvm 23 generate JVM bytecode
+ terminal 24 the last phase during a compilation run
diff --git a/test/files/neg/t6446-show-phases.check b/test/files/neg/t6446-show-phases.check
index 3ae3f96ef2..373f63e5b2 100644
--- a/test/files/neg/t6446-show-phases.check
+++ b/test/files/neg/t6446-show-phases.check
@@ -10,28 +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
-#partest !-optimise
- jvm 24 generate JVM bytecode
- terminal 25 the last phase during a compilation run
-#partest -optimise
- inliner 24 optimization: do inlining
-inlinehandlers 25 optimization: inline exception handlers
- closelim 26 optimization: eliminate uncalled closures
- constopt 27 optimization: optimize null and other constants
- dce 28 optimization: eliminate dead code
- jvm 29 generate JVM bytecode
- terminal 30 the last phase during a compilation run
-#partest
+ jvm 23 generate JVM bytecode
+ terminal 24 the last phase during a compilation run
diff --git a/test/files/neg/t6455.flags b/test/files/neg/t6455.flags
deleted file mode 100644
index 112fc720a0..0000000000
--- a/test/files/neg/t6455.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xfuture \ No newline at end of file
diff --git a/test/files/neg/t6455.scala b/test/files/neg/t6455.scala
index ebbb37f1cd..22e4c30fdd 100644
--- a/test/files/neg/t6455.scala
+++ b/test/files/neg/t6455.scala
@@ -1,6 +1,6 @@
object O { def filter(p: Int => Boolean): O.type = this }
class Test {
- // should not compile because we no longer rewrite withFilter => filter under -Xfuture
+ // should not compile because we no longer rewrite withFilter => filter
O.withFilter(f => true)
-} \ No newline at end of file
+}
diff --git a/test/files/neg/t6567.flags b/test/files/neg/t6567.flags
index e93641e931..076333a011 100644
--- a/test/files/neg/t6567.flags
+++ b/test/files/neg/t6567.flags
@@ -1 +1 @@
--Xlint -Xfatal-warnings \ No newline at end of file
+-Xlint:option-implicit -Xfatal-warnings
diff --git a/test/files/neg/t6666.check b/test/files/neg/t6666.check
index 43c8252753..bae948fe56 100644
--- a/test/files/neg/t6666.check
+++ b/test/files/neg/t6666.check
@@ -1,7 +1,7 @@
t6666.scala:23: error: Implementation restriction: access of method x$2 in object O1 from <$anon: Function0>, would require illegal premature access to object O1
F.byname(x)
^
-t6666.scala:30: error: Implementation restriction: access of value x$3 in object O2 from <$anon: Function0>, would require illegal premature access to object O2
+t6666.scala:30: error: Implementation restriction: access of lazy value x$3 in object O2 from <$anon: Function0>, would require illegal premature access to object O2
F.byname(x)
^
t6666.scala:37: error: Implementation restriction: access of method x$4 in object O3 from <$anon: Function0>, would require illegal premature access to object O3
@@ -10,7 +10,7 @@ t6666.scala:37: error: Implementation restriction: access of method x$4 in objec
t6666.scala:50: error: Implementation restriction: access of method x$6 in class C1 from <$anon: Function0>, would require illegal premature access to the unconstructed `this` of class C1
F.byname(x)
^
-t6666.scala:54: error: Implementation restriction: access of value x$7 in class C2 from <$anon: Function0>, would require illegal premature access to the unconstructed `this` of class C2
+t6666.scala:54: error: Implementation restriction: access of lazy value x$7 in class C2 from <$anon: Function0>, would require illegal premature access to the unconstructed `this` of class C2
F.byname(x)
^
t6666.scala:58: error: Implementation restriction: access of method x$8 in class C3 from <$anon: Function0>, would require illegal premature access to the unconstructed `this` of class C3
diff --git a/test/files/neg/t6675.flags b/test/files/neg/t6675.flags
index 2843ea9efc..c6bfaf1f64 100644
--- a/test/files/neg/t6675.flags
+++ b/test/files/neg/t6675.flags
@@ -1 +1 @@
--deprecation -Xlint -Xfatal-warnings \ No newline at end of file
+-deprecation -Xfatal-warnings
diff --git a/test/files/neg/t6810.check b/test/files/neg/t6810.check
new file mode 100644
index 0000000000..497ef35070
--- /dev/null
+++ b/test/files/neg/t6810.check
@@ -0,0 +1,28 @@
+t6810.scala:4: error: unclosed character literal
+ val y = '
+ ^
+t6810.scala:5: error: unclosed character literal
+' // but not embedded EOL sequences not represented as escapes
+^
+t6810.scala:9: error: unclosed string literal
+ val Y = "
+ ^
+t6810.scala:10: error: unclosed string literal
+" // obviously not
+^
+t6810.scala:20: error: unclosed quoted identifier
+ val `
+ ^
+t6810.scala:21: error: unclosed quoted identifier
+` = EOL // not raw string literals aka triple-quoted, multiline strings
+^
+t6810.scala:24: error: unclosed character literal
+ val b = '
+ ^
+t6810.scala:25: error: unclosed character literal
+' // CR seen as EOL by scanner
+^
+t6810.scala:24: error: '=' expected but ';' found.
+ val b = '
+^
+9 errors found
diff --git a/test/files/neg/t6810.scala b/test/files/neg/t6810.scala
new file mode 100644
index 0000000000..50c305d70c
--- /dev/null
+++ b/test/files/neg/t6810.scala
@@ -0,0 +1,26 @@
+
+trait t6810 {
+ val x = '\u000A' // char literals accept arbitrary unicode escapes
+ val y = '
+' // but not embedded EOL sequences not represented as escapes
+ val z = '\n' // normally, expect this escape
+
+ val X = "\u000A" // it's the same as ordinary string literals
+ val Y = "
+" // obviously not
+ val Z = "\n" // normally, expect this escape
+
+ val A = """
+""" // which is what these are for
+ val B = s"""
+""" // or the same for interpolated strings
+
+ import scala.compat.Platform.EOL
+ val `\u000A` = EOL // backquoted identifiers are arbitrary string literals
+ val `
+` = EOL // not raw string literals aka triple-quoted, multiline strings
+
+ val a = '\u000D' // similar treatment of CR
+ val b = ' ' // CR seen as EOL by scanner
+ val c = '\r' // traditionally
+}
diff --git a/test/files/neg/t6829.check b/test/files/neg/t6829.check
index 914a1c9260..5ccd531be1 100644
--- a/test/files/neg/t6829.check
+++ b/test/files/neg/t6829.check
@@ -1,6 +1,6 @@
t6829.scala:35: error: type mismatch;
found : AgentSimulation.this.state.type (with underlying type G#State)
- required: _9.State
+ required: _1.State
lazy val actions: Map[G#Agent,G#Action] = agents.map(a => a -> a.chooseAction(state)).toMap
^
t6829.scala:45: error: trait AgentSimulation takes type parameters
@@ -17,32 +17,32 @@ t6829.scala:49: error: not found: value nextState
^
t6829.scala:50: error: type mismatch;
found : s.type (with underlying type Any)
- required: _53.State where val _53: G
+ required: _1.State where val _1: G
val r = rewards(agent).r(s,a,s2)
^
t6829.scala:50: error: type mismatch;
found : a.type (with underlying type Any)
- required: _53.Action where val _53: G
+ required: _1.Action where val _1: G
val r = rewards(agent).r(s,a,s2)
^
t6829.scala:50: error: type mismatch;
found : s2.type (with underlying type Any)
- required: _53.State where val _53: G
+ required: _1.State where val _1: G
val r = rewards(agent).r(s,a,s2)
^
t6829.scala:51: error: type mismatch;
found : s.type (with underlying type Any)
- required: _50.State
+ required: _1.State
agent.learn(s,a,s2,r): G#Agent
^
t6829.scala:51: error: type mismatch;
found : a.type (with underlying type Any)
- required: _50.Action
+ required: _1.Action
agent.learn(s,a,s2,r): G#Agent
^
t6829.scala:51: error: type mismatch;
found : s2.type (with underlying type Any)
- required: _50.State
+ required: _1.State
agent.learn(s,a,s2,r): G#Agent
^
t6829.scala:53: error: not found: value nextState
diff --git a/test/files/neg/t6920.check b/test/files/neg/t6920.check
index ee4eafb83e..d10abff03c 100644
--- a/test/files/neg/t6920.check
+++ b/test/files/neg/t6920.check
@@ -1,6 +1,6 @@
-t6920.scala:9: error: too many arguments for method applyDynamicNamed: (values: Seq[(String, Any)])String
+t6920.scala:9: error: too many arguments (2) for method applyDynamicNamed: (values: Seq[(String, Any)])String
error after rewriting to CompilerError.this.test.applyDynamicNamed("crushTheCompiler")(scala.Tuple2("a", 1), scala.Tuple2("b", 2))
possible cause: maybe a wrong Dynamic method signature?
test.crushTheCompiler(a = 1, b = 2)
- ^
+ ^
one error found
diff --git a/test/files/neg/t7014.check b/test/files/neg/t7014.check
new file mode 100644
index 0000000000..c68c170835
--- /dev/null
+++ b/test/files/neg/t7014.check
@@ -0,0 +1,5 @@
+warning: While parsing annotations in t7014-neg.obj/t7014/ThreadSafetyLevel_1.class, could not find COMPLETELY_THREADSAFE in enum object ThreadSafetyLevel_1.
+This is likely due to an implementation restriction: an annotation argument cannot refer to a member of the annotated class (SI-7014).
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/t7014.flags b/test/files/neg/t7014.flags
new file mode 100644
index 0000000000..85d8eb2ba2
--- /dev/null
+++ b/test/files/neg/t7014.flags
@@ -0,0 +1 @@
+-Xfatal-warnings
diff --git a/test/files/pos/t7014/ThreadSafetyLevel.java b/test/files/neg/t7014/ThreadSafetyLevel_1.java
index 4df1dc787a..eeca65366b 100644
--- a/test/files/pos/t7014/ThreadSafetyLevel.java
+++ b/test/files/neg/t7014/ThreadSafetyLevel_1.java
@@ -4,5 +4,5 @@ package t7014; // package needed due to other bug in scalac's java parser
// and on doing so, fail to find a symbol for the COMPLETELY_THREADSAFE reference
// from the annotation's argument to the enum's member
// for now, let's just not crash -- should implement lazy completing at some point
-@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
-public enum ThreadSafetyLevel { COMPLETELY_THREADSAFE }
+@ThreadSafety_1(level=ThreadSafetyLevel_1.COMPLETELY_THREADSAFE)
+public enum ThreadSafetyLevel_1 { COMPLETELY_THREADSAFE }
diff --git a/test/files/pos/t7014/ThreadSafety.java b/test/files/neg/t7014/ThreadSafety_1.java
index ed508804e3..e68b103d1f 100644
--- a/test/files/pos/t7014/ThreadSafety.java
+++ b/test/files/neg/t7014/ThreadSafety_1.java
@@ -4,6 +4,6 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME) // must be exactly RUNTIME retention (those we parse)
-public @interface ThreadSafety {
- ThreadSafetyLevel level();
+public @interface ThreadSafety_1 {
+ ThreadSafetyLevel_1 level();
} \ No newline at end of file
diff --git a/test/files/neg/t7014/t7014_2.scala b/test/files/neg/t7014/t7014_2.scala
new file mode 100644
index 0000000000..4845fc9a5d
--- /dev/null
+++ b/test/files/neg/t7014/t7014_2.scala
@@ -0,0 +1,3 @@
+package t7014
+
+import ThreadSafetyLevel_1.COMPLETELY_THREADSAFE // refer to annotation so it gets parsed
diff --git a/test/files/neg/t712.check b/test/files/neg/t712.check
index 831e943063..3f02b4b294 100644
--- a/test/files/neg/t712.check
+++ b/test/files/neg/t712.check
@@ -1,5 +1,4 @@
-t712.scala:10: error: value self is not a member of B.this.ParentImpl
- Note: implicit method coerce is not applicable here because it comes after the application point and it lacks an explicit result type
+t712.scala:10: error: overloaded method coerce needs result type
implicit def coerce(p : ParentImpl) = p.self;
^
one error found
diff --git a/test/files/neg/t7157.check b/test/files/neg/t7157.check
index 3988460d4b..0b81394946 100644
--- a/test/files/neg/t7157.check
+++ b/test/files/neg/t7157.check
@@ -1,22 +1,22 @@
-Test_2.scala:5: error: too many arguments for macro method m1_0_0: ()Unit
+Test_2.scala:5: error: no arguments allowed for nullary macro method m1_0_0: ()Unit
m1_0_0(1)
- ^
-Test_2.scala:6: error: too many arguments for macro method m1_0_0: ()Unit
+ ^
+Test_2.scala:6: error: no arguments allowed for nullary macro method m1_0_0: ()Unit
m1_0_0(1, 2)
- ^
-Test_2.scala:7: error: too many arguments for macro method m1_0_0: ()Unit
+ ^
+Test_2.scala:7: error: no arguments allowed for nullary macro method m1_0_0: ()Unit
m1_0_0(1, 2, 3)
- ^
+ ^
Test_2.scala:9: error: not enough arguments for macro method m1_1_1: (x: Int)Unit.
Unspecified value parameter x.
m1_1_1()
^
-Test_2.scala:11: error: too many arguments for macro method m1_1_1: (x: Int)Unit
+Test_2.scala:11: error: too many arguments (2) for macro method m1_1_1: (x: Int)Unit
m1_1_1(1, 2)
- ^
-Test_2.scala:12: error: too many arguments for macro method m1_1_1: (x: Int)Unit
+ ^
+Test_2.scala:12: error: too many arguments (3) for macro method m1_1_1: (x: Int)Unit
m1_1_1(1, 2, 3)
- ^
+ ^
Test_2.scala:14: error: not enough arguments for macro method m1_2_2: (x: Int, y: Int)Unit.
Unspecified value parameters x, y.
m1_2_2()
@@ -25,9 +25,9 @@ Test_2.scala:15: error: not enough arguments for macro method m1_2_2: (x: Int, y
Unspecified value parameter y.
m1_2_2(1)
^
-Test_2.scala:17: error: too many arguments for macro method m1_2_2: (x: Int, y: Int)Unit
+Test_2.scala:17: error: too many arguments (3) for macro method m1_2_2: (x: Int, y: Int)Unit
m1_2_2(1, 2, 3)
- ^
+ ^
Test_2.scala:24: error: not enough arguments for macro method m1_1_inf: (x: Int, y: Int*)Unit.
Unspecified value parameters x, y.
m1_1_inf()
@@ -40,25 +40,25 @@ Test_2.scala:30: error: not enough arguments for macro method m1_2_inf: (x: Int,
Unspecified value parameters y, z.
m1_2_inf(1)
^
-Test_2.scala:35: error: too many arguments for macro method m2_0_0: ()Unit
+Test_2.scala:35: error: no arguments allowed for nullary macro method m2_0_0: ()Unit
m2_0_0()(1)
- ^
-Test_2.scala:36: error: too many arguments for macro method m2_0_0: ()Unit
+ ^
+Test_2.scala:36: error: no arguments allowed for nullary macro method m2_0_0: ()Unit
m2_0_0()(1, 2)
- ^
-Test_2.scala:37: error: too many arguments for macro method m2_0_0: ()Unit
+ ^
+Test_2.scala:37: error: no arguments allowed for nullary macro method m2_0_0: ()Unit
m2_0_0()(1, 2, 3)
- ^
+ ^
Test_2.scala:39: error: not enough arguments for macro method m2_1_1: (x: Int)Unit.
Unspecified value parameter x.
m2_1_1()()
^
-Test_2.scala:41: error: too many arguments for macro method m2_1_1: (x: Int)Unit
+Test_2.scala:41: error: too many arguments (2) for macro method m2_1_1: (x: Int)Unit
m2_1_1()(1, 2)
- ^
-Test_2.scala:42: error: too many arguments for macro method m2_1_1: (x: Int)Unit
+ ^
+Test_2.scala:42: error: too many arguments (3) for macro method m2_1_1: (x: Int)Unit
m2_1_1()(1, 2, 3)
- ^
+ ^
Test_2.scala:44: error: not enough arguments for macro method m2_2_2: (x: Int, y: Int)Unit.
Unspecified value parameters x, y.
m2_2_2()()
@@ -67,9 +67,9 @@ Test_2.scala:45: error: not enough arguments for macro method m2_2_2: (x: Int, y
Unspecified value parameter y.
m2_2_2()(1)
^
-Test_2.scala:47: error: too many arguments for macro method m2_2_2: (x: Int, y: Int)Unit
+Test_2.scala:47: error: too many arguments (3) for macro method m2_2_2: (x: Int, y: Int)Unit
m2_2_2()(1, 2, 3)
- ^
+ ^
Test_2.scala:54: error: not enough arguments for macro method m2_1_inf: (x: Int, y: Int*)Unit.
Unspecified value parameters x, y.
m2_1_inf()()
diff --git a/test/files/neg/t7171.check b/test/files/neg/t7171.check
index ecd768afda..2de9151483 100644
--- a/test/files/neg/t7171.check
+++ b/test/files/neg/t7171.check
@@ -1,6 +1,9 @@
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
+ ^
error: No warnings can be incurred under -Xfatal-warnings.
-one warning found
+two warnings found
one error found
diff --git a/test/files/neg/t7171b.check b/test/files/neg/t7171b.check
index bf695afea7..6b05b6fa63 100644
--- a/test/files/neg/t7171b.check
+++ b/test/files/neg/t7171b.check
@@ -1,6 +1,12 @@
t7171b.scala:2: warning: The outer reference in this type test cannot be checked at run time.
final case class A()
^
+t7171b.scala:8: warning: The outer reference in this type test cannot be checked at run time.
+ case _: A => true; case _ => false
+ ^
+t7171b.scala:13: warning: The outer reference in this type test cannot be checked at run time.
+ case _: A => true; case _ => false
+ ^
error: No warnings can be incurred under -Xfatal-warnings.
-one warning found
+three warnings found
one error found
diff --git a/test/files/neg/t7187.check b/test/files/neg/t7187.check
new file mode 100644
index 0000000000..a30803c746
--- /dev/null
+++ b/test/files/neg/t7187.check
@@ -0,0 +1,6 @@
+t7187.scala:3: warning: Eta-expansion of zero-argument method values is deprecated. Did you intend to write EtaExpandZeroArg.this.foo()?
+ val f: () => Any = foo
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/t7187.flags b/test/files/neg/t7187.flags
new file mode 100644
index 0000000000..c6bfaf1f64
--- /dev/null
+++ b/test/files/neg/t7187.flags
@@ -0,0 +1 @@
+-deprecation -Xfatal-warnings
diff --git a/test/files/neg/t7187.scala b/test/files/neg/t7187.scala
new file mode 100644
index 0000000000..45d33f06af
--- /dev/null
+++ b/test/files/neg/t7187.scala
@@ -0,0 +1,6 @@
+class EtaExpandZeroArg {
+ def foo(): () => String = () => ""
+ val f: () => Any = foo
+
+ // f() would evaluate to <function0> instead of ""
+}
diff --git a/test/files/neg/t7294.check b/test/files/neg/t7294.check
index f15289c1c0..a308f2457d 100644
--- a/test/files/neg/t7294.check
+++ b/test/files/neg/t7294.check
@@ -1,6 +1,10 @@
t7294.scala:4: warning: fruitless type test: a value of type (Int, Int) cannot also be a Seq[A]
(1, 2) match { case Seq() => 0; case _ => 1 }
^
-error: No warnings can be incurred under -Xfatal-warnings.
+t7294.scala:4: error: pattern type is incompatible with expected type;
+ found : Seq[A]
+ required: (Int, Int)
+ (1, 2) match { case Seq() => 0; case _ => 1 }
+ ^
one warning found
one error found
diff --git a/test/files/neg/t7294.flags b/test/files/neg/t7294.flags
deleted file mode 100644
index 3f3381a45b..0000000000
--- a/test/files/neg/t7294.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xfuture -Xfatal-warnings
diff --git a/test/files/neg/t7294b.check b/test/files/neg/t7294b.check
index 0033b72125..3390cb7278 100644
--- a/test/files/neg/t7294b.check
+++ b/test/files/neg/t7294b.check
@@ -1,6 +1,4 @@
-t7294b.scala:1: warning: inheritance from class Tuple2 in package scala is deprecated: Tuples will be made final in a future version.
+t7294b.scala:1: error: illegal inheritance from final class Tuple2
class C extends Tuple2[Int, Int](0, 0)
^
-error: No warnings can be incurred under -Xfatal-warnings.
-one warning found
one error found
diff --git a/test/files/neg/t7294b.flags b/test/files/neg/t7294b.flags
deleted file mode 100644
index d1b831ea87..0000000000
--- a/test/files/neg/t7294b.flags
+++ /dev/null
@@ -1 +0,0 @@
--deprecation -Xfatal-warnings \ No newline at end of file
diff --git a/test/files/neg/t7475d.check b/test/files/neg/t7475d.check
deleted file mode 100644
index 6bd1da0d44..0000000000
--- a/test/files/neg/t7475d.check
+++ /dev/null
@@ -1,7 +0,0 @@
-t7475d.scala:4: error: value priv is not a member of T.this.TT
- (??? : TT).priv
- ^
-t7475d.scala:10: error: value priv is not a member of U.this.UU
- (??? : UU).priv
- ^
-two errors found
diff --git a/test/files/neg/t7494-no-options.check b/test/files/neg/t7494-no-options.check
index e3316f590a..1bf5c23711 100644
--- a/test/files/neg/t7494-no-options.check
+++ b/test/files/neg/t7494-no-options.check
@@ -11,30 +11,18 @@ 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
-#partest !-optimise
- jvm 24 generate JVM bytecode
- ploogin 25 A sample phase that does so many things it's kind of hard...
- terminal 26 the last phase during a compilation run
-#partest -optimise
- inliner 24 optimization: do inlining
-inlinehandlers 25 optimization: inline exception handlers
- closelim 26 optimization: eliminate uncalled closures
- constopt 27 optimization: optimize null and other constants
- dce 28 optimization: eliminate dead code
- jvm 29 generate JVM bytecode
- ploogin 30 A sample phase that does so many things it's kind of hard...
- terminal 31 the last phase during a compilation run
-#partest
+ jvm 23 generate JVM bytecode
+ ploogin 24 A sample phase that does so many things it's kind of hard...
+ terminal 25 the last phase during a compilation run
diff --git a/test/files/neg/t7602.check b/test/files/neg/t7602.check
index 5bb1450d7d..5ce3776790 100644
--- a/test/files/neg/t7602.check
+++ b/test/files/neg/t7602.check
@@ -1,5 +1,5 @@
-t7602.scala:16: error: method foo is defined twice
- conflicting symbols both originated in file 't7602.scala'
+t7602.scala:16: error: method foo is defined twice;
+ the conflicting method foo was defined at line 15:7
def foo : Device
^
one error found
diff --git a/test/files/neg/t7622-cyclic-dependency.check b/test/files/neg/t7622-cyclic-dependency.check
index 3546964f5f..81e3ecc6a4 100644
--- a/test/files/neg/t7622-cyclic-dependency.check
+++ b/test/files/neg/t7622-cyclic-dependency.check
@@ -1 +1 @@
-error: Cycle in phase dependencies detected at cyclicdependency1, created phase-cycle.dot
+error: Cycle in phase dependencies detected at cyclicdependency2, created phase-cycle.dot
diff --git a/test/files/neg/t7622-cyclic-dependency/ThePlugin.scala b/test/files/neg/t7622-cyclic-dependency/ThePlugin.scala
index 35c0ff8f53..0734863e64 100644
--- a/test/files/neg/t7622-cyclic-dependency/ThePlugin.scala
+++ b/test/files/neg/t7622-cyclic-dependency/ThePlugin.scala
@@ -26,7 +26,7 @@ class ThePlugin(val global: Global) extends Plugin {
private object thePhase2 extends PluginComponent {
val global = ThePlugin.this.global
- val runsAfter = List[String]("dce","cyclicdependency1")
+ val runsAfter = List[String]("jvm","cyclicdependency1")
val phaseName = ThePlugin.this.name + "2"
diff --git a/test/files/neg/t7848-interp-warn.check b/test/files/neg/t7848-interp-warn.check
index 637fc8941a..cc94cc81de 100644
--- a/test/files/neg/t7848-interp-warn.check
+++ b/test/files/neg/t7848-interp-warn.check
@@ -1,15 +1,27 @@
-t7848-interp-warn.scala:8: warning: possible missing interpolator: detected interpolated identifier `$foo`
- "An important $foo message!"
+t7848-interp-warn.scala:18: warning: possible missing interpolator: detected interpolated identifier `$foo`
+ "An important $foo message!" // warn on ident in scope
^
-t7848-interp-warn.scala:12: warning: possible missing interpolator: detected an interpolated expression
- "A doubly important ${foo * 2} message!"
+t7848-interp-warn.scala:22: warning: possible missing interpolator: detected an interpolated expression
+ "A doubly important ${foo * 2} message!" // warn on some expr, see below
^
-t7848-interp-warn.scala:15: warning: possible missing interpolator: detected interpolated identifier `$bar`
- def i = s"Try using '${ "$bar" }' instead." // was: no warn on space test
+t7848-interp-warn.scala:25: warning: possible missing interpolator: detected interpolated identifier `$bar`
+ def i = s"Try using '${ "$bar" }' instead." // was: no warn on space test
^
-t7848-interp-warn.scala:16: warning: possible missing interpolator: detected interpolated identifier `$bar`
+t7848-interp-warn.scala:26: warning: possible missing interpolator: detected interpolated identifier `$bar`
def j = s"Try using '${ "something like $bar" }' instead." // warn
^
+t7848-interp-warn.scala:32: warning: possible missing interpolator: detected an interpolated expression
+ def v = "${baz}${bar}" // warn on second expr
+ ^
+t7848-interp-warn.scala:33: warning: possible missing interpolator: detected an interpolated expression
+ def w = "${ op_* }" // warn, only cheap ident parsing
+ ^
+t7848-interp-warn.scala:34: warning: possible missing interpolator: detected an interpolated expression
+ def x = "${ bar }" // warn, a cheap ident in scope
+ ^
+t7848-interp-warn.scala:36: warning: possible missing interpolator: detected an interpolated expression
+ def z = "${ baz * 3}" // warn, no expr parsing
+ ^
error: No warnings can be incurred under -Xfatal-warnings.
-four warnings found
+8 warnings found
one error found
diff --git a/test/files/neg/t7848-interp-warn.scala b/test/files/neg/t7848-interp-warn.scala
index a76141041d..ceaf6c7d67 100644
--- a/test/files/neg/t7848-interp-warn.scala
+++ b/test/files/neg/t7848-interp-warn.scala
@@ -1,18 +1,37 @@
package test
+package pancake { }
+
object Test {
+ type NonVal = Int
+
+ def ok = "Don't warn on $nosymbol interpolated."
+
+ def pass = "Don't warn on $pancake package names."
+
+ def types = "Or $NonVal type symbols either."
+
def bar = "bar"
def f = {
val foo = "bar"
- "An important $foo message!"
+ "An important $foo message!" // warn on ident in scope
}
def g = {
val foo = "bar"
- "A doubly important ${foo * 2} message!"
+ "A doubly important ${foo * 2} message!" // warn on some expr, see below
}
- def h = s"Try using '$$bar' instead." // no warn
- def i = s"Try using '${ "$bar" }' instead." // was: no warn on space test
+ def h = s"Try using '$$bar' instead." // no warn
+ def i = s"Try using '${ "$bar" }' instead." // was: no warn on space test
def j = s"Try using '${ "something like $bar" }' instead." // warn
- def k = f"Try using '$bar' instead." // no warn on other std interps
+ def k = f"Try using '$bar' instead." // no warn on other std interps
+ def p = "Template ${} {}" // no warn on unlikely or empty expressions
+ def q = "${}$bar" // disables subsequent checks! (a feature)
+ def r = "${}${bar}" // disables subsequent checks! (a feature)
+
+ def v = "${baz}${bar}" // warn on second expr
+ def w = "${ op_* }" // warn, only cheap ident parsing
+ def x = "${ bar }" // warn, a cheap ident in scope
+ def y = "${ baz }" // no warn, cheap ident not in scope
+ def z = "${ baz * 3}" // warn, no expr parsing
}
diff --git a/test/files/neg/t7860.check b/test/files/neg/t7860.check
new file mode 100644
index 0000000000..9b9d86c89d
--- /dev/null
+++ b/test/files/neg/t7860.check
@@ -0,0 +1,9 @@
+t7860.scala:5: warning: private class for your eyes only in object Test is never used
+ private implicit class `for your eyes only`(i: Int) { // warn
+ ^
+t7860.scala:31: warning: private class C in object Test3 is never used
+ private implicit class C(val i: Int) extends AnyVal { // warn
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+two warnings found
+one error found
diff --git a/test/files/neg/t7860.flags b/test/files/neg/t7860.flags
new file mode 100644
index 0000000000..6ff0dea0b2
--- /dev/null
+++ b/test/files/neg/t7860.flags
@@ -0,0 +1 @@
+-Xfatal-warnings -Ywarn-unused:privates
diff --git a/test/files/neg/t7860.scala b/test/files/neg/t7860.scala
new file mode 100644
index 0000000000..6cc0d3e7f5
--- /dev/null
+++ b/test/files/neg/t7860.scala
@@ -0,0 +1,42 @@
+
+class Test
+
+object Test {
+ private implicit class `for your eyes only`(i: Int) { // warn
+ def f = i
+ }
+}
+
+class Test2 {
+ import Test2._
+ println(5.toStr)
+}
+
+object Test2 {
+ // was: warning: private object in object Test2 is never used
+ // i.e. synthetic object C
+ private implicit class C(val i: Int) extends AnyVal { // no warn
+ def toStr = i.toString
+ }
+}
+
+class Test3 {
+ import Test3._
+ //println(5.toStr)
+}
+
+object Test3 {
+ // was: warning: private object in object Test2 is never used
+ // i.e. synthetic object C
+ private implicit class C(val i: Int) extends AnyVal { // warn
+ def toStr = i.toString
+ }
+}
+
+object Test4 {
+ class A { class B }
+
+ private val a: A = new A
+
+ def b = (new a.B).##
+}
diff --git a/test/files/neg/t800.check b/test/files/neg/t800.check
index 8ba95fddde..238b8dd27d 100644
--- a/test/files/neg/t800.check
+++ b/test/files/neg/t800.check
@@ -1,16 +1,16 @@
t800.scala:4: error: qualification is already defined as value qualification
val qualification = false;
^
-t800.scala:8: error: method qualification is defined twice
- conflicting symbols both originated in file 't800.scala'
+t800.scala:8: error: value qualification is defined twice;
+ the conflicting variable qualification was defined at line 7:7
val qualification = false;
^
-t800.scala:12: error: value qualification is defined twice
- conflicting symbols both originated in file 't800.scala'
+t800.scala:12: error: variable qualification is defined twice;
+ the conflicting value qualification was defined at line 11:7
var qualification = false;
^
-t800.scala:16: error: method qualification is defined twice
- conflicting symbols both originated in file 't800.scala'
+t800.scala:16: error: variable qualification is defined twice;
+ the conflicting variable qualification was defined at line 15:7
var qualification = false;
^
four errors found
diff --git a/test/files/neg/t8002-nested-scope.check b/test/files/neg/t8002-nested-scope.check
new file mode 100644
index 0000000000..f66249e432
--- /dev/null
+++ b/test/files/neg/t8002-nested-scope.check
@@ -0,0 +1,4 @@
+t8002-nested-scope.scala:8: error: method x in class C cannot be accessed in C
+ new C().x
+ ^
+one error found
diff --git a/test/files/neg/t8002-nested-scope.scala b/test/files/neg/t8002-nested-scope.scala
new file mode 100644
index 0000000000..44704a12b1
--- /dev/null
+++ b/test/files/neg/t8002-nested-scope.scala
@@ -0,0 +1,12 @@
+class C {
+ def foo = {
+ class C { private def x = 0 }
+
+ {
+ val a = 0
+ object C {
+ new C().x
+ }
+ }
+ }
+}
diff --git a/test/files/neg/t8006.check b/test/files/neg/t8006.check
index fbac26e3ad..6152d0fba3 100644
--- a/test/files/neg/t8006.check
+++ b/test/files/neg/t8006.check
@@ -1,6 +1,6 @@
-t8006.scala:3: error: too many arguments for method applyDynamicNamed: (value: (String, Any))String
+t8006.scala:3: error: too many arguments (2) for method applyDynamicNamed: (value: (String, Any))String
error after rewriting to X.this.d.applyDynamicNamed("meth")(scala.Tuple2("value1", 10), scala.Tuple2("value2", 100))
possible cause: maybe a wrong Dynamic method signature?
d.meth(value1 = 10, value2 = 100) // two arguments here, but only one is allowed
- ^
+ ^
one error found
diff --git a/test/files/neg/t8035-deprecated.check b/test/files/neg/t8035-deprecated.check
index 01f27e5310..35aba5551d 100644
--- a/test/files/neg/t8035-deprecated.check
+++ b/test/files/neg/t8035-deprecated.check
@@ -1,16 +1,16 @@
-t8035-deprecated.scala:2: warning: Adaptation of argument list by inserting () has been deprecated: this is unlikely to be what you want.
+t8035-deprecated.scala:2: warning: Adaptation of argument list by inserting () is deprecated: this is unlikely to be what you want.
signature: GenSetLike.apply(elem: A): Boolean
given arguments: <none>
after adaptation: GenSetLike((): Unit)
List(1,2,3).toSet()
^
-t8035-deprecated.scala:5: warning: Adaptation of argument list by inserting () has been deprecated: this is unlikely to be what you want.
+t8035-deprecated.scala:5: warning: Adaptation of argument list by inserting () is deprecated: this is unlikely to be what you want.
signature: A(x: T): Foo.A[T]
given arguments: <none>
after adaptation: new A((): Unit)
new A
^
-t8035-deprecated.scala:9: warning: Adaptation of argument list by inserting () has been deprecated: leaky (Object-receiving) target makes this especially dangerous.
+t8035-deprecated.scala:9: warning: Adaptation of argument list by inserting () is deprecated: leaky (Object-receiving) target makes this especially dangerous.
signature: Format.format(x$1: Any): String
given arguments: <none>
after adaptation: Format.format((): Unit)
diff --git a/test/files/neg/t8035-no-adapted-args.check b/test/files/neg/t8035-no-adapted-args.check
index 43637b2c1f..0115dddc91 100644
--- a/test/files/neg/t8035-no-adapted-args.check
+++ b/test/files/neg/t8035-no-adapted-args.check
@@ -4,9 +4,9 @@ t8035-no-adapted-args.scala:4: warning: No automatic adaptation here: use explic
after adaptation: Test.f((1, 2, 3): (Int, Int, Int))
f(1, 2, 3)
^
-t8035-no-adapted-args.scala:4: error: too many arguments for method f: (x: (Int, Int, Int))Int
+t8035-no-adapted-args.scala:4: error: too many arguments (3) for method f: (x: (Int, Int, Int))Int
f(1, 2, 3)
- ^
+ ^
t8035-no-adapted-args.scala:5: warning: No automatic adaptation here: use explicit parentheses.
signature: Test.f[T](x: T): Int
given arguments: <none>
diff --git a/test/files/neg/t8044-b.check b/test/files/neg/t8044-b.check
new file mode 100644
index 0000000000..4a93e9a772
--- /dev/null
+++ b/test/files/neg/t8044-b.check
@@ -0,0 +1,4 @@
+t8044-b.scala:3: error: Pattern variables must start with a lower-case letter. (SLS 8.1.1.)
+ def g = 42 match { case `Oops` : Int => } // must be varish
+ ^
+one error found
diff --git a/test/files/neg/t8044-b.scala b/test/files/neg/t8044-b.scala
new file mode 100644
index 0000000000..fb2e921ac9
--- /dev/null
+++ b/test/files/neg/t8044-b.scala
@@ -0,0 +1,4 @@
+
+trait T {
+ def g = 42 match { case `Oops` : Int => } // must be varish
+}
diff --git a/test/files/neg/t8044.check b/test/files/neg/t8044.check
new file mode 100644
index 0000000000..678bf8c700
--- /dev/null
+++ b/test/files/neg/t8044.check
@@ -0,0 +1,4 @@
+t8044.scala:3: error: not found: value _
+ def f = 42 match { case `_` : Int => `_` } // doesn't leak quoted underscore
+ ^
+one error found
diff --git a/test/files/neg/t8044.scala b/test/files/neg/t8044.scala
new file mode 100644
index 0000000000..930c30c5a5
--- /dev/null
+++ b/test/files/neg/t8044.scala
@@ -0,0 +1,4 @@
+
+trait T {
+ def f = 42 match { case `_` : Int => `_` } // doesn't leak quoted underscore
+}
diff --git a/test/files/neg/t8079a.check b/test/files/neg/t8079a.check
new file mode 100644
index 0000000000..6bbe78afa6
--- /dev/null
+++ b/test/files/neg/t8079a.check
@@ -0,0 +1,4 @@
+t8079a.scala:3: error: contravariant type I occurs in covariant position in type C.this.X of value b
+ def f2(b: X): Unit
+ ^
+one error found
diff --git a/test/files/neg/t8079a.scala b/test/files/neg/t8079a.scala
new file mode 100644
index 0000000000..4997ea282e
--- /dev/null
+++ b/test/files/neg/t8079a.scala
@@ -0,0 +1,4 @@
+trait C[-I] {
+ private[this] type X = C[I]
+ def f2(b: X): Unit
+}
diff --git a/test/files/neg/t8217-local-alias-requires-rhs.check b/test/files/neg/t8217-local-alias-requires-rhs.check
index 0d4f0864ba..383b1f8d63 100644
--- a/test/files/neg/t8217-local-alias-requires-rhs.check
+++ b/test/files/neg/t8217-local-alias-requires-rhs.check
@@ -1,10 +1,10 @@
-t8217-local-alias-requires-rhs.scala:6: error: only classes can have declared but undefined members
- type B
- ^
-t8217-local-alias-requires-rhs.scala:3: error: only classes can have declared but undefined members
+t8217-local-alias-requires-rhs.scala:3: error: only traits and abstract classes can have declared but undefined members
type A
^
-t8217-local-alias-requires-rhs.scala:14: error: only classes can have declared but undefined members
+t8217-local-alias-requires-rhs.scala:6: error: only traits and abstract classes can have declared but undefined members
+ type B
+ ^
+t8217-local-alias-requires-rhs.scala:14: error: only traits and abstract classes can have declared but undefined members
def this(a: Any) = { this(); type C }
^
three errors found
diff --git a/test/files/neg/t8417.check b/test/files/neg/t8417.check
new file mode 100644
index 0000000000..6ec9e1d14d
--- /dev/null
+++ b/test/files/neg/t8417.check
@@ -0,0 +1,15 @@
+t8417.scala:5: warning: Adapting argument list by creating a 2-tuple: this may not be what you want.
+ signature: T.f(x: Any)(y: Any): String
+ given arguments: "hello", "world"
+ after adaptation: T.f(("hello", "world"): (String, String))
+ def g = f("hello", "world")("holy", "moly")
+ ^
+t8417.scala:5: warning: Adapting argument list by creating a 2-tuple: this may not be what you want.
+ signature: T.f(x: Any)(y: Any): String
+ given arguments: "holy", "moly"
+ after adaptation: T.f(("holy", "moly"): (String, String))
+ def g = f("hello", "world")("holy", "moly")
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+two warnings found
+one error found
diff --git a/test/files/neg/t8417.flags b/test/files/neg/t8417.flags
new file mode 100644
index 0000000000..26b215ff2d
--- /dev/null
+++ b/test/files/neg/t8417.flags
@@ -0,0 +1 @@
+-Xfatal-warnings -Ywarn-adapted-args
diff --git a/test/files/neg/t8417.scala b/test/files/neg/t8417.scala
new file mode 100644
index 0000000000..fb6449c2d1
--- /dev/null
+++ b/test/files/neg/t8417.scala
@@ -0,0 +1,6 @@
+
+
+trait T {
+ def f(x: Any)(y: Any) = "" + x + y
+ def g = f("hello", "world")("holy", "moly")
+}
diff --git a/test/files/neg/t8667.check b/test/files/neg/t8667.check
new file mode 100644
index 0000000000..82451ee5d6
--- /dev/null
+++ b/test/files/neg/t8667.check
@@ -0,0 +1,91 @@
+t8667.scala:6: error: too many arguments (3) for constructor C: (a: Int, b: Int)C
+Note that 'c' is not a parameter name of the invoked method.
+ def c2 = new C(a = 42, b = 17, c = 5)
+ ^
+t8667.scala:7: error: unknown parameter name: c
+ def c3 = new C(b = 42, a = 17, c = 5)
+ ^
+t8667.scala:7: error: too many arguments (3) for constructor C: (a: Int, b: Int)C
+ def c3 = new C(b = 42, a = 17, c = 5)
+ ^
+t8667.scala:8: error: positional after named argument.
+ def c4 = new C(b = 42, a = 17, 5)
+ ^
+t8667.scala:8: error: too many arguments (3) for constructor C: (a: Int, b: Int)C
+ def c4 = new C(b = 42, a = 17, 5)
+ ^
+t8667.scala:9: error: not found: value c
+ def c5 = new C(a = 42, c = 17)
+ ^
+t8667.scala:10: error: parameter 'b' is already specified at parameter position 2
+Note that 'c' is not a parameter name of the invoked method.
+ def c6 = new C(a = 42, c = 17, b = 5)
+ ^
+t8667.scala:10: error: too many arguments (3) for constructor C: (a: Int, b: Int)C
+Note that 'c' is not a parameter name of the invoked method.
+ def c6 = new C(a = 42, c = 17, b = 5)
+ ^
+t8667.scala:11: error: parameter 'a' is already specified at parameter position 1
+Note that 'c' is not a parameter name of the invoked method.
+ def c7 = new C(c = 42, a = 17, b = 5)
+ ^
+t8667.scala:11: error: too many arguments (3) for constructor C: (a: Int, b: Int)C
+Note that 'c' is not a parameter name of the invoked method.
+ def c7 = new C(c = 42, a = 17, b = 5)
+ ^
+t8667.scala:12: error: parameter 'b' is already specified at parameter position 2
+ def c8 = new C(42, 17, b = 5)
+ ^
+t8667.scala:12: error: too many arguments (3) for constructor C: (a: Int, b: Int)C
+ def c8 = new C(42, 17, b = 5)
+ ^
+t8667.scala:13: error: parameter 'b' is already specified at parameter position 2
+Note that 'c' is not a parameter name of the invoked method.
+ def c9 = new C(a = 42, c = 17, d = 3, b = 5)
+ ^
+t8667.scala:13: error: too many arguments (4) for constructor C: (a: Int, b: Int)C
+Note that 'c', 'd' are not parameter names of the invoked method.
+ def c9 = new C(a = 42, c = 17, d = 3, b = 5)
+ ^
+t8667.scala:14: error: too many arguments (4) for constructor C: (a: Int, b: Int)C
+Note that 'd', 'c' are not parameter names of the invoked method.
+ def c0 = new C(42, 17, d = 3, c = 5)
+ ^
+t8667.scala:25: error: no arguments allowed for nullary method f0: ()Int
+ f0(1)
+ ^
+t8667.scala:26: error: too many arguments (2) for method f1: (i: Int)Int
+ f1(1, 2)
+ ^
+t8667.scala:27: error: too many arguments (3) for method f1: (i: Int)Int
+ f1(1, 2, 3)
+ ^
+t8667.scala:28: error: 3 more arguments than can be applied to method f1: (i: Int)Int
+ f1(1, 2, 3, 4)
+ ^
+t8667.scala:29: error: 3 more arguments than can be applied to method f1: (i: Int)Int
+Note that 'j' is not a parameter name of the invoked method.
+ f1(1, j = 2, 3, 4)
+ ^
+t8667.scala:30: error: 3 more arguments than can be applied to method f1: (i: Int)Int
+Note that 'j', 'k' are not parameter names of the invoked method.
+ f1(1, j = 2, k = 3, 4)
+ ^
+t8667.scala:31: error: parameter 'i' is already specified at parameter position 1
+Note that 'k' is not a parameter name of the invoked method.
+ f2(k = 1, i = 2, j = 3)
+ ^
+t8667.scala:31: error: too many arguments (3) for method f2: (i: Int, j: Int)Int
+Note that 'k' is not a parameter name of the invoked method.
+ f2(k = 1, i = 2, j = 3)
+ ^
+t8667.scala:32: error: one more argument than can be applied to method f6: (i: Int, j: Int, k: Int, l: Int, m: Int, n: Int)Int
+ f6(1, 2, 3, 4, 5, 6, 7)
+ ^
+t8667.scala:33: error: 2 more arguments than can be applied to method f6: (i: Int, j: Int, k: Int, l: Int, m: Int, n: Int)Int
+ f6(1, 2, 3, 4, 5, 6, 7, 8)
+ ^
+t8667.scala:34: error: 15 arguments but expected 12 for method f12: (i: Int, j: Int, k: Int, l: Int, m: Int, n: Int, o: Int, p: Int, q: Int, r: Int, s: Int, t: Int)Int
+ f12(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
+ ^
+26 errors found
diff --git a/test/files/neg/t8667.scala b/test/files/neg/t8667.scala
new file mode 100644
index 0000000000..d55582ca6b
--- /dev/null
+++ b/test/files/neg/t8667.scala
@@ -0,0 +1,37 @@
+
+class C(a: Int, b: Int)
+
+trait T {
+ def c1 = new C(a = 42, b = 17)
+ def c2 = new C(a = 42, b = 17, c = 5)
+ def c3 = new C(b = 42, a = 17, c = 5)
+ def c4 = new C(b = 42, a = 17, 5)
+ def c5 = new C(a = 42, c = 17)
+ def c6 = new C(a = 42, c = 17, b = 5)
+ def c7 = new C(c = 42, a = 17, b = 5)
+ def c8 = new C(42, 17, b = 5)
+ def c9 = new C(a = 42, c = 17, d = 3, b = 5)
+ def c0 = new C(42, 17, d = 3, c = 5)
+}
+
+trait X {
+ def f0() = 42
+ def f1(i: Int) = 42
+ def f2(i: Int, j: Int) = 42
+ def f6(i: Int, j: Int, k: Int, l: Int, m: Int, n: Int) = 42
+ def f12(i: Int, j: Int, k: Int, l: Int, m: Int, n: Int, o: Int, p: Int, q: Int, r: Int, s: Int, t: Int) = 42
+
+ def g() = {
+ f0(1)
+ f1(1, 2)
+ f1(1, 2, 3)
+ f1(1, 2, 3, 4)
+ f1(1, j = 2, 3, 4)
+ f1(1, j = 2, k = 3, 4)
+ f2(k = 1, i = 2, j = 3)
+ f6(1, 2, 3, 4, 5, 6, 7)
+ f6(1, 2, 3, 4, 5, 6, 7, 8)
+ f12(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
+ ()
+ }
+}
diff --git a/test/files/neg/t8685.check b/test/files/neg/t8685.check
new file mode 100644
index 0000000000..a31e2e265a
--- /dev/null
+++ b/test/files/neg/t8685.check
@@ -0,0 +1,48 @@
+t8685.scala:6: warning: constructor D in class D is deprecated (since now): ctor D is depr
+case class D @deprecated("ctor D is depr", since="now") (i: Int)
+ ^
+t8685.scala:35: warning: class C is deprecated (since now): class C is depr
+ def f = C(42)
+ ^
+t8685.scala:36: warning: constructor D in class D is deprecated (since now): ctor D is depr
+ def g = D(42)
+ ^
+t8685.scala:37: warning: object E is deprecated (since now): module E is depr
+ def h = E(42)
+ ^
+t8685.scala:37: warning: class E is deprecated (since now): class E is depr
+ def h = E(42)
+ ^
+t8685.scala:38: warning: object F is deprecated (since now): module F is depr
+ def i = F.G(42)
+ ^
+t8685.scala:39: warning: object F in object Extra is deprecated (since now): Extra module F is depr
+ def j = Extra.F.G(42)
+ ^
+t8685.scala:43: warning: value gg in trait Applies is deprecated (since now): member gg
+ def k = this.gg.H(0)
+ ^
+t8685.scala:45: warning: class K in object J is deprecated (since now): Inner K is depr
+ def l = J.K(42)
+ ^
+t8685.scala:48: warning: class C is deprecated (since now): class C is depr
+ def f = new C(42)
+ ^
+t8685.scala:49: warning: constructor D in class D is deprecated (since now): ctor D is depr
+ def g = new D(42)
+ ^
+t8685.scala:50: warning: class E is deprecated (since now): class E is depr
+ def h = new E(42)
+ ^
+t8685.scala:51: warning: object F is deprecated (since now): module F is depr
+ def i = new F.G(42)
+ ^
+t8685.scala:52: warning: object F in object Extra is deprecated (since now): Extra module F is depr
+ def j = new Extra.F.G(42)
+ ^
+t8685.scala:53: warning: class K in object J is deprecated (since now): Inner K is depr
+ def l = new J.K(42)
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+15 warnings found
+one error found
diff --git a/test/files/neg/t8685.flags b/test/files/neg/t8685.flags
new file mode 100644
index 0000000000..c6bfaf1f64
--- /dev/null
+++ b/test/files/neg/t8685.flags
@@ -0,0 +1 @@
+-deprecation -Xfatal-warnings
diff --git a/test/files/neg/t8685.scala b/test/files/neg/t8685.scala
new file mode 100644
index 0000000000..711680ecbd
--- /dev/null
+++ b/test/files/neg/t8685.scala
@@ -0,0 +1,54 @@
+
+
+@deprecated("class C is depr", since="now")
+case class C(i: Int)
+
+case class D @deprecated("ctor D is depr", since="now") (i: Int)
+
+@deprecated("class E is depr", since="now")
+case class E(i: Int)
+@deprecated("module E is depr", since="now")
+object E
+
+@deprecated("module F is depr", since="now")
+object F {
+ case class G(i: Int)
+}
+
+object G {
+ case class H(i: Int)
+}
+
+object Extra {
+ @deprecated("Extra module F is depr", since="now")
+ object F {
+ case class G(i: Int)
+ }
+}
+
+object J {
+ @deprecated("Inner K is depr", since="now")
+ case class K(i: Int)
+}
+
+trait Applies {
+ def f = C(42)
+ def g = D(42)
+ def h = E(42)
+ def i = F.G(42)
+ def j = Extra.F.G(42)
+
+ @deprecated("member gg", since="now")
+ val gg = G
+ def k = this.gg.H(0)
+
+ def l = J.K(42)
+}
+trait News {
+ def f = new C(42)
+ def g = new D(42)
+ def h = new E(42)
+ def i = new F.G(42)
+ def j = new Extra.F.G(42)
+ def l = new J.K(42)
+}
diff --git a/test/files/neg/t8700a.check b/test/files/neg/t8700a.check
new file mode 100644
index 0000000000..ce7945a3fc
--- /dev/null
+++ b/test/files/neg/t8700a.check
@@ -0,0 +1,11 @@
+Bar.scala:2: warning: match may not be exhaustive.
+It would fail on the following input: B
+ def bar1(foo: Foo) = foo match {
+ ^
+Bar.scala:6: warning: match may not be exhaustive.
+It would fail on the following input: B
+ def bar2(foo: Baz) = foo match {
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+two warnings found
+one error found
diff --git a/test/files/neg/t8700a.flags b/test/files/neg/t8700a.flags
new file mode 100644
index 0000000000..85d8eb2ba2
--- /dev/null
+++ b/test/files/neg/t8700a.flags
@@ -0,0 +1 @@
+-Xfatal-warnings
diff --git a/test/files/neg/t8700a/Bar.scala b/test/files/neg/t8700a/Bar.scala
new file mode 100644
index 0000000000..33ad8e9877
--- /dev/null
+++ b/test/files/neg/t8700a/Bar.scala
@@ -0,0 +1,9 @@
+object Bar {
+ def bar1(foo: Foo) = foo match {
+ case Foo.A => 1
+ }
+
+ def bar2(foo: Baz) = foo match {
+ case Baz.A => 1
+ }
+}
diff --git a/test/files/neg/t8700a/Baz.java b/test/files/neg/t8700a/Baz.java
new file mode 100644
index 0000000000..f85ad40802
--- /dev/null
+++ b/test/files/neg/t8700a/Baz.java
@@ -0,0 +1,11 @@
+public enum Baz {
+ A {
+ public void baz1() {}
+ },
+ B {
+ public void baz1() {}
+ };
+
+ public abstract void baz1();
+ public void baz2() {}
+}
diff --git a/test/files/neg/t8700a/Foo.java b/test/files/neg/t8700a/Foo.java
new file mode 100644
index 0000000000..cc8e9daf1f
--- /dev/null
+++ b/test/files/neg/t8700a/Foo.java
@@ -0,0 +1,4 @@
+public enum Foo {
+ A,
+ B
+}
diff --git a/test/files/neg/t8700b.check b/test/files/neg/t8700b.check
new file mode 100644
index 0000000000..3bff78dd29
--- /dev/null
+++ b/test/files/neg/t8700b.check
@@ -0,0 +1,11 @@
+Bar_2.scala:2: warning: match may not be exhaustive.
+It would fail on the following input: B
+ def bar1(foo: Foo_1) = foo match {
+ ^
+Bar_2.scala:6: warning: match may not be exhaustive.
+It would fail on the following input: B
+ def bar2(foo: Baz_1) = foo match {
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+two warnings found
+one error found
diff --git a/test/files/neg/t8700b.flags b/test/files/neg/t8700b.flags
new file mode 100644
index 0000000000..85d8eb2ba2
--- /dev/null
+++ b/test/files/neg/t8700b.flags
@@ -0,0 +1 @@
+-Xfatal-warnings
diff --git a/test/files/neg/t8700b/Bar_2.scala b/test/files/neg/t8700b/Bar_2.scala
new file mode 100644
index 0000000000..97ba16df27
--- /dev/null
+++ b/test/files/neg/t8700b/Bar_2.scala
@@ -0,0 +1,9 @@
+object Bar {
+ def bar1(foo: Foo_1) = foo match {
+ case Foo_1.A => 1
+ }
+
+ def bar2(foo: Baz_1) = foo match {
+ case Baz_1.A => 1
+ }
+}
diff --git a/test/files/neg/t8700b/Baz_1.java b/test/files/neg/t8700b/Baz_1.java
new file mode 100644
index 0000000000..6a057c2c9c
--- /dev/null
+++ b/test/files/neg/t8700b/Baz_1.java
@@ -0,0 +1,11 @@
+public enum Baz_1 {
+ A {
+ public void baz1() {}
+ },
+ B {
+ public void baz1() {}
+ };
+
+ public abstract void baz1();
+ public void baz2() {}
+}
diff --git a/test/files/neg/t8700b/Foo_1.java b/test/files/neg/t8700b/Foo_1.java
new file mode 100644
index 0000000000..22656bdedd
--- /dev/null
+++ b/test/files/neg/t8700b/Foo_1.java
@@ -0,0 +1,4 @@
+public enum Foo_1 {
+ A,
+ B
+}
diff --git a/test/files/neg/t8704.check b/test/files/neg/t8704.check
new file mode 100644
index 0000000000..b567a8bb17
--- /dev/null
+++ b/test/files/neg/t8704.check
@@ -0,0 +1,11 @@
+t8704.scala:7: warning: 2 parameter sections are effectively implicit
+class D(private implicit val i: Int)(implicit s: String)
+ ^
+t8704.scala:3: error: an implicit parameter section must be last
+class C(i: Int)(implicit j: Int)(implicit k: Int)(n: Int) {
+ ^
+t8704.scala:3: error: multiple implicit parameter sections are not allowed
+class C(i: Int)(implicit j: Int)(implicit k: Int)(n: Int) {
+ ^
+one warning found
+two errors found
diff --git a/test/files/neg/t8704.flags b/test/files/neg/t8704.flags
new file mode 100644
index 0000000000..f175a06c74
--- /dev/null
+++ b/test/files/neg/t8704.flags
@@ -0,0 +1 @@
+-Ywarn-extra-implicit
diff --git a/test/files/neg/t8704.scala b/test/files/neg/t8704.scala
new file mode 100644
index 0000000000..db43bfcaa5
--- /dev/null
+++ b/test/files/neg/t8704.scala
@@ -0,0 +1,7 @@
+
+
+class C(i: Int)(implicit j: Int)(implicit k: Int)(n: Int) {
+ def f = n
+}
+
+class D(private implicit val i: Int)(implicit s: String)
diff --git a/test/files/neg/t876.check b/test/files/neg/t876.check
index 04c5c8f22e..7df2e126a6 100644
--- a/test/files/neg/t876.check
+++ b/test/files/neg/t876.check
@@ -1,4 +1,4 @@
-t876.scala:25: error: too many arguments for method apply: (key: AssertionError.A)manager.B in class HashMap
+t876.scala:25: error: too many arguments (2) for method apply: (key: AssertionError.A)manager.B in class HashMap
assert(manager.map(A2) == List(manager.map(A2, A1)))
- ^
+ ^
one error found
diff --git a/test/files/neg/t8764.check b/test/files/neg/t8764.check
deleted file mode 100644
index 6d89ebe106..0000000000
--- a/test/files/neg/t8764.check
+++ /dev/null
@@ -1,6 +0,0 @@
-t8764.scala:8: error: type mismatch;
- found : AnyVal
- required: Double
- val d: Double = a.productElement(0)
- ^
-one error found
diff --git a/test/files/neg/t8764.scala b/test/files/neg/t8764.scala
deleted file mode 100644
index dc5bfb0160..0000000000
--- a/test/files/neg/t8764.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-object Main {
-
- case class IntAndDouble(i: Int, d: Double)
-
- // a.productElement used to be Int => Double
- // now: Int => AnyVal
- val a = IntAndDouble(1, 5.0)
- val d: Double = a.productElement(0)
-}
diff --git a/test/files/neg/t8849.check b/test/files/neg/t8849.check
new file mode 100644
index 0000000000..1d5b4164b2
--- /dev/null
+++ b/test/files/neg/t8849.check
@@ -0,0 +1,7 @@
+t8849.scala:8: error: ambiguous implicit values:
+ both lazy value global in object Implicits of type => scala.concurrent.ExecutionContext
+ and value dummy of type scala.concurrent.ExecutionContext
+ match expected type scala.concurrent.ExecutionContext
+ require(implicitly[ExecutionContext] eq dummy)
+ ^
+one error found
diff --git a/test/files/neg/t8849.scala b/test/files/neg/t8849.scala
new file mode 100644
index 0000000000..336f16b40f
--- /dev/null
+++ b/test/files/neg/t8849.scala
@@ -0,0 +1,10 @@
+import scala.concurrent.ExecutionContext
+import ExecutionContext.Implicits.global
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ implicit val dummy: ExecutionContext = null
+ require(scala.concurrent.ExecutionContext.Implicits.global ne null)
+ require(implicitly[ExecutionContext] eq dummy)
+ }
+} \ No newline at end of file
diff --git a/test/files/neg/t9045.check b/test/files/neg/t9045.check
new file mode 100644
index 0000000000..07d0e2dd74
--- /dev/null
+++ b/test/files/neg/t9045.check
@@ -0,0 +1,7 @@
+t9045.scala:3: error: constructor invokes itself
+ def this(axes: Array[Int]) = this(axes)
+ ^
+t9045.scala:6: error: called constructor's definition must precede calling constructor's definition
+ def this(d: Double) = this(d.toLong)
+ ^
+two errors found
diff --git a/test/files/neg/t9045.scala b/test/files/neg/t9045.scala
new file mode 100644
index 0000000000..e6710ab324
--- /dev/null
+++ b/test/files/neg/t9045.scala
@@ -0,0 +1,8 @@
+
+case class AffineImageShape(axes: Seq[Int]) {
+ def this(axes: Array[Int]) = this(axes)
+}
+class X(i: Int) {
+ def this(d: Double) = this(d.toLong)
+ def this(n: Long) = this(n.toInt)
+}
diff --git a/test/files/neg/t9361.check b/test/files/neg/t9361.check
new file mode 100644
index 0000000000..847d137f7d
--- /dev/null
+++ b/test/files/neg/t9361.check
@@ -0,0 +1,11 @@
+t9361.scala:4: error: type mismatch;
+ found : Tc[_$2] where type _$2
+ required: Nothing[]
+ new Foo { def tc = null.asInstanceOf[Tc[_]] }
+ ^
+t9361.scala:4: error: type mismatch;
+ found : Foo[Nothing]
+ required: Foo[Tc]{type T = Nothing}
+ new Foo { def tc = null.asInstanceOf[Tc[_]] }
+ ^
+two errors found
diff --git a/test/files/neg/t9361.scala b/test/files/neg/t9361.scala
new file mode 100644
index 0000000000..b689461e4d
--- /dev/null
+++ b/test/files/neg/t9361.scala
@@ -0,0 +1,5 @@
+abstract class Foo[Tc[_]] { def tc: Tc[_] }
+object Foo {
+ def foo[Tc[_]](): Foo[Tc] { type T = Nothing } =
+ new Foo { def tc = null.asInstanceOf[Tc[_]] }
+}
diff --git a/test/files/neg/t9382.check b/test/files/neg/t9382.check
new file mode 100644
index 0000000000..93bf48926a
--- /dev/null
+++ b/test/files/neg/t9382.check
@@ -0,0 +1,10 @@
+t9382.scala:3: error: value x is not a member of (List[Int], List[Int])
+ def f = (List(1,2,3), List(4,5,6)).x
+ ^
+t9382.scala:4: error: value x is not a member of (List[Int], List[Int], List[Int])
+ def g = (List(1,2,3), List(4,5,6), List(7,8,9)).x
+ ^
+t9382.scala:5: error: value x is not a member of (Int, Int)
+ def huh = (1,2).x
+ ^
+three errors found
diff --git a/test/files/neg/t9382.scala b/test/files/neg/t9382.scala
new file mode 100644
index 0000000000..19703525e4
--- /dev/null
+++ b/test/files/neg/t9382.scala
@@ -0,0 +1,6 @@
+
+trait T {
+ def f = (List(1,2,3), List(4,5,6)).x
+ def g = (List(1,2,3), List(4,5,6), List(7,8,9)).x
+ def huh = (1,2).x
+}
diff --git a/test/files/neg/t9398.check b/test/files/neg/t9398.check
new file mode 100644
index 0000000000..f0c464daa1
--- /dev/null
+++ b/test/files/neg/t9398.check
@@ -0,0 +1,7 @@
+match.scala:3: warning: match may not be exhaustive.
+It would fail on the following input: CC(B2)
+ def test(c: CC): Unit = c match {
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/t9398.flags b/test/files/neg/t9398.flags
new file mode 100644
index 0000000000..85d8eb2ba2
--- /dev/null
+++ b/test/files/neg/t9398.flags
@@ -0,0 +1 @@
+-Xfatal-warnings
diff --git a/test/files/neg/t9398/data.scala b/test/files/neg/t9398/data.scala
new file mode 100644
index 0000000000..7a98c0e8e8
--- /dev/null
+++ b/test/files/neg/t9398/data.scala
@@ -0,0 +1,5 @@
+sealed abstract class TB
+case object B extends TB
+case object B2 extends TB
+
+case class CC(tb: TB)
diff --git a/test/files/neg/t9398/match.scala b/test/files/neg/t9398/match.scala
new file mode 100644
index 0000000000..e110c6a96a
--- /dev/null
+++ b/test/files/neg/t9398/match.scala
@@ -0,0 +1,6 @@
+class Test {
+ // Should warn that CC(B2) isn't matched
+ def test(c: CC): Unit = c match {
+ case CC(B) => ()
+ }
+}
diff --git a/test/files/neg/t9527a.check b/test/files/neg/t9527a.check
new file mode 100644
index 0000000000..e756518bed
--- /dev/null
+++ b/test/files/neg/t9527a.check
@@ -0,0 +1,7 @@
+t9527a.scala:5: error: ambiguous implicit values:
+ both method f in class C of type (x: Int)String
+ and method g in class C of type (x: Int)String
+ match expected type Int => String
+ implicitly[Int => String]
+ ^
+one error found
diff --git a/test/files/neg/t9527a.scala b/test/files/neg/t9527a.scala
new file mode 100644
index 0000000000..35c58fc9a6
--- /dev/null
+++ b/test/files/neg/t9527a.scala
@@ -0,0 +1,8 @@
+class C {
+ implicit def f(x: Int): String = "f was here"
+ implicit def g(x: Int): String = "f was here"
+ def test: Unit = {
+ implicitly[Int => String]
+ }
+}
+
diff --git a/test/files/neg/t9527b.check b/test/files/neg/t9527b.check
new file mode 100644
index 0000000000..4529ec83ea
--- /dev/null
+++ b/test/files/neg/t9527b.check
@@ -0,0 +1,4 @@
+t9527b.scala:6: error: msg A=Nothing
+ implicitly[Int => String]
+ ^
+one error found
diff --git a/test/files/neg/t9527b.scala b/test/files/neg/t9527b.scala
new file mode 100644
index 0000000000..b40a4dca9e
--- /dev/null
+++ b/test/files/neg/t9527b.scala
@@ -0,0 +1,9 @@
+class C {
+ @annotation.implicitAmbiguous("msg A=${A}")
+ implicit def f[A](x: Int): String = "f was here"
+ implicit def g(x: Int): String = "f was here"
+ def test: Unit = {
+ implicitly[Int => String]
+ }
+}
+
diff --git a/test/files/neg/t9535.check b/test/files/neg/t9535.check
new file mode 100644
index 0000000000..5c3e3ea8e6
--- /dev/null
+++ b/test/files/neg/t9535.check
@@ -0,0 +1,7 @@
+t9535.scala:4: error: not found: type E1
+ @throws[E1] def f[E1 <: Exception] = 1
+ ^
+t9535.scala:6: error: class type required but E found
+ @throws(classOf[E]) def g: E = ??? // neg test: classOf requires class type
+ ^
+two errors found
diff --git a/test/files/neg/t9535.scala b/test/files/neg/t9535.scala
new file mode 100644
index 0000000000..37253804ce
--- /dev/null
+++ b/test/files/neg/t9535.scala
@@ -0,0 +1,7 @@
+class C[E <: Exception] {
+ // cannot be expressed in Scala (it's allowed in Java)
+ // https://issues.scala-lang.org/browse/SI-7066
+ @throws[E1] def f[E1 <: Exception] = 1
+
+ @throws(classOf[E]) def g: E = ??? // neg test: classOf requires class type
+}
diff --git a/test/files/neg/t9629.check b/test/files/neg/t9629.check
new file mode 100644
index 0000000000..4eafa84236
--- /dev/null
+++ b/test/files/neg/t9629.check
@@ -0,0 +1,17 @@
+t9629.scala:4: error: pattern must be a value: Option[Int]
+Note: if you intended to match against the class, try `case _: Option[_]`
+ case Option[Int] => // error was issued before
+ ^
+t9629.scala:5: error: pattern must be a value: Option[Int]
+Note: if you intended to match against the class, try `case _: Option[_]`
+ case Some(Option[Int]) => // error was skipped, patmat issued an internal error
+ ^
+t9629.scala:8: error: pattern must be a value: Option[Int]
+Note: if you intended to match against the class, try `case _: Option[_]`
+ case (_, Option[Int]) =>
+ ^
+t9629.scala:9: error: pattern must be a value: Option[Int]
+Note: if you intended to match against the class, try `case _: Option[_]`
+ case x @ (y @ Option[Int]) =>
+ ^
+four errors found
diff --git a/test/files/neg/t9629.scala b/test/files/neg/t9629.scala
new file mode 100644
index 0000000000..2be2b039f2
--- /dev/null
+++ b/test/files/neg/t9629.scala
@@ -0,0 +1,12 @@
+class Test {
+ def foo(a: Any) {
+ a match {
+ case Option[Int] => // error was issued before
+ case Some(Option[Int]) => // error was skipped, patmat issued an internal error
+
+ // variations
+ case (_, Option[Int]) =>
+ case x @ (y @ Option[Int]) =>
+ }
+ }
+}
diff --git a/test/files/neg/t963.check b/test/files/neg/t963.check
index 483e53c77d..85b64b0bb5 100644
--- a/test/files/neg/t963.check
+++ b/test/files/neg/t963.check
@@ -1,12 +1,12 @@
+t963.scala:10: error: type mismatch;
+ found : AnyRef{def x: Integer}
+ required: AnyRef{val x: Integer}
+ val y2 : { val x : java.lang.Integer } = new { def x = new java.lang.Integer(r.nextInt) }
+ ^
t963.scala:14: error: stable identifier required, but y3.x.type found.
val w3 : y3.x.type = y3.x
^
t963.scala:17: error: stable identifier required, but y4.x.type found.
val w4 : y4.x.type = y4.x
^
-t963.scala:10: error: type mismatch;
- found : AnyRef{def x: Integer}
- required: AnyRef{val x: Integer}
- val y2 : { val x : java.lang.Integer } = new { def x = new java.lang.Integer(r.nextInt) }
- ^
three errors found
diff --git a/test/files/neg/t9636.check b/test/files/neg/t9636.check
new file mode 100644
index 0000000000..f36d1d32b2
--- /dev/null
+++ b/test/files/neg/t9636.check
@@ -0,0 +1,6 @@
+t9636.scala:11: warning: a type was inferred to be `AnyVal`; this may indicate a programming error.
+ if (signature.sameElements(Array(0x1F, 0x8B))) {
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/t9636.flags b/test/files/neg/t9636.flags
new file mode 100644
index 0000000000..7949c2afa2
--- /dev/null
+++ b/test/files/neg/t9636.flags
@@ -0,0 +1 @@
+-Xlint -Xfatal-warnings
diff --git a/test/files/neg/t9636.scala b/test/files/neg/t9636.scala
new file mode 100644
index 0000000000..7ad5fb3e9e
--- /dev/null
+++ b/test/files/neg/t9636.scala
@@ -0,0 +1,17 @@
+
+import java.io._
+import java.util.zip._
+
+class C {
+ def isWrapper(is: FileInputStream): InputStream = {
+ val pb = new PushbackInputStream(is, 2)
+ val signature = new Array[Byte](2)
+ pb.read(signature)
+ pb.unread(signature)
+ if (signature.sameElements(Array(0x1F, 0x8B))) {
+ new GZIPInputStream(new BufferedInputStream(pb))
+ } else {
+ pb
+ }
+ }
+}
diff --git a/test/files/neg/t9675.check b/test/files/neg/t9675.check
new file mode 100644
index 0000000000..255477499c
--- /dev/null
+++ b/test/files/neg/t9675.check
@@ -0,0 +1,27 @@
+t9675.scala:4: warning: comparing values of types Test.A and String using `!=' will always yield true
+ val func1 = (x: A) => { x != "x" }
+ ^
+t9675.scala:6: warning: comparing values of types Test.A and String using `!=' will always yield true
+ val func2 = (x: A) => { x != "x" }: Boolean
+ ^
+t9675.scala:8: warning: comparing values of types Test.A and String using `!=' will always yield true
+ val func3: Function1[A, Boolean] = (x) => { x != "x" }
+ ^
+t9675.scala:11: warning: comparing values of types Test.A and String using `!=' will always yield true
+ def apply(x: A): Boolean = { x != "x" }
+ ^
+t9675.scala:14: warning: comparing values of types Test.A and String using `!=' will always yield true
+ def method(x: A): Boolean = { x != "x" }
+ ^
+t9675.scala:18: warning: comparing values of types Test.A and String using `!=' will always yield true
+ A("x") != "x"
+ ^
+t9675.scala:20: warning: comparing values of types Test.A and String using `!=' will always yield true
+ val func5: Function1[A, Boolean] = (x) => { x != "x" }
+ ^
+t9675.scala:22: warning: comparing values of types Test.A and String using `!=' will always yield true
+ List(A("x")).foreach((item: A) => item != "x")
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+8 warnings found
+one error found
diff --git a/test/files/neg/t9675.flags b/test/files/neg/t9675.flags
new file mode 100644
index 0000000000..85d8eb2ba2
--- /dev/null
+++ b/test/files/neg/t9675.flags
@@ -0,0 +1 @@
+-Xfatal-warnings
diff --git a/test/files/neg/t9675.scala b/test/files/neg/t9675.scala
new file mode 100644
index 0000000000..f76b74b6ac
--- /dev/null
+++ b/test/files/neg/t9675.scala
@@ -0,0 +1,24 @@
+object Test {
+ case class A(x: String)
+
+ val func1 = (x: A) => { x != "x" }
+
+ val func2 = (x: A) => { x != "x" }: Boolean
+
+ val func3: Function1[A, Boolean] = (x) => { x != "x" }
+
+ val func4 = new Function1[A, Boolean] {
+ def apply(x: A): Boolean = { x != "x" }
+ }
+
+ def method(x: A): Boolean = { x != "x" }
+ case class PersonInfo(rankPayEtc: Unit)
+
+ def main(args: Array[String]) {
+ A("x") != "x"
+
+ val func5: Function1[A, Boolean] = (x) => { x != "x" }
+
+ List(A("x")).foreach((item: A) => item != "x")
+ }
+}
diff --git a/test/files/neg/t9684.check b/test/files/neg/t9684.check
new file mode 100644
index 0000000000..bb5669733d
--- /dev/null
+++ b/test/files/neg/t9684.check
@@ -0,0 +1,9 @@
+t9684.scala:6: warning: object JavaConversions in package collection is deprecated (since 2.12.0): use JavaConverters
+ null.asInstanceOf[java.util.List[Int]] : Buffer[Int]
+ ^
+t9684.scala:8: warning: object JavaConversions in package collection is deprecated (since 2.12.0): use JavaConverters
+ null.asInstanceOf[Iterable[Int]] : java.util.Collection[Int]
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+two warnings found
+one error found
diff --git a/test/files/neg/t9684.flags b/test/files/neg/t9684.flags
new file mode 100644
index 0000000000..c6bfaf1f64
--- /dev/null
+++ b/test/files/neg/t9684.flags
@@ -0,0 +1 @@
+-deprecation -Xfatal-warnings
diff --git a/test/files/neg/t9684.scala b/test/files/neg/t9684.scala
new file mode 100644
index 0000000000..f7ece269e6
--- /dev/null
+++ b/test/files/neg/t9684.scala
@@ -0,0 +1,9 @@
+
+import scala.collection.JavaConversions._
+import scala.collection.mutable.Buffer
+
+trait Test {
+ null.asInstanceOf[java.util.List[Int]] : Buffer[Int]
+
+ null.asInstanceOf[Iterable[Int]] : java.util.Collection[Int]
+}
diff --git a/test/files/neg/t9684b.check b/test/files/neg/t9684b.check
new file mode 100644
index 0000000000..5f328abd43
--- /dev/null
+++ b/test/files/neg/t9684b.check
@@ -0,0 +1,7 @@
+t9684b.scala:6: error: reference to asScalaIterator is ambiguous;
+it is imported twice in the same scope by
+import scala.collection.JavaConversions._
+and import scala.collection.JavaConverters._
+ asScalaIterator(null) // fails: asScalaIterator is imported twice.
+ ^
+one error found
diff --git a/test/files/neg/t9684b.scala b/test/files/neg/t9684b.scala
new file mode 100644
index 0000000000..010e9d1b5d
--- /dev/null
+++ b/test/files/neg/t9684b.scala
@@ -0,0 +1,14 @@
+trait T1 {
+ import scala.collection.JavaConverters._
+ import scala.collection.JavaConversions._
+
+ null.asInstanceOf[java.util.Iterator[String]]: Iterator[String] // works
+ asScalaIterator(null) // fails: asScalaIterator is imported twice.
+}
+
+trait T2 {
+ import scala.collection.JavaConversions.asScalaIterator
+
+ null.asInstanceOf[java.util.Iterator[String]]: Iterator[String] // works
+ asScalaIterator(null) // works
+}
diff --git a/test/files/neg/t9781.check b/test/files/neg/t9781.check
new file mode 100644
index 0000000000..422c51013a
--- /dev/null
+++ b/test/files/neg/t9781.check
@@ -0,0 +1,4 @@
+t9781.scala:3: error: not found: value undefinedSymbol
+ c(undefinedSymbol) += 1
+ ^
+one error found
diff --git a/test/files/neg/t9781.scala b/test/files/neg/t9781.scala
new file mode 100644
index 0000000000..70234dcca5
--- /dev/null
+++ b/test/files/neg/t9781.scala
@@ -0,0 +1,4 @@
+object T9781 {
+ val c: collection.mutable.Map[Int, Int] = ???
+ c(undefinedSymbol) += 1
+}
diff --git a/test/files/neg/t9847.check b/test/files/neg/t9847.check
new file mode 100644
index 0000000000..e55109b3ef
--- /dev/null
+++ b/test/files/neg/t9847.check
@@ -0,0 +1,45 @@
+t9847.scala:4: warning: discarded non-Unit value
+ def f(): Unit = 42
+ ^
+t9847.scala:4: warning: a pure expression does nothing in statement position
+ def f(): Unit = 42
+ ^
+t9847.scala:5: warning: discarded non-Unit value
+ def g = (42: Unit)
+ ^
+t9847.scala:5: warning: a pure expression does nothing in statement position
+ def g = (42: Unit)
+ ^
+t9847.scala:7: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
+ 1
+ ^
+t9847.scala:12: warning: discarded non-Unit value
+ + 1
+ ^
+t9847.scala:12: warning: a pure expression does nothing in statement position
+ + 1
+ ^
+t9847.scala:11: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
+ 1
+ ^
+t9847.scala:12: warning: multiline expressions might require enclosing parentheses; a value can be silently discarded when Unit is expected
+ + 1
+ ^
+t9847.scala:16: warning: discarded non-Unit value
+ x + 1
+ ^
+t9847.scala:19: warning: discarded non-Unit value
+ def j(): Unit = x + 1
+ ^
+t9847.scala:21: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
+ class C { 42 }
+ ^
+t9847.scala:22: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
+ class D { 42 ; 17 }
+ ^
+t9847.scala:22: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
+ class D { 42 ; 17 }
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+14 warnings found
+one error found
diff --git a/test/files/neg/t9847.flags b/test/files/neg/t9847.flags
new file mode 100644
index 0000000000..065e3ca61e
--- /dev/null
+++ b/test/files/neg/t9847.flags
@@ -0,0 +1 @@
+-Xfatal-warnings -Ywarn-value-discard
diff --git a/test/files/neg/t9847.scala b/test/files/neg/t9847.scala
new file mode 100644
index 0000000000..51c16d815f
--- /dev/null
+++ b/test/files/neg/t9847.scala
@@ -0,0 +1,23 @@
+
+trait T {
+
+ def f(): Unit = 42
+ def g = (42: Unit)
+ def h = {
+ 1
+ + 1
+ }
+ def hh(): Unit = {
+ 1
+ + 1
+ }
+ def i(): Unit = {
+ val x = 1
+ x + 1
+ }
+ def x = 42
+ def j(): Unit = x + 1
+
+ class C { 42 }
+ class D { 42 ; 17 }
+}
diff --git a/test/files/neg/t9849.check b/test/files/neg/t9849.check
new file mode 100644
index 0000000000..7b47150846
--- /dev/null
+++ b/test/files/neg/t9849.check
@@ -0,0 +1,7 @@
+t9849.scala:14: error: method h in object O cannot be accessed in object p.O
+ O.h()
+ ^
+t9849.scala:15: error: method h$default$1 in object O cannot be accessed in object p.O
+ O.h$default$1
+ ^
+two errors found
diff --git a/test/files/neg/t9849.scala b/test/files/neg/t9849.scala
new file mode 100644
index 0000000000..bcd18b6916
--- /dev/null
+++ b/test/files/neg/t9849.scala
@@ -0,0 +1,16 @@
+package p
+
+object O {
+ protected[p] def f(x: Int = 1) = x
+ private[p] def g(x: Int = 1) = x
+ private def h(x: Int = 1) = x
+}
+
+object Test {
+ O.f()
+ O.f$default$1
+ O.g()
+ O.g$default$1
+ O.h()
+ O.h$default$1
+}
diff --git a/test/files/neg/t9953.check b/test/files/neg/t9953.check
new file mode 100644
index 0000000000..f5dcbcacee
--- /dev/null
+++ b/test/files/neg/t9953.check
@@ -0,0 +1,6 @@
+t9953.scala:10: warning: Object and X are unrelated: they will never compare equal
+ def b = y == x // warn
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/t9953.flags b/test/files/neg/t9953.flags
new file mode 100644
index 0000000000..85d8eb2ba2
--- /dev/null
+++ b/test/files/neg/t9953.flags
@@ -0,0 +1 @@
+-Xfatal-warnings
diff --git a/test/files/neg/t9953.scala b/test/files/neg/t9953.scala
new file mode 100644
index 0000000000..faaee86d50
--- /dev/null
+++ b/test/files/neg/t9953.scala
@@ -0,0 +1,13 @@
+
+class X(val v: Int) extends AnyVal
+trait T extends Any
+object Y extends T
+
+class C {
+ val x = new X(42)
+ val y = new Object
+ val a: T = null
+ def b = y == x // warn
+ def c = y == a // no warn
+ def d = Y == a // no warn
+}
diff --git a/test/files/neg/trailing-commas.check b/test/files/neg/trailing-commas.check
new file mode 100644
index 0000000000..e2677dc3f5
--- /dev/null
+++ b/test/files/neg/trailing-commas.check
@@ -0,0 +1,130 @@
+trailing-commas.scala:10: error: illegal start of simple expression
+trait ArgumentExprs1 { f(23, "bar", )(Ev0, Ev1) }
+ ^
+trailing-commas.scala:10: error: ')' expected but '}' found.
+trait ArgumentExprs1 { f(23, "bar", )(Ev0, Ev1) }
+ ^
+trailing-commas.scala:11: error: illegal start of simple expression
+trait ArgumentExprs2 { f(23, "bar")(Ev0, Ev1, ) }
+ ^
+trailing-commas.scala:11: error: ')' expected but '}' found.
+trait ArgumentExprs2 { f(23, "bar")(Ev0, Ev1, ) }
+ ^
+trailing-commas.scala:12: error: illegal start of simple expression
+trait ArgumentExprs3 { new C(23, "bar", )(Ev0, Ev1) }
+ ^
+trailing-commas.scala:12: error: ')' expected but '}' found.
+trait ArgumentExprs3 { new C(23, "bar", )(Ev0, Ev1) }
+ ^
+trailing-commas.scala:13: error: illegal start of simple expression
+trait ArgumentExprs4 { new C(23, "bar")(Ev0, Ev1, ) }
+ ^
+trailing-commas.scala:13: error: ')' expected but '}' found.
+trait ArgumentExprs4 { new C(23, "bar")(Ev0, Ev1, ) }
+ ^
+trailing-commas.scala:15: error: identifier expected but ')' found.
+trait Params1 { def f(foo: Int, bar: String, )(implicit ev0: Ev0, ev1: Ev1, ) = 1 }
+ ^
+trailing-commas.scala:15: error: ':' expected but '}' found.
+trait Params1 { def f(foo: Int, bar: String, )(implicit ev0: Ev0, ev1: Ev1, ) = 1 }
+ ^
+trailing-commas.scala:16: error: identifier expected but ')' found.
+trait Params2 { def f(foo: Int, bar: String, )(implicit ev0: Ev0, ev1: Ev1, ) = 1 }
+ ^
+trailing-commas.scala:16: error: ':' expected but '}' found.
+trait Params2 { def f(foo: Int, bar: String, )(implicit ev0: Ev0, ev1: Ev1, ) = 1 }
+ ^
+trailing-commas.scala:17: error: identifier expected but ')' found.
+trait ClassParams1 { final class C(foo: Int, bar: String, )(implicit ev0: Ev0, ev1: Ev1) }
+ ^
+trailing-commas.scala:17: error: ':' expected but '}' found.
+trait ClassParams1 { final class C(foo: Int, bar: String, )(implicit ev0: Ev0, ev1: Ev1) }
+ ^
+trailing-commas.scala:18: error: identifier expected but ')' found.
+trait ClassParams2 { final class C(foo: Int, bar: String)(implicit ev0: Ev0, ev1: Ev1, ) }
+ ^
+trailing-commas.scala:18: error: ':' expected but '}' found.
+trait ClassParams2 { final class C(foo: Int, bar: String)(implicit ev0: Ev0, ev1: Ev1, ) }
+ ^
+trailing-commas.scala:20: error: illegal start of simple expression
+trait SimpleExpr { (23, "bar", ) }
+ ^
+trailing-commas.scala:20: error: ')' expected but '}' found.
+trait SimpleExpr { (23, "bar", ) }
+ ^
+trailing-commas.scala:22: error: identifier expected but ']' found.
+trait TypeArgs { def f: C[Int, String, ] }
+ ^
+trailing-commas.scala:22: error: ']' expected but '}' found.
+trait TypeArgs { def f: C[Int, String, ] }
+ ^
+trailing-commas.scala:23: error: identifier expected but ']' found.
+trait TypeParamClause { type C[A, B, ] }
+ ^
+trailing-commas.scala:23: error: ']' expected but '}' found.
+trait TypeParamClause { type C[A, B, ] }
+ ^
+trailing-commas.scala:24: error: identifier expected but ']' found.
+trait FunTypeParamClause { def f[A, B, ] }
+ ^
+trailing-commas.scala:24: error: ']' expected but '}' found.
+trait FunTypeParamClause { def f[A, B, ] }
+ ^
+trailing-commas.scala:26: error: identifier expected but ')' found.
+trait SimpleType { def f: (Int, String, ) }
+ ^
+trailing-commas.scala:26: error: ')' expected but '}' found.
+trait SimpleType { def f: (Int, String, ) }
+ ^
+trailing-commas.scala:27: error: identifier expected but ')' found.
+trait FunctionArgTypes { def f: (Int, String, ) => Boolean }
+ ^
+trailing-commas.scala:27: error: ')' expected but '}' found.
+trait FunctionArgTypes { def f: (Int, String, ) => Boolean }
+ ^
+trailing-commas.scala:29: error: illegal start of simple pattern
+trait SimplePattern { val (foo, bar, ) = null: Any }
+ ^
+trailing-commas.scala:31: error: identifier expected but '}' found.
+trait ImportSelectors { import foo.{ Ev0, Ev1, } }
+ ^
+trailing-commas.scala:33: error: identifier expected but '}' found.
+trait Import { import foo.Ev0, foo.Ev1, }
+ ^
+trailing-commas.scala:35: error: illegal start of simple pattern
+trait ValDcl { val foo, bar, = 23 }
+ ^
+trailing-commas.scala:35: error: '=' expected but '}' found.
+trait ValDcl { val foo, bar, = 23 }
+ ^
+trailing-commas.scala:36: error: illegal start of simple pattern
+trait VarDcl { var foo, bar, = 23 }
+ ^
+trailing-commas.scala:36: error: '=' expected but '}' found.
+trait VarDcl { var foo, bar, = 23 }
+ ^
+trailing-commas.scala:37: error: illegal start of simple pattern
+trait VarDef { var foo, bar, = _ }
+ ^
+trailing-commas.scala:37: error: '=' expected but '}' found.
+trait VarDef { var foo, bar, = _ }
+ ^
+trailing-commas.scala:38: error: illegal start of simple pattern
+trait PatDef { val Foo(foo), Bar(bar), = bippy }
+ ^
+trailing-commas.scala:38: error: '=' expected but '}' found.
+trait PatDef { val Foo(foo), Bar(bar), = bippy }
+ ^
+trailing-commas.scala:45: error: illegal start of simple expression
+trait SimpleExpr2 { (23, ) }
+ ^
+trailing-commas.scala:45: error: ')' expected but '}' found.
+trait SimpleExpr2 { (23, ) }
+ ^
+trailing-commas.scala:48: error: identifier expected but ')' found.
+trait SimpleType2 { def f: (Int, ) }
+ ^
+trailing-commas.scala:48: error: ')' expected but '}' found.
+trait SimpleType2 { def f: (Int, ) }
+ ^
+43 errors found
diff --git a/test/files/neg/trailing-commas.scala b/test/files/neg/trailing-commas.scala
new file mode 100644
index 0000000000..a873cb1e39
--- /dev/null
+++ b/test/files/neg/trailing-commas.scala
@@ -0,0 +1,56 @@
+package foo
+
+// Note: Using traits to get distinct errors
+// (instead of sharing one single "')' expected but '}' found." at the end)
+
+
+
+//// Multi-line only cases: make sure trailing commas are only supported when multi-line
+
+trait ArgumentExprs1 { f(23, "bar", )(Ev0, Ev1) }
+trait ArgumentExprs2 { f(23, "bar")(Ev0, Ev1, ) }
+trait ArgumentExprs3 { new C(23, "bar", )(Ev0, Ev1) }
+trait ArgumentExprs4 { new C(23, "bar")(Ev0, Ev1, ) }
+
+trait Params1 { def f(foo: Int, bar: String, )(implicit ev0: Ev0, ev1: Ev1, ) = 1 }
+trait Params2 { def f(foo: Int, bar: String, )(implicit ev0: Ev0, ev1: Ev1, ) = 1 }
+trait ClassParams1 { final class C(foo: Int, bar: String, )(implicit ev0: Ev0, ev1: Ev1) }
+trait ClassParams2 { final class C(foo: Int, bar: String)(implicit ev0: Ev0, ev1: Ev1, ) }
+
+trait SimpleExpr { (23, "bar", ) }
+
+trait TypeArgs { def f: C[Int, String, ] }
+trait TypeParamClause { type C[A, B, ] }
+trait FunTypeParamClause { def f[A, B, ] }
+
+trait SimpleType { def f: (Int, String, ) }
+trait FunctionArgTypes { def f: (Int, String, ) => Boolean }
+
+trait SimplePattern { val (foo, bar, ) = null: Any }
+
+trait ImportSelectors { import foo.{ Ev0, Ev1, } }
+
+trait Import { import foo.Ev0, foo.Ev1, }
+
+trait ValDcl { val foo, bar, = 23 }
+trait VarDcl { var foo, bar, = 23 }
+trait VarDef { var foo, bar, = _ }
+trait PatDef { val Foo(foo), Bar(bar), = bippy }
+
+
+
+//// The Tuple 1 cases
+
+// the Tuple1 value case: make sure that the possible "(23, )" syntax for Tuple1 doesn't compile to "23"
+trait SimpleExpr2 { (23, ) }
+
+// the Tuple1 type case: make sure that the possible "(Int, )" syntax for Tuple1[Int] doesn't compile to "Int"
+trait SimpleType2 { def f: (Int, ) }
+
+
+
+//// Test utilities
+object `package` {
+ sealed trait Ev0; implicit object Ev0 extends Ev0
+ sealed trait Ev1; implicit object Ev1 extends Ev1
+}
diff --git a/test/files/neg/trait-defaults-super.check b/test/files/neg/trait-defaults-super.check
new file mode 100644
index 0000000000..2b19402828
--- /dev/null
+++ b/test/files/neg/trait-defaults-super.check
@@ -0,0 +1,4 @@
+trait-defaults-super.scala:14: error: Unable to implement a super accessor required by trait T unless Iterable[String] is directly extended by class C.
+class C extends T
+ ^
+one error found
diff --git a/test/files/neg/trait-defaults-super.scala b/test/files/neg/trait-defaults-super.scala
new file mode 100644
index 0000000000..def271e8e7
--- /dev/null
+++ b/test/files/neg/trait-defaults-super.scala
@@ -0,0 +1,21 @@
+trait T extends java.lang.Iterable[String] {
+
+ override def spliterator(): java.util.Spliterator[String] = {
+ super[Iterable].spliterator
+ super.spliterator
+ null
+ }
+ def foo = {
+ super[Iterable].spliterator
+ super.spliterator
+ }
+ def iterator(): java.util.Iterator[String] = java.util.Collections.emptyList().iterator()
+}
+class C extends T
+object Test {
+ def main(args: Array[String]): Unit = {
+ val t: T = new C
+ t.spliterator
+ t.foo
+ }
+}
diff --git a/test/files/neg/trait-no-native.check b/test/files/neg/trait-no-native.check
new file mode 100644
index 0000000000..12bce4042d
--- /dev/null
+++ b/test/files/neg/trait-no-native.check
@@ -0,0 +1,4 @@
+trait-no-native.scala:3: error: A trait cannot define a native method.
+ @native def foo = ???
+ ^
+one error found
diff --git a/test/files/neg/trait-no-native.scala b/test/files/neg/trait-no-native.scala
new file mode 100644
index 0000000000..463e604a48
--- /dev/null
+++ b/test/files/neg/trait-no-native.scala
@@ -0,0 +1,4 @@
+trait T {
+ // should not compile, because it would result in a VerifyError
+ @native def foo = ???
+}
diff --git a/test/files/neg/trait_fields_conflicts.check b/test/files/neg/trait_fields_conflicts.check
new file mode 100644
index 0000000000..696d0284c1
--- /dev/null
+++ b/test/files/neg/trait_fields_conflicts.check
@@ -0,0 +1,273 @@
+trait_fields_conflicts.scala:5: error: overriding value x in trait Val of type Int;
+ value x needs `override' modifier
+trait ValForVal extends Val { val x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:6: error: overriding value x in trait Val of type Int;
+ variable x needs `override' modifier
+trait VarForVal extends Val { var x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:7: error: overriding value x in trait Val of type Int;
+ method x needs `override' modifier
+trait DefForVal extends Val { def x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:8: error: overriding variable x in trait Var of type Int;
+ value x needs `override' modifier
+trait ValForVar extends Var { val x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:9: error: overriding variable x in trait Var of type Int;
+ variable x needs `override' modifier
+trait VarForVar extends Var { var x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:10: error: overriding variable x in trait Var of type Int;
+ method x needs `override' modifier
+trait DefForVar extends Var { def x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:11: error: overriding lazy value x in trait Lazy of type Int;
+ value x needs `override' modifier
+trait ValForLazy extends Lazy { val x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:12: error: overriding lazy value x in trait Lazy of type Int;
+ variable x needs `override' modifier
+trait VarForLazy extends Lazy { var x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:13: error: overriding lazy value x in trait Lazy of type Int;
+ method x needs `override' modifier
+trait DefForLazy extends Lazy { def x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:16: error: overriding value x in trait Val of type Int;
+ variable x needs to be a stable, immutable value
+trait VarForValOvr extends Val { override var x: Int = 1 } // bad override
+ ^
+trait_fields_conflicts.scala:17: error: overriding value x in trait Val of type Int;
+ method x needs to be a stable, immutable value
+trait DefForValOvr extends Val { override def x: Int = 1 } // bad override
+ ^
+trait_fields_conflicts.scala:18: error: overriding variable x in trait Var of type Int;
+ value x cannot override a mutable variable
+trait ValForVarOvr extends Var { override val x: Int = 1 } // bad override -- unsound if used in path and var changes
+ ^
+trait_fields_conflicts.scala:19: error: overriding variable x in trait Var of type Int;
+ variable x cannot override a mutable variable
+trait VarForVarOvr extends Var { override var x: Int = 1 } // bad override -- why?
+ ^
+trait_fields_conflicts.scala:20: error: overriding variable x in trait Var of type Int;
+ method x cannot override a mutable variable
+trait DefForVarOvr extends Var { override def x: Int = 1 } // bad override -- why?
+ ^
+trait_fields_conflicts.scala:21: error: overriding lazy value x in trait Lazy of type Int;
+ value x must be declared lazy to override a concrete lazy value
+trait ValForLazyOvr extends Lazy { override val x: Int = 1 } // bad override -- why?
+ ^
+trait_fields_conflicts.scala:22: error: overriding lazy value x in trait Lazy of type Int;
+ variable x needs to be a stable, immutable value
+trait VarForLazyOvr extends Lazy { override var x: Int = 1 } // bad override -- why?
+ ^
+trait_fields_conflicts.scala:23: error: overriding lazy value x in trait Lazy of type Int;
+ method x needs to be a stable, immutable value
+trait DefForLazyOvr extends Lazy { override def x: Int = 1 } // bad override -- why?
+ ^
+trait_fields_conflicts.scala:25: error: overriding value x in trait Val of type Int;
+ value x needs `override' modifier
+class CValForVal extends Val { val x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:26: error: overriding value x in trait Val of type Int;
+ variable x needs `override' modifier
+class CVarForVal extends Val { var x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:27: error: overriding value x in trait Val of type Int;
+ method x needs `override' modifier
+class CDefForVal extends Val { def x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:28: error: overriding variable x in trait Var of type Int;
+ value x needs `override' modifier
+class CValForVar extends Var { val x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:29: error: overriding variable x in trait Var of type Int;
+ variable x needs `override' modifier
+class CVarForVar extends Var { var x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:30: error: overriding variable x in trait Var of type Int;
+ method x needs `override' modifier
+class CDefForVar extends Var { def x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:31: error: overriding lazy value x in trait Lazy of type Int;
+ value x needs `override' modifier
+class CValForLazy extends Lazy { val x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:32: error: overriding lazy value x in trait Lazy of type Int;
+ variable x needs `override' modifier
+class CVarForLazy extends Lazy { var x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:33: error: overriding lazy value x in trait Lazy of type Int;
+ method x needs `override' modifier
+class CDefForLazy extends Lazy { def x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:36: error: overriding value x in trait Val of type Int;
+ variable x needs to be a stable, immutable value
+class CVarForValOvr extends Val { override var x: Int = 1 } // bad override
+ ^
+trait_fields_conflicts.scala:37: error: overriding value x in trait Val of type Int;
+ method x needs to be a stable, immutable value
+class CDefForValOvr extends Val { override def x: Int = 1 } // bad override
+ ^
+trait_fields_conflicts.scala:38: error: overriding variable x in trait Var of type Int;
+ value x cannot override a mutable variable
+class CValForVarOvr extends Var { override val x: Int = 1 } // bad override -- unsound if used in path and var changes
+ ^
+trait_fields_conflicts.scala:39: error: overriding variable x in trait Var of type Int;
+ variable x cannot override a mutable variable
+class CVarForVarOvr extends Var { override var x: Int = 1 } // bad override -- why?
+ ^
+trait_fields_conflicts.scala:40: error: overriding variable x in trait Var of type Int;
+ method x cannot override a mutable variable
+class CDefForVarOvr extends Var { override def x: Int = 1 } // bad override -- why?
+ ^
+trait_fields_conflicts.scala:41: error: overriding lazy value x in trait Lazy of type Int;
+ value x must be declared lazy to override a concrete lazy value
+class CValForLazyOvr extends Lazy { override val x: Int = 1 } // bad override -- why?
+ ^
+trait_fields_conflicts.scala:42: error: overriding lazy value x in trait Lazy of type Int;
+ variable x needs to be a stable, immutable value
+class CVarForLazyOvr extends Lazy { override var x: Int = 1 } // bad override -- why?
+ ^
+trait_fields_conflicts.scala:43: error: overriding lazy value x in trait Lazy of type Int;
+ method x needs to be a stable, immutable value
+class CDefForLazyOvr extends Lazy { override def x: Int = 1 } // bad override -- why?
+ ^
+trait_fields_conflicts.scala:49: error: overriding value x in class CVal of type Int;
+ value x needs `override' modifier
+trait ValForCVal extends CVal { val x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:50: error: overriding value x in class CVal of type Int;
+ variable x needs `override' modifier
+trait VarForCVal extends CVal { var x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:51: error: overriding value x in class CVal of type Int;
+ method x needs `override' modifier
+trait DefForCVal extends CVal { def x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:52: error: overriding variable x in class CVar of type Int;
+ value x needs `override' modifier
+trait ValForCVar extends CVar { val x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:53: error: overriding variable x in class CVar of type Int;
+ variable x needs `override' modifier
+trait VarForCVar extends CVar { var x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:54: error: overriding variable x in class CVar of type Int;
+ method x needs `override' modifier
+trait DefForCVar extends CVar { def x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:55: error: overriding lazy value x in class CLazy of type Int;
+ value x needs `override' modifier
+trait ValForCLazy extends CLazy { val x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:56: error: overriding lazy value x in class CLazy of type Int;
+ variable x needs `override' modifier
+trait VarForCLazy extends CLazy { var x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:57: error: overriding lazy value x in class CLazy of type Int;
+ method x needs `override' modifier
+trait DefForCLazy extends CLazy { def x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:60: error: overriding value x in class CVal of type Int;
+ variable x needs to be a stable, immutable value
+trait VarForCValOvr extends CVal { override var x: Int = 1 } // bad override
+ ^
+trait_fields_conflicts.scala:61: error: overriding value x in class CVal of type Int;
+ method x needs to be a stable, immutable value
+trait DefForCValOvr extends CVal { override def x: Int = 1 } // bad override
+ ^
+trait_fields_conflicts.scala:62: error: overriding variable x in class CVar of type Int;
+ value x cannot override a mutable variable
+trait ValForCVarOvr extends CVar { override val x: Int = 1 } // bad override -- unsound if used in path and var changes
+ ^
+trait_fields_conflicts.scala:63: error: overriding variable x in class CVar of type Int;
+ variable x cannot override a mutable variable
+trait VarForCVarOvr extends CVar { override var x: Int = 1 } // bad override -- why?
+ ^
+trait_fields_conflicts.scala:64: error: overriding variable x in class CVar of type Int;
+ method x cannot override a mutable variable
+trait DefForCVarOvr extends CVar { override def x: Int = 1 } // bad override -- why?
+ ^
+trait_fields_conflicts.scala:65: error: overriding lazy value x in class CLazy of type Int;
+ value x must be declared lazy to override a concrete lazy value
+trait ValForCLazyOvr extends CLazy { override val x: Int = 1 } // bad override -- why?
+ ^
+trait_fields_conflicts.scala:66: error: overriding lazy value x in class CLazy of type Int;
+ variable x needs to be a stable, immutable value
+trait VarForCLazyOvr extends CLazy { override var x: Int = 1 } // bad override -- why?
+ ^
+trait_fields_conflicts.scala:67: error: overriding lazy value x in class CLazy of type Int;
+ method x needs to be a stable, immutable value
+trait DefForCLazyOvr extends CLazy { override def x: Int = 1 } // bad override -- why?
+ ^
+trait_fields_conflicts.scala:69: error: overriding value x in class CVal of type Int;
+ value x needs `override' modifier
+class CValForCVal extends CVal { val x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:70: error: overriding value x in class CVal of type Int;
+ variable x needs `override' modifier
+class CVarForCVal extends CVal { var x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:71: error: overriding value x in class CVal of type Int;
+ method x needs `override' modifier
+class CDefForCVal extends CVal { def x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:72: error: overriding variable x in class CVar of type Int;
+ value x needs `override' modifier
+class CValForCVar extends CVar { val x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:73: error: overriding variable x in class CVar of type Int;
+ variable x needs `override' modifier
+class CVarForCVar extends CVar { var x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:74: error: overriding variable x in class CVar of type Int;
+ method x needs `override' modifier
+class CDefForCVar extends CVar { def x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:75: error: overriding lazy value x in class CLazy of type Int;
+ value x needs `override' modifier
+class CValForCLazy extends CLazy { val x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:76: error: overriding lazy value x in class CLazy of type Int;
+ variable x needs `override' modifier
+class CVarForCLazy extends CLazy { var x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:77: error: overriding lazy value x in class CLazy of type Int;
+ method x needs `override' modifier
+class CDefForCLazy extends CLazy { def x: Int = 1 } // needs override
+ ^
+trait_fields_conflicts.scala:80: error: overriding value x in class CVal of type Int;
+ variable x needs to be a stable, immutable value
+class CVarForCValOvr extends CVal { override var x: Int = 1 } // bad override
+ ^
+trait_fields_conflicts.scala:81: error: overriding value x in class CVal of type Int;
+ method x needs to be a stable, immutable value
+class CDefForCValOvr extends CVal { override def x: Int = 1 } // bad override
+ ^
+trait_fields_conflicts.scala:82: error: overriding variable x in class CVar of type Int;
+ value x cannot override a mutable variable
+class CValForCVarOvr extends CVar { override val x: Int = 1 } // bad override -- unsound if used in path and var changes
+ ^
+trait_fields_conflicts.scala:83: error: overriding variable x in class CVar of type Int;
+ variable x cannot override a mutable variable
+class CVarForCVarOvr extends CVar { override var x: Int = 1 } // bad override -- why?
+ ^
+trait_fields_conflicts.scala:84: error: overriding variable x in class CVar of type Int;
+ method x cannot override a mutable variable
+class CDefForCVarOvr extends CVar { override def x: Int = 1 } // bad override -- why?
+ ^
+trait_fields_conflicts.scala:85: error: overriding lazy value x in class CLazy of type Int;
+ value x must be declared lazy to override a concrete lazy value
+class CValForCLazyOvr extends CLazy { override val x: Int = 1 } // bad override -- why?
+ ^
+trait_fields_conflicts.scala:86: error: overriding lazy value x in class CLazy of type Int;
+ variable x needs to be a stable, immutable value
+class CVarForCLazyOvr extends CLazy { override var x: Int = 1 } // bad override -- why?
+ ^
+trait_fields_conflicts.scala:87: error: overriding lazy value x in class CLazy of type Int;
+ method x needs to be a stable, immutable value
+class CDefForCLazyOvr extends CLazy { override def x: Int = 1 } // bad override -- why?
+ ^
+68 errors found
diff --git a/test/files/neg/trait_fields_conflicts.scala b/test/files/neg/trait_fields_conflicts.scala
new file mode 100644
index 0000000000..92fc106e44
--- /dev/null
+++ b/test/files/neg/trait_fields_conflicts.scala
@@ -0,0 +1,87 @@
+trait Val { val x: Int = 123 }
+trait Var { var x: Int = 123 }
+trait Lazy { lazy val x: Int = 123 }
+
+trait ValForVal extends Val { val x: Int = 1 } // needs override
+trait VarForVal extends Val { var x: Int = 1 } // needs override
+trait DefForVal extends Val { def x: Int = 1 } // needs override
+trait ValForVar extends Var { val x: Int = 1 } // needs override
+trait VarForVar extends Var { var x: Int = 1 } // needs override
+trait DefForVar extends Var { def x: Int = 1 } // needs override
+trait ValForLazy extends Lazy { val x: Int = 1 } // needs override
+trait VarForLazy extends Lazy { var x: Int = 1 } // needs override
+trait DefForLazy extends Lazy { def x: Int = 1 } // needs override
+
+trait ValForValOvr extends Val { override val x: Int = 1 } // override ok
+trait VarForValOvr extends Val { override var x: Int = 1 } // bad override
+trait DefForValOvr extends Val { override def x: Int = 1 } // bad override
+trait ValForVarOvr extends Var { override val x: Int = 1 } // bad override -- unsound if used in path and var changes
+trait VarForVarOvr extends Var { override var x: Int = 1 } // bad override -- why?
+trait DefForVarOvr extends Var { override def x: Int = 1 } // bad override -- why?
+trait ValForLazyOvr extends Lazy { override val x: Int = 1 } // bad override -- why?
+trait VarForLazyOvr extends Lazy { override var x: Int = 1 } // bad override -- why?
+trait DefForLazyOvr extends Lazy { override def x: Int = 1 } // bad override -- why?
+
+class CValForVal extends Val { val x: Int = 1 } // needs override
+class CVarForVal extends Val { var x: Int = 1 } // needs override
+class CDefForVal extends Val { def x: Int = 1 } // needs override
+class CValForVar extends Var { val x: Int = 1 } // needs override
+class CVarForVar extends Var { var x: Int = 1 } // needs override
+class CDefForVar extends Var { def x: Int = 1 } // needs override
+class CValForLazy extends Lazy { val x: Int = 1 } // needs override
+class CVarForLazy extends Lazy { var x: Int = 1 } // needs override
+class CDefForLazy extends Lazy { def x: Int = 1 } // needs override
+
+class CValForValOvr extends Val { override val x: Int = 1 } // override ok
+class CVarForValOvr extends Val { override var x: Int = 1 } // bad override
+class CDefForValOvr extends Val { override def x: Int = 1 } // bad override
+class CValForVarOvr extends Var { override val x: Int = 1 } // bad override -- unsound if used in path and var changes
+class CVarForVarOvr extends Var { override var x: Int = 1 } // bad override -- why?
+class CDefForVarOvr extends Var { override def x: Int = 1 } // bad override -- why?
+class CValForLazyOvr extends Lazy { override val x: Int = 1 } // bad override -- why?
+class CVarForLazyOvr extends Lazy { override var x: Int = 1 } // bad override -- why?
+class CDefForLazyOvr extends Lazy { override def x: Int = 1 } // bad override -- why?
+
+class CVal { val x: Int = 123 }
+class CVar { var x: Int = 123 }
+class CLazy { lazy val x: Int = 123 }
+
+trait ValForCVal extends CVal { val x: Int = 1 } // needs override
+trait VarForCVal extends CVal { var x: Int = 1 } // needs override
+trait DefForCVal extends CVal { def x: Int = 1 } // needs override
+trait ValForCVar extends CVar { val x: Int = 1 } // needs override
+trait VarForCVar extends CVar { var x: Int = 1 } // needs override
+trait DefForCVar extends CVar { def x: Int = 1 } // needs override
+trait ValForCLazy extends CLazy { val x: Int = 1 } // needs override
+trait VarForCLazy extends CLazy { var x: Int = 1 } // needs override
+trait DefForCLazy extends CLazy { def x: Int = 1 } // needs override
+
+trait ValForCValOvr extends CVal { override val x: Int = 1 } // override ok
+trait VarForCValOvr extends CVal { override var x: Int = 1 } // bad override
+trait DefForCValOvr extends CVal { override def x: Int = 1 } // bad override
+trait ValForCVarOvr extends CVar { override val x: Int = 1 } // bad override -- unsound if used in path and var changes
+trait VarForCVarOvr extends CVar { override var x: Int = 1 } // bad override -- why?
+trait DefForCVarOvr extends CVar { override def x: Int = 1 } // bad override -- why?
+trait ValForCLazyOvr extends CLazy { override val x: Int = 1 } // bad override -- why?
+trait VarForCLazyOvr extends CLazy { override var x: Int = 1 } // bad override -- why?
+trait DefForCLazyOvr extends CLazy { override def x: Int = 1 } // bad override -- why?
+
+class CValForCVal extends CVal { val x: Int = 1 } // needs override
+class CVarForCVal extends CVal { var x: Int = 1 } // needs override
+class CDefForCVal extends CVal { def x: Int = 1 } // needs override
+class CValForCVar extends CVar { val x: Int = 1 } // needs override
+class CVarForCVar extends CVar { var x: Int = 1 } // needs override
+class CDefForCVar extends CVar { def x: Int = 1 } // needs override
+class CValForCLazy extends CLazy { val x: Int = 1 } // needs override
+class CVarForCLazy extends CLazy { var x: Int = 1 } // needs override
+class CDefForCLazy extends CLazy { def x: Int = 1 } // needs override
+
+class CValForCValOvr extends CVal { override val x: Int = 1 } // override ok
+class CVarForCValOvr extends CVal { override var x: Int = 1 } // bad override
+class CDefForCValOvr extends CVal { override def x: Int = 1 } // bad override
+class CValForCVarOvr extends CVar { override val x: Int = 1 } // bad override -- unsound if used in path and var changes
+class CVarForCVarOvr extends CVar { override var x: Int = 1 } // bad override -- why?
+class CDefForCVarOvr extends CVar { override def x: Int = 1 } // bad override -- why?
+class CValForCLazyOvr extends CLazy { override val x: Int = 1 } // bad override -- why?
+class CVarForCLazyOvr extends CLazy { override var x: Int = 1 } // bad override -- why?
+class CDefForCLazyOvr extends CLazy { override def x: Int = 1 } // bad override -- why?
diff --git a/test/files/neg/trait_fields_deprecated_overriding.check b/test/files/neg/trait_fields_deprecated_overriding.check
new file mode 100644
index 0000000000..89dfa5c295
--- /dev/null
+++ b/test/files/neg/trait_fields_deprecated_overriding.check
@@ -0,0 +1,6 @@
+trait_fields_deprecated_overriding.scala:8: warning: overriding value x in trait DeprecatedOverriding is deprecated
+ override val x = 2
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/trait_fields_deprecated_overriding.flags b/test/files/neg/trait_fields_deprecated_overriding.flags
new file mode 100644
index 0000000000..c6bfaf1f64
--- /dev/null
+++ b/test/files/neg/trait_fields_deprecated_overriding.flags
@@ -0,0 +1 @@
+-deprecation -Xfatal-warnings
diff --git a/test/files/neg/trait_fields_deprecated_overriding.scala b/test/files/neg/trait_fields_deprecated_overriding.scala
new file mode 100644
index 0000000000..e7d722c92f
--- /dev/null
+++ b/test/files/neg/trait_fields_deprecated_overriding.scala
@@ -0,0 +1,11 @@
+package scala
+
+trait DeprecatedOverriding {
+ @deprecatedOverriding val x = 1
+}
+
+class COverride extends DeprecatedOverriding {
+ override val x = 2
+}
+
+class CSynthImpl extends DeprecatedOverriding \ No newline at end of file
diff --git a/test/files/neg/trait_fields_var_override.check b/test/files/neg/trait_fields_var_override.check
new file mode 100644
index 0000000000..7245c78b09
--- /dev/null
+++ b/test/files/neg/trait_fields_var_override.check
@@ -0,0 +1,5 @@
+trait_fields_var_override.scala:2: error: overriding variable end in trait SizeChangeEvent of type Int;
+ variable end cannot override a mutable variable
+class BackedUpListIterator[E](override protected var end: Int) extends SizeChangeEvent
+ ^
+one error found
diff --git a/test/files/neg/trait_fields_var_override.scala b/test/files/neg/trait_fields_var_override.scala
new file mode 100644
index 0000000000..f61ba09eec
--- /dev/null
+++ b/test/files/neg/trait_fields_var_override.scala
@@ -0,0 +1,2 @@
+trait SizeChangeEvent { protected var end: Int = 1 }
+class BackedUpListIterator[E](override protected var end: Int) extends SizeChangeEvent
diff --git a/test/files/neg/type-diagnostics.check b/test/files/neg/type-diagnostics.check
index c5e6dec3f8..fd327bcb66 100644
--- a/test/files/neg/type-diagnostics.check
+++ b/test/files/neg/type-diagnostics.check
@@ -1,6 +1,6 @@
type-diagnostics.scala:4: error: type mismatch;
- found : scala.collection.Set[String]
- required: scala.collection.immutable.Set[String]
+ found : Set[String] (in scala.collection)
+ required: Set[String] (in scala.collection.immutable)
def f = Calculator("Hello", binding.keySet: collection.Set[String])
^
type-diagnostics.scala:13: error: type mismatch;
diff --git a/test/files/neg/unit-returns-value.check b/test/files/neg/unit-returns-value.check
index f30a506ebe..7ebfbfde29 100644
--- a/test/files/neg/unit-returns-value.check
+++ b/test/files/neg/unit-returns-value.check
@@ -1,13 +1,13 @@
-unit-returns-value.scala:4: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+unit-returns-value.scala:4: warning: a pure expression does nothing in statement position
if (b) return 5
^
unit-returns-value.scala:4: warning: enclosing method f has result type Unit: return value discarded
if (b) return 5
^
-unit-returns-value.scala:22: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+unit-returns-value.scala:22: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
i1 // warn
^
-unit-returns-value.scala:23: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+unit-returns-value.scala:23: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
i2 // warn
^
error: No warnings can be incurred under -Xfatal-warnings.
diff --git a/test/files/neg/userdefined_apply.flags b/test/files/neg/userdefined_apply.flags
deleted file mode 100644
index 0acce1e7ce..0000000000
--- a/test/files/neg/userdefined_apply.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xsource:2.12
diff --git a/test/files/neg/val_infer.check b/test/files/neg/val_infer.check
new file mode 100644
index 0000000000..711450add9
--- /dev/null
+++ b/test/files/neg/val_infer.check
@@ -0,0 +1,6 @@
+val_infer.scala:3: error: type mismatch;
+ found : String("")
+ required: Int
+ trait Sub extends Base { def foo = "" }
+ ^
+one error found
diff --git a/test/files/neg/val_infer.scala b/test/files/neg/val_infer.scala
new file mode 100644
index 0000000000..7fe8393749
--- /dev/null
+++ b/test/files/neg/val_infer.scala
@@ -0,0 +1,4 @@
+class Test {
+ trait Base { def foo: Int }
+ trait Sub extends Base { def foo = "" }
+} \ No newline at end of file
diff --git a/test/files/neg/val_sig_infer_match.check b/test/files/neg/val_sig_infer_match.check
new file mode 100644
index 0000000000..704c99cf84
--- /dev/null
+++ b/test/files/neg/val_sig_infer_match.check
@@ -0,0 +1,4 @@
+val_sig_infer_match.scala:21: error: value y is not a member of A
+ def m = f.y // doesn't compile anymore
+ ^
+one error found
diff --git a/test/files/neg/val_sig_infer_match.scala b/test/files/neg/val_sig_infer_match.scala
new file mode 100644
index 0000000000..fb8aa66d56
--- /dev/null
+++ b/test/files/neg/val_sig_infer_match.scala
@@ -0,0 +1,22 @@
+class A
+
+class B extends A {
+ def y: Int = 0
+}
+
+class B1 extends B
+class B2 extends B
+
+class C {
+ def f: A = null
+}
+
+class D extends C {
+ def s = ""
+ override final val f = s match {
+ case "" => new B1
+ case _ => new B2
+ }
+
+ def m = f.y // doesn't compile anymore
+} \ No newline at end of file
diff --git a/test/files/neg/val_sig_infer_struct.check b/test/files/neg/val_sig_infer_struct.check
new file mode 100644
index 0000000000..26efbbc3f4
--- /dev/null
+++ b/test/files/neg/val_sig_infer_struct.check
@@ -0,0 +1,4 @@
+val_sig_infer_struct.scala:7: error: value foo is not a member of Object
+ def bar = f.foo
+ ^
+one error found
diff --git a/test/files/neg/val_sig_infer_struct.scala b/test/files/neg/val_sig_infer_struct.scala
new file mode 100644
index 0000000000..e88340337c
--- /dev/null
+++ b/test/files/neg/val_sig_infer_struct.scala
@@ -0,0 +1,8 @@
+class C {
+ def f: Object = this
+}
+
+class D extends C {
+ override val f = new Object { def foo = 1 }
+ def bar = f.foo
+} \ No newline at end of file
diff --git a/test/files/neg/variances.check b/test/files/neg/variances.check
index cb1a60a632..3c1545a375 100644
--- a/test/files/neg/variances.check
+++ b/test/files/neg/variances.check
@@ -19,7 +19,7 @@ variances.scala:74: error: covariant type A occurs in contravariant position in
variances.scala:89: error: covariant type T occurs in invariant position in type T of type A
type A = T
^
-variances.scala:90: error: covariant type T occurs in contravariant position in type => test.TestAlias.B[C.this.A] of method foo
+variances.scala:90: error: covariant type A occurs in contravariant position in type => test.TestAlias.B[C.this.A] of method foo
def foo: B[A]
^
8 errors found
diff --git a/test/files/neg/warn-inferred-any.check b/test/files/neg/warn-inferred-any.check
index 8ad81d1529..2b321a83c9 100644
--- a/test/files/neg/warn-inferred-any.check
+++ b/test/files/neg/warn-inferred-any.check
@@ -9,7 +9,7 @@ warn-inferred-any.scala:17: warning: a type was inferred to be `AnyVal`; this ma
^
warn-inferred-any.scala:25: warning: a type was inferred to be `Any`; this may indicate a programming error.
def za = f(1, "one")
- ^
+ ^
error: No warnings can be incurred under -Xfatal-warnings.
four warnings found
one error found
diff --git a/test/files/neg/warn-unused-implicits.check b/test/files/neg/warn-unused-implicits.check
new file mode 100644
index 0000000000..4cc5836800
--- /dev/null
+++ b/test/files/neg/warn-unused-implicits.check
@@ -0,0 +1,9 @@
+warn-unused-implicits.scala:11: warning: parameter value s in method f is never used
+ )(implicit s: String): Int = { // warn
+ ^
+warn-unused-implicits.scala:31: warning: parameter value s in method i is never used
+ def i(implicit s: String, t: Int) = t // yes, warn
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+two warnings found
+one error found
diff --git a/test/files/neg/warn-unused-implicits.flags b/test/files/neg/warn-unused-implicits.flags
new file mode 100644
index 0000000000..18169f3218
--- /dev/null
+++ b/test/files/neg/warn-unused-implicits.flags
@@ -0,0 +1 @@
+-Ywarn-unused:implicits -Xfatal-warnings
diff --git a/test/files/neg/warn-unused-implicits.scala b/test/files/neg/warn-unused-implicits.scala
new file mode 100644
index 0000000000..54f924eac0
--- /dev/null
+++ b/test/files/neg/warn-unused-implicits.scala
@@ -0,0 +1,32 @@
+
+trait InterFace {
+ /** Call something. */
+ def call(a: Int, b: String, c: Double)(implicit s: String): Int
+}
+
+trait BadAPI extends InterFace {
+ def f(a: Int,
+ b: String,
+ c: Double
+ )(implicit s: String): Int = { // warn
+ println(b + c)
+ a
+ }
+ @deprecated ("no warn in deprecated API", since="yesterday")
+ def g(a: Int,
+ b: String,
+ c: Double
+ )(implicit s: String): Int = { // no warn
+ println(b + c)
+ a
+ }
+ override def call(a: Int,
+ b: String,
+ c: Double
+ )(implicit s: String): Int = { // no warn, required by superclass
+ println(b + c)
+ a
+ }
+
+ def i(implicit s: String, t: Int) = t // yes, warn
+}
diff --git a/test/files/neg/warn-unused-imports.check b/test/files/neg/warn-unused-imports.check
index 0a53d7a9cd..29d73a6264 100644
--- a/test/files/neg/warn-unused-imports.check
+++ b/test/files/neg/warn-unused-imports.check
@@ -51,5 +51,8 @@ warn-unused-imports_2.scala:149: warning: Unused import
warn-unused-imports_2.scala:150: warning: Unused import
import p1.A // warn
^
-16 warnings found
+warn-unused-imports_2.scala:158: warning: Unused import
+ def x = Macro.f // warn, not crash
+ ^
+17 warnings found
one error found
diff --git a/test/files/neg/warn-unused-imports.flags b/test/files/neg/warn-unused-imports.flags
index 24db705df1..c4e11e7fe7 100644
--- a/test/files/neg/warn-unused-imports.flags
+++ b/test/files/neg/warn-unused-imports.flags
@@ -1 +1 @@
--Xfatal-warnings -Ywarn-unused-import
+-Xfatal-warnings -Ywarn-unused:imports
diff --git a/test/files/neg/warn-unused-imports/sample_1.scala b/test/files/neg/warn-unused-imports/sample_1.scala
index d2f86239db..eea4d0eb4c 100644
--- a/test/files/neg/warn-unused-imports/sample_1.scala
+++ b/test/files/neg/warn-unused-imports/sample_1.scala
@@ -15,3 +15,18 @@ object Sample {
def f(x: X) = ???
def g(y: Y) = ???
}
+
+import scala.language.experimental.macros
+import scala.reflect.macros.blackbox.Context
+
+object Macro {
+ def f: Int = macro fImpl
+ def fImpl(c: Context): c.Tree = {
+ import c.universe._
+
+ q"""
+ import scala.util.Random
+ 42 // TODO randomize
+ """
+ }
+}
diff --git a/test/files/neg/warn-unused-imports/warn-unused-imports_2.scala b/test/files/neg/warn-unused-imports/warn-unused-imports_2.scala
index ded1186209..58fe0131d9 100644
--- a/test/files/neg/warn-unused-imports/warn-unused-imports_2.scala
+++ b/test/files/neg/warn-unused-imports/warn-unused-imports_2.scala
@@ -96,7 +96,7 @@ trait Warn {
trait Nested {
{
import p1._ // warn
- trait Warn { // warn about unused local trait for good measure
+ trait Warn { // don't warn about unused local trait with -Ywarn-unused:imports
import p2._
println(new A)
println("abc".bippy)
@@ -153,3 +153,7 @@ trait Outsiders {
//Future("abc".bippy)
}
}
+
+class MacroClient {
+ def x = Macro.f // warn, not crash
+}
diff --git a/test/files/neg/warn-unused-params.check b/test/files/neg/warn-unused-params.check
new file mode 100644
index 0000000000..373417ce08
--- /dev/null
+++ b/test/files/neg/warn-unused-params.check
@@ -0,0 +1,18 @@
+warn-unused-params.scala:9: warning: parameter value b in method f is never used
+ b: String, // warn
+ ^
+warn-unused-params.scala:32: warning: parameter value s in method i is never used
+ def i(implicit s: String) = 42 // yes, warn
+ ^
+warn-unused-params.scala:49: warning: parameter value u in class Unusing is never used
+class Unusing(u: Int) { // warn
+ ^
+warn-unused-params.scala:59: warning: parameter value s in class CaseyAtTheBat is never used
+case class CaseyAtTheBat(k: Int)(s: String) // warn
+ ^
+warn-unused-params.scala:62: warning: parameter value readResolve in method f is never used
+ def f(readResolve: Int) = 42 // warn
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+5 warnings found
+one error found
diff --git a/test/files/neg/warn-unused-params.flags b/test/files/neg/warn-unused-params.flags
new file mode 100644
index 0000000000..795fb74272
--- /dev/null
+++ b/test/files/neg/warn-unused-params.flags
@@ -0,0 +1 @@
+-Ywarn-unused:params -Xfatal-warnings
diff --git a/test/files/neg/warn-unused-params.scala b/test/files/neg/warn-unused-params.scala
new file mode 100644
index 0000000000..b166e8fae6
--- /dev/null
+++ b/test/files/neg/warn-unused-params.scala
@@ -0,0 +1,69 @@
+
+trait InterFace {
+ /** Call something. */
+ def call(a: Int, b: String, c: Double): Int
+}
+
+trait BadAPI extends InterFace {
+ def f(a: Int,
+ b: String, // warn
+ c: Double): Int = {
+ println(c)
+ a
+ }
+ @deprecated ("no warn in deprecated API", since="yesterday")
+ def g(a: Int,
+ b: String, // no warn
+ c: Double): Int = {
+ println(c)
+ a
+ }
+ override def call(a: Int,
+ b: String, // no warn, required by superclass
+ c: Double): Int = {
+ println(c)
+ a
+ }
+
+ def meth(x: Int) = x
+
+ override def equals(other: Any): Boolean = true // no warn
+
+ def i(implicit s: String) = 42 // yes, warn
+
+ /*
+ def future(x: Int): Int = {
+ val y = 42
+ val x = y // maybe option to warn only if shadowed
+ x
+ }
+ */
+}
+
+// mustn't alter warnings in super
+trait PoorClient extends BadAPI {
+ override def meth(x: Int) = ??? // no warn
+ override def f(a: Int, b: String, c: Double): Int = a + b.toInt + c.toInt
+}
+
+class Unusing(u: Int) { // warn
+ def f = ???
+}
+
+class Valuing(val u: Int) // no warn
+
+class Revaluing(u: Int) { def f = u } // no warn
+
+case class CaseyKasem(k: Int) // no warn
+
+case class CaseyAtTheBat(k: Int)(s: String) // warn
+
+trait Ignorance {
+ def f(readResolve: Int) = 42 // warn
+}
+
+class Reusing(u: Int) extends Unusing(u) // no warn
+
+class Main {
+ def main(args: Array[String]): Unit = println("hello, args") // no warn
+}
diff --git a/test/files/neg/warn-unused-patvars.check b/test/files/neg/warn-unused-patvars.check
new file mode 100644
index 0000000000..2665126a36
--- /dev/null
+++ b/test/files/neg/warn-unused-patvars.check
@@ -0,0 +1,12 @@
+warn-unused-patvars.scala:9: warning: private val x in trait Boundings is never used
+ private val x = 42 // warn, sanity check
+ ^
+warn-unused-patvars.scala:28: warning: local val x in method v is never used
+ val D(x) = d // warn, fixme
+ ^
+warn-unused-patvars.scala:32: warning: local val x in method w is never used
+ val D(x @ _) = d // warn, fixme (valdef pos is different)
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+three warnings found
+one error found
diff --git a/test/files/neg/warn-unused-patvars.flags b/test/files/neg/warn-unused-patvars.flags
new file mode 100644
index 0000000000..d5bd86a658
--- /dev/null
+++ b/test/files/neg/warn-unused-patvars.flags
@@ -0,0 +1 @@
+-Ywarn-unused:-patvars,_ -Xfatal-warnings
diff --git a/test/files/neg/warn-unused-patvars.scala b/test/files/neg/warn-unused-patvars.scala
new file mode 100644
index 0000000000..3d35dfedd6
--- /dev/null
+++ b/test/files/neg/warn-unused-patvars.scala
@@ -0,0 +1,53 @@
+
+// verify no warning when -Ywarn-unused:-patvars
+
+case class C(a: Int, b: String, c: Option[String])
+case class D(a: Int)
+
+trait Boundings {
+
+ private val x = 42 // warn, sanity check
+
+ def c = C(42, "hello", Some("world"))
+ def d = D(42)
+
+ def f() = {
+ val C(x, y, Some(z)) = c // no warn
+ 17
+ }
+ def g() = {
+ val C(x @ _, y @ _, Some(z @ _)) = c // no warn
+ 17
+ }
+ def h() = {
+ val C(x @ _, y @ _, z @ Some(_)) = c // no warn for z?
+ 17
+ }
+
+ def v() = {
+ val D(x) = d // warn, fixme
+ 17
+ }
+ def w() = {
+ val D(x @ _) = d // warn, fixme (valdef pos is different)
+ 17
+ }
+
+}
+
+trait Forever {
+ def f = {
+ val t = Option((17, 42))
+ for {
+ ns <- t
+ (i, j) = ns // no warn
+ } yield (i + j)
+ }
+ def g = {
+ val t = Option((17, 42))
+ for {
+ ns <- t
+ (i, j) = ns // no warn
+ } yield 42
+ }
+}
diff --git a/test/files/neg/warn-unused-privates.check b/test/files/neg/warn-unused-privates.check
index 4876ed8fc2..2a88d3e6c3 100644
--- a/test/files/neg/warn-unused-privates.check
+++ b/test/files/neg/warn-unused-privates.check
@@ -1,69 +1,120 @@
warn-unused-privates.scala:2: warning: private constructor in class Bippy is never used
private def this(c: Int) = this(c, c) // warn
^
-warn-unused-privates.scala:4: warning: private method in class Bippy is never used
+warn-unused-privates.scala:4: warning: private method boop in class Bippy is never used
private def boop(x: Int) = x+a+b // warn
^
-warn-unused-privates.scala:6: warning: private val in class Bippy is never used
+warn-unused-privates.scala:6: warning: private val MILLIS2 in class Bippy is never used
final private val MILLIS2: Int = 1000 // warn
^
-warn-unused-privates.scala:13: warning: private val in object Bippy is never used
+warn-unused-privates.scala:13: warning: private val HEY_INSTANCE in object Bippy is never used
private val HEY_INSTANCE: Int = 1000 // warn
^
-warn-unused-privates.scala:14: warning: private val in object Bippy is never used
+warn-unused-privates.scala:14: warning: private val BOOL in object Bippy is never used
private lazy val BOOL: Boolean = true // warn
^
-warn-unused-privates.scala:36: warning: private val in class Boppy is never used
+warn-unused-privates.scala:36: warning: private val hummer in class Boppy is never used
private val hummer = "def" // warn
^
-warn-unused-privates.scala:43: warning: private var in trait Accessors is never used
+warn-unused-privates.scala:43: warning: private var v1 in trait Accessors is never used
private var v1: Int = 0 // warn
^
-warn-unused-privates.scala:43: warning: private setter in trait Accessors is never used
- private var v1: Int = 0 // warn
- ^
-warn-unused-privates.scala:44: warning: private setter in trait Accessors is never used
+warn-unused-privates.scala:44: warning: private var v2 in trait Accessors is never used
private var v2: Int = 0 // warn, never set
^
-warn-unused-privates.scala:45: warning: private var in trait Accessors is never used
+warn-unused-privates.scala:45: warning: private var v3 in trait Accessors is never used
private var v3: Int = 0 // warn, never got
^
-warn-unused-privates.scala:57: warning: private default argument in trait DefaultArgs is never used
+warn-unused-privates.scala:56: warning: private var s1 in class StableAccessors is never used
+ private var s1: Int = 0 // warn
+ ^
+warn-unused-privates.scala:57: warning: private setter of s2 in class StableAccessors is never used
+ private var s2: Int = 0 // warn, never set
+ ^
+warn-unused-privates.scala:58: warning: private var s3 in class StableAccessors is never used
+ private var s3: Int = 0 // warn, never got
+ ^
+warn-unused-privates.scala:70: warning: private default argument in trait DefaultArgs is never used
private def bippy(x1: Int, x2: Int = 10, x3: Int = 15): Int = x1 + x2 + x3
^
-warn-unused-privates.scala:57: warning: private default argument in trait DefaultArgs is never used
+warn-unused-privates.scala:70: warning: private default argument in trait DefaultArgs is never used
private def bippy(x1: Int, x2: Int = 10, x3: Int = 15): Int = x1 + x2 + x3
^
-warn-unused-privates.scala:68: warning: local var in method f0 is never used
+warn-unused-privates.scala:86: warning: local var x in method f0 is never used
var x = 1 // warn
^
-warn-unused-privates.scala:75: warning: local val in method f1 is never used
+warn-unused-privates.scala:93: warning: local val b in method f1 is never used
val b = new Outer // warn
^
-warn-unused-privates.scala:85: warning: private object in object Types is never used
+warn-unused-privates.scala:103: warning: private object Dongo in object Types is never used
private object Dongo { def f = this } // warn
^
-warn-unused-privates.scala:95: warning: local object in method l1 is never used
+warn-unused-privates.scala:113: warning: local object HiObject in method l1 is never used
object HiObject { def f = this } // warn
^
-warn-unused-privates.scala:79: warning: local var x in method f2 is never set - it could be a val
+warn-unused-privates.scala:136: warning: private method x_= in class OtherNames is never used
+ private def x_=(i: Int): Unit = ???
+ ^
+warn-unused-privates.scala:137: warning: private method x in class OtherNames is never used
+ private def x: Int = 42
+ ^
+warn-unused-privates.scala:138: warning: private method y_= in class OtherNames is never used
+ private def y_=(i: Int): Unit = ???
+ ^
+warn-unused-privates.scala:153: warning: local val x in method f is never used
+ val C(x, y, Some(z)) = c // warn
+ ^
+warn-unused-privates.scala:153: warning: local val y in method f is never used
+ val C(x, y, Some(z)) = c // warn
+ ^
+warn-unused-privates.scala:153: warning: local val z in method f is never used
+ val C(x, y, Some(z)) = c // warn
+ ^
+warn-unused-privates.scala:161: warning: local val z in method h is never used
+ val C(x @ _, y @ _, z @ Some(_)) = c // warn for z?
+ ^
+warn-unused-privates.scala:166: warning: local val x in method v is never used
+ val D(x) = d // warn
+ ^
+warn-unused-privates.scala:170: warning: local val x in method w is never used
+ val D(x @ _) = d // warn, fixme (valdef pos is different)
+ ^
+warn-unused-privates.scala:97: warning: local var x in method f2 is never set: consider using immutable val
var x = 100 // warn about it being a var
^
-warn-unused-privates.scala:86: warning: private class Bar1 in object Types is never used
+warn-unused-privates.scala:104: warning: private class Bar1 in object Types is never used
private class Bar1 // warn
^
-warn-unused-privates.scala:88: warning: private type Alias1 in object Types is never used
+warn-unused-privates.scala:106: warning: private type Alias1 in object Types is never used
private type Alias1 = String // warn
^
-warn-unused-privates.scala:96: warning: local class Hi is never used
+warn-unused-privates.scala:114: warning: local class Hi is never used
class Hi { // warn
^
-warn-unused-privates.scala:100: warning: local class DingDongDoobie is never used
+warn-unused-privates.scala:118: warning: local class DingDongDoobie is never used
class DingDongDoobie // warn
^
-warn-unused-privates.scala:103: warning: local type OtherThing is never used
+warn-unused-privates.scala:121: warning: local type OtherThing is never used
type OtherThing = String // warn
^
+warn-unused-privates.scala:216: warning: private class for your eyes only in object not even using companion privates is never used
+ private implicit class `for your eyes only`(i: Int) { // warn
+ ^
+warn-unused-privates.scala:201: warning: pattern var z in method f is never used; `z@_' suppresses this warning
+ case z => "warn"
+ ^
+warn-unused-privates.scala:208: warning: pattern var z in method f is never used; `z@_' suppresses this warning
+ case Some(z) => "warn"
+ ^
+warn-unused-privates.scala:20: warning: parameter value msg0 in class B3 is never used
+class B3(msg0: String) extends A("msg")
+ ^
+warn-unused-privates.scala:136: warning: parameter value i in method x_= is never used
+ private def x_=(i: Int): Unit = ???
+ ^
+warn-unused-privates.scala:138: warning: parameter value i in method y_= is never used
+ private def y_=(i: Int): Unit = ???
+ ^
error: No warnings can be incurred under -Xfatal-warnings.
-22 warnings found
+39 warnings found
one error found
diff --git a/test/files/neg/warn-unused-privates.scala b/test/files/neg/warn-unused-privates.scala
index 2eda280d40..f7640927fb 100644
--- a/test/files/neg/warn-unused-privates.scala
+++ b/test/files/neg/warn-unused-privates.scala
@@ -52,6 +52,19 @@ trait Accessors {
}
}
+class StableAccessors {
+ private var s1: Int = 0 // warn
+ private var s2: Int = 0 // warn, never set
+ private var s3: Int = 0 // warn, never got
+ private var s4: Int = 0 // no warn
+
+ def bippy(): Int = {
+ s3 = 5
+ s4 = 6
+ s2 + s4
+ }
+}
+
trait DefaultArgs {
// warn about default getters for x2 and x3
private def bippy(x1: Int, x2: Int = 10, x3: Int = 15): Int = x1 + x2 + x3
@@ -59,6 +72,11 @@ trait DefaultArgs {
def boppy() = bippy(5, 100, 200)
}
+/* SI-7707 Both usages warn default arg because using PrivateRyan.apply, not new.
+case class PrivateRyan private (ryan: Int = 42) { def f = PrivateRyan() }
+object PrivateRyan { def f = PrivateRyan() }
+*/
+
class Outer {
class Inner
}
@@ -104,3 +122,105 @@ object Types {
(new Bippy): Something
}
}
+
+trait Underwarn {
+ def f(): Seq[Int]
+
+ def g() = {
+ val Seq(_, _) = f() // no warn
+ true
+ }
+}
+
+class OtherNames {
+ private def x_=(i: Int): Unit = ???
+ private def x: Int = 42
+ private def y_=(i: Int): Unit = ???
+ private def y: Int = 42
+
+ def f = y
+}
+
+case class C(a: Int, b: String, c: Option[String])
+case class D(a: Int)
+
+trait Boundings {
+
+ def c = C(42, "hello", Some("world"))
+ def d = D(42)
+
+ def f() = {
+ val C(x, y, Some(z)) = c // warn
+ 17
+ }
+ def g() = {
+ val C(x @ _, y @ _, Some(z @ _)) = c // no warn
+ 17
+ }
+ def h() = {
+ val C(x @ _, y @ _, z @ Some(_)) = c // warn for z?
+ 17
+ }
+
+ def v() = {
+ val D(x) = d // warn
+ 17
+ }
+ def w() = {
+ val D(x @ _) = d // warn, fixme (valdef pos is different)
+ 17
+ }
+
+}
+
+trait Forever {
+ def f = {
+ val t = Option((17, 42))
+ for {
+ ns <- t
+ (i, j) = ns // no warn
+ } yield (i + j)
+ }
+ def g = {
+ val t = Option((17, 42))
+ for {
+ ns <- t
+ (i, j) = ns // warn, fixme
+ } yield 42 // val emitted only if needed, hence nothing unused
+ }
+}
+
+trait Ignorance {
+ private val readResolve = 42 // ignore
+}
+
+trait CaseyKasem {
+ def f = 42 match {
+ case x if x < 25 => "no warn"
+ case y if toString.nonEmpty => "no warn" + y
+ case z => "warn"
+ }
+}
+trait CaseyAtTheBat {
+ def f = Option(42) match {
+ case Some(x) if x < 25 => "no warn"
+ case Some(y @ _) if toString.nonEmpty => "no warn"
+ case Some(z) => "warn"
+ case None => "no warn"
+ }
+}
+
+class `not even using companion privates`
+
+object `not even using companion privates` {
+ private implicit class `for your eyes only`(i: Int) { // warn
+ def f = i
+ }
+}
+
+class `no warn in patmat anonfun isDefinedAt` {
+ def f(pf: PartialFunction[String, Int]) = pf("42")
+ def g = f {
+ case s => s.length // no warn (used to warn case s => true in isDefinedAt)
+ }
+}
diff --git a/test/files/pos/MailBox.scala b/test/files/pos/MailBox.scala
index 8e27bd362d..6bb25adb19 100644
--- a/test/files/pos/MailBox.scala
+++ b/test/files/pos/MailBox.scala
@@ -1,6 +1,6 @@
package test;
-import scala.actors.TIMEOUT;
+object TIMEOUT
class MailBox {
diff --git a/test/files/pos/SI-7060.flags b/test/files/pos/SI-7060.flags
deleted file mode 100644
index c926ad6493..0000000000
--- a/test/files/pos/SI-7060.flags
+++ /dev/null
@@ -1 +0,0 @@
--Yinline -Ydead-code
diff --git a/test/files/pos/SI-7060.scala b/test/files/pos/SI-7060.scala
deleted file mode 100644
index c87620e020..0000000000
--- a/test/files/pos/SI-7060.scala
+++ /dev/null
@@ -1,11 +0,0 @@
-object Test {
-
- @inline final def mbarray_apply_minibox(array: Any, tag: Byte): Long =
- if (tag == 0) {
- array.asInstanceOf[Array[Long]](0)
- } else
- array.asInstanceOf[Array[Byte]](0).toLong
-
- def crash_method(): Unit =
- mbarray_apply_minibox(null, 0)
-}
diff --git a/test/files/pos/alladin763.scala b/test/files/pos/alladin763.scala
new file mode 100644
index 0000000000..29c9b25318
--- /dev/null
+++ b/test/files/pos/alladin763.scala
@@ -0,0 +1,37 @@
+// Test from http://lrytz.github.io/scala-aladdin-bugtracker/displayItem.do%3Fid=763.html
+// and expanded with package object variants
+
+
+trait Foo { type T; def apply() : T }
+object e extends Foo { type T = Int; def apply() = 42 }
+
+package p {
+ trait T[X] { def O : { def apply(): X } }
+ object `package` extends T[Int] {
+ def O: { def apply(): Int } = new { def apply(): Int = 42 }
+ }
+
+ object Test {
+ val x: Int = O()
+ }
+}
+
+object Test {
+
+ val f = new Foo { type T = Int; def apply() = 42 }
+
+ def main(args: Array[String]): Unit = {
+ val g = new Foo { type T = Int; def apply() = 42 }
+
+ (e: Foo)()
+ val ee: Int = e()
+
+ (f: Foo)()
+ val ff: Int = f()
+
+ (g: Foo)()
+ val gg: Int = g()
+
+ val pp: Int = p.O()
+ }
+}
diff --git a/test/files/pos/arrays2.scala b/test/files/pos/arrays2.scala
index 795c486e37..b770d21b8a 100644
--- a/test/files/pos/arrays2.scala
+++ b/test/files/pos/arrays2.scala
@@ -17,7 +17,7 @@ object arrays4 {
// #2461
object arrays3 {
- import scala.collection.JavaConversions._
+ import collection.convert.ImplicitConversions._
def apply[X](xs : X*) : java.util.List[X] = java.util.Arrays.asList(xs: _*)
}
diff --git a/test/files/pos/constant-warning.check b/test/files/pos/constant-warning.check
new file mode 100644
index 0000000000..f7df2165d1
--- /dev/null
+++ b/test/files/pos/constant-warning.check
@@ -0,0 +1,4 @@
+constant-warning.scala:2: warning: Evaluation of a constant expression results in an arithmetic error: / by zero
+ val fails = 1 + 2 / (3 - 2 - 1)
+ ^
+one warning found
diff --git a/test/files/pos/constant-warning.flags b/test/files/pos/constant-warning.flags
new file mode 100644
index 0000000000..d00cbbe77b
--- /dev/null
+++ b/test/files/pos/constant-warning.flags
@@ -0,0 +1 @@
+-Xlint:constant
diff --git a/test/files/pos/constant-warning.scala b/test/files/pos/constant-warning.scala
new file mode 100644
index 0000000000..c8ca8823e7
--- /dev/null
+++ b/test/files/pos/constant-warning.scala
@@ -0,0 +1,3 @@
+object Test {
+ val fails = 1 + 2 / (3 - 2 - 1)
+}
diff --git a/test/files/pos/fields_widen_trait_var.scala b/test/files/pos/fields_widen_trait_var.scala
new file mode 100644
index 0000000000..0ea9d9629a
--- /dev/null
+++ b/test/files/pos/fields_widen_trait_var.scala
@@ -0,0 +1,4 @@
+// check that the `var x` below is assigned the type `Int`, and not `Constant(0)`,
+// and that we can assign to it (if it gets a constant type, the `x` in `x = 42`
+// is constant-folded to `0` and we can't find a setter..
+trait C { protected final var x = 0; x = 42 }
diff --git a/test/files/pos/fun_undo_eta.scala b/test/files/pos/fun_undo_eta.scala
new file mode 100644
index 0000000000..466b0e2629
--- /dev/null
+++ b/test/files/pos/fun_undo_eta.scala
@@ -0,0 +1,10 @@
+class Test {
+ def m(i: Int) = i
+
+ def expectWild[A](f: A) = ???
+ def expectFun[A](f: A => Int) = ???
+
+ expectWild((i => m(i))) // manual eta expansion
+ expectWild(m(_)) // have to undo eta expansion with wildcard expected type
+ expectFun(m(_)) // have to undo eta expansion with function expected type
+}
diff --git a/test/files/pos/functions.scala b/test/files/pos/functions.scala
index 0207523dde..25d1c46eac 100644
--- a/test/files/pos/functions.scala
+++ b/test/files/pos/functions.scala
@@ -1,4 +1,6 @@
-import scala.actors.Actor
+object Actor {
+ def receive[A](f: PartialFunction[Any, A]): A = ???
+}
object Test {
diff --git a/test/files/pos/hkgadt.scala b/test/files/pos/hkgadt.scala
index efd7d3df21..5719c752cd 100644
--- a/test/files/pos/hkgadt.scala
+++ b/test/files/pos/hkgadt.scala
@@ -1,18 +1,35 @@
-package test
-
object HKGADT {
sealed trait Foo[F[_]]
final case class Bar() extends Foo[List]
def frob[F[_]](foo: Foo[F]): F[Int] =
foo match {
- case Bar() =>
- List(1)
+ case Bar() => List(1)
+ }
+
+ sealed trait Foo1[F]
+ final case class Bar1() extends Foo1[Int]
+ def frob1[A](foo: Foo1[A]): A = foo match {
+ case Bar1() => 1
+ }
+}
+
+object HKGADT2 {
+ sealed trait Foo[F[_]]
+ final case class Bar() extends Foo[List]
+ final case class Baz() extends Foo[Set]
+
+ def frob[F[_]](foo: Foo[F]): F[Int] =
+ foo match {
+ case Bar() => List(1)
+ case Baz() => Set(1)
}
sealed trait Foo1[F]
final case class Bar1() extends Foo1[Int]
- def frob1[A](foo: Foo1[A]) = foo match {
+ final case class Baz1() extends Foo1[Boolean]
+ def frob1[A](foo: Foo1[A]): A = foo match {
case Bar1() => 1
+ case Baz1() => true
}
}
diff --git a/test/files/presentation/t4287c.flags b/test/files/pos/infer_override_def_args.flags
index d1a8244169..d1a8244169 100644
--- a/test/files/presentation/t4287c.flags
+++ b/test/files/pos/infer_override_def_args.flags
diff --git a/test/files/pos/infer_override_def_args.scala b/test/files/pos/infer_override_def_args.scala
new file mode 100644
index 0000000000..ac10720c81
--- /dev/null
+++ b/test/files/pos/infer_override_def_args.scala
@@ -0,0 +1,5 @@
+abstract class A { def foo(a: Int): A }
+class B extends A {
+ implicit def spackle(x: Int): A = new B
+ def foo(a) = a
+} \ No newline at end of file
diff --git a/test/files/pos/inline-access-levels.flags b/test/files/pos/inline-access-levels.flags
index 882f40f050..faa7d2b186 100644
--- a/test/files/pos/inline-access-levels.flags
+++ b/test/files/pos/inline-access-levels.flags
@@ -1 +1 @@
--optimise -Xfatal-warnings -Yinline-warnings
+-opt:l:classpath -Xfatal-warnings -opt-warnings
diff --git a/test/files/pos/inliner2.flags b/test/files/pos/inliner2.flags
deleted file mode 100644
index ea03113c66..0000000000
--- a/test/files/pos/inliner2.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimise -Xfatal-warnings \ No newline at end of file
diff --git a/test/files/pos/inliner2.scala b/test/files/pos/inliner2.scala
deleted file mode 100644
index bc83e04312..0000000000
--- a/test/files/pos/inliner2.scala
+++ /dev/null
@@ -1,57 +0,0 @@
-// This isn't actually testing much, because no warning is emitted in versions
-// before the fix which comes with this because the method isn't even considered
-// for inlining due to the bug.
-class A {
- private var debug = false
- @inline private def ifelse[T](cond: => Boolean, ifPart: => T, elsePart: => T): T =
- if (cond) ifPart else elsePart
-
- final def bob1() = ifelse(debug, 1, 2)
- final def bob2() = if (debug) 1 else 2
-}
-// Cool:
-//
-// % ls -1 /tmp/2901/
-// A$$anonfun$bob1$1.class
-// A$$anonfun$bob1$2.class
-// A$$anonfun$bob1$3.class
-// A.class
-// % ls -1 /tmp/trunk
-// A.class
-//
-// Observations:
-//
-// (1) The inlined version accesses the field: the explicit one calls the accessor.
-// (2) The inlined version fails to eliminate boxing. With reference types it emits
-// an unneeded checkcast.
-// (3) The private var debug is mangled to A$$debug, but after inlining it is never accessed
-// from outside of the class and doesn't need mangling.
-// (4) We could forego emitting bytecode for ifelse entirely if it has been
-// inlined at all sites.
-//
-// Generated bytecode for the above:
-//
-// public final int bob1();
-// Code:
-// Stack=1, Locals=1, Args_size=1
-// 0: aload_0
-// 1: getfield #11; //Field A$$debug:Z
-// 4: ifeq 14
-// 7: iconst_1
-// 8: invokestatic #41; //Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer;
-// 11: goto 18
-// 14: iconst_2
-// 15: invokestatic #41; //Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer;
-// 18: invokestatic #45; //Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I
-// 21: ireturn
-//
-// public final int bob2();
-// Code:
-// Stack=1, Locals=1, Args_size=1
-// 0: aload_0
-// 1: invokevirtual #48; //Method A$$debug:()Z
-// 4: ifeq 11
-// 7: iconst_1
-// 8: goto 12
-// 11: iconst_2
-// 12: ireturn
diff --git a/test/files/pos/issue244.scala b/test/files/pos/issue244.scala
new file mode 100644
index 0000000000..f9189c9313
--- /dev/null
+++ b/test/files/pos/issue244.scala
@@ -0,0 +1,2 @@
+trait T { lazy val overloaded: String = "a" }
+class C extends T { def overloaded(a: String): String = "b" }
diff --git a/test/files/pos/java-type-annotations/NotNull.java b/test/files/pos/java-type-annotations/NotNull.java
new file mode 100644
index 0000000000..2716fe1a99
--- /dev/null
+++ b/test/files/pos/java-type-annotations/NotNull.java
@@ -0,0 +1,6 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+public @interface NotNull {
+}
diff --git a/test/files/pos/java-type-annotations/Test.java b/test/files/pos/java-type-annotations/Test.java
new file mode 100644
index 0000000000..d6bda1dedb
--- /dev/null
+++ b/test/files/pos/java-type-annotations/Test.java
@@ -0,0 +1,4 @@
+public class Test {
+ static class C<@NotNull T> {};
+ @NotNull String foo() { return ""; }
+}
diff --git a/test/files/pos/javaConversions-2.10-ambiguity.scala b/test/files/pos/javaConversions-2.10-ambiguity.scala
index c4aad6cbfc..b08568f475 100644
--- a/test/files/pos/javaConversions-2.10-ambiguity.scala
+++ b/test/files/pos/javaConversions-2.10-ambiguity.scala
@@ -1,5 +1,5 @@
-import collection.{JavaConversions, mutable, concurrent}
-import JavaConversions._
+import collection.{mutable, concurrent}
+import collection.convert.ImplicitConversionsToScala._
import java.util.concurrent.{ConcurrentHashMap => CHM}
object Bar {
diff --git a/test/files/pos/javaConversions-2.10-regression.scala b/test/files/pos/javaConversions-2.10-regression.scala
index 7c7ff03b55..8d84c92b61 100644
--- a/test/files/pos/javaConversions-2.10-regression.scala
+++ b/test/files/pos/javaConversions-2.10-regression.scala
@@ -1,10 +1,10 @@
-import collection.{JavaConversions, mutable, concurrent}
-import JavaConversions._
+import collection.{convert, mutable, concurrent, JavaConverters}
+import convert.ImplicitConversionsToScala._
import java.util.concurrent.{ConcurrentHashMap => CHM}
object Foo {
def buildCache2_9_simple[K <: AnyRef, V <: AnyRef]: concurrent.Map[K, V] =
- mapAsScalaConcurrentMap(new CHM())
+ JavaConverters.mapAsScalaConcurrentMap(new CHM())
def buildCache2_9_implicit[K <: AnyRef, V <: AnyRef]: concurrent.Map[K, V] =
new CHM[K, V]()
diff --git a/test/files/pos/list-optim-check.flags b/test/files/pos/list-optim-check.flags
deleted file mode 100644
index 49d036a887..0000000000
--- a/test/files/pos/list-optim-check.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimize
diff --git a/test/files/pos/list-optim-check.scala b/test/files/pos/list-optim-check.scala
deleted file mode 100644
index f6e6ddec77..0000000000
--- a/test/files/pos/list-optim-check.scala
+++ /dev/null
@@ -1,21 +0,0 @@
-// Tests a map known to crash in optimizer with faster List map in SI-8240.
-// Equivalent tests for collect and flatmap do not crash, but are provided
-// anyway.
-// See ticket SI-8334 for optimizer bug.
-// TODO - Remove this test once SI-8334 is fixed and has its own test.
-class A {
- 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
- }
-}
diff --git a/test/files/pos/lub-from-hell.scala b/test/files/pos/lub-from-hell.scala
new file mode 100644
index 0000000000..cb4b1733c7
--- /dev/null
+++ b/test/files/pos/lub-from-hell.scala
@@ -0,0 +1,6 @@
+class Test {
+ trait Tree
+ def foo(b: Boolean, buf: collection.mutable.ArrayBuffer[Any], acc: StringBuilder) = if (b) buf else acc
+}
+// This test case minimizes a case that failed to compile due to a bug in my work on
+// SI-5294. After refining my patches, it compiles again, as expected. \ No newline at end of file
diff --git a/test/files/pos/native-warning.scala b/test/files/pos/native-warning.scala
index f721a57e8f..a2918c11b5 100644
--- a/test/files/pos/native-warning.scala
+++ b/test/files/pos/native-warning.scala
@@ -1,3 +1,7 @@
class A {
@native def setup(): Unit
+
+ // also kosher
+ @native private def f(): Unit
+ @native final def g(): Unit
}
diff --git a/test/files/pos/overloaded_ho_fun.scala b/test/files/pos/overloaded_ho_fun.scala
new file mode 100644
index 0000000000..17176715f0
--- /dev/null
+++ b/test/files/pos/overloaded_ho_fun.scala
@@ -0,0 +1,66 @@
+import scala.math.Ordering
+import scala.reflect.ClassTag
+
+trait Sam { def apply(x: Int): String }
+trait SamP[U] { def apply(x: Int): U }
+
+class OverloadedFun[T](x: T) {
+ def foo(f: T => String): String = f(x)
+ def foo(f: Any => T): T = f("a")
+
+ def poly[U](f: Int => String): String = f(1)
+ def poly[U](f: Int => U): U = f(1)
+
+ def polySam[U](f: Sam): String = f(1)
+ def polySam[U](f: SamP[U]): U = f(1)
+
+ // check that we properly instantiate java.util.function.Function's type param to String
+ def polyJavaSam(f: String => String) = 1
+ def polyJavaSam(f: java.util.function.Function[String, String]) = 2
+}
+
+class StringLike(xs: String) {
+ def map[A](f: Char => A): Array[A] = ???
+ def map(f: Char => Char): String = ???
+}
+
+object Test {
+ val of = new OverloadedFun[Int](1)
+
+ of.foo(_.toString)
+
+ of.poly(x => x / 2 )
+ of.polySam(x => x / 2 )
+ of.polyJavaSam(x => x)
+
+ val sl = new StringLike("a")
+ sl.map(_ == 'a') // : Array[Boolean]
+ sl.map(x => 'a') // : String
+}
+
+object sorting {
+ def stableSort[K: ClassTag](a: Seq[K], f: (K, K) => Boolean): Array[K] = ???
+ def stableSort[L: ClassTag](a: Array[L], f: (L, L) => Boolean): Unit = ???
+
+ stableSort(??? : Seq[Boolean], (x: Boolean, y: Boolean) => x && !y)
+}
+
+// trait Bijection[A, B] extends (A => B) {
+// def andThen[C](g: Bijection[B, C]): Bijection[A, C] = ???
+// def compose[T](g: Bijection[T, A]) = g andThen this
+// }
+
+object SI10194 {
+ trait X[A] {
+ def map[B](f: A => B): Unit
+ }
+
+ trait Y[A] extends X[A] {
+ def map[B](f: A => B)(implicit ordering: Ordering[B]): Unit
+ }
+
+ trait Z[A] extends Y[A]
+
+ (null: Y[Int]).map(x => x.toString) // compiled
+ (null: Z[Int]).map(x => x.toString) // didn't compile
+}
diff --git a/test/files/pos/sam_erasure_boundedwild.scala b/test/files/pos/sam_erasure_boundedwild.scala
new file mode 100644
index 0000000000..1ec27e0ea4
--- /dev/null
+++ b/test/files/pos/sam_erasure_boundedwild.scala
@@ -0,0 +1,11 @@
+class Test {
+ trait Q[T] {
+ def toArray[T](x: Array[T]): Array[T]
+ def toArray(): Array[T]
+ }
+
+ def crashTyper: Array[_] = {
+ val x : Q[_] = ???
+ x.toArray // crashes while doing overload resolution
+ }
+} \ No newline at end of file
diff --git a/test/files/pos/sammy_ctor_arg.scala b/test/files/pos/sammy_ctor_arg.scala
new file mode 100644
index 0000000000..3c556d59f0
--- /dev/null
+++ b/test/files/pos/sammy_ctor_arg.scala
@@ -0,0 +1,4 @@
+trait Fun[A, B] { def apply(a: A): B }
+// can't do sam expansion until the sam body def is a static method in the sam class, and not a local method in a block'
+class C(f: Fun[Int, String])
+class Test extends C(s => "a") \ No newline at end of file
diff --git a/test/files/pos/sammy_exist.flags b/test/files/pos/sammy_exist.flags
deleted file mode 100644
index 48fd867160..0000000000
--- a/test/files/pos/sammy_exist.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xexperimental
diff --git a/test/files/pos/sammy_extends_function.scala b/test/files/pos/sammy_extends_function.scala
new file mode 100644
index 0000000000..e8cf5d8749
--- /dev/null
+++ b/test/files/pos/sammy_extends_function.scala
@@ -0,0 +1,4 @@
+// https://github.com/scala/scala-dev/issues/206
+
+trait T extends Function1[String, String]
+object O { (x => x): T }
diff --git a/test/files/pos/sammy_implicit.scala b/test/files/pos/sammy_implicit.scala
new file mode 100644
index 0000000000..ab63fc729e
--- /dev/null
+++ b/test/files/pos/sammy_implicit.scala
@@ -0,0 +1,11 @@
+trait Fun[A, B] { def apply(a: A): B }
+
+abstract class SamImplicitConvert {
+ class Lst[T]
+ abstract class Str { def getBytes: Array[Int] }
+ def flatMap[B](f: Fun[Str, Lst[B]]): List[B] = ???
+
+ implicit def conv(xs: Array[Int]): Lst[Int]
+
+ def encoded = flatMap (_.getBytes)
+}
diff --git a/test/files/pos/sammy_infer_argtype_subtypes.scala b/test/files/pos/sammy_infer_argtype_subtypes.scala
new file mode 100644
index 0000000000..63966f879e
--- /dev/null
+++ b/test/files/pos/sammy_infer_argtype_subtypes.scala
@@ -0,0 +1,6 @@
+trait Fun[A, B] { def apply(a: A): B }
+
+class SamInferResult {
+ def foreach[U](f: Fun[String, U]): U = ???
+ def foo = foreach(println)
+} \ No newline at end of file
diff --git a/test/files/pos/sammy_inferargs.scala b/test/files/pos/sammy_inferargs.scala
new file mode 100644
index 0000000000..10d9b4f0dd
--- /dev/null
+++ b/test/files/pos/sammy_inferargs.scala
@@ -0,0 +1,6 @@
+trait Proc { def apply(): Unit }
+class Test {
+ val initCode = List[Proc]()
+ initCode foreach { proc => proc() }
+
+}
diff --git a/test/files/pos/sammy_overload.flags b/test/files/pos/sammy_overload.flags
deleted file mode 100644
index 48fd867160..0000000000
--- a/test/files/pos/sammy_overload.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xexperimental
diff --git a/test/files/pos/sammy_overload.scala b/test/files/pos/sammy_overload.scala
index 5472248f4d..6a3c88ec55 100644
--- a/test/files/pos/sammy_overload.scala
+++ b/test/files/pos/sammy_overload.scala
@@ -6,4 +6,29 @@ object Test {
def foo(x: String): Unit = ???
def foo(): Unit = ???
val f: Consumer[_ >: String] = foo
-} \ No newline at end of file
+}
+
+trait A[A, B] { def apply(a: A): B }
+
+class ArityDisambiguate {
+ object O {
+ def m(a: A[Int, Int]) = 0
+ def m(f: (Int, Int) => Int) = 1
+ }
+
+ O.m(x => x) // ok
+ O.m((x, y) => x) // ok
+}
+
+class InteractionWithImplicits {
+ object O {
+ class Ev
+ implicit object E1 extends Ev
+ implicit object E2 extends Ev
+ def m(a: A[Int, Int])(implicit ol: E1.type) = 0
+ def m(a: A[String, Int])(implicit ol: E2.type) = 1
+ }
+
+ O.m((x: Int) => 1) // ok
+ O.m((x: String) => 1) // ok
+}
diff --git a/test/files/pos/sammy_override.flags b/test/files/pos/sammy_override.flags
deleted file mode 100644
index 48fd867160..0000000000
--- a/test/files/pos/sammy_override.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xexperimental
diff --git a/test/files/pos/sammy_poly.flags b/test/files/pos/sammy_poly.flags
deleted file mode 100644
index 48fd867160..0000000000
--- a/test/files/pos/sammy_poly.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xexperimental
diff --git a/test/files/pos/sammy_poly.scala b/test/files/pos/sammy_poly.scala
index c629be7166..ba10baea49 100644
--- a/test/files/pos/sammy_poly.scala
+++ b/test/files/pos/sammy_poly.scala
@@ -1,7 +1,12 @@
// test synthesizeSAMFunction where the sam type is not fully defined
-class T {
- trait F[T, U] { def apply(x: T): U }
- // NOTE: the f(x) desugaring for now assumes the single abstract method is called 'apply'
+trait F[T, R]{ def apply(x: T): R }
+
+class PolySammy {
+ (x => x + 1): F[Int, Int]
+ ((x: Int) => x + 1): F[Int, Int]
+ ((x: String) => 1): F[String, Int]
+ ((x: Object) => 1): F[String, Int]
+
def app[T, U](x: T)(f: F[T, U]): U = f(x)
app(1)(x => List(x))
-} \ No newline at end of file
+}
diff --git a/test/files/pos/sammy_scope.flags b/test/files/pos/sammy_scope.flags
deleted file mode 100644
index 48fd867160..0000000000
--- a/test/files/pos/sammy_scope.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xexperimental
diff --git a/test/files/pos/sammy_scope.scala b/test/files/pos/sammy_scope.scala
index 8f1fe7058e..9d35501a47 100644
--- a/test/files/pos/sammy_scope.scala
+++ b/test/files/pos/sammy_scope.scala
@@ -1,8 +1,8 @@
// test synthesizeSAMFunction: scope hygiene
-abstract class SamFun[T1, R] { self =>
+trait SamFun[T1, R] { self =>
def apply(v1: T1): R
// this should type check, as the apply ref is equivalent to self.apply
// it shouldn't resolve to the sam's apply that's synthesized (that wouldn't type check, hence the pos test)
def compose[A](g: SamFun[A, T1]): SamFun[A, R] = { x => apply(g(x)) }
-} \ No newline at end of file
+}
diff --git a/test/files/pos/sammy_single.flags b/test/files/pos/sammy_single.flags
deleted file mode 100644
index 48fd867160..0000000000
--- a/test/files/pos/sammy_single.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xexperimental
diff --git a/test/files/pos/sammy_twice.flags b/test/files/pos/sammy_twice.flags
deleted file mode 100644
index 48fd867160..0000000000
--- a/test/files/pos/sammy_twice.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xexperimental
diff --git a/test/files/pos/sd219.scala b/test/files/pos/sd219.scala
new file mode 100644
index 0000000000..3c3f4962f0
--- /dev/null
+++ b/test/files/pos/sd219.scala
@@ -0,0 +1,11 @@
+class Global { class Name }
+
+trait CommonPrintUtils {
+ val global: Global
+
+ lazy val precedence: global.Name => Int = ???
+}
+
+trait CompilerProvider { val global: Global = ??? }
+
+class AbstractPrinter extends CommonPrintUtils with CompilerProvider \ No newline at end of file
diff --git a/test/files/pos/sd248/Prop_1.scala b/test/files/pos/sd248/Prop_1.scala
new file mode 100644
index 0000000000..d5decda547
--- /dev/null
+++ b/test/files/pos/sd248/Prop_1.scala
@@ -0,0 +1,2 @@
+package p
+object Prop { class Whitelist }
diff --git a/test/files/pos/sd248/Test_2.scala b/test/files/pos/sd248/Test_2.scala
new file mode 100644
index 0000000000..602e6d37b5
--- /dev/null
+++ b/test/files/pos/sd248/Test_2.scala
@@ -0,0 +1,5 @@
+package p
+
+object PropTest {
+ def t = new Prop.Whitelist
+}
diff --git a/test/files/pos/sd248/package_1.scala b/test/files/pos/sd248/package_1.scala
new file mode 100644
index 0000000000..a90354e66f
--- /dev/null
+++ b/test/files/pos/sd248/package_1.scala
@@ -0,0 +1,3 @@
+package object p {
+ type Prop = String
+}
diff --git a/test/files/pos/sd268.scala b/test/files/pos/sd268.scala
new file mode 100644
index 0000000000..8839651501
--- /dev/null
+++ b/test/files/pos/sd268.scala
@@ -0,0 +1,17 @@
+class Context(val v : AnyRef)
+
+trait AbidePlugin {
+ val someVal = ""
+
+ val x = null.asInstanceOf[Context { val v : someVal.type }] // CRASH
+ lazy val y = null.asInstanceOf[Context { val v : someVal.type }] // CRASH
+ var z = null.asInstanceOf[Context { val v : someVal.type }] // CRASH
+}
+
+class C {
+ val someVal = ""
+
+ val x = null.asInstanceOf[Context { val v : someVal.type }]
+ lazy val y = null.asInstanceOf[Context { val v : someVal.type }] // CRASH
+ var z = null.asInstanceOf[Context { val v : someVal.type }]
+}
diff --git a/test/files/pos/sealed-final.flags b/test/files/pos/sealed-final.flags
deleted file mode 100644
index cfabf7a5b4..0000000000
--- a/test/files/pos/sealed-final.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xfatal-warnings -Yinline-warnings -optimise \ No newline at end of file
diff --git a/test/files/pos/sealed-final.scala b/test/files/pos/sealed-final.scala
deleted file mode 100644
index bdedb5c1f6..0000000000
--- a/test/files/pos/sealed-final.scala
+++ /dev/null
@@ -1,14 +0,0 @@
-sealed abstract class Foo {
- @inline def bar(x: Int) = x + 1
-}
-object Foo {
- def mkFoo(): Foo = new Baz2
-}
-
-object Baz1 extends Foo
-final class Baz2 extends Foo
-
-object Test {
- // bar should be inlined now
- def f = Foo.mkFoo() bar 10
-}
diff --git a/test/files/pos/shapeless-regression.scala b/test/files/pos/shapeless-regression.scala
new file mode 100644
index 0000000000..f3a1ed1ba0
--- /dev/null
+++ b/test/files/pos/shapeless-regression.scala
@@ -0,0 +1,16 @@
+class W[T <: AnyRef](val t: T) {
+ val v: T {} = t
+}
+
+object W {
+ def apply[T <: AnyRef](t: T) = new W[t.type](t)
+}
+
+object RightAssoc {
+ def ra_:[T](t: T): Unit = ()
+}
+
+object Boom {
+ W("fooo").v ra_: RightAssoc
+}
+
diff --git a/test/files/pos/t10009.scala b/test/files/pos/t10009.scala
new file mode 100644
index 0000000000..7cd96f0f3d
--- /dev/null
+++ b/test/files/pos/t10009.scala
@@ -0,0 +1,6 @@
+class C {
+ def c(a: Any, b: Any*) = a
+}
+object Test {
+ new C().c(b = new { val x = 42 }, a = 0)
+}
diff --git a/test/files/pos/t10066.scala b/test/files/pos/t10066.scala
new file mode 100644
index 0000000000..bef85cb08c
--- /dev/null
+++ b/test/files/pos/t10066.scala
@@ -0,0 +1,38 @@
+package dynamicrash
+
+import scala.language.dynamics
+
+class Config
+
+trait Extractor[A] {
+ def extract(config: Config, name: String): A
+}
+
+object Extractor {
+ // this has "implicit", unlike the corresponding neg test
+ implicit val stringExtractor = new Extractor[String] {
+ override def extract(config: Config, name: String): String = ???
+ }
+}
+
+class Workspace extends Dynamic {
+ val config: Config = new Config
+
+ def selectDynamic[A](name: String)(implicit extractor: Extractor[A]): A =
+ extractor.extract(config, name)
+}
+
+object Main {
+ val storage = new Workspace
+
+ // this line works fine
+ // val a = storage.foo
+
+ // this line crashes the compiler ("head of empty list")
+ // in ContextErrors$InferencerContextErrors$InferErrorGen$.NotWithinBoundsErrorMessage
+ println(storage.foo[String])
+
+ // this line crashes the compiler in different way ("unknown type")
+ // in the backend, warning: an unexpected type representation reached the compiler backend while compiling Test.scala: <error>
+ println(storage.foo)
+}
diff --git a/test/files/pos/t10093.flags b/test/files/pos/t10093.flags
new file mode 100644
index 0000000000..85d8eb2ba2
--- /dev/null
+++ b/test/files/pos/t10093.flags
@@ -0,0 +1 @@
+-Xfatal-warnings
diff --git a/test/files/pos/t10093.scala b/test/files/pos/t10093.scala
new file mode 100644
index 0000000000..a894a54926
--- /dev/null
+++ b/test/files/pos/t10093.scala
@@ -0,0 +1,5 @@
+class A[@specialized(Int) T](val value: T) {
+ trait B
+ def useValue(x:T): Unit = ()
+ useValue(value)
+}
diff --git a/test/files/pos/t10154.scala b/test/files/pos/t10154.scala
new file mode 100644
index 0000000000..51616b71d6
--- /dev/null
+++ b/test/files/pos/t10154.scala
@@ -0,0 +1,11 @@
+trait Bar2[T]
+
+object Test2 {
+ def wrap {
+ object Foo {
+ implicit def fooBar: Bar2[Foo.type] = ???
+ }
+
+ implicitly[Bar2[Foo.type]]
+ }
+}
diff --git a/test/files/pos/t10154b.scala b/test/files/pos/t10154b.scala
new file mode 100644
index 0000000000..809a286c0e
--- /dev/null
+++ b/test/files/pos/t10154b.scala
@@ -0,0 +1,16 @@
+ import scala.language.existentials
+
+ class Bar[T]
+ class Test {
+ def method = {
+ object Foo {
+ implicit def x: Bar[Foo.type] = new Bar[Foo.type]
+ }
+ type T = Foo.type
+
+ {
+ object Foo
+ implicitly[Bar[T]]
+ }
+ }
+}
diff --git a/test/files/pos/t2171.flags b/test/files/pos/t2171.flags
deleted file mode 100644
index eb4d19bcb9..0000000000
--- a/test/files/pos/t2171.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimise \ No newline at end of file
diff --git a/test/files/pos/t2171.scala b/test/files/pos/t2171.scala
deleted file mode 100644
index 6c754c76a6..0000000000
--- a/test/files/pos/t2171.scala
+++ /dev/null
@@ -1,7 +0,0 @@
-final object test {
- def logIgnoredException(msg: => String) =
- try 0 catch { case ex => println(msg) }
-
- def main (args: Array[String]): Unit =
- while (true) logIgnoredException ("...")
-}
diff --git a/test/files/pos/t2293.scala b/test/files/pos/t2293.scala
index 65f717f851..baa44552c9 100644
--- a/test/files/pos/t2293.scala
+++ b/test/files/pos/t2293.scala
@@ -1,5 +1,5 @@
-import scala.collection.JavaConversions._
+import scala.collection.convert.ImplicitConversionsToJava._
object Test {
val m: java.util.Map[String,String] = collection.mutable.Map("1"->"2")
-} \ No newline at end of file
+}
diff --git a/test/files/pos/t2377b/Q.java b/test/files/pos/t2377b/Q.java
new file mode 100644
index 0000000000..fbf9c776e9
--- /dev/null
+++ b/test/files/pos/t2377b/Q.java
@@ -0,0 +1,13 @@
+public class Q {
+
+ public static class Builder {}
+
+ public static class Inner {
+ public static class Builder { public void innerMethod() {} }
+ public Builder foo() { return new Builder(); } // this line gives an error, that Builder is ambiguous
+
+ public Inner.Builder viaSelect() { return new Builder(); } // this line gives an error, that Builder is ambiguous
+ }
+
+}
+
diff --git a/test/files/pos/t2377b/a.scala b/test/files/pos/t2377b/a.scala
new file mode 100644
index 0000000000..3053841589
--- /dev/null
+++ b/test/files/pos/t2377b/a.scala
@@ -0,0 +1,5 @@
+object Test {
+ (new Q.Inner).foo.innerMethod
+ (new Q.Inner).viaSelect.innerMethod
+
+}
diff --git a/test/files/pos/t2956/t2956.scala b/test/files/pos/t2956/t2956.scala
index eb6e817465..9b6ae8098f 100644
--- a/test/files/pos/t2956/t2956.scala
+++ b/test/files/pos/t2956/t2956.scala
@@ -1,7 +1,7 @@
-import scala.collection.JavaConversions._
+import scala.collection.convert.ImplicitConversionsToScala._
class Outer {
protected class Inner extends BeanDefinitionVisitor {
protected def visitMap(mapVal: Map[_, _]): Unit = ()
}
-} \ No newline at end of file
+}
diff --git a/test/files/pos/t3234.flags b/test/files/pos/t3234.flags
new file mode 100644
index 0000000000..b88ec8709d
--- /dev/null
+++ b/test/files/pos/t3234.flags
@@ -0,0 +1 @@
+-opt:l:project -opt-warnings -Xfatal-warnings
diff --git a/test/files/neg/t3234.scala b/test/files/pos/t3234.scala
index 1553f1fa05..8c588e5aa9 100644
--- a/test/files/neg/t3234.scala
+++ b/test/files/pos/t3234.scala
@@ -1,19 +1,17 @@
trait Trait1 {
- // need more work before this one works
- // @inline
- def foo2(n: Int) = n*n
+ @inline final def foo2(n: Int) = n*n
}
trait Trait2 {
- @inline def foo3(n: Int) = 1
+ @inline final def foo3(n: Int) = 1
}
class Base extends Trait1 {
- @inline def foo(n: Int) = n
+ @inline final def foo(n: Int) = n
}
object Test extends Base with Trait2 {
def main(args: Array[String]) = {
println(foo(42) + foo2(11) + foo3(2))
}
-} \ No newline at end of file
+}
diff --git a/test/files/pos/t3252.flags b/test/files/pos/t3252.flags
deleted file mode 100644
index eb4d19bcb9..0000000000
--- a/test/files/pos/t3252.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimise \ No newline at end of file
diff --git a/test/files/pos/t3252.scala b/test/files/pos/t3252.scala
deleted file mode 100644
index 3ecc1e7cef..0000000000
--- a/test/files/pos/t3252.scala
+++ /dev/null
@@ -1,15 +0,0 @@
-class A {
- def f(x : Boolean) : Thread = {
- g {
- x match {
- case false =>
- B.h { }
- }
- }
- }
-
- private def g[T](block : => T) = sys.error("")
-}
-object B {
- def h(block : => Unit) : Nothing = sys.error("")
-}
diff --git a/test/files/pos/t3420.flags b/test/files/pos/t3420.flags
index d37e817882..5eea92d94a 100644
--- a/test/files/pos/t3420.flags
+++ b/test/files/pos/t3420.flags
@@ -1 +1 @@
--optimise -Xfatal-warnings
+-opt-warnings -opt:l:classpath -Xfatal-warnings \ No newline at end of file
diff --git a/test/files/pos/t3430.flags b/test/files/pos/t3430.flags
deleted file mode 100644
index eb4d19bcb9..0000000000
--- a/test/files/pos/t3430.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimise \ No newline at end of file
diff --git a/test/files/pos/t3430.scala b/test/files/pos/t3430.scala
deleted file mode 100644
index 3129c6276a..0000000000
--- a/test/files/pos/t3430.scala
+++ /dev/null
@@ -1,13 +0,0 @@
-// package com.example
-
-object A {
- def f1(f: String => Boolean) = f("a")
-
- def f2(): Boolean =
- f1 { s1 =>
- f1 { s2 =>
- while (true) { }
- true
- }
- }
-} \ No newline at end of file
diff --git a/test/files/pos/t3688.scala b/test/files/pos/t3688.scala
index d15e9d1a84..58464332d1 100644
--- a/test/files/pos/t3688.scala
+++ b/test/files/pos/t3688.scala
@@ -1,5 +1,5 @@
import collection.mutable
-import collection.JavaConversions._
+import collection.convert.ImplicitConversionsToJava._
import java.{util => ju}
object Test {
@@ -11,4 +11,4 @@ object Test {
object Test2 {
def m[P <% ju.List[Int]](l: P) = 1
m(List(1)) // bug: should compile
-} \ No newline at end of file
+}
diff --git a/test/files/pos/t3772.scala b/test/files/pos/t3772.scala
new file mode 100644
index 0000000000..62c433ebd1
--- /dev/null
+++ b/test/files/pos/t3772.scala
@@ -0,0 +1,8 @@
+class Test {
+ def m = {
+ case class C(c: Int)
+ object C { def xxx = true}
+ C(42).c
+ C.xxx
+ }
+}
diff --git a/test/files/pos/t4237.scala b/test/files/pos/t4237.scala
index fcf6eb8bf1..3f605607b2 100644
--- a/test/files/pos/t4237.scala
+++ b/test/files/pos/t4237.scala
@@ -2,5 +2,16 @@ class A {
(new { def field = 0; def field_=(i: Int) = () }).field = 5 // compiles as expected
(new { def field(implicit i: Int) = 0; def field_=(i: Int) = () }).field = 5 // compiles even with implicit params on getter
(new { def field = 0; def field_=[T](i: Int) = () }).field = 5 // compiles with type param on setter
- (new { def field[T] = 0; def field_=(i: Int) = () }).field = 5 // DOESN'T COMPILE
-} \ No newline at end of file
+ (new { def field[T] = 0; def field_=(i: Int) = () }).field = 5 // DIDN'T COMPILE
+
+ class Imp
+ implicit val imp: Imp = new Imp
+ implicit val implicitList: List[Int] = null
+
+ // compiles even with implicit params on setter
+ (new { def field(implicit i: Int) = 0; def field_=(i: Int)(implicit j: Imp) = () }).field = 5
+ (new { def field(implicit i: Int) = 0; def field_=[T <: Imp](i: Int)(implicit j: T) = () }).field = 5
+ // was reassignment to val
+ (new { def field[T](implicit ts: List[T]) = 0; def field_=[T](i: Int)(implicit ts: List[T]) = () }).field = 5
+ (new { def field[T](implicit ts: List[T]) = 0; def field_=[T](i: T)(implicit ts: List[T]) = () }).field = 5
+}
diff --git a/test/files/pos/t4365/a_1.scala b/test/files/pos/t4365/a_1.scala
index a24b57772d..e7466e0d48 100644
--- a/test/files/pos/t4365/a_1.scala
+++ b/test/files/pos/t4365/a_1.scala
@@ -9,7 +9,7 @@ trait SeqViewLike[+A,
trait Transformed[+B] extends super[GenSeqViewLike].Transformed[B]
abstract class AbstractTransformed[+B] extends Seq[B] with Transformed[B] {
- def underlying: Coll = error("")
+ def underlying: Coll = sys.error("")
}
trait Reversed extends Transformed[A] with super[GenSeqViewLike].Reversed
diff --git a/test/files/pos/t4365/b_1.scala b/test/files/pos/t4365/b_1.scala
index e1423813f1..1158db6c32 100644
--- a/test/files/pos/t4365/b_1.scala
+++ b/test/files/pos/t4365/b_1.scala
@@ -10,7 +10,7 @@ self =>
trait Transformed[+B] {
def length: Int = 0
- def apply(idx: Int): B = error("")
+ def apply(idx: Int): B = sys.error("")
}
trait Reversed extends Transformed[A] {
diff --git a/test/files/pos/t4579.flags b/test/files/pos/t4579.flags
deleted file mode 100644
index 1182725e86..0000000000
--- a/test/files/pos/t4579.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimize \ No newline at end of file
diff --git a/test/files/pos/t482.scala b/test/files/pos/t482.scala
new file mode 100644
index 0000000000..b121c93337
--- /dev/null
+++ b/test/files/pos/t482.scala
@@ -0,0 +1,7 @@
+object Test {
+ class Foo { val z = "foo"; val y : z.type = z }
+
+ val x : ({ val y : z.type } forSome { val z : String }) = new Foo
+
+ val x2 : ({ val y : T } forSome { type T <: String with Singleton }) = new Foo
+}
diff --git a/test/files/pos/t4840.flags b/test/files/pos/t4840.flags
index eb4d19bcb9..768ca4f13b 100644
--- a/test/files/pos/t4840.flags
+++ b/test/files/pos/t4840.flags
@@ -1 +1 @@
--optimise \ No newline at end of file
+-opt:l:classpath \ No newline at end of file
diff --git a/test/files/pos/t4914.scala b/test/files/pos/t4914.scala
new file mode 100644
index 0000000000..a6c8ef5a4e
--- /dev/null
+++ b/test/files/pos/t4914.scala
@@ -0,0 +1,20 @@
+trait Type {
+ type S
+}
+
+class ConcreteType extends Type {
+ type S = Double
+}
+
+trait Base {
+ type T <: Type
+ val m: Map[t#S, t#S] forSome { type t <: T with Singleton }
+ val n: Map[x.type#S, x.type#S] forSome { val x: T }
+}
+
+abstract class Derived extends Base {
+ override type T = ConcreteType
+ override val m = Map[Double, Double]()
+ /** This does not work. §3.2.10 indicates that types n is shorthand for type of m. */
+ override val n = Map[Double, Double]()
+}
diff --git a/test/files/pos/t5120.scala b/test/files/pos/t5120.scala
index 86d4470bd5..40540b8a7d 100644
--- a/test/files/pos/t5120.scala
+++ b/test/files/pos/t5120.scala
@@ -1,4 +1,4 @@
-// An example extracted from SBT by Iulian
+// An example extracted from sbt by Iulian
// that showed that the previous fix to t5120
// was too strict.
class Test {
diff --git a/test/files/pos/t5165b.flags b/test/files/pos/t5165b.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/pos/t5165b.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/pos/t5183.scala b/test/files/pos/t5183.scala
new file mode 100644
index 0000000000..783b8c28dc
--- /dev/null
+++ b/test/files/pos/t5183.scala
@@ -0,0 +1,34 @@
+trait Day
+
+object Test {
+ def foo(t: Int with Day) = t == t
+}
+
+class DayOps(val i: Int with Day) extends AnyVal
+
+case class Test1(d: Int with Day)
+case class Test2(d1: Int with Day, d2: Int with Day)
+
+class User
+class Checkin
+object Example {
+
+ type Tagged[U] = { type Tag = U }
+ type @@[T, U] = T with Tagged[U] // Thanks to @retronym for suggesting this type alias
+
+ class Tagger[U] {
+ def apply[T](t : T) : T @@ U = t.asInstanceOf[T @@ U]
+ }
+ def tag[U] = new Tagger[U]
+
+ // Manual specialization needed here ... specializing apply above doesn't help
+ def tag[U](i : Int) : Int @@ U = i.asInstanceOf[Int @@ U]
+ def tag[U](l : Long) : Long @@ U = l.asInstanceOf[Long @@ U]
+ def tag[U](d : Double) : Double @@ U = d.asInstanceOf[Double @@ U]
+
+ def fetch[A](id: Int @@ A): A = null.asInstanceOf[A]
+
+ def tag[U](arr: Array[Int]):Array[Int @@ U] = arr.asInstanceOf[Array[Int @@ U]]
+
+ tag[User](Array(3, 4, 5)).map(_.toString)
+} \ No newline at end of file
diff --git a/test/files/pos/t5240.scala b/test/files/pos/t5240.scala
index 065d175f2f..ae52c6d69a 100644
--- a/test/files/pos/t5240.scala
+++ b/test/files/pos/t5240.scala
@@ -1,11 +1,3 @@
-
-
-
-
-
-
package object foo {
-
var labels: Array[_ <: String] = null
-
}
diff --git a/test/files/pos/t5294b.scala b/test/files/pos/t5294b.scala
new file mode 100644
index 0000000000..038d2ff806
--- /dev/null
+++ b/test/files/pos/t5294b.scala
@@ -0,0 +1,36 @@
+class Test {
+ def test = {
+
+ val l1 = null: Int #: String #: Boolean #: String #: HNil.type
+
+ type _2 = Succ[Succ[Zero.type]]
+
+ val t1: Boolean = null.asInstanceOf[ l1.type#Drop[_2]#Head ]
+
+ val t2: Boolean = null.asInstanceOf[ l1.type#Apply[_2] ]
+ }
+}
+
+
+sealed trait Nat {
+ type Fold[U, F[_ <: U] <: U, Z <: U] <: U
+}
+
+final object Zero extends Nat {
+ type Fold[U, F[_ <: U] <: U, Z <: U] = Z
+}
+
+final class Succ[N <: Nat] extends Nat {
+ type Fold[U, F[_ <: U] <: U, Z <: U] = F[N#Fold[U, F, Z]]
+}
+
+trait HList {
+ type Head
+ type Tail <: HList
+ type Drop[N <: Nat] = N#Fold[HList, ({ type L[X <: HList] = X#Tail })#L, this.type]
+ type Apply[N <: Nat] = Drop[N]#Head
+}
+
+class #: [H, T <: HList] extends HList { type Head = H; type Tail = T }
+
+object HNil extends HList { type Head = Nothing; type Tail = Nothing }
diff --git a/test/files/pos/t5294c.scala b/test/files/pos/t5294c.scala
new file mode 100644
index 0000000000..2709098988
--- /dev/null
+++ b/test/files/pos/t5294c.scala
@@ -0,0 +1,30 @@
+sealed trait Nat {
+ type IsZero[U, A <: U, B <: U] <: U
+}
+
+final object Zero extends Nat {
+ type IsZero[U, T <: U, F <: U] = T
+}
+
+final class Succ[N <: Nat] extends Nat {
+ type IsZero[U, T <: U, F <: U] = F
+}
+
+trait HList {
+ type Head
+ type Tail <: HList
+ type Drop[N <: Nat] = N#IsZero[HList, this.type, Tail]
+ type Apply[N <: Nat] = Drop[N]#Head // typechecks as HList.this.Head
+}
+
+object Test {
+ type ::[H, T <: HList] = HList { type Head = H; type Tail = T}
+ type HNil <: HList
+ type T = Int :: String :: HNil
+
+ type U = T#Drop[Succ[Zero.type]]#Head
+ type V = T#Apply[Succ[Zero.type]]
+ var u: U = ???
+ var v: V = ???
+ u = v
+}
diff --git a/test/files/pos/t533.scala b/test/files/pos/t533.scala
deleted file mode 100644
index 0a6515fed3..0000000000
--- a/test/files/pos/t533.scala
+++ /dev/null
@@ -1,11 +0,0 @@
-import scala.actors._
-
-object test extends Actor {
- def act() {
- receive {
- case TIMEOUT => Console.println("TIMEOUT")
- //case _ => Console.println("_")
- }
- }
-}
-
diff --git a/test/files/pos/t5644/BoxesRunTime.java b/test/files/pos/t5644/BoxesRunTime.java
index 74c4c6b4b9..2b931519aa 100644
--- a/test/files/pos/t5644/BoxesRunTime.java
+++ b/test/files/pos/t5644/BoxesRunTime.java
@@ -267,10 +267,6 @@ public final class BoxesRunTime
else if (n instanceof java.lang.Float) return hashFromFloat((java.lang.Float)n);
else return n.hashCode();
}
- public static int hashFromObject(Object a) {
- if (a instanceof Number) return hashFromNumber((Number)a);
- else return a.hashCode();
- }
private static int unboxCharOrInt(Object arg1, int code) {
if (code == CHAR)
diff --git a/test/files/pos/t5729.scala b/test/files/pos/t5729.scala
deleted file mode 100644
index 9fd9c9ffbb..0000000000
--- a/test/files/pos/t5729.scala
+++ /dev/null
@@ -1,6 +0,0 @@
-trait T[X]
-object Test {
- def join(in: Seq[T[_]]): Int = ???
- def join[S](in: Seq[T[S]]): String = ???
- join(null: Seq[T[_]])
-} \ No newline at end of file
diff --git a/test/files/pos/t5899.scala b/test/files/pos/t5899.scala
index b16f1f84fe..885baca790 100644
--- a/test/files/pos/t5899.scala
+++ b/test/files/pos/t5899.scala
@@ -14,6 +14,7 @@ trait Foo {
Bippy(Stable) match {
case Bippy(nme.WILDCARD) => 1
case Bippy(Stable) => 2 // should not be considered unreachable
+ case Bippy(_) => 3
}
}
} \ No newline at end of file
diff --git a/test/files/pos/t6091.scala b/test/files/pos/t6091.scala
index 72e663ec3b..0318640e7b 100644
--- a/test/files/pos/t6091.scala
+++ b/test/files/pos/t6091.scala
@@ -1,6 +1,6 @@
-object Foo { def eq(x:Int) = x }
+object Foo { def eq(x: Int) = x }
-class X { def ==(other: String) = true }
+class X { def ==(other: String) = other.nonEmpty }
object Test {
def main(args: Array[String]): Unit = {
diff --git a/test/files/pos/t6157.flags b/test/files/pos/t6157.flags
deleted file mode 100644
index 0ebca3e7af..0000000000
--- a/test/files/pos/t6157.flags
+++ /dev/null
@@ -1 +0,0 @@
- -optimize
diff --git a/test/files/pos/t6157.scala b/test/files/pos/t6157.scala
deleted file mode 100644
index 7463989b14..0000000000
--- a/test/files/pos/t6157.scala
+++ /dev/null
@@ -1,25 +0,0 @@
-// SI-6157 - Compiler crash on inlined function and -optimize option
-
-object Test {
- def main(args: Array[String]) {
- Console.println(
- ErrorHandler.defaultIfIOException("String")("String")
- )
- }
-}
-
-import java.io.IOException
-
-object ErrorHandler {
-
- @inline
- def defaultIfIOException[T](default: => T)(closure: => T): T = {
- try {
- closure
- } catch {
- case e: IOException =>
- default
- }
- }
-}
-
diff --git a/test/files/pos/t6161b.scala b/test/files/pos/t6161b.scala
new file mode 100644
index 0000000000..5783cc85f2
--- /dev/null
+++ b/test/files/pos/t6161b.scala
@@ -0,0 +1,22 @@
+object t6161 {
+ trait N {
+ type Name
+ }
+
+ trait N1 extends N {
+ class Name {
+ type ThisNameType <: Name
+ def encode: ThisNameType = ???
+ }
+ }
+
+ trait S {
+ self: N => // change to N1 and it compiles
+ type NameType <: Name
+ }
+
+ object g extends S with N1
+
+ val n1: g.NameType = ???
+ val n2: g.Name = n1.encode
+}
diff --git a/test/files/pos/t6547.flags b/test/files/pos/t6547.flags
deleted file mode 100644
index c9b68d70dc..0000000000
--- a/test/files/pos/t6547.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimise
diff --git a/test/files/pos/t6547.scala b/test/files/pos/t6547.scala
deleted file mode 100644
index 53bd798219..0000000000
--- a/test/files/pos/t6547.scala
+++ /dev/null
@@ -1,6 +0,0 @@
-trait ConfigurableDefault[@specialized V] {
- def fillArray(arr: Array[V], v: V) = (arr: Any) match {
- case x: Array[Int] => null
- case x: Array[Long] => v.asInstanceOf[Long]
- }
-}
diff --git a/test/files/pos/t6734.scala b/test/files/pos/t6734.scala
new file mode 100644
index 0000000000..88932cd2cc
--- /dev/null
+++ b/test/files/pos/t6734.scala
@@ -0,0 +1,17 @@
+
+// desugars to package p { object `package` }
+// previously, synthetic p.C was incorrectly added to this tree
+// This only matters because synthetics are not hygienic
+package object p
+
+package p {
+ import scala.concurrent.Future
+ case class C private[p] (value: Future[Int]) // private to avoid rewriting C.apply to new C
+}
+
+package client {
+ trait X {
+ import scala.concurrent.Future
+ def f = p.C(Future(42)(null)) // ensure synthetics were generated, i.e., p.C.apply
+ }
+}
diff --git a/test/files/pos/t6778.scala b/test/files/pos/t6778.scala
new file mode 100644
index 0000000000..b7483c8fce
--- /dev/null
+++ b/test/files/pos/t6778.scala
@@ -0,0 +1,5 @@
+object test extends AnyRef with App {
+ // Check that random can be called with parenthesis.
+ scala.math.random()
+}
+
diff --git a/test/files/pos/t6978.flags b/test/files/pos/t6978.flags
new file mode 100644
index 0000000000..7949c2afa2
--- /dev/null
+++ b/test/files/pos/t6978.flags
@@ -0,0 +1 @@
+-Xlint -Xfatal-warnings
diff --git a/test/files/pos/t6978/J.java b/test/files/pos/t6978/J.java
new file mode 100644
index 0000000000..1b9029ce53
--- /dev/null
+++ b/test/files/pos/t6978/J.java
@@ -0,0 +1,5 @@
+
+public class J {
+ public int f() { return 42; }
+}
+
diff --git a/test/files/pos/t6978/S.scala b/test/files/pos/t6978/S.scala
new file mode 100644
index 0000000000..41897db5ac
--- /dev/null
+++ b/test/files/pos/t6978/S.scala
@@ -0,0 +1,7 @@
+
+trait X { def f: Int }
+
+object Test extends J with X with App {
+ println(f)
+}
+
diff --git a/test/files/pos/t7014/t7014.scala b/test/files/pos/t7014/t7014.scala
deleted file mode 100644
index 7c73f700be..0000000000
--- a/test/files/pos/t7014/t7014.scala
+++ /dev/null
@@ -1,3 +0,0 @@
-package t7014
-
-import ThreadSafetyLevel.COMPLETELY_THREADSAFE // refer to annotation so it gets parsed
diff --git a/test/files/pos/t7088.scala b/test/files/pos/t7088.scala
new file mode 100644
index 0000000000..de9d1b7040
--- /dev/null
+++ b/test/files/pos/t7088.scala
@@ -0,0 +1,8 @@
+object Example extends App {
+ type Tag[X] = {type Tag = X}
+ type TaggedArray[T] = Array[T] with Tag[Any]
+
+ def method[T: reflect.ClassTag](a: TaggedArray[T], value: T) {a.update(0, value)}
+
+ method(Array(1, 2).asInstanceOf[TaggedArray[Int]], 1)
+}
diff --git a/test/files/pos/t7239.scala b/test/files/pos/t7239.scala
deleted file mode 100644
index 16e9d00f17..0000000000
--- a/test/files/pos/t7239.scala
+++ /dev/null
@@ -1,38 +0,0 @@
-object Test {
- def BrokenMethod(): HasFilter[(Int, String)] = ???
-
- trait HasFilter[B] {
- def filter(p: B => Boolean) = ???
- }
-
- trait HasWithFilter {
- def withFilter = ???
- }
-
- object addWithFilter {
- trait NoImplicit
- implicit def enrich(v: Any)
- (implicit F0: NoImplicit): HasWithFilter = ???
- }
-
- BrokenMethod().withFilter(_ => true) // okay
- BrokenMethod().filter(_ => true) // okay
-
- locally {
- import addWithFilter._
- BrokenMethod().withFilter((_: (Int, String)) => true) // okay
- }
-
- locally {
- import addWithFilter._
- // adaptToMemberWithArgs sets the type of the tree `x`
- // to ErrorType (while in silent mode, so the error is not
- // reported. Later, when the fallback from `withFilter`
- // to `filter` is attempted, the closure is taken to have
- // have the type `<error> => Boolean`, which conforms to
- // `(B => Boolean)`. Only later during pickling does the
- // defensive check for erroneous types in the tree pick up
- // the problem.
- BrokenMethod().withFilter(x => true) // erroneous or inaccessible type.
- }
-}
diff --git a/test/files/pos/t7294.scala b/test/files/pos/t7294.scala
deleted file mode 100644
index ccac2b1400..0000000000
--- a/test/files/pos/t7294.scala
+++ /dev/null
@@ -1,6 +0,0 @@
-object Test {
- // no fruitless warning as Tuple2 isn't (yet) final.
- // The corresponding `neg` test will treat it as final
- // for the purposes of these tests under -Xfuture.
- (1, 2) match { case Seq() => 0; case _ => 1 }
-}
diff --git a/test/files/pos/t7551.flags b/test/files/pos/t7551.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/pos/t7551.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/pos/t7551/A.java b/test/files/pos/t7551/A.java
new file mode 100644
index 0000000000..72aeb40fa0
--- /dev/null
+++ b/test/files/pos/t7551/A.java
@@ -0,0 +1,9 @@
+package p;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface A {
+ Class<?> subInterface();
+}
diff --git a/test/files/pos/t7551/T.scala b/test/files/pos/t7551/T.scala
new file mode 100644
index 0000000000..017926e0e2
--- /dev/null
+++ b/test/files/pos/t7551/T.scala
@@ -0,0 +1,9 @@
+package p
+
+@A(subInterface = classOf[T.S])
+trait T {
+}
+
+object T {
+ private[p] trait S extends T { }
+}
diff --git a/test/files/pos/t7551/Test.scala b/test/files/pos/t7551/Test.scala
new file mode 100644
index 0000000000..c1f529c4b1
--- /dev/null
+++ b/test/files/pos/t7551/Test.scala
@@ -0,0 +1,5 @@
+package p
+
+object Foo {
+ def bar(t: T) { }
+}
diff --git a/test/files/pos/t7784.scala b/test/files/pos/t7784.scala
new file mode 100644
index 0000000000..e6824a4203
--- /dev/null
+++ b/test/files/pos/t7784.scala
@@ -0,0 +1,13 @@
+object Test {
+ final val a = ""
+ var b: a.type = a
+ b = a
+
+ final val x = classOf[Object]
+ var y: x.type = x
+ y = x
+
+ final val e = Thread.State.NEW
+ var e1: e.type = e
+ e1 = e
+}
diff --git a/test/files/pos/t8002-nested-scope.scala b/test/files/pos/t8002-nested-scope.scala
deleted file mode 100644
index 8ce809e556..0000000000
--- a/test/files/pos/t8002-nested-scope.scala
+++ /dev/null
@@ -1,20 +0,0 @@
-// This test serves to capture the status quo, but should really
-// emit an accessibility error.
-
-// `Namers#companionSymbolOf` seems too lenient, and currently doesn't
-// implement the same-scope checks mentioned:
-//
-// https://github.com/scala/scala/pull/2816#issuecomment-22555206
-//
-class C {
- def foo = {
- class C { private def x = 0 }
-
- {
- val a = 0
- object C {
- new C().x
- }
- }
- }
-}
diff --git a/test/files/pos/t8013.flags b/test/files/pos/t8013.flags
index 3955bb6710..219723cec9 100644
--- a/test/files/pos/t8013.flags
+++ b/test/files/pos/t8013.flags
@@ -1 +1 @@
--Xfatal-warnings -Xlint:-infer-any,_
+-Xfatal-warnings -Xlint:missing-interpolator
diff --git a/test/files/pos/t8040.flags b/test/files/pos/t8040.flags
new file mode 100644
index 0000000000..3126c059f0
--- /dev/null
+++ b/test/files/pos/t8040.flags
@@ -0,0 +1 @@
+-Xfatal-warnings -Ywarn-unused:params
diff --git a/test/files/pos/t8040.scala b/test/files/pos/t8040.scala
new file mode 100644
index 0000000000..3e01014ab4
--- /dev/null
+++ b/test/files/pos/t8040.scala
@@ -0,0 +1,13 @@
+
+object Test {
+ implicit class C(val sc: StringContext) { // no warn unused sc
+ def c(args: Any*): String = "c?" + args.mkString(",") // would warn unused args
+ }
+
+ def f(implicit x: DummyImplicit) = 42 // no warn DummyImplicit
+
+
+ def f(x: Int)(y: Int = 1) = x + y // no warn default getter
+
+ def g(@deprecated("","") x: Int) = 42 // no warn deprecated
+}
diff --git a/test/files/pos/t8044.scala b/test/files/pos/t8044.scala
new file mode 100644
index 0000000000..2519a8306b
--- /dev/null
+++ b/test/files/pos/t8044.scala
@@ -0,0 +1,15 @@
+
+trait T {
+ def f = 42 match { case `x` @ _ => x }
+ def g = 42 match { case `type` @ _ => `type` }
+ def h = 42 match { case `type` : Int => `type` }
+ def i = (null: Any) match { case _: Int | _: String => 17 }
+
+ // arbitrary idents allowed in @ syntax
+ def j = "Fred" match { case Name @ (_: String) => Name }
+ def k = "Fred" match { case * @ (_: String) => * }
+
+ // also in sequence pattern
+ def m = List(1,2,3,4,5) match { case List(1, `Rest of them` @ _*) => `Rest of them` }
+
+}
diff --git a/test/files/pos/t8062.flags b/test/files/pos/t8062.flags
deleted file mode 100644
index 49d036a887..0000000000
--- a/test/files/pos/t8062.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimize
diff --git a/test/files/pos/t8062/A_1.scala b/test/files/pos/t8062/A_1.scala
deleted file mode 100644
index ca0411dae8..0000000000
--- a/test/files/pos/t8062/A_1.scala
+++ /dev/null
@@ -1,5 +0,0 @@
-package warmup
-
-object Warmup {
- def filter[A](p: Any => Boolean): Any = filter[Any](p)
-}
diff --git a/test/files/pos/t8062/B_2.scala b/test/files/pos/t8062/B_2.scala
deleted file mode 100644
index f0a6761488..0000000000
--- a/test/files/pos/t8062/B_2.scala
+++ /dev/null
@@ -1,3 +0,0 @@
-object Test {
- warmup.Warmup.filter[Any](x => false)
-}
diff --git a/test/files/pos/t8079b.scala b/test/files/pos/t8079b.scala
new file mode 100644
index 0000000000..f3b7b78077
--- /dev/null
+++ b/test/files/pos/t8079b.scala
@@ -0,0 +1,7 @@
+trait F1[/* - */T, /* + */ R]
+
+object Test {
+ import scala.annotation.unchecked._
+ type VariantF1[-T, +R] = F1[T @uncheckedVariance, R @uncheckedVariance]
+ trait C[+T] { def foo: VariantF1[Any, T] }
+}
diff --git a/test/files/pos/t8306.flags b/test/files/pos/t8306.flags
deleted file mode 100644
index 49d036a887..0000000000
--- a/test/files/pos/t8306.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimize
diff --git a/test/files/pos/t8306.scala b/test/files/pos/t8306.scala
deleted file mode 100644
index e04b054eb9..0000000000
--- a/test/files/pos/t8306.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-class Si8306 {
- def foo: Int = 123
- lazy val extension: Int =
- foo match {
- case idx if idx != -1 => 15
- case _ => 17
- }
-}
diff --git a/test/files/pos/t8310.flags b/test/files/pos/t8310.flags
deleted file mode 100644
index 48fd867160..0000000000
--- a/test/files/pos/t8310.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xexperimental
diff --git a/test/files/pos/t8315.flags b/test/files/pos/t8315.flags
deleted file mode 100644
index c926ad6493..0000000000
--- a/test/files/pos/t8315.flags
+++ /dev/null
@@ -1 +0,0 @@
--Yinline -Ydead-code
diff --git a/test/files/pos/t8315.scala b/test/files/pos/t8315.scala
deleted file mode 100644
index 2f7742ed67..0000000000
--- a/test/files/pos/t8315.scala
+++ /dev/null
@@ -1,12 +0,0 @@
-object Test {
- def crash(as: Listt): Unit = {
- map(as, (_: Any) => return)
- }
-
- final def map(x: Listt, f: Any => Any): Any = {
- if (x eq Nill) "" else f("")
- }
-}
-
-object Nill extends Listt
-class Listt
diff --git a/test/files/pos/t8315b.flags b/test/files/pos/t8315b.flags
deleted file mode 100644
index c926ad6493..0000000000
--- a/test/files/pos/t8315b.flags
+++ /dev/null
@@ -1 +0,0 @@
--Yinline -Ydead-code
diff --git a/test/files/pos/t8315b.scala b/test/files/pos/t8315b.scala
deleted file mode 100644
index d7a2bf565f..0000000000
--- a/test/files/pos/t8315b.scala
+++ /dev/null
@@ -1,11 +0,0 @@
-object Test extends Object {
- def crash: Unit = {
- val key = ""
- try map(new F(key))
- catch { case _: Throwable => }
- };
- final def map(f: F): Any = f.apply("");
-};
-final class F(key: String) {
- final def apply(a: Any): Any = throw new RuntimeException(key);
-}
diff --git a/test/files/pos/t8359-closelim-crash.flags b/test/files/pos/t8359-closelim-crash.flags
deleted file mode 100644
index 49d036a887..0000000000
--- a/test/files/pos/t8359-closelim-crash.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimize
diff --git a/test/files/pos/t8359-closelim-crash.scala b/test/files/pos/t8359-closelim-crash.scala
deleted file mode 100644
index 1413694d10..0000000000
--- a/test/files/pos/t8359-closelim-crash.scala
+++ /dev/null
@@ -1,23 +0,0 @@
-package test
-
-// This is a minimization of code that crashed the compiler during bootstrapping
-// in the first iteration of https://github.com/scala/scala/pull/4373, the PR
-// that adjusted the order of free and declared params in LambdaLift.
-
-// Was:
-// java.lang.AssertionError: assertion failed:
-// Record Record(<$anon: Function1>,Map(value a$1 -> Deref(LocalVar(value b)))) does not contain a field value b$1
-// at scala.tools.nsc.Global.assert(Global.scala:262)
-// at scala.tools.nsc.backend.icode.analysis.CopyPropagation$copyLattice$State.getFieldNonRecordValue(CopyPropagation.scala:113)
-// at scala.tools.nsc.backend.icode.analysis.CopyPropagation$copyLattice$State.getFieldNonRecordValue(CopyPropagation.scala:122)
-// at scala.tools.nsc.backend.opt.ClosureElimination$ClosureElim$$anonfun$analyzeMethod$1$$anonfun$apply$2.replaceFieldAccess$1(ClosureElimination.scala:124)
-class Typer {
- def bar(a: Boolean, b: Boolean): Unit = {
- @inline
- def baz(): Unit = {
- ((_: Any) => (Typer.this, a, b)).apply("")
- }
- ((_: Any) => baz()).apply("")
- }
-}
-
diff --git a/test/files/pos/t8410.flags b/test/files/pos/t8410.flags
index dcd5943c2f..85e4257541 100644
--- a/test/files/pos/t8410.flags
+++ b/test/files/pos/t8410.flags
@@ -1 +1 @@
--optimise -Xfatal-warnings -deprecation:false -Yinline-warnings:false
+-opt:l:project -Xfatal-warnings -deprecation:false -opt-warnings:none
diff --git a/test/files/pos/t8429.scala b/test/files/pos/t8429.scala
new file mode 100644
index 0000000000..a2d32637e1
--- /dev/null
+++ b/test/files/pos/t8429.scala
@@ -0,0 +1,7 @@
+trait Must { def musta(str: String, i: Int): Unit }
+
+object Mustare {
+ def takesM(m: Must) = ???
+ takesM{ (a, b) => println } // ok
+ takesM{ case (a: String, b: Int) => println("") } // should also be accepted
+}
diff --git a/test/files/pos/t8462.scala b/test/files/pos/t8462.scala
new file mode 100644
index 0000000000..6946cf8e5e
--- /dev/null
+++ b/test/files/pos/t8462.scala
@@ -0,0 +1,11 @@
+
+trait ConstantOps {
+ def exprs = (
+ 1 << 2L : Int, // was: error: type mismatch; found : Long(4L)
+ 64 >> 2L : Int, // was: error: type mismatch; found : Long(4L)
+ 64 >>> 2L : Int, // was: error: type mismatch; found : Long(4L)
+ 'a' << 2L : Int,
+ 'a' >> 2L : Int,
+ 'a'>>> 2L : Int
+ )
+}
diff --git a/test/files/pos/t8862a.scala b/test/files/pos/t8862a.scala
new file mode 100644
index 0000000000..f9576707ba
--- /dev/null
+++ b/test/files/pos/t8862a.scala
@@ -0,0 +1,47 @@
+package p {
+
+ abstract class C[A] {
+ def x: A
+ implicit def oops: A = x
+ implicit def oopso: Option[A] = None
+ }
+
+ package q {
+
+ class Oops
+
+ object `package` extends C[Oops] {
+ override def x = new Oops
+ }
+
+ object Blah {
+ oops
+ oopso
+
+ // implicits found in enclosing context
+ implicitly[Oops]
+ implicitly[Option[Oops]]
+ }
+ }
+}
+
+package other {
+
+ object Blah {
+ // implicits found through this import
+ import p.q._
+
+ oops
+ oopso
+
+ implicitly[Oops]
+ implicitly[Option[Oops]]
+ }
+
+
+ object Blee {
+ // implicits found through the companion implicits
+ implicitly[p.q.Oops]
+ implicitly[Option[p.q.Oops]]
+ }
+}
diff --git a/test/files/pos/t8862b.scala b/test/files/pos/t8862b.scala
new file mode 100644
index 0000000000..8be7fb5fab
--- /dev/null
+++ b/test/files/pos/t8862b.scala
@@ -0,0 +1,12 @@
+package p {
+ trait T[X] { def O : { def apply(): X } }
+ object `package` extends T[Int] {
+ def O: { def apply(): Int } = new { def apply(): Int = 42 }
+ }
+
+ object Test {
+ def main(args: Array[String]): Unit = {
+ val x: Int = O()
+ }
+ }
+}
diff --git a/test/files/pos/t8873.scala b/test/files/pos/t8873.scala
new file mode 100644
index 0000000000..e2f0a5fad2
--- /dev/null
+++ b/test/files/pos/t8873.scala
@@ -0,0 +1 @@
+case class X(@volatile var x:Int)
diff --git a/test/files/pos/t8947/Macro_1.scala b/test/files/pos/t8947/Macro_1.scala
index ace389f339..c669e68b1e 100644
--- a/test/files/pos/t8947/Macro_1.scala
+++ b/test/files/pos/t8947/Macro_1.scala
@@ -36,6 +36,6 @@ object X {
// }
//
// To make this visible to the macro implementation, it will need to be compiled in an earlier stage,
- // e.g a separate SBT sub-project.
+ // e.g a separate sbt sub-project.
}
diff --git a/test/files/pos/t9020.scala b/test/files/pos/t9020.scala
index 16e31e2572..c77a63cb1a 100644
--- a/test/files/pos/t9020.scala
+++ b/test/files/pos/t9020.scala
@@ -8,3 +8,9 @@ test/files/pos/t9020.scala:2: warning: discarded non-Unit value
^
one warning found
*/
+
+trait DiscardThis {
+ import collection.mutable.ListBuffer
+ val b = ListBuffer.empty[String]
+ def add(s: String): Unit = b += s
+}
diff --git a/test/files/pos/t9074.scala b/test/files/pos/t9074.scala
new file mode 100644
index 0000000000..67db281f54
--- /dev/null
+++ b/test/files/pos/t9074.scala
@@ -0,0 +1,24 @@
+package blam {
+
+ package foo {
+
+ trait F[T] {
+ def f(d: Double, t: T): T = ???
+ def f(d: Int, t: T): T = ???
+ def f(d: String, t: T): T = ???
+
+ def g[A](a: T): T = ???
+ def g(a: Int) = ???
+ }
+ }
+
+ package object foo extends foo.F[Double] {
+ override def f(d: Double, t: Double): Double = ???
+ }
+}
+
+object Test {
+ import blam._
+ foo.f("3", 4.0)
+ foo.g[Any](1d) : Double
+}
diff --git a/test/files/pos/t9074b.scala b/test/files/pos/t9074b.scala
new file mode 100644
index 0000000000..dadcebf399
--- /dev/null
+++ b/test/files/pos/t9074b.scala
@@ -0,0 +1,15 @@
+trait Echo [T] {
+ def echo(t: T): Unit
+}
+
+trait IntEcho extends Echo[Int] {
+ def echo(t: Int) = println(t)
+}
+
+object echo extends IntEcho
+package object echo1 extends IntEcho
+
+object App extends App {
+ echo.echo(1)
+ echo1.echo(1)
+}
diff --git a/test/files/pos/t9111-inliner-workaround.flags b/test/files/pos/t9111-inliner-workaround.flags
index 63b5558cfd..768ca4f13b 100644
--- a/test/files/pos/t9111-inliner-workaround.flags
+++ b/test/files/pos/t9111-inliner-workaround.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/pos/t9123.flags b/test/files/pos/t9123.flags
deleted file mode 100644
index c16e2f71dc..0000000000
--- a/test/files/pos/t9123.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimize -Ydelambdafy:method
diff --git a/test/files/pos/t9123.scala b/test/files/pos/t9123.scala
deleted file mode 100644
index 22d55b4351..0000000000
--- a/test/files/pos/t9123.scala
+++ /dev/null
@@ -1,10 +0,0 @@
-trait Setting {
- type T
- def value: T
-}
-
-object Test {
- def test(x: Some[Setting]) = x match {
- case Some(dep) => Some(dep.value) map (_ => true)
- }
-}
diff --git a/test/files/pos/t9131.scala b/test/files/pos/t9131.scala
new file mode 100644
index 0000000000..1a186a0a24
--- /dev/null
+++ b/test/files/pos/t9131.scala
@@ -0,0 +1,12 @@
+class Test {
+
+ def byNameFunc(f: (=> (() => Any)) => Any): Unit = ()
+
+ def test = {
+ // "value apply is not a member of => () => Any"
+ byNameFunc(z => z())
+ // okay
+ byNameFunc(z => z.apply())
+ byNameFunc(z => {val f = z; f()})
+ }
+}
diff --git a/test/files/neg/sammy_restrictions.flags b/test/files/pos/t9178b.flags
index 48fd867160..48fd867160 100644
--- a/test/files/neg/sammy_restrictions.flags
+++ b/test/files/pos/t9178b.flags
diff --git a/test/files/pos/t9178b.scala b/test/files/pos/t9178b.scala
new file mode 100644
index 0000000000..cbeaed4f17
--- /dev/null
+++ b/test/files/pos/t9178b.scala
@@ -0,0 +1,7 @@
+abstract class Test{
+ val writeInput: java.io.OutputStream => Unit
+ def getOutputStream(): java.io.OutputStream
+
+ writeInput(getOutputStream)
+}
+
diff --git a/test/files/pos/t9326a.scala b/test/files/pos/t9326a.scala
new file mode 100644
index 0000000000..aefc735585
--- /dev/null
+++ b/test/files/pos/t9326a.scala
@@ -0,0 +1,6 @@
+package p
+
+trait M[A]
+
+class C extends M[Tuple1[X] forSome { type X }]
+
diff --git a/test/files/pos/t9397.scala b/test/files/pos/t9397.scala
new file mode 100644
index 0000000000..3dbc6591d3
--- /dev/null
+++ b/test/files/pos/t9397.scala
@@ -0,0 +1,12 @@
+package foo.scala
+
+import scala.reflect.runtime.universe._
+
+object Foo {
+
+ def bar[T: TypeTag]() {
+ }
+
+ import foo._
+ bar[String]()
+}
diff --git a/test/files/pos/t9449.scala b/test/files/pos/t9449.scala
new file mode 100644
index 0000000000..3b86dc80a0
--- /dev/null
+++ b/test/files/pos/t9449.scala
@@ -0,0 +1,19 @@
+trait II {
+ def apply(x: Int): Int
+}
+
+object Test {
+ def ii(x: Int): Int = x
+ def test = {
+ val ii1: II = x => ii(x) // works
+ val ii2: II = ii // works (adapting `ii` to `II`)
+ val ii3: II = ii _ // works (failed before the fix)
+ // typedTyped({ii : (() => <empty>)})
+ // typedEta(ii, pt = II)
+ // adapt(ii, pt = (? => ?))
+ // instantiatedToMethodType(ii, pt = (? => ?))
+ // val ii3: II = ii _ // error:
+ // found : Int => Int
+ // required: II
+ }
+} \ No newline at end of file
diff --git a/test/files/pos/t9479.scala b/test/files/pos/t9479.scala
new file mode 100644
index 0000000000..38eabf4338
--- /dev/null
+++ b/test/files/pos/t9479.scala
@@ -0,0 +1,15 @@
+trait Predefs {
+ def bridge(p: String): Unit = ???
+ def bridge(p: Any): Unit = ???
+}
+
+package object molecule extends Predefs
+
+package molecule {
+ package process {
+ class Test {
+ def main(): Unit = bridge(null, null)
+ }
+ }
+}
+
diff --git a/test/files/pos/t9479b.scala b/test/files/pos/t9479b.scala
new file mode 100644
index 0000000000..5fc795a1fd
--- /dev/null
+++ b/test/files/pos/t9479b.scala
@@ -0,0 +1,15 @@
+trait Predefs {
+ def bridge(p: String): Unit = ???
+ def bridge(p: Any): Unit = ???
+}
+
+package object molecule extends Predefs
+
+package molecule {
+ package process {
+ class Test {
+ def main(): Unit = molecule.bridge(null, null)
+ }
+ }
+}
+
diff --git a/test/files/pos/t9498.scala b/test/files/pos/t9498.scala
new file mode 100644
index 0000000000..32fc01a806
--- /dev/null
+++ b/test/files/pos/t9498.scala
@@ -0,0 +1,25 @@
+trait Inv[A] { def head: A }
+trait Cov[+A] { def head: A }
+
+class Test {
+ def inv(i: Inv[Inv[String]]) = i match {
+ case l: Inv[a] =>
+ val x: a = l.head
+ x.head: String // okay
+ }
+
+ def cov(c: Cov[Cov[String]]) = c match {
+ case l: Cov[a] =>
+ val x: a = l.head
+ x.head: String // was: found A, required String
+ }
+
+ def cov1(c: Cov[Cov[String]]) = c match {
+ case l: Cov[a] => l.head.head
+ }
+ cov1(null): String // was: found A, required String
+
+ def cov3(c: Cov[Cov[String]]): String = c match {
+ case l: Cov[a] => val l1: l.type = l; l1.head.head
+ }
+}
diff --git a/test/files/pos/t9542.scala b/test/files/pos/t9542.scala
new file mode 100644
index 0000000000..d65f7ac4c6
--- /dev/null
+++ b/test/files/pos/t9542.scala
@@ -0,0 +1,8 @@
+object O {
+ trait T
+
+ class VC(val self: Any) extends AnyVal {
+ def extMethod(f: F1[T, Any]) = ()
+ }
+}
+trait F1[A, B]
diff --git a/test/files/pos/t9658.scala b/test/files/pos/t9658.scala
new file mode 100644
index 0000000000..a2c695a8ae
--- /dev/null
+++ b/test/files/pos/t9658.scala
@@ -0,0 +1,10 @@
+sealed trait G[T]
+case object GI extends G[Int]
+
+class C {
+ def typerFail[T](rt: G[T]): T = rt match {
+ case GI =>
+ { case x => x } : PartialFunction[Any, Any] // comment this line, compiles.
+ 0 // found Int, required T
+ }
+}
diff --git a/test/files/pos/t9665.scala b/test/files/pos/t9665.scala
new file mode 100644
index 0000000000..1aa7a5d459
--- /dev/null
+++ b/test/files/pos/t9665.scala
@@ -0,0 +1,7 @@
+
+object | { def unapply(x: (Any, Any)) = Some(x) }
+
+trait Test {
+ def f() = (1,2) match { case 1 `|` 2 => }
+ def g() = 2 match { case 1 | 2 => }
+}
diff --git a/test/files/pos/t9855.scala b/test/files/pos/t9855.scala
new file mode 100644
index 0000000000..b6ac3e2432
--- /dev/null
+++ b/test/files/pos/t9855.scala
@@ -0,0 +1,10 @@
+class C {
+ def xx(verb: String, a: Array[Int]) {
+ val reYYYY = """(\d\d\d\d)""".r
+ verb match {
+ case "time" if a.isEmpty =>
+ case "time" =>
+ case reYYYY(y) =>
+ }
+ }
+}
diff --git a/test/files/pos/t9855b.scala b/test/files/pos/t9855b.scala
new file mode 100644
index 0000000000..30c58be3dc
--- /dev/null
+++ b/test/files/pos/t9855b.scala
@@ -0,0 +1,16 @@
+object Test {
+ var FALSE = false
+ def main(args: Array[String]): Unit = {
+ val SomeB = new B
+ new B() match {
+ case SomeB if FALSE =>
+ case SomeB =>
+ case Ext(_) =>
+ }
+ }
+}
+object Ext {
+ def unapply(s: A) = Some(())
+}
+class A
+class B extends A
diff --git a/test/files/pos/t9918/package.scala b/test/files/pos/t9918/package.scala
new file mode 100644
index 0000000000..9bd8ac9a69
--- /dev/null
+++ b/test/files/pos/t9918/package.scala
@@ -0,0 +1 @@
+package object pkg extends T
diff --git a/test/files/pos/t9918/t9918.scala b/test/files/pos/t9918/t9918.scala
new file mode 100644
index 0000000000..ec9a146579
--- /dev/null
+++ b/test/files/pos/t9918/t9918.scala
@@ -0,0 +1,3 @@
+package pkg
+
+trait T { object O }
diff --git a/test/files/pos/t9920.scala b/test/files/pos/t9920.scala
new file mode 100644
index 0000000000..8612618cc4
--- /dev/null
+++ b/test/files/pos/t9920.scala
@@ -0,0 +1,6 @@
+object Test {
+ def o = {
+ def i: Int = { i; 0 }
+ i
+ }
+}
diff --git a/test/files/pos/t9943.scala b/test/files/pos/t9943.scala
new file mode 100644
index 0000000000..0d4717ccbb
--- /dev/null
+++ b/test/files/pos/t9943.scala
@@ -0,0 +1,9 @@
+class Foo[T] {
+ def toMap[K, V](implicit ev: Foo[T] <:< Foo[(K, V)]): Foo[Map[K, V]] = null
+ def toMap[K](keySelector: T => K): Foo[Map[K, T]] = null
+}
+
+object Foo {
+ (??? : Foo[Int]) toMap (_ % 2)
+ (??? : Foo[(Int, String)]).toMap
+}
diff --git a/test/files/pos/tcpoly_bounds1.scala b/test/files/pos/tcpoly_bounds1.scala
index 63263cb152..4f52f55cb6 100644
--- a/test/files/pos/tcpoly_bounds1.scala
+++ b/test/files/pos/tcpoly_bounds1.scala
@@ -1,7 +1,9 @@
-class Foo[t[x]<: Tuple2[Int, x]]
+case class T2[+T1, +T2](_1: T1, _2: T2) extends Product2[T1, T2]
+
+class Foo[t[x]<: T2[Int, x]]
//
-class MyPair[z](a: Int, b: z) extends Tuple2[Int, z](a,b)
+class MyPair[z](a: Int, b: z) extends T2[Int, z](a,b)
object foo extends Foo[MyPair]
diff --git a/test/files/pos/trailing-commas.scala b/test/files/pos/trailing-commas.scala
new file mode 100644
index 0000000000..b9401fe49d
--- /dev/null
+++ b/test/files/pos/trailing-commas.scala
@@ -0,0 +1,155 @@
+package foo
+
+trait ArgumentExprs1 {
+ def f(foo: Int, bar: String)(implicit ev0: Ev0, ev1: Ev1) = 1
+ f(
+ 23,
+ "bar",
+ )(
+ Ev0,
+ Ev1,
+ )
+
+ // test arg exprs in the presence of varargs
+ def g(x: Int, y: Int*) = 1
+ g(1,2,
+ )
+ g(1,List(2, 3): _*,
+ )
+}
+
+trait ArgumentExprs2 {
+ class C(foo: Int, bar: String)(implicit ev0: Ev0, ev1: Ev1)
+ new C(
+ 23,
+ "bar",
+ )(
+ Ev0,
+ Ev1,
+ )
+}
+
+trait Params {
+ def f(
+ foo: Int,
+ bar: String,
+ )(implicit
+ ev0: Ev0,
+ ev1: Ev1,
+ )
+}
+
+trait ClassParams {
+ class C(
+ foo: Int,
+ bar: String,
+ )(implicit
+ ev0: Ev0,
+ ev1: Ev1,
+ )
+
+ // test class params in the precense of varargs
+ case class D(i: Int*,
+ )
+}
+
+trait SimpleExpr1 {
+ def f: (Int, String) = (
+ 23,
+ "bar",
+ )
+
+ // the Tuple1 value case, the trailing comma is ignored so the type is Int and the value 23
+ def g: Int = (
+ 23,
+ )
+}
+
+trait TypeArgs {
+ class C[A, B]
+ def f: C[
+ Int,
+ String,
+ ]
+}
+
+trait TypeParamClause {
+ class C[
+ A,
+ B,
+ ]
+}
+
+trait FunTypeParamClause {
+ def f[
+ A,
+ B,
+ ]
+}
+
+trait SimpleType {
+ def f: (
+ Int,
+ String,
+ )
+
+ // the Tuple1 type case, the trailing comma is ignored so the type is Int and the value 23
+ def g: (
+ Int,
+ ) = 23
+}
+
+trait FunctionArgTypes {
+ def f: (
+ Int,
+ String,
+ ) => Boolean
+}
+
+trait SimplePattern {
+ val (
+ foo,
+ bar,
+ ) = null: Any
+
+ // test '@' syntax in patterns
+ Some(1) match {
+ case Some(x @ 1,
+ ) => x
+ }
+
+ // test ': _*' syntax in patterns
+ List(1, 2, 3) match {
+ case List(1, 2, _ @ _*,
+ ) => 1
+ }
+
+ // test varargs in patterns
+ val List(x, y, _*,
+ ) = 42 :: 17 :: Nil
+}
+
+trait ImportSelectors {
+ import foo.{
+ Ev0,
+ Ev1,
+ }
+}
+
+trait Bindings {
+ def g(f: (Int, String) => Boolean)
+
+ g((
+ foo,
+ bar,
+ ) => true)
+}
+
+// Import, ids, ValDcl, VarDcl, VarDef, PatDef use commas, but not inside paren, bracket or brace,
+// so they don't support an optional trailing comma
+
+// test utilities
+object `package` {
+ sealed trait Ev0; implicit object Ev0 extends Ev0
+ sealed trait Ev1; implicit object Ev1 extends Ev1
+}
diff --git a/test/files/pos/trait-defaults-super.scala b/test/files/pos/trait-defaults-super.scala
new file mode 100644
index 0000000000..8f867ab563
--- /dev/null
+++ b/test/files/pos/trait-defaults-super.scala
@@ -0,0 +1,21 @@
+trait T extends java.lang.Iterable[String] {
+
+ override def spliterator(): java.util.Spliterator[String] = {
+ super[Iterable].spliterator
+ super.spliterator
+ null
+ }
+ def foo = {
+ super[Iterable].spliterator
+ super.spliterator
+ }
+ def iterator(): java.util.Iterator[String] = java.util.Collections.emptyList().iterator()
+}
+class C extends T with java.lang.Iterable[String] // super accessor is okay with Iterable as a direct parent
+object Test {
+ def main(args: Array[String]): Unit = {
+ val t: T = new C
+ t.spliterator
+ t.foo
+ }
+}
diff --git a/test/files/pos/trait-force-info.flags b/test/files/pos/trait-force-info.flags
deleted file mode 100644
index eb4d19bcb9..0000000000
--- a/test/files/pos/trait-force-info.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimise \ No newline at end of file
diff --git a/test/files/pos/trait-force-info.scala b/test/files/pos/trait-force-info.scala
deleted file mode 100644
index c2b33869c3..0000000000
--- a/test/files/pos/trait-force-info.scala
+++ /dev/null
@@ -1,18 +0,0 @@
-/** This does NOT crash unless it's in the interactive package.
- */
-
-package scala.tools.nsc
-package interactive
-
-trait MyContextTrees {
- val self: Global
- val NoContext = self.analyzer.NoContext
-}
-//
-// error: java.lang.AssertionError: assertion failed: trait Contexts.NoContext$ linkedModule: <none>List()
-// at scala.Predef$.assert(Predef.scala:160)
-// at scala.tools.nsc.symtab.classfile.ClassfileParser$innerClasses$.innerSymbol$1(ClassfileParser.scala:1211)
-// at scala.tools.nsc.symtab.classfile.ClassfileParser$innerClasses$.classSymbol(ClassfileParser.scala:1223)
-// at scala.tools.nsc.symtab.classfile.ClassfileParser.classNameToSymbol(ClassfileParser.scala:489)
-// at scala.tools.nsc.symtab.classfile.ClassfileParser.sig2type$1(ClassfileParser.scala:757)
-// at scala.tools.nsc.symtab.classfile.ClassfileParser.sig2type$1(ClassfileParser.scala:789)
diff --git a/test/files/pos/trait_fields_dependent_conflict.scala b/test/files/pos/trait_fields_dependent_conflict.scala
new file mode 100644
index 0000000000..afb6f4b0c5
--- /dev/null
+++ b/test/files/pos/trait_fields_dependent_conflict.scala
@@ -0,0 +1,20 @@
+// derived from test/files/pos/S5.scala
+
+// compile with -uniqid to see a hint of the trouble
+trait N {
+ // the symbol for self does not get rebound when synthesizing members in C
+ val self: N = ???
+ val n: self.type = self
+}
+
+abstract class M {
+ val self: N
+ val n: self.type
+}
+
+abstract class MConflict extends N {
+ val self: N
+ val n: self.type
+}
+
+class C extends M with N
diff --git a/test/files/pos/trait_fields_dependent_rebind.scala b/test/files/pos/trait_fields_dependent_rebind.scala
new file mode 100644
index 0000000000..e2cf4c43c3
--- /dev/null
+++ b/test/files/pos/trait_fields_dependent_rebind.scala
@@ -0,0 +1,15 @@
+// derived from test/files/pos/S5.scala
+
+// compile with -uniqid to see a hint of the trouble
+trait N {
+ // the symbol for self does not get rebound when synthesizing members in C
+ val self: N = ???
+ val n: self.type = self
+}
+
+abstract class M {
+ val self: N
+ val n: self.type
+}
+
+class C extends M with N
diff --git a/test/files/pos/trait_fields_inherit_double_def.scala b/test/files/pos/trait_fields_inherit_double_def.scala
new file mode 100644
index 0000000000..8703d6312c
--- /dev/null
+++ b/test/files/pos/trait_fields_inherit_double_def.scala
@@ -0,0 +1,20 @@
+// done
+// test/files/trait-defaults/fields.scala:24: error: double definition:
+// def signalDelegate_=(x$1: Signalling): Unit at line 24 and
+// def signalDelegate_=(x$1: Signalling): Unit at line 24
+// have same type
+// class SUB extends IterableSplitter
+// ^
+// one error found
+
+trait Signalling
+
+trait DelegatedSignalling extends Signalling {
+ var signalDelegate: Signalling
+}
+
+trait IterableSplitter extends DelegatedSignalling {
+ var signalDelegate: Signalling = ???
+}
+
+class SUB extends IterableSplitter \ No newline at end of file
diff --git a/test/files/pos/trait_fields_lambdalift.scala b/test/files/pos/trait_fields_lambdalift.scala
new file mode 100644
index 0000000000..62304a5268
--- /dev/null
+++ b/test/files/pos/trait_fields_lambdalift.scala
@@ -0,0 +1,22 @@
+class Lift {
+ def foo = {
+ // this will be captured by the MouseHandler trait,
+ // which gives rise to a new trait field during LambdaLift
+ var Clicked = "Clicked"
+
+ def bar = Clicked
+
+ trait MouseHandler {
+ def mouseClicked = Clicked + bar
+ }
+
+ class CC extends MouseHandler
+
+ // new C {}
+ (new CC).mouseClicked
+ }
+}
+
+object O extends Lift with App {
+ println(foo)
+}
diff --git a/test/files/pos/trait_fields_nested_private_object.scala b/test/files/pos/trait_fields_nested_private_object.scala
new file mode 100644
index 0000000000..8efc1cb3fa
--- /dev/null
+++ b/test/files/pos/trait_fields_nested_private_object.scala
@@ -0,0 +1,8 @@
+trait NestedObj {
+ private object O { println("NO") }
+}
+
+
+class C extends NestedObj {
+ def O = ???
+} \ No newline at end of file
diff --git a/test/files/pos/trait_fields_nested_public_object.scala b/test/files/pos/trait_fields_nested_public_object.scala
new file mode 100644
index 0000000000..016487fb8a
--- /dev/null
+++ b/test/files/pos/trait_fields_nested_public_object.scala
@@ -0,0 +1,5 @@
+trait NestedObj {
+ object O { println("NO") }
+}
+
+class C extends NestedObj \ No newline at end of file
diff --git a/test/files/pos/trait_fields_owners.scala b/test/files/pos/trait_fields_owners.scala
new file mode 100644
index 0000000000..6aa5572171
--- /dev/null
+++ b/test/files/pos/trait_fields_owners.scala
@@ -0,0 +1,19 @@
+trait V {
+ // ok
+ // error: java.lang.IllegalArgumentException: Could not find proxy for val f: Function1 in List(value f, value v, trait V, package <empty>, package <root>) (currentOwner= value <local V$class> )
+ val v = { val f = (x: Int) => x + 1; f(2) }
+
+ // ok
+ // assertion failed:
+ // Trying to access the this of another class: tree.symbol = trait V, class symbol = object V$class compilation unit: fields.scala
+ val developmentVersion =
+ for {
+ v <- scalaPropOrNone("maven.version.number")
+ if v endsWith "-SNAPSHOT"
+ ov <- scalaPropOrNone("version.number")
+ } yield ov
+
+ def scalaPropOrNone(name: String): Option[String] = ???
+}
+
+object O extends V \ No newline at end of file
diff --git a/test/files/pos/trait_fields_private_this.scala b/test/files/pos/trait_fields_private_this.scala
new file mode 100644
index 0000000000..8065cc89e6
--- /dev/null
+++ b/test/files/pos/trait_fields_private_this.scala
@@ -0,0 +1,5 @@
+trait Chars {
+ private[this] val char2uescapeArray: String = ???
+}
+
+object Chars extends Chars \ No newline at end of file
diff --git a/test/files/pos/trait_fields_static_fwd.scala b/test/files/pos/trait_fields_static_fwd.scala
new file mode 100644
index 0000000000..af2cdad9ff
--- /dev/null
+++ b/test/files/pos/trait_fields_static_fwd.scala
@@ -0,0 +1,10 @@
+trait T {
+ // Need to mark the synthesized member in the object's module class as notPROTECTED,
+ // since the trait member will receive this flag later.
+ // If we don't add notPROTECTED to the synthesized one, the member will not be seen as overriding the trait member.
+ // Therefore, addForwarders's call to membersBasedOnFlags would see the deferred member in the trait,
+ // instead of the concrete (desired) one in the class, and thus not create the static forwarder.
+ protected val propFilename: String = "/"
+}
+
+object P extends T
diff --git a/test/files/pos/trait_fields_var_override_deferred.scala b/test/files/pos/trait_fields_var_override_deferred.scala
new file mode 100644
index 0000000000..0205326506
--- /dev/null
+++ b/test/files/pos/trait_fields_var_override_deferred.scala
@@ -0,0 +1,2 @@
+trait SizeChangeEvent { protected var end: Int }
+class BackedUpListIterator[E](override protected var end: Int) extends SizeChangeEvent
diff --git a/test/files/pos/trait_fields_volatile.scala b/test/files/pos/trait_fields_volatile.scala
new file mode 100644
index 0000000000..030b24f187
--- /dev/null
+++ b/test/files/pos/trait_fields_volatile.scala
@@ -0,0 +1,13 @@
+// This test illustrates the intent of what should work (but didn't for a while during the fields refactoring),
+// but it does not actually defend against the regression seen in twitter-util's Scheduler, which I cannot reproduce
+// outside the project. The whole project consistently fails to build before, and compiles after the commit
+// that includes this test, but this single test file (as well as Scheduler.scala with external dependencies removed)
+// compiles both before and after....
+// (https://github.com/twitter/util/blob/6398a56923/util-core/src/main/scala/com/twitter/concurrent/Scheduler.scala#L260-L265)
+// There's also a run test that checks that the field in C is actually volatile.
+trait Vola {
+ @volatile private[this] var _vola = "tile"
+ @volatile var vola = "tile"
+}
+
+class C extends Vola
diff --git a/test/files/pos/trait_lazy_accessboundary.scala b/test/files/pos/trait_lazy_accessboundary.scala
new file mode 100644
index 0000000000..6529816ffb
--- /dev/null
+++ b/test/files/pos/trait_lazy_accessboundary.scala
@@ -0,0 +1,2 @@
+package foo { trait HasLazy { private[foo] lazy val myLazy = "my lady" } }
+package bar { class MixInSuperLazy extends foo.HasLazy }
diff --git a/test/files/pos/typevar-in-prefix.scala b/test/files/pos/typevar-in-prefix.scala
new file mode 100644
index 0000000000..929648b789
--- /dev/null
+++ b/test/files/pos/typevar-in-prefix.scala
@@ -0,0 +1,9 @@
+trait Test1 {
+ abstract class Setting
+ def Bool: Setting
+
+ class C[T <: Setting](val s: T)
+ val setting1 = null.asInstanceOf[_1.s.type forSome { val _1: C[Setting] }]
+ // the derived accessor for this val was not using an inferred type, as was
+ // the intention of the implementation in MethodSynthesis.
+}
diff --git a/test/files/pos/userdefined_apply.flags b/test/files/pos/userdefined_apply.flags
deleted file mode 100644
index 0acce1e7ce..0000000000
--- a/test/files/pos/userdefined_apply.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xsource:2.12
diff --git a/test/files/pos/userdefined_apply_poly_overload.flags b/test/files/pos/userdefined_apply_poly_overload.flags
deleted file mode 100644
index 0acce1e7ce..0000000000
--- a/test/files/pos/userdefined_apply_poly_overload.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xsource:2.12
diff --git a/test/files/pos/val_infer.scala b/test/files/pos/val_infer.scala
new file mode 100644
index 0000000000..5f82da8393
--- /dev/null
+++ b/test/files/pos/val_infer.scala
@@ -0,0 +1,5 @@
+class Test {
+ implicit def s2i(s: String): Int = s.length
+ trait Base { def foo: Int }
+ trait Sub extends Base { val foo = "" }
+}
diff --git a/test/files/pos/virtpatmat_exist1.scala b/test/files/pos/virtpatmat_exist1.scala
index 6cad017b0b..1f24892489 100644
--- a/test/files/pos/virtpatmat_exist1.scala
+++ b/test/files/pos/virtpatmat_exist1.scala
@@ -1,5 +1,6 @@
import annotation.unchecked.{ uncheckedVariance=> uV }
-import scala.collection.immutable.{ListMap, HashMap, ListSet, HashSet}
+import scala.collection.immutable.{ListMap, ListSet}
+import scala.collection.mutable.{HashMap, HashSet}
object Test {
class HashMapCollision1[A, +B](var hash: Int, var kvs: ListMap[A, B @uV]) extends HashMap[A, B @uV]
diff --git a/test/files/presentation/callcc-interpreter/Runner.scala b/test/files/presentation/callcc-interpreter/Runner.scala
index 1ef3cf9025..1c03e3d5ba 100644
--- a/test/files/presentation/callcc-interpreter/Runner.scala
+++ b/test/files/presentation/callcc-interpreter/Runner.scala
@@ -1,3 +1,3 @@
import scala.tools.nsc.interactive.tests._
-object Test extends InteractiveTest \ No newline at end of file
+object Test extends InteractiveTest
diff --git a/test/files/presentation/doc/doc.scala b/test/files/presentation/doc/doc.scala
index ce431910ee..08c6ebf059 100644
--- a/test/files/presentation/doc/doc.scala
+++ b/test/files/presentation/doc/doc.scala
@@ -37,7 +37,7 @@ object Test extends InteractiveTest {
prepre + docComment(nTags) + prepost + post
}
- override lazy val compiler = {
+ override lazy val compiler: Global { def getComment(sym: Symbol, source: SourceFile, fragments: List[(Symbol,SourceFile)]): Option[Comment] } = {
prepareSettings(settings)
new Global(settings, compilerReporter) with MemberLookupBase with CommentFactoryBase with doc.ScaladocGlobalTrait {
outer =>
@@ -62,7 +62,7 @@ object Test extends InteractiveTest {
def getComment(sym: Symbol, source: SourceFile, fragments: List[(Symbol,SourceFile)]): Option[Comment] = {
val docResponse = new Response[(String, String, Position)]
askDocComment(sym, source, sym.owner, fragments, docResponse)
- docResponse.get.left.toOption flatMap {
+ docResponse.get.swap.toOption flatMap {
case (expanded, raw, pos) =>
if (expanded.isEmpty)
None
@@ -85,13 +85,13 @@ object Test extends InteractiveTest {
val batch = new BatchSourceFile(source.file, newText.toCharArray)
val reloadResponse = new Response[Unit]
compiler.askReload(List(batch), reloadResponse)
- reloadResponse.get.left.toOption match {
+ reloadResponse.get.swap.toOption match {
case None =>
println("Couldn't reload")
case Some(_) =>
val parseResponse = new Response[Tree]
askParsedEntered(batch, true, parseResponse)
- parseResponse.get.left.toOption match {
+ parseResponse.get.swap.toOption match {
case None =>
println("Couldn't parse")
case Some(_) =>
diff --git a/test/files/presentation/ide-bug-1000531/src/CrashOnLoad.scala b/test/files/presentation/ide-bug-1000531/src/CrashOnLoad.scala
index 3f59282083..25e0a9580f 100644
--- a/test/files/presentation/ide-bug-1000531/src/CrashOnLoad.scala
+++ b/test/files/presentation/ide-bug-1000531/src/CrashOnLoad.scala
@@ -1,6 +1,6 @@
/** When this files is opened within the IDE, a typing error is reported. */
class A[B] extends TestIterable[B] {
- import scala.collection.JavaConversions._
+ import collection.convert.ImplicitConversionsToScala._
def iterator: other.TestIterator[Nothing] = ???
iterator./*!*/
diff --git a/test/files/presentation/random.check b/test/files/presentation/random.check
index fb3500aeea..1e40e178be 100644
--- a/test/files/presentation/random.check
+++ b/test/files/presentation/random.check
@@ -4,7 +4,7 @@ askType at Random.scala(18,14)
================================================================================
[response] askTypeAt (18,14)
val filter: Int => Boolean = try {
- java.this.lang.Integer.parseInt(args.apply(0)) match {
+ java.lang.Integer.parseInt(args.apply(0)) match {
case 1 => ((x: Int) => x.%(2).!=(0))
case 2 => ((x: Int) => x.%(2).==(0))
case _ => ((x: Int) => x.!=(0))
diff --git a/test/files/presentation/scope-completion-3.check b/test/files/presentation/scope-completion-3.check
index b70a7d5c6b..f2510127fb 100644
--- a/test/files/presentation/scope-completion-3.check
+++ b/test/files/presentation/scope-completion-3.check
@@ -3,7 +3,7 @@ reload: Completions.scala
askScopeCompletion at Completions.scala(75,2)
================================================================================
[response] askScopeCompletion at (75,2)
-retrieved 37 members
+retrieved 38 members
abstract class Base1 extends AnyRef
abstract trait Trait1 extends AnyRef
class Cb1 extends AnyRef
@@ -14,6 +14,8 @@ def <init>(): test.Completion1
def fb1: Int
def fc1: Int
def ft1: Int
+def rt1: Int
+def rt1_=(x$1: Int): Unit
object Completion2
object Ob1
object Oc1
@@ -30,23 +32,22 @@ private[this] val vb1: Int
private[this] val vb3: Int
private[this] val vc1: Int
private[this] val vc2: Int
-private[this] val vt1: Int
private[this] val vt3: Int
private[this] var rb1: Int
private[this] var rb3: Int
private[this] var rc1: Int
private[this] var rc2: Int
-private[this] var rt1: Int
private[this] var rt3: Int
type tb1 = Completion1.this.tb1
type tc1 = Completion1.this.tc1
type tt1 = Completion1.this.tt1
+val vt1: Int
================================================================================
askScopeCompletion at Completions.scala(104,2)
================================================================================
[response] askScopeCompletion at (104,2)
-retrieved 37 members
+retrieved 38 members
abstract class Base1 extends AnyRef
abstract trait Trait1 extends AnyRef
class Cb1 extends AnyRef
@@ -57,6 +58,8 @@ def <init>(): test.Completion2.type
def fb1: Int
def fo1: Int
def ft1: Int
+def rt1: Int
+def rt1_=(x$1: Int): Unit
object Completion2
object Ob1
object Oo1
@@ -73,15 +76,14 @@ private[this] val vb1: Int
private[this] val vb3: Int
private[this] val vo1: Int
private[this] val vo2: Int
-private[this] val vt1: Int
private[this] val vt3: Int
private[this] var rb1: Int
private[this] var rb3: Int
private[this] var ro1: Int
private[this] var ro2: Int
-private[this] var rt1: Int
private[this] var rt3: Int
type tb1 = test.Completion2.tb1
type to1 = test.Completion2.to1
type tt1 = test.Completion2.tt1
+val vt1: Int
================================================================================
diff --git a/test/files/presentation/scope-completion-3/src/Completions.scala b/test/files/presentation/scope-completion-3/src/Completions.scala
index 18cef1cefa..8d79adc669 100644
--- a/test/files/presentation/scope-completion-3/src/Completions.scala
+++ b/test/files/presentation/scope-completion-3/src/Completions.scala
@@ -1,6 +1,6 @@
package test
-/* check availability of members defined locally and in hierachy */
+/* check availability of members defined locally and in hierarchy */
abstract class Base1 {
diff --git a/test/files/presentation/t4287c.check b/test/files/presentation/t4287c.check
deleted file mode 100644
index 42fc30997d..0000000000
--- a/test/files/presentation/t4287c.check
+++ /dev/null
@@ -1,11 +0,0 @@
-reload: Foo.scala
-
-askHyperlinkPos for `A` at (1,18) Foo.scala
-================================================================================
-[response] found askHyperlinkPos for `A` at (3,8) Foo.scala
-================================================================================
-
-askHyperlinkPos for `a` at (1,25) Foo.scala
-================================================================================
-[response] found askHyperlinkPos for `a` at (4,7) Foo.scala
-================================================================================
diff --git a/test/files/presentation/t4287c/Test.scala b/test/files/presentation/t4287c/Test.scala
deleted file mode 100644
index bec1131c4c..0000000000
--- a/test/files/presentation/t4287c/Test.scala
+++ /dev/null
@@ -1,3 +0,0 @@
-import scala.tools.nsc.interactive.tests.InteractiveTest
-
-object Test extends InteractiveTest \ No newline at end of file
diff --git a/test/files/presentation/t4287c/src/Foo.scala b/test/files/presentation/t4287c/src/Foo.scala
deleted file mode 100644
index 26870b5021..0000000000
--- a/test/files/presentation/t4287c/src/Foo.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-class A(a: Int = A/*#*/.a/*#*/)
-
-object A {
- val a = 2
-}
-
-class B extends A {
- def this(a) = this()
-} \ No newline at end of file
diff --git a/test/files/presentation/t5708.check b/test/files/presentation/t5708.check
index 4b33893e98..0f24d9626b 100644
--- a/test/files/presentation/t5708.check
+++ b/test/files/presentation/t5708.check
@@ -35,7 +35,7 @@ final def wait(): Unit
final def wait(x$1: Long): Unit
final def wait(x$1: Long,x$2: Int): Unit
final private[this] val CONST_STRING: String("constant")
-lazy private[this] var foo: Int
+lazy val foo: Int
private[package test] def pkgPrivateM: String
private[this] val pkgPrivateV: String
================================================================================
diff --git a/test/files/presentation/t7678/Runner.scala b/test/files/presentation/t7678/Runner.scala
index 14d6dc2a70..c6736a65b0 100644
--- a/test/files/presentation/t7678/Runner.scala
+++ b/test/files/presentation/t7678/Runner.scala
@@ -7,7 +7,7 @@ object Test extends InteractiveTest {
override def runDefaultTests() {
def resolveTypeTagHyperlink() {
- val sym = compiler.askForResponse(() => compiler.currentRun.runDefinitions.TypeTagClass).get.left.get
+ val sym = compiler.askForResponse(() => compiler.currentRun.runDefinitions.TypeTagClass).get.swap.getOrElse(???)
val r = new Response[Position]
compiler.askLinkPos(sym, new BatchSourceFile("", source), r)
r.get
diff --git a/test/files/presentation/t8459.check b/test/files/presentation/t8459.check
index 336c147141..4c105d2a00 100644
--- a/test/files/presentation/t8459.check
+++ b/test/files/presentation/t8459.check
@@ -9,6 +9,7 @@ scala.AnyRef {
()
};
private[this] val bar: F = new F();
+ <stable> <accessor> def bar: F = Foo.this.bar;
Foo.this.bar.<selectDynamic: error>("<error>")
}
================================================================================
diff --git a/test/files/presentation/t8941.check b/test/files/presentation/t8941.check
index 341804903a..4285eebd8f 100644
--- a/test/files/presentation/t8941.check
+++ b/test/files/presentation/t8941.check
@@ -3,5 +3,5 @@ reload: Source.scala
askType at Source.scala(6,7)
================================================================================
[response] askTypeAt (6,7)
-scala.this.Predef.???
+scala.Predef.???
================================================================================
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/pos/t4579.scala b/test/files/run/lisp.scala
index cd1553f02a..162c7d2599 100644
--- a/test/files/pos/t4579.scala
+++ b/test/files/run/lisp.scala
@@ -1,5 +1,5 @@
//############################################################################
-// Lisp interpreter (revived as an optimizer test.)
+// Lisp interpreter
//############################################################################
//############################################################################
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-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_java8.flags b/test/files/run/sammy_java8.flags
deleted file mode 100644
index 48fd867160..0000000000
--- a/test/files/run/sammy_java8.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xexperimental
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])("rO0ABXNyACxzY2FsYS5yZWZsZWN0Lk1hbmlmZXN0RmFjdG9yeSRPYmplY3RNYW5pZmVzdAAAAAAAAAABAgAAeHIALXNjYWxhLnJlZmxlY3QuTWFuaWZlc3RGYWN0b3J5JFBoYW50b21NYW5pZmVzdAAAAAAAAAABAgABTAAIdG9TdHJpbmd0ABJMamF2YS9sYW5nL1N0cmluZzt4cgAvc2NhbGEucmVmbGVjdC5NYW5pZmVzdEZhY3RvcnkkQ2xhc3NUeXBlTWFuaWZlc3QAAAAAAAAAAQIAA0wABnByZWZpeHQADkxzY2FsYS9PcHRpb247TAAMcnVudGltZUNsYXNzdAARTGphdmEvbGFuZy9DbGFzcztMAA10eXBlQXJndW1lbnRzdAAhTHNjYWxhL2NvbGxlY3Rpb24vaW1tdXRhYmxlL0xpc3Q7eHBzcgALc2NhbGEuTm9uZSRGUCT2U8qUrAIAAHhyAAxzY2FsYS5PcHRpb27+aTf92w5mdAIAAHhwdnIAEGphdmEubGFuZy5PYmplY3QAAAAAAAAAAAAAAHhwc3IAMnNjYWxhLmNvbGxlY3Rpb24uaW1tdXRhYmxlLkxpc3QkU2VyaWFsaXphdGlvblByb3h5AAAAAAAAAAEDAAB4cHNyACxzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5MaXN0U2VyaWFsaXplRW5kJIpcY1v3UwttAgAAeHB4dAAGT2JqZWN0")
// TODO SI-8576 unstable under -Xcheckinit
// check(Enum)( "rO0ABXNyAApUZXN0JEVudW0ketCIyQ8C23MCAAJMAAJWMXQAGUxzY2FsYS9FbnVtZXJhdGlvbiRWYWx1ZTtMAAJWMnQAF0xzY2FsYS9FbnVtZXJhdGlvbiRWYWw7eHIAEXNjYWxhLkVudW1lcmF0aW9udaDN3ZgOWY4CAAhJAAZuZXh0SWRJABtzY2FsYSRFbnVtZXJhdGlvbiQkYm90dG9tSWRJABhzY2FsYSRFbnVtZXJhdGlvbiQkdG9wSWRMABRWYWx1ZU9yZGVyaW5nJG1vZHVsZXQAIkxzY2FsYS9FbnVtZXJhdGlvbiRWYWx1ZU9yZGVyaW5nJDtMAA9WYWx1ZVNldCRtb2R1bGV0AB1Mc2NhbGEvRW51bWVyYXRpb24kVmFsdWVTZXQkO0wACG5leHROYW1ldAAbTHNjYWxhL2NvbGxlY3Rpb24vSXRlcmF0b3I7TAAXc2NhbGEkRW51bWVyYXRpb24kJG5tYXB0AB5Mc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL01hcDtMABdzY2FsYSRFbnVtZXJhdGlvbiQkdm1hcHEAfgAHeHAAAAArAAAAAAAAACtwcHBzcgAgc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLkhhc2hNYXAAAAAAAAAAAQMAAHhwdw0AAALuAAAAAAAAAAQAeHNxAH4ACXcNAAAC7gAAAAEAAAAEAHNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAAqc3IAFXNjYWxhLkVudW1lcmF0aW9uJFZhbM9pZ6/J/O1PAgACSQAYc2NhbGEkRW51bWVyYXRpb24kVmFsJCRpTAAEbmFtZXQAEkxqYXZhL2xhbmcvU3RyaW5nO3hyABdzY2FsYS5FbnVtZXJhdGlvbiRWYWx1ZWJpfC/tIR1RAgACTAAGJG91dGVydAATTHNjYWxhL0VudW1lcmF0aW9uO0wAHHNjYWxhJEVudW1lcmF0aW9uJCRvdXRlckVudW1xAH4AEnhwcQB+AAhxAH4ACAAAACpweHNyABFUZXN0JEVudW0kJGFub24kMVlIjlmE1sXaAgAAeHEAfgARcQB+AAhxAH4ACHEAfgAT")
@@ -116,6 +116,19 @@ object Test extends App {
// TODO SI-8576 unstable under -Xcheckinit
check(collection.convert.Wrappers)( "rO0ABXNyACJzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkrrSziizavIECABJMABhEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJERpY3Rpb25hcnlXcmFwcGVyJDtMABZJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYWJsZVdyYXBwZXIkO0wAFkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADRMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEl0ZXJhdG9yV3JhcHBlciQ7TAAZSkNvbGxlY3Rpb25XcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbGxlY3Rpb25XcmFwcGVyJDtMABxKQ29uY3VycmVudE1hcFdyYXBwZXIkbW9kdWxldAA6THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKQ29uY3VycmVudE1hcFdyYXBwZXIkO0wAGUpEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpEaWN0aW9uYXJ5V3JhcHBlciQ7TAAaSkVudW1lcmF0aW9uV3JhcHBlciRtb2R1bGV0ADhMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpFbnVtZXJhdGlvbldyYXBwZXIkO0wAF0pJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKSXRlcmFibGVXcmFwcGVyJDtMABdKSXRlcmF0b3JXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhdG9yV3JhcHBlciQ7TAATSkxpc3RXcmFwcGVyJG1vZHVsZXQAMUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkxpc3RXcmFwcGVyJDtMABJKTWFwV3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpNYXBXcmFwcGVyJDtMABlKUHJvcGVydGllc1dyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKUHJvcGVydGllc1dyYXBwZXIkO0wAEkpTZXRXcmFwcGVyJG1vZHVsZXQAMExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlNldFdyYXBwZXIkO0wAG011dGFibGVCdWZmZXJXcmFwcGVyJG1vZHVsZXQAOUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZUJ1ZmZlcldyYXBwZXIkO0wAGE11dGFibGVNYXBXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXIkO0wAGE11dGFibGVTZXFXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNlcVdyYXBwZXIkO0wAGE11dGFibGVTZXRXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXIkO0wAEVNlcVdyYXBwZXIkbW9kdWxldAAvTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRTZXFXcmFwcGVyJDt4cHBwcHBwcHBwcHBwcHBwcHBwcA==")
+ check(new collection.convert.Wrappers.SetWrapper(immutable.Set()))("rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkU2V0V3JhcHBlcgAAAAAAAAABAgACTAAGJG91dGVydAAjTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycztMADhzY2FsYSRjb2xsZWN0aW9uJGNvbnZlcnQkV3JhcHBlcnMkU2V0V3JhcHBlciQkdW5kZXJseWluZ3QAFkxzY2FsYS9jb2xsZWN0aW9uL1NldDt4cHNyACJzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkrrSziizavIECABJMABhEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJERpY3Rpb25hcnlXcmFwcGVyJDtMABZJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYWJsZVdyYXBwZXIkO0wAFkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADRMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEl0ZXJhdG9yV3JhcHBlciQ7TAAZSkNvbGxlY3Rpb25XcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbGxlY3Rpb25XcmFwcGVyJDtMABxKQ29uY3VycmVudE1hcFdyYXBwZXIkbW9kdWxldAA6THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKQ29uY3VycmVudE1hcFdyYXBwZXIkO0wAGUpEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpEaWN0aW9uYXJ5V3JhcHBlciQ7TAAaSkVudW1lcmF0aW9uV3JhcHBlciRtb2R1bGV0ADhMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpFbnVtZXJhdGlvbldyYXBwZXIkO0wAF0pJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKSXRlcmFibGVXcmFwcGVyJDtMABdKSXRlcmF0b3JXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhdG9yV3JhcHBlciQ7TAATSkxpc3RXcmFwcGVyJG1vZHVsZXQAMUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkxpc3RXcmFwcGVyJDtMABJKTWFwV3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpNYXBXcmFwcGVyJDtMABlKUHJvcGVydGllc1dyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKUHJvcGVydGllc1dyYXBwZXIkO0wAEkpTZXRXcmFwcGVyJG1vZHVsZXQAMExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlNldFdyYXBwZXIkO0wAG011dGFibGVCdWZmZXJXcmFwcGVyJG1vZHVsZXQAOUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZUJ1ZmZlcldyYXBwZXIkO0wAGE11dGFibGVNYXBXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXIkO0wAGE11dGFibGVTZXFXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNlcVdyYXBwZXIkO0wAGE11dGFibGVTZXRXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXIkO0wAEVNlcVdyYXBwZXIkbW9kdWxldAAvTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRTZXFXcmFwcGVyJDt4cHBwcHBwcHBwcHBwcHBwcHBwcHNyAChzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5TZXQkRW1wdHlTZXQk3hYx1+cpzHgCAAB4cA==")
+ check(new collection.convert.Wrappers.SetWrapper(immutable.Set(1, 2, 3)))("rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkU2V0V3JhcHBlcgAAAAAAAAABAgACTAAGJG91dGVydAAjTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycztMADhzY2FsYSRjb2xsZWN0aW9uJGNvbnZlcnQkV3JhcHBlcnMkU2V0V3JhcHBlciQkdW5kZXJseWluZ3QAFkxzY2FsYS9jb2xsZWN0aW9uL1NldDt4cHNyACJzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkrrSziizavIECABJMABhEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJERpY3Rpb25hcnlXcmFwcGVyJDtMABZJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYWJsZVdyYXBwZXIkO0wAFkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADRMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEl0ZXJhdG9yV3JhcHBlciQ7TAAZSkNvbGxlY3Rpb25XcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbGxlY3Rpb25XcmFwcGVyJDtMABxKQ29uY3VycmVudE1hcFdyYXBwZXIkbW9kdWxldAA6THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKQ29uY3VycmVudE1hcFdyYXBwZXIkO0wAGUpEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpEaWN0aW9uYXJ5V3JhcHBlciQ7TAAaSkVudW1lcmF0aW9uV3JhcHBlciRtb2R1bGV0ADhMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpFbnVtZXJhdGlvbldyYXBwZXIkO0wAF0pJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKSXRlcmFibGVXcmFwcGVyJDtMABdKSXRlcmF0b3JXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhdG9yV3JhcHBlciQ7TAATSkxpc3RXcmFwcGVyJG1vZHVsZXQAMUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkxpc3RXcmFwcGVyJDtMABJKTWFwV3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpNYXBXcmFwcGVyJDtMABlKUHJvcGVydGllc1dyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKUHJvcGVydGllc1dyYXBwZXIkO0wAEkpTZXRXcmFwcGVyJG1vZHVsZXQAMExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlNldFdyYXBwZXIkO0wAG011dGFibGVCdWZmZXJXcmFwcGVyJG1vZHVsZXQAOUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZUJ1ZmZlcldyYXBwZXIkO0wAGE11dGFibGVNYXBXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXIkO0wAGE11dGFibGVTZXFXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNlcVdyYXBwZXIkO0wAGE11dGFibGVTZXRXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXIkO0wAEVNlcVdyYXBwZXIkbW9kdWxldAAvTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRTZXFXcmFwcGVyJDt4cHBwcHBwcHBwcHBwcHBwcHBwcHNyACNzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5TZXQkU2V0M84syT0560SgAgADTAAFZWxlbTF0ABJMamF2YS9sYW5nL09iamVjdDtMAAVlbGVtMnEAfgAZTAAFZWxlbTNxAH4AGXhwc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAFzcQB+ABsAAAACc3EAfgAbAAAAAw==")
+ check(new collection.convert.Wrappers.SetWrapper(mutable.Set()))("rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkU2V0V3JhcHBlcgAAAAAAAAABAgACTAAGJG91dGVydAAjTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycztMADhzY2FsYSRjb2xsZWN0aW9uJGNvbnZlcnQkV3JhcHBlcnMkU2V0V3JhcHBlciQkdW5kZXJseWluZ3QAFkxzY2FsYS9jb2xsZWN0aW9uL1NldDt4cHNyACJzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkrrSziizavIECABJMABhEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJERpY3Rpb25hcnlXcmFwcGVyJDtMABZJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYWJsZVdyYXBwZXIkO0wAFkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADRMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEl0ZXJhdG9yV3JhcHBlciQ7TAAZSkNvbGxlY3Rpb25XcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbGxlY3Rpb25XcmFwcGVyJDtMABxKQ29uY3VycmVudE1hcFdyYXBwZXIkbW9kdWxldAA6THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKQ29uY3VycmVudE1hcFdyYXBwZXIkO0wAGUpEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpEaWN0aW9uYXJ5V3JhcHBlciQ7TAAaSkVudW1lcmF0aW9uV3JhcHBlciRtb2R1bGV0ADhMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpFbnVtZXJhdGlvbldyYXBwZXIkO0wAF0pJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKSXRlcmFibGVXcmFwcGVyJDtMABdKSXRlcmF0b3JXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhdG9yV3JhcHBlciQ7TAATSkxpc3RXcmFwcGVyJG1vZHVsZXQAMUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkxpc3RXcmFwcGVyJDtMABJKTWFwV3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpNYXBXcmFwcGVyJDtMABlKUHJvcGVydGllc1dyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKUHJvcGVydGllc1dyYXBwZXIkO0wAEkpTZXRXcmFwcGVyJG1vZHVsZXQAMExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlNldFdyYXBwZXIkO0wAG011dGFibGVCdWZmZXJXcmFwcGVyJG1vZHVsZXQAOUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZUJ1ZmZlcldyYXBwZXIkO0wAGE11dGFibGVNYXBXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXIkO0wAGE11dGFibGVTZXFXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNlcVdyYXBwZXIkO0wAGE11dGFibGVTZXRXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXIkO0wAEVNlcVdyYXBwZXIkbW9kdWxldAAvTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRTZXFXcmFwcGVyJDt4cHBwcHBwcHBwcHBwcHBwcHBwcHNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGFzaFNldAAAAAAAAAABAwAAeHB3DQAAAcIAAAAAAAAABQB4")
+ check(new collection.convert.Wrappers.SetWrapper(mutable.Set(1, 2, 3)))("rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkU2V0V3JhcHBlcgAAAAAAAAABAgACTAAGJG91dGVydAAjTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycztMADhzY2FsYSRjb2xsZWN0aW9uJGNvbnZlcnQkV3JhcHBlcnMkU2V0V3JhcHBlciQkdW5kZXJseWluZ3QAFkxzY2FsYS9jb2xsZWN0aW9uL1NldDt4cHNyACJzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkrrSziizavIECABJMABhEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJERpY3Rpb25hcnlXcmFwcGVyJDtMABZJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYWJsZVdyYXBwZXIkO0wAFkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADRMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEl0ZXJhdG9yV3JhcHBlciQ7TAAZSkNvbGxlY3Rpb25XcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbGxlY3Rpb25XcmFwcGVyJDtMABxKQ29uY3VycmVudE1hcFdyYXBwZXIkbW9kdWxldAA6THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKQ29uY3VycmVudE1hcFdyYXBwZXIkO0wAGUpEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpEaWN0aW9uYXJ5V3JhcHBlciQ7TAAaSkVudW1lcmF0aW9uV3JhcHBlciRtb2R1bGV0ADhMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpFbnVtZXJhdGlvbldyYXBwZXIkO0wAF0pJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKSXRlcmFibGVXcmFwcGVyJDtMABdKSXRlcmF0b3JXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhdG9yV3JhcHBlciQ7TAATSkxpc3RXcmFwcGVyJG1vZHVsZXQAMUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkxpc3RXcmFwcGVyJDtMABJKTWFwV3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpNYXBXcmFwcGVyJDtMABlKUHJvcGVydGllc1dyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKUHJvcGVydGllc1dyYXBwZXIkO0wAEkpTZXRXcmFwcGVyJG1vZHVsZXQAMExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlNldFdyYXBwZXIkO0wAG011dGFibGVCdWZmZXJXcmFwcGVyJG1vZHVsZXQAOUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZUJ1ZmZlcldyYXBwZXIkO0wAGE11dGFibGVNYXBXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXIkO0wAGE11dGFibGVTZXFXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNlcVdyYXBwZXIkO0wAGE11dGFibGVTZXRXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXIkO0wAEVNlcVdyYXBwZXIkbW9kdWxldAAvTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRTZXFXcmFwcGVyJDt4cHBwcHBwcHBwcHBwcHBwcHBwcHNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGFzaFNldAAAAAAAAAABAwAAeHB3DQAAAcIAAAADAAAABQBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AGgAAAAJzcQB+ABoAAAADeA==")
+ check(new collection.convert.Wrappers.MutableSetWrapper(mutable.Set()))("rO0ABXNyADNzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXK9XXTONonwwgIAAUwACnVuZGVybHlpbmd0AB5Mc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL1NldDt4cgAsc2NhbGEuY29sbGVjdGlvbi5jb252ZXJ0LldyYXBwZXJzJFNldFdyYXBwZXIAAAAAAAAAAQIAAkwABiRvdXRlcnQAI0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnM7TAA4c2NhbGEkY29sbGVjdGlvbiRjb252ZXJ0JFdyYXBwZXJzJFNldFdyYXBwZXIkJHVuZGVybHlpbmd0ABZMc2NhbGEvY29sbGVjdGlvbi9TZXQ7eHBzcgAic2NhbGEuY29sbGVjdGlvbi5jb252ZXJ0LldyYXBwZXJzJK60s4os2ryBAgASTAAYRGljdGlvbmFyeVdyYXBwZXIkbW9kdWxldAA2THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyREaWN0aW9uYXJ5V3JhcHBlciQ7TAAWSXRlcmFibGVXcmFwcGVyJG1vZHVsZXQANExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSXRlcmFibGVXcmFwcGVyJDtMABZJdGVyYXRvcldyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYXRvcldyYXBwZXIkO0wAGUpDb2xsZWN0aW9uV3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpDb2xsZWN0aW9uV3JhcHBlciQ7TAAcSkNvbmN1cnJlbnRNYXBXcmFwcGVyJG1vZHVsZXQAOkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbmN1cnJlbnRNYXBXcmFwcGVyJDtMABlKRGljdGlvbmFyeVdyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKRGljdGlvbmFyeVdyYXBwZXIkO0wAGkpFbnVtZXJhdGlvbldyYXBwZXIkbW9kdWxldAA4THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKRW51bWVyYXRpb25XcmFwcGVyJDtMABdKSXRlcmFibGVXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhYmxlV3JhcHBlciQ7TAAXSkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADVMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpJdGVyYXRvcldyYXBwZXIkO0wAE0pMaXN0V3JhcHBlciRtb2R1bGV0ADFMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpMaXN0V3JhcHBlciQ7TAASSk1hcFdyYXBwZXIkbW9kdWxldAAwTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKTWFwV3JhcHBlciQ7TAAZSlByb3BlcnRpZXNXcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlByb3BlcnRpZXNXcmFwcGVyJDtMABJKU2V0V3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpTZXRXcmFwcGVyJDtMABtNdXRhYmxlQnVmZmVyV3JhcHBlciRtb2R1bGV0ADlMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVCdWZmZXJXcmFwcGVyJDtMABhNdXRhYmxlTWFwV3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVNYXBXcmFwcGVyJDtMABhNdXRhYmxlU2VxV3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVTZXFXcmFwcGVyJDtMABhNdXRhYmxlU2V0V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVTZXRXcmFwcGVyJDtMABFTZXFXcmFwcGVyJG1vZHVsZXQAL0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkU2VxV3JhcHBlciQ7eHBwcHBwcHBwcHBwcHBwcHBwcHBzcgAgc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLkhhc2hTZXQAAAAAAAAAAQMAAHhwdw0AAAHCAAAAAAAAAAUAeHEAfgAb")
+ check(new collection.convert.Wrappers.MutableSetWrapper(mutable.Set(1, 2, 3)))("rO0ABXNyADNzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXK9XXTONonwwgIAAUwACnVuZGVybHlpbmd0AB5Mc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL1NldDt4cgAsc2NhbGEuY29sbGVjdGlvbi5jb252ZXJ0LldyYXBwZXJzJFNldFdyYXBwZXIAAAAAAAAAAQIAAkwABiRvdXRlcnQAI0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnM7TAA4c2NhbGEkY29sbGVjdGlvbiRjb252ZXJ0JFdyYXBwZXJzJFNldFdyYXBwZXIkJHVuZGVybHlpbmd0ABZMc2NhbGEvY29sbGVjdGlvbi9TZXQ7eHBzcgAic2NhbGEuY29sbGVjdGlvbi5jb252ZXJ0LldyYXBwZXJzJK60s4os2ryBAgASTAAYRGljdGlvbmFyeVdyYXBwZXIkbW9kdWxldAA2THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyREaWN0aW9uYXJ5V3JhcHBlciQ7TAAWSXRlcmFibGVXcmFwcGVyJG1vZHVsZXQANExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSXRlcmFibGVXcmFwcGVyJDtMABZJdGVyYXRvcldyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYXRvcldyYXBwZXIkO0wAGUpDb2xsZWN0aW9uV3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpDb2xsZWN0aW9uV3JhcHBlciQ7TAAcSkNvbmN1cnJlbnRNYXBXcmFwcGVyJG1vZHVsZXQAOkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbmN1cnJlbnRNYXBXcmFwcGVyJDtMABlKRGljdGlvbmFyeVdyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKRGljdGlvbmFyeVdyYXBwZXIkO0wAGkpFbnVtZXJhdGlvbldyYXBwZXIkbW9kdWxldAA4THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKRW51bWVyYXRpb25XcmFwcGVyJDtMABdKSXRlcmFibGVXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhYmxlV3JhcHBlciQ7TAAXSkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADVMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpJdGVyYXRvcldyYXBwZXIkO0wAE0pMaXN0V3JhcHBlciRtb2R1bGV0ADFMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpMaXN0V3JhcHBlciQ7TAASSk1hcFdyYXBwZXIkbW9kdWxldAAwTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKTWFwV3JhcHBlciQ7TAAZSlByb3BlcnRpZXNXcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlByb3BlcnRpZXNXcmFwcGVyJDtMABJKU2V0V3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpTZXRXcmFwcGVyJDtMABtNdXRhYmxlQnVmZmVyV3JhcHBlciRtb2R1bGV0ADlMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVCdWZmZXJXcmFwcGVyJDtMABhNdXRhYmxlTWFwV3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVNYXBXcmFwcGVyJDtMABhNdXRhYmxlU2VxV3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVTZXFXcmFwcGVyJDtMABhNdXRhYmxlU2V0V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVTZXRXcmFwcGVyJDtMABFTZXFXcmFwcGVyJG1vZHVsZXQAL0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkU2VxV3JhcHBlciQ7eHBwcHBwcHBwcHBwcHBwcHBwcHBzcgAgc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLkhhc2hTZXQAAAAAAAAAAQMAAHhwdw0AAAHCAAAAAwAAAAUAc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAFzcQB+ABwAAAACc3EAfgAcAAAAA3hxAH4AGw==")
+ check(new collection.convert.Wrappers.MapWrapper(immutable.Map()))("rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkTWFwV3JhcHBlcgAAAAAAAAABAgACTAAGJG91dGVydAAjTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycztMADhzY2FsYSRjb2xsZWN0aW9uJGNvbnZlcnQkV3JhcHBlcnMkTWFwV3JhcHBlciQkdW5kZXJseWluZ3QAFkxzY2FsYS9jb2xsZWN0aW9uL01hcDt4cHNyACJzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkrrSziizavIECABJMABhEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJERpY3Rpb25hcnlXcmFwcGVyJDtMABZJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYWJsZVdyYXBwZXIkO0wAFkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADRMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEl0ZXJhdG9yV3JhcHBlciQ7TAAZSkNvbGxlY3Rpb25XcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbGxlY3Rpb25XcmFwcGVyJDtMABxKQ29uY3VycmVudE1hcFdyYXBwZXIkbW9kdWxldAA6THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKQ29uY3VycmVudE1hcFdyYXBwZXIkO0wAGUpEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpEaWN0aW9uYXJ5V3JhcHBlciQ7TAAaSkVudW1lcmF0aW9uV3JhcHBlciRtb2R1bGV0ADhMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpFbnVtZXJhdGlvbldyYXBwZXIkO0wAF0pJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKSXRlcmFibGVXcmFwcGVyJDtMABdKSXRlcmF0b3JXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhdG9yV3JhcHBlciQ7TAATSkxpc3RXcmFwcGVyJG1vZHVsZXQAMUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkxpc3RXcmFwcGVyJDtMABJKTWFwV3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpNYXBXcmFwcGVyJDtMABlKUHJvcGVydGllc1dyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKUHJvcGVydGllc1dyYXBwZXIkO0wAEkpTZXRXcmFwcGVyJG1vZHVsZXQAMExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlNldFdyYXBwZXIkO0wAG011dGFibGVCdWZmZXJXcmFwcGVyJG1vZHVsZXQAOUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZUJ1ZmZlcldyYXBwZXIkO0wAGE11dGFibGVNYXBXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXIkO0wAGE11dGFibGVTZXFXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNlcVdyYXBwZXIkO0wAGE11dGFibGVTZXRXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXIkO0wAEVNlcVdyYXBwZXIkbW9kdWxldAAvTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRTZXFXcmFwcGVyJDt4cHBwcHBwcHBwcHBwcHBwcHBwcHNyAChzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5NYXAkRW1wdHlNYXAksesbhW5CgMsCAAB4cA==")
+ check(new collection.convert.Wrappers.MapWrapper(immutable.Map[Int, Int](1 -> 2, 2 -> 3, 3 -> 4)))("rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkTWFwV3JhcHBlcgAAAAAAAAABAgACTAAGJG91dGVydAAjTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycztMADhzY2FsYSRjb2xsZWN0aW9uJGNvbnZlcnQkV3JhcHBlcnMkTWFwV3JhcHBlciQkdW5kZXJseWluZ3QAFkxzY2FsYS9jb2xsZWN0aW9uL01hcDt4cHNyACJzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkrrSziizavIECABJMABhEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJERpY3Rpb25hcnlXcmFwcGVyJDtMABZJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYWJsZVdyYXBwZXIkO0wAFkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADRMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEl0ZXJhdG9yV3JhcHBlciQ7TAAZSkNvbGxlY3Rpb25XcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbGxlY3Rpb25XcmFwcGVyJDtMABxKQ29uY3VycmVudE1hcFdyYXBwZXIkbW9kdWxldAA6THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKQ29uY3VycmVudE1hcFdyYXBwZXIkO0wAGUpEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpEaWN0aW9uYXJ5V3JhcHBlciQ7TAAaSkVudW1lcmF0aW9uV3JhcHBlciRtb2R1bGV0ADhMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpFbnVtZXJhdGlvbldyYXBwZXIkO0wAF0pJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKSXRlcmFibGVXcmFwcGVyJDtMABdKSXRlcmF0b3JXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhdG9yV3JhcHBlciQ7TAATSkxpc3RXcmFwcGVyJG1vZHVsZXQAMUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkxpc3RXcmFwcGVyJDtMABJKTWFwV3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpNYXBXcmFwcGVyJDtMABlKUHJvcGVydGllc1dyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKUHJvcGVydGllc1dyYXBwZXIkO0wAEkpTZXRXcmFwcGVyJG1vZHVsZXQAMExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlNldFdyYXBwZXIkO0wAG011dGFibGVCdWZmZXJXcmFwcGVyJG1vZHVsZXQAOUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZUJ1ZmZlcldyYXBwZXIkO0wAGE11dGFibGVNYXBXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXIkO0wAGE11dGFibGVTZXFXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNlcVdyYXBwZXIkO0wAGE11dGFibGVTZXRXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXIkO0wAEVNlcVdyYXBwZXIkbW9kdWxldAAvTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRTZXFXcmFwcGVyJDt4cHBwcHBwcHBwcHBwcHBwcHBwcHNyACNzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5NYXAkTWFwM6csFD+HjyRxAgAGTAAEa2V5MXQAEkxqYXZhL2xhbmcvT2JqZWN0O0wABGtleTJxAH4AGUwABGtleTNxAH4AGUwABnZhbHVlMXEAfgAZTAAGdmFsdWUycQB+ABlMAAZ2YWx1ZTNxAH4AGXhwc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAFzcQB+ABsAAAACc3EAfgAbAAAAA3EAfgAecQB+AB9zcQB+ABsAAAAE")
+ check(new collection.convert.Wrappers.MapWrapper(mutable.Map()))("rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkTWFwV3JhcHBlcgAAAAAAAAABAgACTAAGJG91dGVydAAjTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycztMADhzY2FsYSRjb2xsZWN0aW9uJGNvbnZlcnQkV3JhcHBlcnMkTWFwV3JhcHBlciQkdW5kZXJseWluZ3QAFkxzY2FsYS9jb2xsZWN0aW9uL01hcDt4cHNyACJzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkrrSziizavIECABJMABhEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJERpY3Rpb25hcnlXcmFwcGVyJDtMABZJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYWJsZVdyYXBwZXIkO0wAFkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADRMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEl0ZXJhdG9yV3JhcHBlciQ7TAAZSkNvbGxlY3Rpb25XcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbGxlY3Rpb25XcmFwcGVyJDtMABxKQ29uY3VycmVudE1hcFdyYXBwZXIkbW9kdWxldAA6THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKQ29uY3VycmVudE1hcFdyYXBwZXIkO0wAGUpEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpEaWN0aW9uYXJ5V3JhcHBlciQ7TAAaSkVudW1lcmF0aW9uV3JhcHBlciRtb2R1bGV0ADhMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpFbnVtZXJhdGlvbldyYXBwZXIkO0wAF0pJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKSXRlcmFibGVXcmFwcGVyJDtMABdKSXRlcmF0b3JXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhdG9yV3JhcHBlciQ7TAATSkxpc3RXcmFwcGVyJG1vZHVsZXQAMUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkxpc3RXcmFwcGVyJDtMABJKTWFwV3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpNYXBXcmFwcGVyJDtMABlKUHJvcGVydGllc1dyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKUHJvcGVydGllc1dyYXBwZXIkO0wAEkpTZXRXcmFwcGVyJG1vZHVsZXQAMExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlNldFdyYXBwZXIkO0wAG011dGFibGVCdWZmZXJXcmFwcGVyJG1vZHVsZXQAOUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZUJ1ZmZlcldyYXBwZXIkO0wAGE11dGFibGVNYXBXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXIkO0wAGE11dGFibGVTZXFXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNlcVdyYXBwZXIkO0wAGE11dGFibGVTZXRXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXIkO0wAEVNlcVdyYXBwZXIkbW9kdWxldAAvTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRTZXFXcmFwcGVyJDt4cHBwcHBwcHBwcHBwcHBwcHBwcHNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGFzaE1hcAAAAAAAAAABAwAAeHB3DQAAAu4AAAAAAAAABAB4")
+ check(new collection.convert.Wrappers.MapWrapper(mutable.Map[Int, Int](1 -> 2, 2 -> 3, 3 -> 4)))("rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkTWFwV3JhcHBlcgAAAAAAAAABAgACTAAGJG91dGVydAAjTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycztMADhzY2FsYSRjb2xsZWN0aW9uJGNvbnZlcnQkV3JhcHBlcnMkTWFwV3JhcHBlciQkdW5kZXJseWluZ3QAFkxzY2FsYS9jb2xsZWN0aW9uL01hcDt4cHNyACJzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkrrSziizavIECABJMABhEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJERpY3Rpb25hcnlXcmFwcGVyJDtMABZJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYWJsZVdyYXBwZXIkO0wAFkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADRMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEl0ZXJhdG9yV3JhcHBlciQ7TAAZSkNvbGxlY3Rpb25XcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbGxlY3Rpb25XcmFwcGVyJDtMABxKQ29uY3VycmVudE1hcFdyYXBwZXIkbW9kdWxldAA6THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKQ29uY3VycmVudE1hcFdyYXBwZXIkO0wAGUpEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpEaWN0aW9uYXJ5V3JhcHBlciQ7TAAaSkVudW1lcmF0aW9uV3JhcHBlciRtb2R1bGV0ADhMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpFbnVtZXJhdGlvbldyYXBwZXIkO0wAF0pJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKSXRlcmFibGVXcmFwcGVyJDtMABdKSXRlcmF0b3JXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhdG9yV3JhcHBlciQ7TAATSkxpc3RXcmFwcGVyJG1vZHVsZXQAMUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkxpc3RXcmFwcGVyJDtMABJKTWFwV3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpNYXBXcmFwcGVyJDtMABlKUHJvcGVydGllc1dyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKUHJvcGVydGllc1dyYXBwZXIkO0wAEkpTZXRXcmFwcGVyJG1vZHVsZXQAMExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlNldFdyYXBwZXIkO0wAG011dGFibGVCdWZmZXJXcmFwcGVyJG1vZHVsZXQAOUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZUJ1ZmZlcldyYXBwZXIkO0wAGE11dGFibGVNYXBXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXIkO0wAGE11dGFibGVTZXFXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNlcVdyYXBwZXIkO0wAGE11dGFibGVTZXRXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXIkO0wAEVNlcVdyYXBwZXIkbW9kdWxldAAvTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRTZXFXcmFwcGVyJDt4cHBwcHBwcHBwcHBwcHBwcHBwcHNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGFzaE1hcAAAAAAAAAABAwAAeHB3DQAAAu4AAAADAAAABABzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAnNxAH4AGgAAAANzcQB+ABoAAAABcQB+ABxxAH4AHXNxAH4AGgAAAAR4")
+ check(new collection.convert.Wrappers.MutableMapWrapper(mutable.Map()))("rO0ABXNyADNzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXJ4TG6ffKy11wIAAUwACnVuZGVybHlpbmd0AB5Mc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL01hcDt4cgAsc2NhbGEuY29sbGVjdGlvbi5jb252ZXJ0LldyYXBwZXJzJE1hcFdyYXBwZXIAAAAAAAAAAQIAAkwABiRvdXRlcnQAI0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnM7TAA4c2NhbGEkY29sbGVjdGlvbiRjb252ZXJ0JFdyYXBwZXJzJE1hcFdyYXBwZXIkJHVuZGVybHlpbmd0ABZMc2NhbGEvY29sbGVjdGlvbi9NYXA7eHBzcgAic2NhbGEuY29sbGVjdGlvbi5jb252ZXJ0LldyYXBwZXJzJK60s4os2ryBAgASTAAYRGljdGlvbmFyeVdyYXBwZXIkbW9kdWxldAA2THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyREaWN0aW9uYXJ5V3JhcHBlciQ7TAAWSXRlcmFibGVXcmFwcGVyJG1vZHVsZXQANExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSXRlcmFibGVXcmFwcGVyJDtMABZJdGVyYXRvcldyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYXRvcldyYXBwZXIkO0wAGUpDb2xsZWN0aW9uV3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpDb2xsZWN0aW9uV3JhcHBlciQ7TAAcSkNvbmN1cnJlbnRNYXBXcmFwcGVyJG1vZHVsZXQAOkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbmN1cnJlbnRNYXBXcmFwcGVyJDtMABlKRGljdGlvbmFyeVdyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKRGljdGlvbmFyeVdyYXBwZXIkO0wAGkpFbnVtZXJhdGlvbldyYXBwZXIkbW9kdWxldAA4THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKRW51bWVyYXRpb25XcmFwcGVyJDtMABdKSXRlcmFibGVXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhYmxlV3JhcHBlciQ7TAAXSkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADVMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpJdGVyYXRvcldyYXBwZXIkO0wAE0pMaXN0V3JhcHBlciRtb2R1bGV0ADFMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpMaXN0V3JhcHBlciQ7TAASSk1hcFdyYXBwZXIkbW9kdWxldAAwTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKTWFwV3JhcHBlciQ7TAAZSlByb3BlcnRpZXNXcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlByb3BlcnRpZXNXcmFwcGVyJDtMABJKU2V0V3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpTZXRXcmFwcGVyJDtMABtNdXRhYmxlQnVmZmVyV3JhcHBlciRtb2R1bGV0ADlMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVCdWZmZXJXcmFwcGVyJDtMABhNdXRhYmxlTWFwV3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVNYXBXcmFwcGVyJDtMABhNdXRhYmxlU2VxV3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVTZXFXcmFwcGVyJDtMABhNdXRhYmxlU2V0V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVTZXRXcmFwcGVyJDtMABFTZXFXcmFwcGVyJG1vZHVsZXQAL0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkU2VxV3JhcHBlciQ7eHBwcHBwcHBwcHBwcHBwcHBwcHBzcgAgc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLkhhc2hNYXAAAAAAAAAAAQMAAHhwdw0AAALuAAAAAAAAAAQAeHEAfgAb")
+ check(new collection.convert.Wrappers.MutableMapWrapper(mutable.Map[Int, Int](1 -> 2, 2 -> 3, 3 -> 4)))("rO0ABXNyADNzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXJ4TG6ffKy11wIAAUwACnVuZGVybHlpbmd0AB5Mc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL01hcDt4cgAsc2NhbGEuY29sbGVjdGlvbi5jb252ZXJ0LldyYXBwZXJzJE1hcFdyYXBwZXIAAAAAAAAAAQIAAkwABiRvdXRlcnQAI0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnM7TAA4c2NhbGEkY29sbGVjdGlvbiRjb252ZXJ0JFdyYXBwZXJzJE1hcFdyYXBwZXIkJHVuZGVybHlpbmd0ABZMc2NhbGEvY29sbGVjdGlvbi9NYXA7eHBzcgAic2NhbGEuY29sbGVjdGlvbi5jb252ZXJ0LldyYXBwZXJzJK60s4os2ryBAgASTAAYRGljdGlvbmFyeVdyYXBwZXIkbW9kdWxldAA2THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyREaWN0aW9uYXJ5V3JhcHBlciQ7TAAWSXRlcmFibGVXcmFwcGVyJG1vZHVsZXQANExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSXRlcmFibGVXcmFwcGVyJDtMABZJdGVyYXRvcldyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYXRvcldyYXBwZXIkO0wAGUpDb2xsZWN0aW9uV3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpDb2xsZWN0aW9uV3JhcHBlciQ7TAAcSkNvbmN1cnJlbnRNYXBXcmFwcGVyJG1vZHVsZXQAOkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbmN1cnJlbnRNYXBXcmFwcGVyJDtMABlKRGljdGlvbmFyeVdyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKRGljdGlvbmFyeVdyYXBwZXIkO0wAGkpFbnVtZXJhdGlvbldyYXBwZXIkbW9kdWxldAA4THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKRW51bWVyYXRpb25XcmFwcGVyJDtMABdKSXRlcmFibGVXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhYmxlV3JhcHBlciQ7TAAXSkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADVMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpJdGVyYXRvcldyYXBwZXIkO0wAE0pMaXN0V3JhcHBlciRtb2R1bGV0ADFMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpMaXN0V3JhcHBlciQ7TAASSk1hcFdyYXBwZXIkbW9kdWxldAAwTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKTWFwV3JhcHBlciQ7TAAZSlByb3BlcnRpZXNXcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlByb3BlcnRpZXNXcmFwcGVyJDtMABJKU2V0V3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpTZXRXcmFwcGVyJDtMABtNdXRhYmxlQnVmZmVyV3JhcHBlciRtb2R1bGV0ADlMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVCdWZmZXJXcmFwcGVyJDtMABhNdXRhYmxlTWFwV3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVNYXBXcmFwcGVyJDtMABhNdXRhYmxlU2VxV3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVTZXFXcmFwcGVyJDtMABhNdXRhYmxlU2V0V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVTZXRXcmFwcGVyJDtMABFTZXFXcmFwcGVyJG1vZHVsZXQAL0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkU2VxV3JhcHBlciQ7eHBwcHBwcHBwcHBwcHBwcHBwcHBzcgAgc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLkhhc2hNYXAAAAAAAAAAAQMAAHhwdw0AAALuAAAAAwAAAAQAc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAJzcQB+ABwAAAADc3EAfgAcAAAAAXEAfgAecQB+AB9zcQB+ABwAAAAEeHEAfgAb")
+
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))( "rO0ABXNyACdzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5MaXN0U2V0JE5vZGX1EX2lizBAdwIAAkwABiRvdXRlcnQAJExzY2FsYS9jb2xsZWN0aW9uL2ltbXV0YWJsZS9MaXN0U2V0O0wABGVsZW10ABJMamF2YS9sYW5nL09iamVjdDt4cgAic2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuTGlzdFNldIswmWkomtI2AgAAeHBzcgAwc2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuTGlzdFNldCRFbXB0eUxpc3RTZXQkRYhxsJisIUwCAAB4cQB+AANzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAQ==")
check(immutable.ListMap())( "rO0ABXNyADBzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5MaXN0TWFwJEVtcHR5TGlzdE1hcCSNalsvpBZeDgIAAHhyACJzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5MaXN0TWFwBC1gfIkUSKsCAAB4cA==")
check(immutable.ListMap(1 -> 2))( "rO0ABXNyACdzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5MaXN0TWFwJE5vZGWmciM1Yav+8gIAA0wABiRvdXRlcnQAJExzY2FsYS9jb2xsZWN0aW9uL2ltbXV0YWJsZS9MaXN0TWFwO0wAA2tleXQAEkxqYXZhL2xhbmcvT2JqZWN0O0wABXZhbHVlcQB+AAJ4cgAic2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuTGlzdE1hcAQtYHyJFEirAgAAeHBzcgAwc2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuTGlzdE1hcCRFbXB0eUxpc3RNYXAkjWpbL6QWXg4CAAB4cQB+AANzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4ABwAAAAI=")
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))( "rO0ABXNyACJzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5UcmVlU2V0sRdVIDjbWAsCAAJMAAhvcmRlcmluZ3QAFUxzY2FsYS9tYXRoL09yZGVyaW5nO0wABHRyZWV0AC5Mc2NhbGEvY29sbGVjdGlvbi9pbW11dGFibGUvUmVkQmxhY2tUcmVlJFRyZWU7eHBzcgAYc2NhbGEubWF0aC5PcmRlcmluZyRJbnQkC4BMdr1Z51wCAAB4cHNyADFzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5SZWRCbGFja1RyZWUkQmxhY2tUcmVlzRxnCKenVAECAAB4cgAsc2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuUmVkQmxhY2tUcmVlJFRyZWVrqCSyHJbsMgIABUkABWNvdW50TAADa2V5dAASTGphdmEvbGFuZy9PYmplY3Q7TAAEbGVmdHEAfgACTAAFcmlnaHRxAH4AAkwABXZhbHVlcQB+AAh4cAAAAANzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAnNxAH4ABgAAAAFzcQB+AAoAAAABcHBzcgAXc2NhbGEucnVudGltZS5Cb3hlZFVuaXR0pn1HHezLmgIAAHhwc3EAfgAGAAAAAXNxAH4ACgAAAANwcHEAfgAQcQB+ABA=")
@@ -157,22 +172,29 @@ object Test extends App {
// check(mutable.ArrayBuffer(1, 2, 3))( "rO0ABXNyACRzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuQXJyYXlCdWZmZXIVOLBTg4KOcwIAA0kAC2luaXRpYWxTaXplSQAFc2l6ZTBbAAVhcnJheXQAE1tMamF2YS9sYW5nL09iamVjdDt4cAAAABAAAAADdXIAE1tMamF2YS5sYW5nLk9iamVjdDuQzlifEHMpbAIAAHhwAAAAEHNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAABc3EAfgAFAAAAAnNxAH4ABQAAAANwcHBwcHBwcHBwcHBw")
// 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]())( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuVHJlZU1hcNx8qC229ZvwAgACTAAIb3JkZXJpbmd0ABVMc2NhbGEvbWF0aC9PcmRlcmluZztMACZzY2FsYSRjb2xsZWN0aW9uJG11dGFibGUkVHJlZU1hcCQkdHJlZXQALExzY2FsYS9jb2xsZWN0aW9uL211dGFibGUvUmVkQmxhY2tUcmVlJFRyZWU7eHBzcgAYc2NhbGEubWF0aC5PcmRlcmluZyRJbnQk8u7cgruVzucCAAB4cHNyACpzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuUmVkQmxhY2tUcmVlJFRyZWUATKc08DWmFQIAAkkABHNpemVMAARyb290dAAsTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9SZWRCbGFja1RyZWUkTm9kZTt4cAAAAABw")
+ check(mutable.TreeMap(1 -> 1, 3 -> 6))( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuVHJlZU1hcNx8qC229ZvwAgACTAAIb3JkZXJpbmd0ABVMc2NhbGEvbWF0aC9PcmRlcmluZztMACZzY2FsYSRjb2xsZWN0aW9uJG11dGFibGUkVHJlZU1hcCQkdHJlZXQALExzY2FsYS9jb2xsZWN0aW9uL211dGFibGUvUmVkQmxhY2tUcmVlJFRyZWU7eHBzcgAYc2NhbGEubWF0aC5PcmRlcmluZyRJbnQk8u7cgruVzucCAAB4cHNyACpzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuUmVkQmxhY2tUcmVlJFRyZWUATKc08DWmFQIAAkkABHNpemVMAARyb290dAAsTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9SZWRCbGFja1RyZWUkTm9kZTt4cAAAAAJzcgAqc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLlJlZEJsYWNrVHJlZSROb2RlGxHsFtValgACAAZaAANyZWRMAANrZXl0ABJMamF2YS9sYW5nL09iamVjdDtMAARsZWZ0cQB+AAdMAAZwYXJlbnRxAH4AB0wABXJpZ2h0cQB+AAdMAAV2YWx1ZXEAfgAKeHAAc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAFwcHNxAH4ACQFzcQB+AAwAAAADcHEAfgALcHNxAH4ADAAAAAZxAH4ADg==")
+ check(mutable.TreeMap(1 -> 1, 3 -> 6).range(1, 2))( "rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuVHJlZU1hcCRUcmVlTWFwVmlldx7MCZxLhVQ8AgADTAAGJG91dGVydAAiTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9UcmVlTWFwO0wABGZyb210AA5Mc2NhbGEvT3B0aW9uO0wABXVudGlscQB+AAJ4cgAgc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLlRyZWVNYXDcfKgttvWb8AIAAkwACG9yZGVyaW5ndAAVTHNjYWxhL21hdGgvT3JkZXJpbmc7TAAmc2NhbGEkY29sbGVjdGlvbiRtdXRhYmxlJFRyZWVNYXAkJHRyZWV0ACxMc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL1JlZEJsYWNrVHJlZSRUcmVlO3hwc3IAGHNjYWxhLm1hdGguT3JkZXJpbmckSW50JPLu3IK7lc7nAgAAeHBzcgAqc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLlJlZEJsYWNrVHJlZSRUcmVlAEynNPA1phUCAAJJAARzaXplTAAEcm9vdHQALExzY2FsYS9jb2xsZWN0aW9uL211dGFibGUvUmVkQmxhY2tUcmVlJE5vZGU7eHAAAAACc3IAKnNjYWxhLmNvbGxlY3Rpb24ubXV0YWJsZS5SZWRCbGFja1RyZWUkTm9kZRsR7BbVWpYAAgAGWgADcmVkTAADa2V5dAASTGphdmEvbGFuZy9PYmplY3Q7TAAEbGVmdHEAfgAKTAAGcGFyZW50cQB+AApMAAVyaWdodHEAfgAKTAAFdmFsdWVxAH4ADXhwAHNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAABcHBzcQB+AAwBc3EAfgAPAAAAA3BxAH4ADnBzcQB+AA8AAAAGcQB+ABFzcQB+AANxAH4ACHEAfgALc3IACnNjYWxhLlNvbWURIvJpXqGLdAIAAUwABXZhbHVlcQB+AA14cgAMc2NhbGEuT3B0aW9u/mk3/dsOZnQCAAB4cHEAfgARc3EAfgAWc3EAfgAPAAAAAg==")
+ check(mutable.TreeSet[Int]())( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuVHJlZVNldM10nxFQDpt4AgACTAAIb3JkZXJpbmd0ABVMc2NhbGEvbWF0aC9PcmRlcmluZztMACZzY2FsYSRjb2xsZWN0aW9uJG11dGFibGUkVHJlZVNldCQkdHJlZXQALExzY2FsYS9jb2xsZWN0aW9uL211dGFibGUvUmVkQmxhY2tUcmVlJFRyZWU7eHBzcgAYc2NhbGEubWF0aC5PcmRlcmluZyRJbnQk8u7cgruVzucCAAB4cHNyACpzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuUmVkQmxhY2tUcmVlJFRyZWUATKc08DWmFQIAAkkABHNpemVMAARyb290dAAsTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9SZWRCbGFja1RyZWUkTm9kZTt4cAAAAABw")
+ check(mutable.TreeSet(1, 3))( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuVHJlZVNldM10nxFQDpt4AgACTAAIb3JkZXJpbmd0ABVMc2NhbGEvbWF0aC9PcmRlcmluZztMACZzY2FsYSRjb2xsZWN0aW9uJG11dGFibGUkVHJlZVNldCQkdHJlZXQALExzY2FsYS9jb2xsZWN0aW9uL211dGFibGUvUmVkQmxhY2tUcmVlJFRyZWU7eHBzcgAYc2NhbGEubWF0aC5PcmRlcmluZyRJbnQk8u7cgruVzucCAAB4cHNyACpzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuUmVkQmxhY2tUcmVlJFRyZWUATKc08DWmFQIAAkkABHNpemVMAARyb290dAAsTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9SZWRCbGFja1RyZWUkTm9kZTt4cAAAAAJzcgAqc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLlJlZEJsYWNrVHJlZSROb2RlGxHsFtValgACAAZaAANyZWRMAANrZXl0ABJMamF2YS9sYW5nL09iamVjdDtMAARsZWZ0cQB+AAdMAAZwYXJlbnRxAH4AB0wABXJpZ2h0cQB+AAdMAAV2YWx1ZXEAfgAKeHAAc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAFwcHNxAH4ACQFzcQB+AAwAAAADcHEAfgALcHBw")
+ check(mutable.TreeSet(1, 3).range(1, 2))( "rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuVHJlZVNldCRUcmVlU2V0Vmlld2JdAzqy0DpGAgADTAAGJG91dGVydAAiTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9UcmVlU2V0O0wABGZyb210AA5Mc2NhbGEvT3B0aW9uO0wABXVudGlscQB+AAJ4cgAgc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLlRyZWVTZXTNdJ8RUA6beAIAAkwACG9yZGVyaW5ndAAVTHNjYWxhL21hdGgvT3JkZXJpbmc7TAAmc2NhbGEkY29sbGVjdGlvbiRtdXRhYmxlJFRyZWVTZXQkJHRyZWV0ACxMc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL1JlZEJsYWNrVHJlZSRUcmVlO3hwc3IAGHNjYWxhLm1hdGguT3JkZXJpbmckSW50JPLu3IK7lc7nAgAAeHBzcgAqc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLlJlZEJsYWNrVHJlZSRUcmVlAEynNPA1phUCAAJJAARzaXplTAAEcm9vdHQALExzY2FsYS9jb2xsZWN0aW9uL211dGFibGUvUmVkQmxhY2tUcmVlJE5vZGU7eHAAAAACc3IAKnNjYWxhLmNvbGxlY3Rpb24ubXV0YWJsZS5SZWRCbGFja1RyZWUkTm9kZRsR7BbVWpYAAgAGWgADcmVkTAADa2V5dAASTGphdmEvbGFuZy9PYmplY3Q7TAAEbGVmdHEAfgAKTAAGcGFyZW50cQB+AApMAAVyaWdodHEAfgAKTAAFdmFsdWVxAH4ADXhwAHNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAABcHBzcQB+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))( "rO0ABXNyACNzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuTGlzdEJ1ZmZlci9y9I7QyWzGAwAEWgAIZXhwb3J0ZWRJAANsZW5MAAVsYXN0MHQAKUxzY2FsYS9jb2xsZWN0aW9uL2ltbXV0YWJsZS8kY29sb24kY29sb247TAAqc2NhbGEkY29sbGVjdGlvbiRtdXRhYmxlJExpc3RCdWZmZXIkJHN0YXJ0dAAhTHNjYWxhL2NvbGxlY3Rpb24vaW1tdXRhYmxlL0xpc3Q7eHBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4ABAAAAAJzcQB+AAQAAAADc3IALHNjYWxhLmNvbGxlY3Rpb24uaW1tdXRhYmxlLkxpc3RTZXJpYWxpemVFbmQkilxjW/dTC20CAAB4cHcFAAAAAAN4")
check(new mutable.StringBuilder(new java.lang.StringBuilder("123")))( "rO0ABXNyACZzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuU3RyaW5nQnVpbGRlcomvqgGv1tTxAgABTAAKdW5kZXJseWluZ3QAGUxqYXZhL2xhbmcvU3RyaW5nQnVpbGRlcjt4cHNyABdqYXZhLmxhbmcuU3RyaW5nQnVpbGRlcjzV+xRaTGrLAwAAeHB3BAAAAAN1cgACW0OwJmaw4l2ErAIAAHhwAAAAEwAxADIAMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAeA==")
- check(mutable.UnrolledBuffer[Int]())( "rO0ABXNyACdzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuVW5yb2xsZWRCdWZmZXIAAAAAAAAAAQMAAUwAA3RhZ3QAGExzY2FsYS9yZWZsZWN0L0NsYXNzVGFnO3hwc3IAJXNjYWxhLnJlZmxlY3QuTWFuaWZlc3RGYWN0b3J5JCRhbm9uJDnN+aJJU2O1UgIAAHhyABxzY2FsYS5yZWZsZWN0LkFueVZhbE1hbmlmZXN0AAAAAAAAAAECAAFMAAh0b1N0cmluZ3QAEkxqYXZhL2xhbmcvU3RyaW5nO3hwdAADSW50dwQAAAAAeA==")
+ 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.flags b/test/files/run/t8764.flags
deleted file mode 100644
index 48fd867160..0000000000
--- a/test/files/run/t8764.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xexperimental
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/neg/sammy_wrong_arity.flags b/test/files/run/t9178a.flags
index 48fd867160..48fd867160 100644
--- a/test/files/neg/sammy_wrong_arity.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/neg/t8764.flags b/test/files/run/t9489.flags
index 48fd867160..48fd867160 100644
--- a/test/files/neg/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/jvm/t1449.check b/test/files/run/trait-static-forwarder.check
index d81cc0710e..d81cc0710e 100644
--- a/test/files/jvm/t1449.check
+++ b/test/files/run/trait-static-forwarder.check
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
diff --git a/test/files/scalacheck/CheckCollections.scala b/test/files/scalacheck/CheckCollections.scala
deleted file mode 100644
index 329d505b47..0000000000
--- a/test/files/scalacheck/CheckCollections.scala
+++ /dev/null
@@ -1,52 +0,0 @@
-import org.scalacheck.Properties
-import org.scalacheck.Prop._
-
-import scala.reflect.internal.util.Collections._
-
-object Test extends Properties("reflect.internal.util.Collections") {
- def map2ConserveOld[A <: AnyRef, B](xs: List[A], ys: List[B])(f: (A, B) => A): List[A] =
- if (xs.isEmpty || ys.isEmpty) xs
- else {
- val x1 = f(xs.head, ys.head)
- val xs1 = map2Conserve(xs.tail, ys.tail)(f)
- if ((x1 eq xs.head) && (xs1 eq xs.tail)) xs
- else x1 :: xs1
- }
-
- val testfun: (String, Int) => String = { case(x, y) =>
- x.toLowerCase + y.toString
- }
- val testid: (String, Int) => String = { case (x, y) => x }
-
- val prop1_map2Conserve = forAll { (xs: List[String], ys: List[Int]) =>
- val res = map2Conserve(xs, ys)(testid)
- res eq xs
- }
-
- val prop2_map2Conserve = forAll { (xs: List[String], ys: List[Int]) =>
- map2Conserve(xs, ys)(testid) == map2ConserveOld(xs, ys)(testid) &&
- map2Conserve(xs, ys)(testfun) == map2ConserveOld(xs, ys)(testfun)
- }
-
- def checkStackOverflow() {
- var xs: List[String] = Nil
- var ys: List[Int] = Nil
- for (i <- 0 until 250000) {
- xs = "X" :: xs
- ys = 1 :: ys
- }
- map2Conserve(xs, ys){ case(x, y) => x.toLowerCase + y.toString }
- }
-
-
- val tests = List(
- ("map2Conserve(identity)", prop1_map2Conserve),
- ("map2Conserve == old impl", prop2_map2Conserve)
- )
-
- checkStackOverflow()
-
- for {
- (label, prop) <- tests
- } property(label) = prop
-}
diff --git a/test/files/scalacheck/CheckEither.scala b/test/files/scalacheck/CheckEither.scala
deleted file mode 100644
index 48f732a22d..0000000000
--- a/test/files/scalacheck/CheckEither.scala
+++ /dev/null
@@ -1,179 +0,0 @@
-import org.scalacheck.{ Arbitrary, Prop, Properties }
-import org.scalacheck.Arbitrary.{arbitrary, arbThrowable}
-import org.scalacheck.Gen.oneOf
-import org.scalacheck.Prop._
-import org.scalacheck.Test.check
-import Function.tupled
-
-object Test extends Properties("Either") {
- implicit def arbitraryEither[X, Y](implicit xa: Arbitrary[X], ya: Arbitrary[Y]): Arbitrary[Either[X, Y]] =
- Arbitrary[Either[X, Y]](oneOf(arbitrary[X].map(Left(_)), arbitrary[Y].map(Right(_))))
-
- val prop_either1 = forAll((n: Int) => Left(n).fold(x => x, b => sys.error("fail")) == n)
-
- val prop_either2 = forAll((n: Int) => Right(n).fold(a => sys.error("fail"), x => x) == n)
-
- val prop_swap = forAll((e: Either[Int, Int]) => e match {
- case Left(a) => e.swap.right.get == a
- case Right(b) => e.swap.left.get == b
- })
-
- val prop_isLeftRight = forAll((e: Either[Int, Int]) => e.isLeft != e.isRight)
-
- object CheckLeftProjection {
- val prop_value = forAll((n: Int) => Left(n).left.get == n)
-
- val prop_getOrElse = forAll((e: Either[Int, Int], or: Int) => e.left.getOrElse(or) == (e match {
- case Left(a) => a
- case Right(_) => or
- }))
-
- val prop_forall = forAll((e: Either[Int, Int]) =>
- e.left.forall(_ % 2 == 0) == (e.isRight || e.left.get % 2 == 0))
-
- val prop_exists = forAll((e: Either[Int, Int]) =>
- e.left.exists(_ % 2 == 0) == (e.isLeft && e.left.get % 2 == 0))
-
- val prop_flatMapLeftIdentity = forAll((e: Either[Int, Int], n: Int, s: String) => {
- def f(x: Int) = if(x % 2 == 0) Left(s) else Right(s)
- Left(n).left.flatMap(f(_)) == f(n)})
-
- val prop_flatMapRightIdentity = forAll((e: Either[Int, Int]) => e.left.flatMap(Left(_)) == e)
-
- val prop_flatMapComposition = forAll((e: Either[Int, Int]) => {
- def f(x: Int) = if(x % 2 == 0) Left(x) else Right(x)
- def g(x: Int) = if(x % 7 == 0) Right(x) else Left(x)
- e.left.flatMap(f(_)).left.flatMap(g(_)) == e.left.flatMap(f(_).left.flatMap(g(_)))})
-
- val prop_mapIdentity = forAll((e: Either[Int, Int]) => e.left.map(x => x) == e)
-
- val prop_mapComposition = forAll((e: Either[String, Int]) => {
- def f(s: String) = s.toLowerCase
- def g(s: String) = s.reverse
- e.left.map(x => f(g(x))) == e.left.map(x => g(x)).left.map(f(_))})
-
- val prop_filter = forAll((e: Either[Int, Int], x: Int) => e.left.filter(_ % 2 == 0) ==
- (if(e.isRight || e.left.get % 2 != 0) None else Some(e)))
-
- val prop_seq = forAll((e: Either[Int, Int]) => e.left.toSeq == (e match {
- case Left(a) => Seq(a)
- case Right(_) => Seq.empty
- }))
-
- val prop_option = forAll((e: Either[Int, Int]) => e.left.toOption == (e match {
- case Left(a) => Some(a)
- case Right(_) => None
- }))
- }
-
- object CheckRightProjection {
- val prop_value = forAll((n: Int) => Right(n).right.get == n)
-
- val prop_getOrElse = forAll((e: Either[Int, Int], or: Int) => e.right.getOrElse(or) == (e match {
- case Left(_) => or
- case Right(b) => b
- }))
-
- val prop_forall = forAll((e: Either[Int, Int]) =>
- e.right.forall(_ % 2 == 0) == (e.isLeft || e.right.get % 2 == 0))
-
- val prop_exists = forAll((e: Either[Int, Int]) =>
- e.right.exists(_ % 2 == 0) == (e.isRight && e.right.get % 2 == 0))
-
- val prop_flatMapLeftIdentity = forAll((e: Either[Int, Int], n: Int, s: String) => {
- def f(x: Int) = if(x % 2 == 0) Left(s) else Right(s)
- Right(n).right.flatMap(f(_)) == f(n)})
-
- val prop_flatMapRightIdentity = forAll((e: Either[Int, Int]) => e.right.flatMap(Right(_)) == e)
-
- val prop_flatMapComposition = forAll((e: Either[Int, Int]) => {
- def f(x: Int) = if(x % 2 == 0) Left(x) else Right(x)
- def g(x: Int) = if(x % 7 == 0) Right(x) else Left(x)
- e.right.flatMap(f(_)).right.flatMap(g(_)) == e.right.flatMap(f(_).right.flatMap(g(_)))})
-
- val prop_mapIdentity = forAll((e: Either[Int, Int]) => e.right.map(x => x) == e)
-
- val prop_mapComposition = forAll((e: Either[Int, String]) => {
- def f(s: String) = s.toLowerCase
- def g(s: String) = s.reverse
- e.right.map(x => f(g(x))) == e.right.map(x => g(x)).right.map(f(_))})
-
- val prop_filter = forAll((e: Either[Int, Int], x: Int) => e.right.filter(_ % 2 == 0) ==
- (if(e.isLeft || e.right.get % 2 != 0) None else Some(e)))
-
- val prop_seq = forAll((e: Either[Int, Int]) => e.right.toSeq == (e match {
- case Left(_) => Seq.empty
- case Right(b) => Seq(b)
- }))
-
- val prop_option = forAll((e: Either[Int, Int]) => e.right.toOption == (e match {
- case Left(_) => None
- case Right(b) => Some(b)
- }))
- }
-
- val prop_Either_left = forAll((n: Int) => Left(n).left.get == n)
-
- val prop_Either_right = forAll((n: Int) => Right(n).right.get == n)
-
- val prop_Either_joinLeft = forAll((e: Either[Either[Int, Int], Int]) => e match {
- case Left(ee) => e.joinLeft == ee
- case Right(n) => e.joinLeft == Right(n)
- })
-
- val prop_Either_joinRight = forAll((e: Either[Int, Either[Int, Int]]) => e match {
- case Left(n) => e.joinRight == Left(n)
- case Right(ee) => e.joinRight == ee
- })
-
- val prop_Either_reduce = forAll((e: Either[Int, Int]) =>
- e.merge == (e match {
- case Left(a) => a
- case Right(a) => a
- }))
-
- /** Hard to believe I'm "fixing" a test to reflect B before A ... */
- val prop_Either_cond = forAll((c: Boolean, a: Int, b: Int) =>
- Either.cond(c, a, b) == (if(c) Right(a) else Left(b)))
-
- val tests = List(
- ("prop_either1", prop_either1),
- ("prop_either2", prop_either2),
- ("prop_swap", prop_swap),
- ("prop_isLeftRight", prop_isLeftRight),
- ("Left.prop_value", CheckLeftProjection.prop_value),
- ("Left.prop_getOrElse", CheckLeftProjection.prop_getOrElse),
- ("Left.prop_forall", CheckLeftProjection.prop_forall),
- ("Left.prop_exists", CheckLeftProjection.prop_exists),
- ("Left.prop_flatMapLeftIdentity", CheckLeftProjection.prop_flatMapLeftIdentity),
- ("Left.prop_flatMapRightIdentity", CheckLeftProjection.prop_flatMapRightIdentity),
- ("Left.prop_flatMapComposition", CheckLeftProjection.prop_flatMapComposition),
- ("Left.prop_mapIdentity", CheckLeftProjection.prop_mapIdentity),
- ("Left.prop_mapComposition", CheckLeftProjection.prop_mapComposition),
- ("Left.prop_filter", CheckLeftProjection.prop_filter),
- ("Left.prop_seq", CheckLeftProjection.prop_seq),
- ("Left.prop_option", CheckLeftProjection.prop_option),
- ("Right.prop_value", CheckRightProjection.prop_value),
- ("Right.prop_getOrElse", CheckRightProjection.prop_getOrElse),
- ("Right.prop_forall", CheckRightProjection.prop_forall),
- ("Right.prop_exists", CheckRightProjection.prop_exists),
- ("Right.prop_flatMapLeftIdentity", CheckRightProjection.prop_flatMapLeftIdentity),
- ("Right.prop_flatMapRightIdentity", CheckRightProjection.prop_flatMapRightIdentity),
- ("Right.prop_flatMapComposition", CheckRightProjection.prop_flatMapComposition),
- ("Right.prop_mapIdentity", CheckRightProjection.prop_mapIdentity),
- ("Right.prop_mapComposition", CheckRightProjection.prop_mapComposition),
- ("Right.prop_filter", CheckRightProjection.prop_filter),
- ("Right.prop_seq", CheckRightProjection.prop_seq),
- ("Right.prop_option", CheckRightProjection.prop_option),
- ("prop_Either_left", prop_Either_left),
- ("prop_Either_right", prop_Either_right),
- ("prop_Either_joinLeft", prop_Either_joinLeft),
- ("prop_Either_joinRight", prop_Either_joinRight),
- ("prop_Either_reduce", prop_Either_reduce),
- ("prop_Either_cond", prop_Either_cond)
- )
-
- for ((label, prop) <- tests) {
- property(label) = prop
- }
-}
diff --git a/test/files/scalacheck/Ctrie.scala b/test/files/scalacheck/Ctrie.scala
deleted file mode 100644
index eef9d06f37..0000000000
--- a/test/files/scalacheck/Ctrie.scala
+++ /dev/null
@@ -1,218 +0,0 @@
-
-
-
-import org.scalacheck._
-import Prop._
-import org.scalacheck.Gen._
-import collection._
-import collection.concurrent.TrieMap
-
-
-
-case class Wrap(i: Int) {
- override def hashCode = i // * 0x9e3775cd
-}
-
-
-/** A check mainly oriented towards checking snapshot correctness.
- */
-object Test extends Properties("concurrent.TrieMap") {
-
- /* generators */
-
- val sizes = choose(0, 200000)
-
- val threadCounts = choose(2, 16)
-
- val threadCountsAndSizes = for {
- p <- threadCounts
- sz <- sizes
- } yield (p, sz);
-
-
- /* helpers */
-
- def inParallel[T](totalThreads: Int)(body: Int => T): Seq[T] = {
- val threads = for (idx <- 0 until totalThreads) yield new Thread {
- setName("ParThread-" + idx)
- private var res: T = _
- override def run() {
- res = body(idx)
- }
- def result = {
- this.join()
- res
- }
- }
-
- threads foreach (_.start())
- threads map (_.result)
- }
-
- def spawn[T](body: =>T): { def get: T } = {
- val t = new Thread {
- setName("SpawnThread")
- private var res: T = _
- override def run() {
- res = body
- }
- def result = res
- }
- t.start()
- new {
- def get: T = {
- t.join()
- t.result
- }
- }
- }
-
- def elementRange(threadIdx: Int, totalThreads: Int, totalElems: Int): Range = {
- val sz = totalElems
- val idx = threadIdx
- val p = totalThreads
- val start = (sz / p) * idx + math.min(idx, sz % p)
- val elems = (sz / p) + (if (idx < sz % p) 1 else 0)
- val end = start + elems
- (start until end)
- }
-
- def hasGrown[K, V](last: Map[K, V], current: Map[K, V]) = {
- (last.size <= current.size) && {
- last forall {
- case (k, v) => current.get(k) == Some(v)
- }
- }
- }
-
- object err {
- var buffer = new StringBuilder
- def println(a: AnyRef) = buffer.append(a.toString).append("\n")
- def clear() = buffer.clear()
- def flush() = {
- Console.out.println(buffer)
- clear()
- }
- }
-
-
- /* properties */
-
- property("concurrent growing snapshots") = forAll(threadCounts, sizes) {
- (numThreads, numElems) =>
- val p = 3 //numThreads
- val sz = 102 //numElems
- val ct = new TrieMap[Wrap, Int]
-
- // checker
- val checker = spawn {
- def check(last: Map[Wrap, Int], iterationsLeft: Int): Boolean = {
- val current = ct.readOnlySnapshot()
- if (!hasGrown(last, current)) false
- else if (current.size >= sz) true
- else if (iterationsLeft < 0) false
- else check(current, iterationsLeft - 1)
- }
- check(ct.readOnlySnapshot(), 500)
- }
-
- // fillers
- inParallel(p) {
- idx =>
- elementRange(idx, p, sz) foreach (i => ct.update(Wrap(i), i))
- }
-
- // wait for checker to finish
- val growing = true//checker.get
-
- val ok = growing && ((0 until sz) forall {
- case i => ct.get(Wrap(i)) == Some(i)
- })
-
- ok
- }
-
- property("update") = forAll(sizes) {
- (n: Int) =>
- val ct = new TrieMap[Int, Int]
- for (i <- 0 until n) ct(i) = i
- (0 until n) forall {
- case i => ct(i) == i
- }
- }
-
- property("concurrent update") = forAll(threadCountsAndSizes) {
- case (p, sz) =>
- val ct = new TrieMap[Wrap, Int]
-
- inParallel(p) {
- idx =>
- for (i <- elementRange(idx, p, sz)) ct(Wrap(i)) = i
- }
-
- (0 until sz) forall {
- case i => ct(Wrap(i)) == i
- }
- }
-
-
- property("concurrent remove") = forAll(threadCounts, sizes) {
- (p, sz) =>
- val ct = new TrieMap[Wrap, Int]
- for (i <- 0 until sz) ct(Wrap(i)) = i
-
- inParallel(p) {
- idx =>
- for (i <- elementRange(idx, p, sz)) ct.remove(Wrap(i))
- }
-
- (0 until sz) forall {
- case i => ct.get(Wrap(i)) == None
- }
- }
-
-
- property("concurrent putIfAbsent") = forAll(threadCounts, sizes) {
- (p, sz) =>
- val ct = new TrieMap[Wrap, Int]
-
- val results = inParallel(p) {
- idx =>
- elementRange(idx, p, sz) find (i => ct.putIfAbsent(Wrap(i), i) != None)
- }
-
- (results forall (_ == None)) && ((0 until sz) forall {
- case i => ct.get(Wrap(i)) == Some(i)
- })
- }
-
- property("concurrent getOrElseUpdate") = forAll(threadCounts, sizes) {
- (p, sz) =>
- val totalInserts = new java.util.concurrent.atomic.AtomicInteger
- val ct = new TrieMap[Wrap, String]
-
- val results = inParallel(p) {
- idx =>
- (0 until sz) foreach {
- i =>
- val v = ct.getOrElseUpdate(Wrap(i), idx + ":" + i)
- if (v == idx + ":" + i) totalInserts.incrementAndGet()
- }
- }
-
- (totalInserts.get == sz) && ((0 until sz) forall {
- case i => ct(Wrap(i)).split(":")(1).toInt == i
- })
- }
-
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/test/files/scalacheck/ReflectionExtractors.scala b/test/files/scalacheck/ReflectionExtractors.scala
deleted file mode 100644
index a2615feb3e..0000000000
--- a/test/files/scalacheck/ReflectionExtractors.scala
+++ /dev/null
@@ -1,52 +0,0 @@
-import org.scalacheck._
-import Prop._
-import Gen._
-import Arbitrary._
-
-import scala.reflect.runtime.universe._
-import Flag._
-
-object Test extends Properties("reflection extractors") {
-
- val genFlag = oneOf(
- TRAIT, INTERFACE, MUTABLE, MACRO, DEFERRED, ABSTRACT, FINAL, SEALED,
- IMPLICIT, LAZY, OVERRIDE, PRIVATE, PROTECTED, LOCAL, CASE, ABSOVERRIDE,
- BYNAMEPARAM, PARAM, COVARIANT, CONTRAVARIANT, DEFAULTPARAM, PRESUPER,
- DEFAULTINIT
- )
- val genModifiers =
- for(flag <- genFlag; privateWithin <- genName)
- yield Modifiers(flag, privateWithin, Nil)
- val genTermName = for(name <- arbitrary[String]) yield TermName(name)
- val genTypeName = for(name <- arbitrary[String]) yield TypeName(name)
- val genName = oneOf(genTermName, genTypeName)
-
- implicit val arbTermName: Arbitrary[TermName] = Arbitrary(genTermName)
- implicit val arbTypeName: Arbitrary[TypeName] = Arbitrary(genTypeName)
- implicit val arbName: Arbitrary[Name] = Arbitrary(genName)
- implicit val arbMods: Arbitrary[Modifiers] = Arbitrary(genModifiers)
-
- property("extract term name") = forAll { (name: TermName) =>
- val TermName(s) = name
- s == name.toString
- }
-
- property("extract type name") = forAll { (name: TypeName) =>
- val TypeName(s) = name
- s == name.toString
- }
-
- property("extract term or type name") = forAll { (name: Name) =>
- name match {
- case TermName(s) => s == name.toString
- case TypeName(s) => s == name.toString
- }
- }
-
- property("extract modifiers") = forAll { (mods: Modifiers) =>
- val Modifiers(flags, priv, annots) = mods
- flags == mods.flags &&
- priv == mods.privateWithin &&
- annots == mods.annotations
- }
-} \ No newline at end of file
diff --git a/test/files/scalacheck/Unrolled.scala b/test/files/scalacheck/Unrolled.scala
deleted file mode 100644
index 34604b8667..0000000000
--- a/test/files/scalacheck/Unrolled.scala
+++ /dev/null
@@ -1,26 +0,0 @@
-import org.scalacheck._
-import Prop._
-import Gen._
-
-import collection.mutable.UnrolledBuffer
-
-object Test extends Properties("UnrolledBuffer") {
-
- property("concat size") = forAll { (l1: List[Int], l2: List[Int]) =>
- val u1 = new UnrolledBuffer[Int]
- u1 ++= l1
- val u2 = new UnrolledBuffer[Int]
- u2 ++= l2
- val totalsz = u1.size + u2.size
- u1 concat u2
- totalsz == u1.size
- }
-
- property("adding") = forAll { (l: List[Int]) =>
- val u = new UnrolledBuffer[Int]
- u ++= l
- u == l
- }
-
-}
-
diff --git a/test/files/scalacheck/array-new.scala b/test/files/scalacheck/array-new.scala
deleted file mode 100644
index d8c69ead78..0000000000
--- a/test/files/scalacheck/array-new.scala
+++ /dev/null
@@ -1,37 +0,0 @@
-import scala.reflect.ClassTag // new style: use ClassTag
-import org.scalacheck._
-import Prop._
-import Gen._
-import Arbitrary._
-import util._
-import Buildable._
-import scala.collection.mutable.ArraySeq
-
-object Test extends Properties("Array") {
- /** At this moment the authentic scalacheck Array Builder/Arb bits are commented out.
- */
- implicit def arbArray[T](implicit a: Arbitrary[T], m: ClassTag[T]): Arbitrary[Array[T]] =
- Arbitrary(containerOf[List,T](arbitrary[T]) map (_.toArray))
-
- val arrGen: Gen[Array[_]] = oneOf(
- arbitrary[Array[Int]],
- arbitrary[Array[Array[Int]]],
- arbitrary[Array[List[String]]],
- arbitrary[Array[String]],
- arbitrary[Array[Boolean]],
- arbitrary[Array[AnyVal]]
- )
-
- // inspired by #1857 and #2352
- property("eq/ne") = forAll(arrGen, arrGen) { (c1, c2) =>
- (c1 eq c2) || (c1 ne c2)
- }
-
- // inspired by #2299
- def smallInt = choose(1, 10)
- property("ofDim") = forAll(smallInt, smallInt, smallInt) { (i1, i2, i3) =>
- val arr = Array.ofDim[String](i1, i2, i3)
- val flattened = arr flatMap (x => x) flatMap (x => x)
- flattened.length == i1 * i2 * i3
- }
-} \ No newline at end of file
diff --git a/test/files/scalacheck/array-old.scala b/test/files/scalacheck/array-old.scala
deleted file mode 100644
index 03c0217180..0000000000
--- a/test/files/scalacheck/array-old.scala
+++ /dev/null
@@ -1,37 +0,0 @@
-import org.scalacheck._
-import Prop._
-import Gen._
-import Arbitrary._
-import util._
-import Buildable._
-import scala.collection.mutable.ArraySeq
-
-object Test extends Properties("Array") {
- /** At this moment the authentic scalacheck Array Builder/Arb bits are commented out.
- */
- implicit def arbArray[T](implicit a: Arbitrary[T], m: Manifest[T]): Arbitrary[Array[T]] =
- Arbitrary(containerOf[List,T](arbitrary[T]) map (_.toArray))
-
- val arrGen: Gen[Array[_]] = oneOf(
- arbitrary[Array[Int]],
- arbitrary[Array[Array[Int]]],
- arbitrary[Array[List[String]]],
- arbitrary[Array[String]],
- arbitrary[Array[Boolean]],
- arbitrary[Array[AnyVal]]
- )
-
- // inspired by #1857 and #2352
- property("eq/ne") = forAll(arrGen, arrGen) { (c1, c2) =>
- (c1 eq c2) || (c1 ne c2)
- }
-
- // inspired by #2299
- def smallInt = choose(1, 10)
- property("ofDim") = forAll(smallInt, smallInt, smallInt) { (i1, i2, i3) =>
- val arr = Array.ofDim[String](i1, i2, i3)
- val flattened = arr flatMap (x => x) flatMap (x => x)
- flattened.length == i1 * i2 * i3
- }
-}
-
diff --git a/test/files/scalacheck/avl.scala b/test/files/scalacheck/avl.scala
deleted file mode 100644
index 4cfacaf407..0000000000
--- a/test/files/scalacheck/avl.scala
+++ /dev/null
@@ -1,112 +0,0 @@
-import org.scalacheck.Gen
-import org.scalacheck.Prop.forAll
-import org.scalacheck.Properties
-
-package scala.collection.mutable {
-
- /**
- * Property of an AVL Tree : Any node of the tree has a balance value beetween in [-1; 1]
- */
- abstract class AVLTreeTest(name: String) extends Properties(name) {
-
- def `2^`(n: Int) = (1 to n).fold(1)((a, b) => b*2)
-
- def capacityMax(depth: Int): Int = `2^`(depth+1) - 1
-
- def minDepthForCapacity(x: Int): Int = {
- var depth = 0
- while(capacityMax(depth) < x)
- depth += 1
- depth
- }
-
- def numberOfElementsInLeftSubTree(n: Int): collection.immutable.IndexedSeq[Int] = {
- val mid = n/2 + n%2
- ((1 until mid)
- .filter { i => math.abs(minDepthForCapacity(i) - minDepthForCapacity(n-i)) < 2 }
- .flatMap { i => Seq(i, n-(i+1)) }).toIndexedSeq.distinct
- }
-
- def makeAllBalancedTree[A](elements: List[A]): List[AVLTree[A]] = elements match {
- case Nil => Leaf::Nil
- case first::Nil => Node(first, Leaf, Leaf)::Nil
- case first::second::Nil => Node(second, Node(first, Leaf, Leaf), Leaf)::Node(first, Leaf, Node(second, Leaf, Leaf))::Nil
- case first::second::third::Nil => Node(second, Node(first, Leaf, Leaf), Node(third, Leaf, Leaf))::Nil
- case _ => {
- val combinations = for {
- left <- numberOfElementsInLeftSubTree(elements.size)
- root = elements(left)
- right = elements.size - (left + 1)
- } yield (root, left, right)
- (combinations.flatMap(triple => for {
- l <- makeAllBalancedTree(elements.take(triple._2))
- r <- makeAllBalancedTree(elements.takeRight(triple._3))
- } yield Node(triple._1, l, r))).toList
- }
- }
-
- def genInput: org.scalacheck.Gen[(Int, List[AVLTree[Int]])] = for {
- size <- org.scalacheck.Gen.choose(20, 25)
- elements <- org.scalacheck.Gen.listOfN(size, org.scalacheck.Gen.choose(0, 1000))
- selected <- org.scalacheck.Gen.choose(0, 1000)
- } yield {
- // selected mustn't be in elements already
- val list = makeAllBalancedTree(elements.sorted.distinct.map(_*2))
- (selected*2+1, list)
- }
-
- def genInputDelete: org.scalacheck.Gen[(Int, List[AVLTree[Int]])] = for {
- size <- org.scalacheck.Gen.choose(20, 25)
- elements <- org.scalacheck.Gen.listOfN(size, org.scalacheck.Gen.choose(0, 1000))
- e = elements.sorted.distinct
- selected <- org.scalacheck.Gen.choose(0, e.size-1)
- } yield {
- // selected must be in elements already
- val list = makeAllBalancedTree(e)
- (e(selected), list)
- }
- }
-
- trait AVLInvariants {
- self: AVLTreeTest =>
-
- def isBalanced[A](t: AVLTree[A]): Boolean = t match {
- case node: Node[A] => math.abs(node.balance) < 2 && (List(node.left, node.right) forall isBalanced)
- case Leaf => true
- }
-
- def setup(invariant: AVLTree[Int] => Boolean) = forAll(genInput) {
- case (selected: Int, trees: List[AVLTree[Int]]) =>
- trees.map(tree => invariant(tree)).fold(true)((a, b) => a && b)
- }
-
- property("Every tree is initially balanced.") = setup(isBalanced)
- }
-
- object TestInsert extends AVLTreeTest("Insert") with AVLInvariants {
- import math.Ordering.Int
- property("`insert` creates a new tree containing the given element. The tree remains balanced.") = forAll(genInput) {
- case (selected: Int, trees: List[AVLTree[Int]]) =>
- trees.map(tree => {
- val modifiedTree = tree.insert(selected, Int)
- modifiedTree.contains(selected, Int) && isBalanced(modifiedTree)
- }).fold(true)((a, b) => a && b)
- }
- }
-
- object TestRemove extends AVLTreeTest("Remove") with AVLInvariants {
- import math.Ordering.Int
- property("`remove` creates a new tree without the given element. The tree remains balanced.") = forAll(genInputDelete) {
- case (selected: Int, trees: List[AVLTree[Int]]) =>
- trees.map(tree => {
- val modifiedTree = tree.remove(selected, Int)
- tree.contains(selected, Int) && !modifiedTree.contains(selected, Int) && isBalanced(modifiedTree)
- }).fold(true)((a, b) => a && b)
- }
- }
-}
-
-object Test extends Properties("AVL") {
- include(scala.collection.mutable.TestInsert)
- include(scala.collection.mutable.TestRemove)
-}
diff --git a/test/files/scalacheck/duration.scala b/test/files/scalacheck/duration.scala
deleted file mode 100644
index 5e93638614..0000000000
--- a/test/files/scalacheck/duration.scala
+++ /dev/null
@@ -1,69 +0,0 @@
-import org.scalacheck._
-import Prop._
-import Gen._
-import Arbitrary._
-import math._
-import concurrent.duration.Duration.fromNanos
-
-object Test extends Properties("Division of Duration by Long") {
-
- val weightedLong =
- frequency(
- 1 -> choose(-128L, 127L),
- 1 -> (arbitrary[Byte] map (_.toLong << 8)),
- 1 -> (arbitrary[Byte] map (_.toLong << 16)),
- 1 -> (arbitrary[Byte] map (_.toLong << 24)),
- 1 -> (arbitrary[Byte] map (_.toLong << 32)),
- 1 -> (arbitrary[Byte] map (_.toLong << 40)),
- 1 -> (arbitrary[Byte] map (_.toLong << 48)),
- 1 -> (choose(-127L, 127L) map (_ << 56))
- )
-
- val genTwoSmall = for {
- a <- weightedLong
- b <- choose(-(Long.MaxValue / max(1, abs(a))), Long.MaxValue / max(1, abs(a)))
- } yield (a, b)
-
- val genTwoLarge = for {
- a <- weightedLong
- b <- arbitrary[Long] suchThat (b => (abs(b) > Long.MaxValue / max(1, abs(a))))
- } yield (a, b)
-
- val genClose = for {
- a <- weightedLong
- if a != 0
- b <- choose(Long.MaxValue / a - 10, Long.MaxValue / a + 10)
- } yield (a, b)
-
- val genBorderline =
- frequency(
- 1 -> (Long.MinValue, 0L),
- 1 -> (Long.MinValue, 1L),
- 1 -> (Long.MinValue, -1L),
- 1 -> (0L, Long.MinValue),
- 1 -> (1L, Long.MinValue),
- 1 -> (-1L, Long.MinValue),
- 90 -> genClose
- )
-
- def mul(a: Long, b: Long): Long = {
- (fromNanos(a) * b).toNanos
- }
-
- property("without overflow") = forAll(genTwoSmall) { case (a, b) =>
- a * b == mul(a, b)
- }
-
- property("with overflow") = forAll(genTwoLarge) { case (a, b) =>
- try { mul(a, b); false } catch { case _: IllegalArgumentException => true }
- }
-
- property("on overflow edge cases") = forAll(genBorderline) { case (a, b) =>
- val shouldFit =
- a != Long.MinValue && // must fail due to illegal duration length
- (b != Long.MinValue || a == 0) && // Long factor may only be MinValue if the duration is zero, otherwise the result will be illegal
- (abs(b) <= Long.MaxValue / max(1, abs(a))) // check the rest against the “safe” division method
- try { mul(a, b); shouldFit }
- catch { case _: IllegalArgumentException => !shouldFit }
- }
-}
diff --git a/test/files/scalacheck/list.scala b/test/files/scalacheck/list.scala
deleted file mode 100644
index 5f6de95237..0000000000
--- a/test/files/scalacheck/list.scala
+++ /dev/null
@@ -1,21 +0,0 @@
-import org.scalacheck._
-import Prop._
-import Gen._
-
-object Test extends Properties("List") {
- def sorted(xs: List[Int]) = xs sortWith (_ < _)
-
- property("concat size") = forAll { (l1: List[Int], l2: List[Int]) => (l1.size + l2.size) == (l1 ::: l2).size }
- property("reverse") = forAll { (l1: List[Int]) => l1.reverse.reverse == l1 }
- property("toSet") = forAll { (l1: List[Int]) => sorted(l1.toSet.toList) sameElements sorted(l1).distinct }
- // property("flatten") = forAll { (xxs: List[List[Int]]) => xxs.flatten.length == (xxs map (_.length) sum) }
- property("startsWith/take") = forAll { (xs: List[Int], count: Int) => xs startsWith (xs take count) }
- property("endsWith/takeRight") = forAll { (xs: List[Int], count: Int) => xs endsWith (xs takeRight count) }
- property("fill") = forAll(choose(1, 100)) { count =>
- forAll { (x: Int) =>
- val xs = List.fill(count)(x)
- (xs.length == count) && (xs.distinct == List(x))
- }
- }
-}
-
diff --git a/test/files/scalacheck/nan-ordering.scala b/test/files/scalacheck/nan-ordering.scala
deleted file mode 100644
index 05e97a13c9..0000000000
--- a/test/files/scalacheck/nan-ordering.scala
+++ /dev/null
@@ -1,130 +0,0 @@
-import org.scalacheck._
-import Gen._
-import Prop._
-
-object Test extends Properties("NaN-Ordering") {
-
- val specFloats: Gen[Float] = oneOf(
- Float.MaxValue,
- Float.MinPositiveValue,
- Float.MinValue,
- Float.NaN,
- Float.NegativeInfinity,
- Float.PositiveInfinity,
- -0.0f,
- +0.0f
- )
-
- property("Float min") = forAll(specFloats, specFloats) { (d1, d2) => {
- val mathmin = math.min(d1, d2)
- val numericmin = d1 min d2
- mathmin == numericmin || mathmin.isNaN && numericmin.isNaN
- }
- }
-
- property("Float max") = forAll(specFloats, specFloats) { (d1, d2) => {
- val mathmax = math.max(d1, d2)
- val numericmax = d1 max d2
- mathmax == numericmax || mathmax.isNaN && numericmax.isNaN
- }
- }
-
- val numFloat = implicitly[Numeric[Float]]
-
- property("Float lt") = forAll(specFloats, specFloats) { (d1, d2) => numFloat.lt(d1, d2) == d1 < d2 }
-
- property("Float lteq") = forAll(specFloats, specFloats) { (d1, d2) => numFloat.lteq(d1, d2) == d1 <= d2 }
-
- property("Float gt") = forAll(specFloats, specFloats) { (d1, d2) => numFloat.gt(d1, d2) == d1 > d2 }
-
- property("Float gteq") = forAll(specFloats, specFloats) { (d1, d2) => numFloat.gteq(d1, d2) == d1 >= d2 }
-
- property("Float equiv") = forAll(specFloats, specFloats) { (d1, d2) => numFloat.equiv(d1, d2) == (d1 == d2) }
-
- property("Float reverse.min") = forAll(specFloats, specFloats) { (d1, d2) => {
- val mathmax = math.max(d1, d2)
- val numericmin = numFloat.reverse.min(d1, d2)
- mathmax == numericmin || mathmax.isNaN && numericmin.isNaN
- }
- }
-
- property("Float reverse.max") = forAll(specFloats, specFloats) { (d1, d2) => {
- val mathmin = math.min(d1, d2)
- val numericmax = numFloat.reverse.max(d1, d2)
- mathmin == numericmax || mathmin.isNaN && numericmax.isNaN
- }
- }
-
- property("Float reverse.lt") = forAll(specFloats, specFloats) { (d1, d2) => numFloat.reverse.lt(d1, d2) == d2 < d1 }
-
- property("Float reverse.lteq") = forAll(specFloats, specFloats) { (d1, d2) => numFloat.reverse.lteq(d1, d2) == d2 <= d1 }
-
- property("Float reverse.gt") = forAll(specFloats, specFloats) { (d1, d2) => numFloat.reverse.gt(d1, d2) == d2 > d1 }
-
- property("Float reverse.gteq") = forAll(specFloats, specFloats) { (d1, d2) => numFloat.reverse.gteq(d1, d2) == d2 >= d1 }
-
- property("Float reverse.equiv") = forAll(specFloats, specFloats) { (d1, d2) => numFloat.reverse.equiv(d1, d2) == (d1 == d2) }
-
-
- val specDoubles: Gen[Double] = oneOf(
- Double.MaxValue,
- Double.MinPositiveValue,
- Double.MinValue,
- Double.NaN,
- Double.NegativeInfinity,
- Double.PositiveInfinity,
- -0.0,
- +0.0
- )
-
- // ticket #5104
- property("Double min") = forAll(specDoubles, specDoubles) { (d1, d2) => {
- val mathmin = math.min(d1, d2)
- val numericmin = d1 min d2
- mathmin == numericmin || mathmin.isNaN && numericmin.isNaN
- }
- }
-
- property("Double max") = forAll(specDoubles, specDoubles) { (d1, d2) => {
- val mathmax = math.max(d1, d2)
- val numericmax = d1 max d2
- mathmax == numericmax || mathmax.isNaN && numericmax.isNaN
- }
- }
-
- val numDouble = implicitly[Numeric[Double]]
-
- property("Double lt") = forAll(specDoubles, specDoubles) { (d1, d2) => numDouble.lt(d1, d2) == d1 < d2 }
-
- property("Double lteq") = forAll(specDoubles, specDoubles) { (d1, d2) => numDouble.lteq(d1, d2) == d1 <= d2 }
-
- property("Double gt") = forAll(specDoubles, specDoubles) { (d1, d2) => numDouble.gt(d1, d2) == d1 > d2 }
-
- property("Double gteq") = forAll(specDoubles, specDoubles) { (d1, d2) => numDouble.gteq(d1, d2) == d1 >= d2 }
-
- property("Double equiv") = forAll(specDoubles, specDoubles) { (d1, d2) => numDouble.equiv(d1, d2) == (d1 == d2) }
-
- property("Double reverse.min") = forAll(specDoubles, specDoubles) { (d1, d2) => {
- val mathmax = math.max(d1, d2)
- val numericmin = numDouble.reverse.min(d1, d2)
- mathmax == numericmin || mathmax.isNaN && numericmin.isNaN
- }
- }
-
- property("Double reverse.max") = forAll(specDoubles, specDoubles) { (d1, d2) => {
- val mathmin = math.min(d1, d2)
- val numericmax = numDouble.reverse.max(d1, d2)
- mathmin == numericmax || mathmin.isNaN && numericmax.isNaN
- }
- }
-
- property("Double reverse.lt") = forAll(specDoubles, specDoubles) { (d1, d2) => numDouble.reverse.lt(d1, d2) == d2 < d1 }
-
- property("Double reverse.lteq") = forAll(specDoubles, specDoubles) { (d1, d2) => numDouble.reverse.lteq(d1, d2) == d2 <= d1 }
-
- property("Double reverse.gt") = forAll(specDoubles, specDoubles) { (d1, d2) => numDouble.reverse.gt(d1, d2) == d2 > d1 }
-
- property("Double reverse.gteq") = forAll(specDoubles, specDoubles) { (d1, d2) => numDouble.reverse.gteq(d1, d2) == d2 >= d1 }
-
- property("Double reverse.equiv") = forAll(specDoubles, specDoubles) { (d1, d2) => numDouble.reverse.equiv(d1, d2) == (d1 == d2) }
-}
diff --git a/test/files/scalacheck/parallel-collections/IntOperators.scala b/test/files/scalacheck/parallel-collections/IntOperators.scala
deleted file mode 100644
index 4a74b91da8..0000000000
--- a/test/files/scalacheck/parallel-collections/IntOperators.scala
+++ /dev/null
@@ -1,129 +0,0 @@
-package scala.collection.parallel.ops
-
-
-import scala.collection.parallel._
-
-
-trait IntOperators extends Operators[Int] {
- def reduceOperators = List(_ + _, _ * _, math.min(_, _), math.max(_, _), _ ^ _)
- def countPredicates = List(
- x => true,
- _ >= 0, _ < 0, _ < 50, _ < 500, _ < 5000, _ < 50000, _ % 2 == 0, _ == 99,
- x => x > 50 && x < 150,
- x => x > 350 && x < 550,
- x => (x > 1000 && x < 1500) || (x > 400 && x < 500)
- )
- def forallPredicates = List(_ >= 0, _ < 0, _ % 2 == 0, _ != 55, _ != 505, _ != 5005)
- def existsPredicates = List(_ >= 0, _ < 0, _ % 2 == 0, _ == 55, _ == 505, _ == 5005)
- def findPredicates = List(_ >= 0, _ % 2 == 0, _ < 0, _ == 50, _ == 500, _ == 5000)
- def mapFunctions = List(-_, math.abs(_), _ % 2, _ % 3, _ % 4, _ % 150, _ % 500)
- def partialMapFunctions = List({case x => -x}, { case 0 => -1; case x if x > 0 => x + 1}, {case x if x % 3 == 0 => x / 3})
- def flatMapFunctions = List(
- (n: Int) => if (n < 0) List() else if (n % 2 == 0) List(1, 2, 3) else List(4, 5, 6),
- (n: Int) => List[Int](),
- (n: Int) => if (n == 0) List(1, 2, 3, 4, 5) else if (n < 0) List(1, 2, 3) else List()
- )
- def filterPredicates = List(
- _ % 2 == 0, _ % 3 == 0,
- _ % 4 != 0, _ % 17 != 0,
- n => n > 50 && n < 100,
- _ >= 0, _ < 0, _ == 99,
- _ > 500, _ > 5000, _ > 50000,
- _ < 500, _ < 50, _ < -50, _ < -5e5,
- x => true, x => false,
- x => x % 53 == 0 && x % 17 == 0
- )
- def filterNotPredicates = filterPredicates
- def partitionPredicates = filterPredicates
- def takeWhilePredicates = List(
- _ != 50, _ != 500, _ != 5000, _ != 50000, _ % 2 == 0, _ % 3 == 1, _ % 47 != 0,
- _ < 100, _ < 1000, _ < 10000, _ < 0,
- _ < -100, _ < -1000, _ > -200, _ > -50,
- n => -90 < n && n < -10,
- n => 50 < n && n < 550,
- n => 5000 < n && n < 7500,
- n => -50 < n && n < 450
- )
- def dropWhilePredicates = takeWhilePredicates
- def spanPredicates = takeWhilePredicates
- def foldArguments = List(
- (0, _ + _),
- (1, _ * _),
- (Int.MinValue, math.max(_, _)),
- (Int.MaxValue, math.min(_, _))
- )
- def addAllTraversables = List(
- List[Int](),
- List(1),
- List(1, 2),
- List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
- Array.fill(1000)(1).toSeq
- )
- def newArray(sz: Int) = new Array[Int](sz)
- def groupByFunctions = List(
- _ % 2, _ % 3, _ % 5, _ % 10, _ % 154, _% 3217,
- _ * 2, _ + 1
- )
-}
-
-
-trait IntSeqOperators extends IntOperators with SeqOperators[Int] {
- def segmentLengthPredicates = List(
- _ % 2 == 0, _ > 0, _ >= 0, _ < 0, _ <= 0, _ > -5000, _ > 5000, _ % 541 != 0, _ < -50, _ > 500,
- n => -90 < n && n < -10, n => 500 < n && n < 1500
- )
- def indexWherePredicates = List(
- _ % 2 == 0, _ % 11 == 0, _ % 123 == 0, _ % 901 == 0,
- _ > 0, _ >= 0, _ < 0, _ <= 0,
- _ > 50, _ > 500, _ > 5000,
- _ < -10, _ < -100, _ < -1000,
- n => n > 50 && n < 100,
- n => n * n > 1000000 && n % 111 == 0
- )
- def lastIndexWherePredicates = List(
- _ % 2 == 0, _ % 17 == 0, _ % 314 == 0, _ % 1017 == 0,
- _ > 0, _ >= 0, _ < 0, _ <= 0,
- _ > 50, _ > 500, _ > 5000,
- _ < -20, _ < -200, _ < -2000,
- _ == 0,
- n => n > -40 && n < 40,
- n => n > -80 && n < -10,
- n => n > 110 && n < 150
- )
- def reverseMapFunctions = List(-_, n => n * n, _ + 1)
- def sameElementsSeqs = List(
- List[Int](),
- List(1),
- List(1, 2, 3, 4, 5, 6, 7, 8, 9),
- Array.fill(150)(1).toSeq,
- Array.fill(1000)(1).toSeq
- )
- def startEndSeqs = List(
- Nil,
- List(1),
- List(1, 2, 3, 4, 5),
- List(0, 1, 2, 3, 4, 5),
- List(4, 5, 6, 7, 8, 9, 10),
- List(4, 5, 6, 7, 8, 9, 0),
- List(-4, -3, -2, -1)
- )
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/files/scalacheck/parallel-collections/IntValues.scala b/test/files/scalacheck/parallel-collections/IntValues.scala
deleted file mode 100644
index cab60ead76..0000000000
--- a/test/files/scalacheck/parallel-collections/IntValues.scala
+++ /dev/null
@@ -1,29 +0,0 @@
-package scala.collection.parallel.ops
-
-
-
-
-
-import org.scalacheck._
-import org.scalacheck.Gen
-import org.scalacheck.Gen._
-import org.scalacheck.Prop._
-import org.scalacheck.Properties
-import org.scalacheck.Arbitrary._
-
-
-
-
-trait IntValues {
- def values = Seq(
- arbitrary[Int],
- arbitrary[Int] suchThat (_ >= 0),
- arbitrary[Int] suchThat (_ < 0),
- choose(0, 0),
- choose(0, 10),
- choose(0, 100),
- choose(0, 1000) suchThat (_ % 2 == 0),
- choose(0, 1000) suchThat (_ % 2 != 0),
- choose(0, 1000) suchThat (n => (n % 2 == 0) || (n % 3 == 0))
- )
-}
diff --git a/test/files/scalacheck/parallel-collections/Operators.scala b/test/files/scalacheck/parallel-collections/Operators.scala
deleted file mode 100644
index 72133a5009..0000000000
--- a/test/files/scalacheck/parallel-collections/Operators.scala
+++ /dev/null
@@ -1,36 +0,0 @@
-package scala.collection.parallel
-
-
-
-
-trait Operators[T] {
- def reduceOperators: List[(T, T) => T]
- def countPredicates: List[T => Boolean]
- def forallPredicates: List[T => Boolean]
- def existsPredicates: List[T => Boolean]
- def findPredicates: List[T => Boolean]
- def mapFunctions: List[T => T]
- def partialMapFunctions: List[PartialFunction[T, T]]
- def flatMapFunctions: List[T => Traversable[T]]
- def filterPredicates: List[T => Boolean]
- def filterNotPredicates: List[T => Boolean]
- def partitionPredicates: List[T => Boolean]
- def takeWhilePredicates: List[T => Boolean]
- def dropWhilePredicates: List[T => Boolean]
- def spanPredicates: List[T => Boolean]
- def foldArguments: List[(T, (T, T) => T)]
- def addAllTraversables: List[Traversable[T]]
- def newArray(sz: Int): Array[T]
- def groupByFunctions: List[T => T]
-}
-
-
-
-trait SeqOperators[T] extends Operators[T] {
- def segmentLengthPredicates: List[T => Boolean]
- def indexWherePredicates: List[T => Boolean]
- def lastIndexWherePredicates: List[T => Boolean]
- def reverseMapFunctions: List[T => T]
- def sameElementsSeqs: List[Seq[T]]
- def startEndSeqs: List[Seq[T]]
-}
diff --git a/test/files/scalacheck/parallel-collections/PairOperators.scala b/test/files/scalacheck/parallel-collections/PairOperators.scala
deleted file mode 100644
index fe851114be..0000000000
--- a/test/files/scalacheck/parallel-collections/PairOperators.scala
+++ /dev/null
@@ -1,101 +0,0 @@
-package scala.collection.parallel.ops
-
-
-import scala.collection.parallel._
-
-
-trait PairOperators[K, V] extends Operators[(K, V)] {
- def koperators: Operators[K]
- def voperators: Operators[V]
-
- private def zipPredicates(kps: List[K => Boolean], vps: List[V => Boolean]): List[((K, V)) => Boolean] = for {
- (kp, vp) <- koperators.countPredicates zip voperators.countPredicates
- } yield new Function1[(K, V), Boolean] {
- def apply(kv: (K, V)) = kp(kv._1) && vp(kv._2)
- }
-
- /* operators */
-
- def reduceOperators = for {
- (kop, vop) <- koperators.reduceOperators zip voperators.reduceOperators
- } yield new Function2[(K, V), (K, V), (K, V)] {
- def apply(kv1: (K, V), kv2: (K, V)) = (kop(kv1._1, kv2._1), vop(kv1._2, kv2._2))
- }
-
- def countPredicates = zipPredicates(koperators.countPredicates, voperators.countPredicates)
-
- def forallPredicates = zipPredicates(koperators.forallPredicates, voperators.forallPredicates)
-
- def existsPredicates = zipPredicates(koperators.existsPredicates, voperators.existsPredicates)
-
- def findPredicates = zipPredicates(koperators.findPredicates, voperators.findPredicates)
-
- def mapFunctions = for {
- (km, vm) <- koperators.mapFunctions zip voperators.mapFunctions
- } yield new Function1[(K, V), (K, V)] {
- def apply(kv: (K, V)) = (km(kv._1), vm(kv._2))
- }
-
- def partialMapFunctions = for {
- (kpm, vpm) <- koperators.partialMapFunctions zip voperators.partialMapFunctions
- } yield new PartialFunction[(K, V), (K, V)] {
- def isDefinedAt(kv: (K, V)) = kpm.isDefinedAt(kv._1) && vpm.isDefinedAt(kv._2)
- def apply(kv: (K, V)) = (kpm(kv._1), vpm(kv._2))
- }
-
- def flatMapFunctions = for {
- (kfm, vfm) <- koperators.flatMapFunctions zip voperators.flatMapFunctions
- } yield new Function1[(K, V), Traversable[(K, V)]] {
- def apply(kv: (K, V)) = kfm(kv._1).toIterable zip vfm(kv._2).toIterable
- }
-
- def filterPredicates = zipPredicates(koperators.filterPredicates, voperators.filterPredicates)
-
- def filterNotPredicates = filterPredicates
-
- def partitionPredicates = filterPredicates
-
- def takeWhilePredicates = zipPredicates(koperators.takeWhilePredicates, voperators.takeWhilePredicates)
-
- def dropWhilePredicates = takeWhilePredicates
-
- def spanPredicates = takeWhilePredicates
-
- def foldArguments = for {
- ((kinit, kop), (vinit, vop)) <- koperators.foldArguments zip voperators.foldArguments
- } yield ((kinit, vinit), new Function2[(K, V), (K, V), (K, V)] {
- def apply(kv1: (K, V), kv2: (K, V)) = (kop(kv1._1, kv2._1), vop(kv1._2, kv2._2))
- })
-
- def addAllTraversables = for {
- (kt, vt) <- koperators.addAllTraversables zip voperators.addAllTraversables
- } yield kt.toIterable zip vt.toIterable
-
- def newArray(sz: Int) = new Array[(K, V)](sz)
-
- def groupByFunctions = (koperators.groupByFunctions zip voperators.groupByFunctions) map {
- opt => { (p: (K, V)) => (opt._1(p._1), opt._2(p._2)) }
- }
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/files/scalacheck/parallel-collections/PairValues.scala b/test/files/scalacheck/parallel-collections/PairValues.scala
deleted file mode 100644
index 864dad2425..0000000000
--- a/test/files/scalacheck/parallel-collections/PairValues.scala
+++ /dev/null
@@ -1,28 +0,0 @@
-package scala.collection.parallel.ops
-
-
-
-
-
-import org.scalacheck._
-import org.scalacheck.Gen
-import org.scalacheck.Gen._
-import org.scalacheck.Prop._
-import org.scalacheck.Properties
-import org.scalacheck.Arbitrary._
-
-
-
-
-trait PairValues[K, V] {
- def kvalues: Seq[Gen[K]]
- def vvalues: Seq[Gen[V]]
-
- def values = for {
- kg <- kvalues
- vg <- vvalues
- } yield for {
- k <- kg
- v <- vg
- } yield (k, v)
-}
diff --git a/test/files/scalacheck/parallel-collections/ParallelArrayCheck.scala b/test/files/scalacheck/parallel-collections/ParallelArrayCheck.scala
deleted file mode 100644
index 691a3e961e..0000000000
--- a/test/files/scalacheck/parallel-collections/ParallelArrayCheck.scala
+++ /dev/null
@@ -1,72 +0,0 @@
-package scala.collection.parallel
-package mutable
-
-
-
-import org.scalacheck._
-import org.scalacheck.Gen
-import org.scalacheck.Gen._
-import org.scalacheck.Prop._
-import org.scalacheck.Properties
-import org.scalacheck.Arbitrary._
-
-import scala.collection._
-import scala.collection.parallel.ops._
-
-
-abstract class ParallelArrayCheck[T](tp: String) extends ParallelSeqCheck[T]("ParArray[" + tp + "]") {
- // ForkJoinTasks.defaultForkJoinPool.setMaximumPoolSize(Runtime.getRuntime.availableProcessors * 2)
- // ForkJoinTasks.defaultForkJoinPool.setParallelism(Runtime.getRuntime.availableProcessors * 2)
-
- type CollType = ParArray[T]
-
- def isCheckingViews = false
-
- def hasStrictOrder = true
-
- def tasksupport: TaskSupport
-
- def ofSize(vals: Seq[Gen[T]], sz: Int) = {
- val a = new mutable.ArrayBuffer[T](sz)
- val gen = vals(rnd.nextInt(vals.size))
- for (i <- 0 until sz) a += sample(gen)
- a
- }
-
- def fromSeq(a: Seq[T]) = {
- val pa = new ParArray[T](a.size)
- pa.tasksupport = tasksupport
- var i = 0
- for (elem <- a.toList) {
- pa(i) = elem
- i += 1
- }
- pa
- }
-
- property("array mappings must be equal") = forAll(collectionPairs) { case (t, coll) =>
- val results = for ((f, ind) <- mapFunctions.zipWithIndex)
- yield ("op index: " + ind) |: t.map(f) == coll.map(f)
- results.reduceLeft(_ && _)
- }
-
-}
-
-
-class IntParallelArrayCheck(val tasksupport: TaskSupport) extends ParallelArrayCheck[Int]("Int") with IntSeqOperators with IntValues {
- override def instances(vals: Seq[Gen[Int]]) = oneOf(super.instances(vals), sized { sz =>
- (0 until sz).toArray.toSeq
- }, sized { sz =>
- (-sz until 0).toArray.toSeq
- })
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/test/files/scalacheck/parallel-collections/ParallelArrayTest.scala b/test/files/scalacheck/parallel-collections/ParallelArrayTest.scala
deleted file mode 100644
index db2b1ea01e..0000000000
--- a/test/files/scalacheck/parallel-collections/ParallelArrayTest.scala
+++ /dev/null
@@ -1,112 +0,0 @@
-// package test.scala.collection.parallel.mutable
-
-// import org.scalatest.FunSuite
-// import collection.parallel.mutable.ParallelArray
-
-// /**
-// * Notes:
-// */
-// class ParallelArrayTest extends FunSuite {
-
-// test("create new parallel array with a bad initial capacity"){
-// intercept[IllegalArgumentException]{
-// new ParallelArray(-5)
-// }
-
-// /**
-// * this currently passes, but do we want it to?
-// * does it have meaning to have an empty parallel array?
-// */
-// new ParallelArray(0)
-// ()
-// }
-
-// test("compare identical ParallelArrays"){
-// assert(new ParallelArray(5) === new ParallelArray(5))
-// assert(ParallelArray(1,2,3,4,5) === ParallelArray(1,2,3,4,5))
-// }
-
-// /**
-// * this test needs attention. how is equality defined on ParallelArrays?
-// * Well, the same way it is for normal collections, I guess. For normal arrays its reference equality.
-// * I do not think it should be that way in the case of ParallelArray-s. I'll check this with Martin.
-// */
-// test("compare non-identical ParallelArrays"){
-// assert(ParallelArray(1,2,3,4,5) != ParallelArray(1,2,3,4),
-// "compared PA's that I expect to not be identical, but they were!")
-// }
-
-// test("creation via PA object [String]"){
-// val paFromApply: ParallelArray[String] = ParallelArray("x", "1", "true", "etrijwejiorwer")
-// val paFromHandoff: ParallelArray[String] = ParallelArray.handoff(Array("x", "1", "true", "etrijwejiorwer"))
-// val paFromCopy: ParallelArray[String] = ParallelArray.createFromCopy(Array("x", "1", "true", "etrijwejiorwer"))
-// assert( paFromApply === paFromCopy )
-// assert( paFromApply === paFromCopy )
-// }
-
-// // // handoffs dont work for primitive types...
-// // test("creation via PA object [Boolean]"){
-// // val paFromApply: ParallelArray[Boolean] = ParallelArray(true, false, true, false)
-// // val paFromCopy: ParallelArray[Boolean] = ParallelArray.createFromCopy(Array(true, false, true, false))
-// // assert( paFromApply === paFromCopy )
-// // }
-// //
-// // // handoffs dont work for primitive types...
-// // test("creation via PA object [Int]"){
-// // val paFromApply: ParallelArray[Int] = ParallelArray(1, 2, 4, 3)
-// // val paFromCopy: ParallelArray[Int] = ParallelArray.createFromCopy(Array(1, 2, 4, 3))
-// // assert( paFromApply === paFromCopy )
-// // }
-
-// /**
-// * This fails because handoff is really doing a copy.
-// * TODO: look at handoff
-// */
-// test("Handoff Is Really A Handoff"){
-// val arrayToHandOff = Array("a", "x", "y", "z")
-// val paFromHandoff: ParallelArray[String] = ParallelArray.handoff(arrayToHandOff)
-// arrayToHandOff(0) = "w"
-// assert(paFromHandoff(0) === "w")
-// }
-
-// test("simple reduce"){
-// assert( ParallelArray(1,2,3,4,5).reduce(_+_) === 15 )
-// }
-
-// test("simple count"){
-// assert( ParallelArray[Int]().count(_ > 7) === 0 )
-// assert( ParallelArray(1,2,3).count(_ > 7) === 0 )
-// assert( ParallelArray(1,2,3).count(_ <= 3) === 3 )
-// assert( ParallelArray(1,2,3,4,5,6,7,8,9,10).count(_ > 7 ) === 3 )
-// }
-
-// test("simple forall"){
-// assert( ParallelArray[Int]().forall(_ > 7) === true )
-// assert( ParallelArray(1,2,3).forall(_ > 3) === false )
-// assert( ParallelArray(1,2,3).forall(_ <= 3) === true )
-// assert( ParallelArray(1,2,3,4,5,6,7,8,9,10).forall(_ > 0) === true )
-// assert( ParallelArray(1,2,3,4,5,6,7,8,9,10).forall(_ < 5) === false )
-// }
-
-// /**
-// */
-// test("simple foreach"){
-// val buf = new java.util.concurrent.ArrayBlockingQueue[Int](10000)
-// ParallelArray((1 to 10000):_*).foreach(buf add _)
-// (1 to 10000).foreach(i => assert( buf contains i, "buf should have contained:" + i ))
-// }
-
-// test("simple exists"){
-// assert( ParallelArray[Int]().exists(_ => true) === false )
-// assert( ParallelArray(1,2,3).forall(_ > 3) === false )
-// assert( ParallelArray(1,2,3,4,5,6,7,8,9,10).exists(_ > 7) === true )
-// }
-
-// test("simple filter"){
-// assert(ParallelArray(1,2,3,4,5).filter( _ < 4 ) === ParallelArray(1,2,3))
-// }
-
-// test("simple map test"){
-// assert(ParallelArray(1,2,3,4,5).map( (_:Int) * 10 ) === ParallelArray(10,20,30,40,50))
-// }
-// }
diff --git a/test/files/scalacheck/parallel-collections/ParallelArrayViewCheck.scala b/test/files/scalacheck/parallel-collections/ParallelArrayViewCheck.scala
deleted file mode 100644
index 9805e2644f..0000000000
--- a/test/files/scalacheck/parallel-collections/ParallelArrayViewCheck.scala
+++ /dev/null
@@ -1,122 +0,0 @@
-// package scala.collection.parallel
-// package mutable
-
-
-
-
-
-
-// import org.scalacheck._
-// import org.scalacheck.Gen
-// import org.scalacheck.Gen._
-// import org.scalacheck.Prop._
-// import org.scalacheck.Properties
-// import org.scalacheck.Arbitrary._
-
-// import scala.collection.TraversableView
-// import scala.collection.mutable.ArrayBuffer
-// import scala.collection.parallel.ops._
-// import scala.collection.mutable.ArraySeq
-
-
-
-// abstract class ParallelArrayViewCheck[T](tp: String)
-// extends ParallelSeqCheck[T]("ParallelSeqView[" + tp + ", ParallelArray[" + tp + "]]") {
-// // ForkJoinTasks.defaultForkJoinPool.setMaximumPoolSize(Runtime.getRuntime.availableProcessors * 2)
-// // ForkJoinTasks.defaultForkJoinPool.setParallelism(Runtime.getRuntime.availableProcessors * 2)
-
-// type CollType = ParallelSeqView[T, ParallelArray[T], ArraySeq[T]]
-
-// def isCheckingViews = true
-
-// def instances(vals: Seq[Gen[T]]): Gen[Seq[T]] = sized { sz =>
-// val a = new ArrayBuffer[T](sz)
-// val gen = vals(rnd.nextInt(vals.size))
-// for (i <- 0 until sz) a += sample(gen)
-// a
-// }
-
-// def fromSeq(a: Seq[T]) = {
-// val pa = new ParallelArray[T](a.size)
-// var i = 0
-// for (elem <- a) {
-// pa(i) = elem
-// i += 1
-// }
-// pa.view
-// }
-
-// property("forces must be equal") = forAll(collectionPairs) { case (s, coll) =>
-// val smodif = (s ++ s).reverse.take(s.length).reverse.zip(s).drop(s.length / 2)
-// val cmodif = (coll ++ s).reverse.take(s.length).reverse.zip(s).drop(s.length / 2).force
-// smodif == cmodif
-// }
-
-// }
-
-
-// object IntParallelArrayViewCheck extends ParallelArrayViewCheck[Int]("Int") with IntSeqOperators with IntValues {
-// override def instances(vals: Seq[Gen[Int]]) = oneOf(super.instances(vals), sized { sz =>
-// (0 until sz).toArray.toSeq
-// }, sized { sz =>
-// (-sz until 0).toArray.toSeq
-// })
-// }
-
-
-// abstract class ParallelArrayViewComposedCheck[T](tp: String)
-// extends ParallelSeqCheck[T]("ParallelSeqView[" + tp + "], ParallelArray[" + tp + "].++.patch.reverse.take.reverse") {
-// ForkJoinTasks.defaultForkJoinPool.setMaximumPoolSize(Runtime.getRuntime.availableProcessors * 2)
-// ForkJoinTasks.defaultForkJoinPool.setParallelism(Runtime.getRuntime.availableProcessors * 2)
-
-// type CollType = collection.parallel.ParallelSeq[T]
-
-// def isCheckingViews = true
-
-// def instances(vals: Seq[Gen[T]]): Gen[Seq[T]] = sized { sz =>
-// val a = new ArrayBuffer[T](sz)
-// val gen = vals(rnd.nextInt(vals.size))
-// for (i <- 0 until sz) a += sample(gen)
-// a
-// }
-
-// def fromSeq(a: Seq[T]) = {
-// val pa = new ParallelArray[T](a.size)
-// var i = 0
-// for (elem <- a) {
-// pa(i) = elem
-// i += 1
-// }
-// val modified = (pa.view ++ a).patch(0, a, a.length).reverse
-// val original = modified.take(modified.length / 2).reverse
-// original
-// }
-
-// }
-
-
-// object IntParallelArrayViewComposedCheck extends ParallelArrayViewComposedCheck[Int]("Int") with IntSeqOperators with IntValues {
-// override def instances(vals: Seq[Gen[Int]]) = oneOf(super.instances(vals), sized { sz =>
-// (0 until sz).toArray.toSeq
-// }, sized { sz =>
-// (-sz until 0).toArray.toSeq
-// })
-// }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/files/scalacheck/parallel-collections/ParallelCtrieCheck.scala b/test/files/scalacheck/parallel-collections/ParallelCtrieCheck.scala
deleted file mode 100644
index cf15afb3b9..0000000000
--- a/test/files/scalacheck/parallel-collections/ParallelCtrieCheck.scala
+++ /dev/null
@@ -1,101 +0,0 @@
-package scala.collection.parallel
-package mutable
-
-
-
-import org.scalacheck._
-import org.scalacheck.Gen
-import org.scalacheck.Gen._
-import org.scalacheck.Prop._
-import org.scalacheck.Properties
-import org.scalacheck.Arbitrary._
-
-import scala.collection._
-import scala.collection.parallel.ops._
-
-
-
-abstract class ParallelConcurrentTrieMapCheck[K, V](tp: String) extends ParallelMapCheck[K, V]("mutable.ParConcurrentTrieMap[" + tp + "]") {
- // ForkJoinTasks.defaultForkJoinPool.setMaximumPoolSize(Runtime.getRuntime.availableProcessors * 2)
- // ForkJoinTasks.defaultForkJoinPool.setParallelism(Runtime.getRuntime.availableProcessors * 2)
-
- type CollType = ParTrieMap[K, V]
-
- def isCheckingViews = false
-
- def hasStrictOrder = false
-
- def tasksupport: TaskSupport
-
- def ofSize(vals: Seq[Gen[(K, V)]], sz: Int) = {
- val ct = new concurrent.TrieMap[K, V]
- val gen = vals(rnd.nextInt(vals.size))
- for (i <- 0 until sz) ct += sample(gen)
- ct
- }
-
- def fromTraversable(t: Traversable[(K, V)]) = {
- val pct = new ParTrieMap[K, V]
- pct.tasksupport = tasksupport
- var i = 0
- for (kv <- t.toList) {
- pct += kv
- i += 1
- }
- pct
- }
-
-}
-
-
-class IntIntParallelConcurrentTrieMapCheck(val tasksupport: TaskSupport) extends ParallelConcurrentTrieMapCheck[Int, Int]("Int, Int")
-with PairOperators[Int, Int]
-with PairValues[Int, Int]
-{
- def intvalues = new IntValues {}
- def kvalues = intvalues.values
- def vvalues = intvalues.values
-
- val intoperators = new IntOperators {}
- def voperators = intoperators
- def koperators = intoperators
-
- override def printDataStructureDebugInfo(ds: AnyRef) = ds match {
- case pm: ParTrieMap[k, v] =>
- println("Mutable parallel ctrie")
- case _ =>
- println("could not match data structure type: " + ds.getClass)
- }
-
- override def checkDataStructureInvariants(orig: Traversable[(Int, Int)], ds: AnyRef) = ds match {
- // case pm: ParHashMap[k, v] if 1 == 0 => // disabled this to make tests faster
- // val invs = pm.brokenInvariants
-
- // val containsall = (for ((k, v) <- orig) yield {
- // if (pm.asInstanceOf[ParHashMap[Int, Int]].get(k) == Some(v)) true
- // else {
- // println("Does not contain original element: " + (k, v))
- // false
- // }
- // }).foldLeft(true)(_ && _)
-
-
- // if (invs.isEmpty) containsall
- // else {
- // println("Invariants broken:\n" + invs.mkString("\n"))
- // false
- // }
- case _ => true
- }
-
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/test/files/scalacheck/parallel-collections/ParallelHashMapCheck.scala b/test/files/scalacheck/parallel-collections/ParallelHashMapCheck.scala
deleted file mode 100644
index 34b3f33de2..0000000000
--- a/test/files/scalacheck/parallel-collections/ParallelHashMapCheck.scala
+++ /dev/null
@@ -1,100 +0,0 @@
-package scala.collection.parallel
-package mutable
-
-
-
-import org.scalacheck._
-import org.scalacheck.Gen
-import org.scalacheck.Gen._
-import org.scalacheck.Prop._
-import org.scalacheck.Properties
-import org.scalacheck.Arbitrary._
-
-import scala.collection._
-import scala.collection.parallel.ops._
-
-
-abstract class ParallelHashMapCheck[K, V](tp: String) extends ParallelMapCheck[K, V]("mutable.ParHashMap[" + tp + "]") {
- // ForkJoinTasks.defaultForkJoinPool.setMaximumPoolSize(Runtime.getRuntime.availableProcessors * 2)
- // ForkJoinTasks.defaultForkJoinPool.setParallelism(Runtime.getRuntime.availableProcessors * 2)
-
- type CollType = ParHashMap[K, V]
-
- def isCheckingViews = false
-
- def hasStrictOrder = false
-
- def tasksupport: TaskSupport
-
- def ofSize(vals: Seq[Gen[(K, V)]], sz: Int) = {
- val hm = new mutable.HashMap[K, V]
- val gen = vals(rnd.nextInt(vals.size))
- for (i <- 0 until sz) hm += sample(gen)
- hm
- }
-
- def fromTraversable(t: Traversable[(K, V)]) = {
- val phm = new ParHashMap[K, V]
- phm.tasksupport = tasksupport
- var i = 0
- for (kv <- t.toList) {
- phm += kv
- i += 1
- }
- phm
- }
-
-}
-
-
-class IntIntParallelHashMapCheck(val tasksupport: TaskSupport) extends ParallelHashMapCheck[Int, Int]("Int, Int")
-with PairOperators[Int, Int]
-with PairValues[Int, Int]
-{
- def intvalues = new IntValues {}
- def kvalues = intvalues.values
- def vvalues = intvalues.values
-
- val intoperators = new IntOperators {}
- def voperators = intoperators
- def koperators = intoperators
-
- override def printDataStructureDebugInfo(ds: AnyRef) = ds match {
- case pm: ParHashMap[k, v] =>
- println("Mutable parallel hash map\n" + pm.hashTableContents.debugInformation)
- case _ =>
- println("could not match data structure type: " + ds.getClass)
- }
-
- override def checkDataStructureInvariants(orig: Traversable[(Int, Int)], ds: AnyRef) = ds match {
- // case pm: ParHashMap[k, v] if 1 == 0 => // disabled this to make tests faster
- // val invs = pm.brokenInvariants
-
- // val containsall = (for ((k, v) <- orig) yield {
- // if (pm.asInstanceOf[ParHashMap[Int, Int]].get(k) == Some(v)) true
- // else {
- // println("Does not contain original element: " + (k, v))
- // false
- // }
- // }).foldLeft(true)(_ && _)
-
-
- // if (invs.isEmpty) containsall
- // else {
- // println("Invariants broken:\n" + invs.mkString("\n"))
- // false
- // }
- case _ => true
- }
-
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/test/files/scalacheck/parallel-collections/ParallelHashSetCheck.scala b/test/files/scalacheck/parallel-collections/ParallelHashSetCheck.scala
deleted file mode 100644
index 91de2472a7..0000000000
--- a/test/files/scalacheck/parallel-collections/ParallelHashSetCheck.scala
+++ /dev/null
@@ -1,97 +0,0 @@
-package scala.collection.parallel
-package mutable
-
-
-
-import org.scalacheck._
-import org.scalacheck.Gen
-import org.scalacheck.Gen._
-import org.scalacheck.Prop._
-import org.scalacheck.Properties
-import org.scalacheck.Arbitrary._
-
-import scala.collection._
-import scala.collection.parallel.ops._
-
-
-abstract class ParallelHashSetCheck[T](tp: String) extends ParallelSetCheck[T]("mutable.ParHashSet[" + tp + "]") {
- // ForkJoinTasks.defaultForkJoinPool.setMaximumPoolSize(Runtime.getRuntime.availableProcessors * 2)
- // ForkJoinTasks.defaultForkJoinPool.setParallelism(Runtime.getRuntime.availableProcessors * 2)
-
- type CollType = ParHashSet[T]
-
- def isCheckingViews = false
-
- def hasStrictOrder = false
-
- def tasksupport: TaskSupport
-
- def ofSize(vals: Seq[Gen[T]], sz: Int) = {
- val hm = new mutable.HashSet[T]
- val gen = vals(rnd.nextInt(vals.size))
- for (i <- 0 until sz) hm += sample(gen)
- hm
- }
-
- def fromTraversable(t: Traversable[T]) = {
- val phs = new ParHashSet[T]
- phs.tasksupport = tasksupport
- var i = 0
- for (kv <- t.toList) {
- phs += kv
- i += 1
- }
- phs
- }
-
-}
-
-
-class IntParallelHashSetCheck(val tasksupport: TaskSupport) extends ParallelHashSetCheck[Int]("Int")
-with IntOperators
-with IntValues
-{
- override def printDataStructureDebugInfo(ds: AnyRef) = ds match {
- case pm: ParHashSet[t] =>
- println("Mutable parallel hash set")
- case _ =>
- println("could not match data structure type: " + ds.getClass)
- }
-
- override def checkDataStructureInvariants(orig: Traversable[Int], ds: AnyRef) = ds match {
- // case pm: ParHashSet[t] if 1 == 0 =>
- // // for an example of how not to write code proceed below
- // val invs = pm.brokenInvariants
-
- // val containsall = (for (elem <- orig) yield {
- // if (pm.asInstanceOf[ParHashSet[Int]](elem) == true) true
- // else {
- // println("Does not contain original element: " + elem)
- // println(pm.hashTableContents.table.find(_ == elem))
- // println(pm.hashTableContents.table.indexOf(elem))
- // false
- // }
- // }).foldLeft(true)(_ && _)
-
-
- // if (invs.isEmpty) {
- // if (!containsall) println(pm.debugInformation)
- // containsall
- // } else {
- // println("Invariants broken:\n" + invs.mkString("\n"))
- // false
- // }
- case _ => true
- }
-
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/test/files/scalacheck/parallel-collections/ParallelHashTrieCheck.scala b/test/files/scalacheck/parallel-collections/ParallelHashTrieCheck.scala
deleted file mode 100644
index 9e29be5429..0000000000
--- a/test/files/scalacheck/parallel-collections/ParallelHashTrieCheck.scala
+++ /dev/null
@@ -1,144 +0,0 @@
-package scala.collection.parallel
-package immutable
-
-
-
-import org.scalacheck._
-import org.scalacheck.Gen
-import org.scalacheck.Gen._
-import org.scalacheck.Prop._
-import org.scalacheck.Properties
-import org.scalacheck.Arbitrary._
-
-import scala.collection._
-import scala.collection.parallel.ops._
-
-
-abstract class ParallelHashMapCheck[K, V](tp: String) extends ParallelMapCheck[K, V]("immutable.ParHashMap[" + tp + "]") {
- // ForkJoinTasks.defaultForkJoinPool.setMaximumPoolSize(Runtime.getRuntime.availableProcessors * 2)
- // ForkJoinTasks.defaultForkJoinPool.setParallelism(Runtime.getRuntime.availableProcessors * 2)
-
- type CollType = ParHashMap[K, V]
-
- def isCheckingViews = false
-
- def hasStrictOrder = false
-
- def tasksupport: TaskSupport
-
- def ofSize(vals: Seq[Gen[(K, V)]], sz: Int) = {
- var hm = new immutable.HashMap[K, V]
- val gen = vals(rnd.nextInt(vals.size))
- for (i <- 0 until sz) hm += sample(gen)
- hm
- }
-
- def fromTraversable(t: Traversable[(K, V)]) = {
- var phm = new ParHashMap[K, V]
- phm.tasksupport = tasksupport
- var i = 0
- for (kv <- t.toList) {
- phm += kv
- i += 1
- }
- phm
- }
-
-}
-
-
-class IntIntParallelHashMapCheck(val tasksupport: TaskSupport) extends ParallelHashMapCheck[Int, Int]("Int, Int")
-with PairOperators[Int, Int]
-with PairValues[Int, Int]
-{
- def intvalues = new IntValues {}
- def kvalues = intvalues.values
- def vvalues = intvalues.values
-
- val intoperators = new IntOperators {}
- def voperators = intoperators
- def koperators = intoperators
-
- override def printDataStructureDebugInfo(ds: AnyRef) = ds match {
- case pm: ParHashMap[k, v] =>
- pm.printDebugInfo
- case _ =>
- println("could not match data structure type: " + ds.getClass)
- }
-}
-
-
-
-abstract class ParallelHashSetCheck[T](tp: String) extends ParallelSetCheck[T]("immutable.ParHashSet[" + tp + "]") {
- // ForkJoinTasks.defaultForkJoinPool.setMaximumPoolSize(Runtime.getRuntime.availableProcessors * 2)
- // ForkJoinTasks.defaultForkJoinPool.setParallelism(Runtime.getRuntime.availableProcessors * 2)
-
- type CollType = ParHashSet[T]
-
- def isCheckingViews = false
-
- def hasStrictOrder = false
-
- def tasksupport: TaskSupport
-
- def ofSize(vals: Seq[Gen[T]], sz: Int) = {
- var hm = new immutable.HashSet[T]
- val gen = vals(rnd.nextInt(vals.size))
- for (i <- 0 until sz) hm += sample(gen)
- hm
- }
-
- def fromTraversable(t: Traversable[T]) = {
- var phs = new ParHashSet[T]
- phs.tasksupport = tasksupport
- var i = 0
- for (kv <- t.toList) {
- phs += kv
- i += 1
- }
- phs
- }
-
- override def printDataStructureDebugInfo(ds: AnyRef) = ds match {
- case pm: ParHashSet[t] =>
- println("Parallel hash set")
- case _ =>
- println("could not match data structure type: " + ds.getClass)
- }
-
-}
-
-
-class IntParallelHashSetCheck(val tasksupport: TaskSupport) extends ParallelHashSetCheck[Int]("Int")
-with IntOperators
-with IntValues
-{
- def intvalues = new IntValues {}
- def kvalues = intvalues.values
- def vvalues = intvalues.values
-
- override def printDataStructureDebugInfo(ds: AnyRef) = ds match {
- case pm: ParHashMap[k, v] =>
- pm.printDebugInfo
- case _ =>
- println("could not match data structure type: " + ds.getClass)
- }
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala b/test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala
deleted file mode 100644
index 468bcb6dd1..0000000000
--- a/test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala
+++ /dev/null
@@ -1,477 +0,0 @@
-package scala.collection.parallel
-
-
-
-import org.scalacheck._
-import org.scalacheck.Gen
-import org.scalacheck.Gen._
-import org.scalacheck.Prop._
-import org.scalacheck.Properties
-
-import scala.collection._
-import scala.collection.parallel._
-
-
-
-
-abstract class ParallelIterableCheck[T](collName: String) extends Properties(collName) with Operators[T] {
- type CollType <: ParIterable[T]
-
- def values: Seq[Gen[T]]
- def ofSize(vals: Seq[Gen[T]], sz: Int): Iterable[T]
- def fromTraversable(t: Traversable[T]): CollType
- def isCheckingViews: Boolean
- def hasStrictOrder: Boolean
-
-
- def instances(vals: Seq[Gen[T]]): Gen[Iterable[T]] = oneOf(
- sized(
- sz =>
- ofSize(vals, sz)
- ),
- for (sz <- choose(1000, 2000)) yield ofSize(vals, sz),
- for (sz <- choose(4000, 4001)) yield ofSize(vals, sz),
- for (sz <- choose(10000, 10001)) yield ofSize(vals, sz)
- )
-
- // used to check if constructed collection is valid
- def checkDataStructureInvariants(orig: Traversable[T], cf: AnyRef) = {
- // can be overridden in subclasses
- true
- }
-
- def printDataStructureDebugInfo(cf: AnyRef) {
- // can be overridden in subclasses
- }
-
- val rnd = new scala.util.Random
-
- def sample(gen: Gen[T]): T = {
- var s = gen.sample
- while (s == None) s = gen.sample
- s.get
- }
-
- def sampleValue: T = sample(values(rnd.nextInt(values.length)))
-
- def collectionPairs = for (inst <- instances(values)) yield (inst, fromTraversable(inst))
-
- def collectionPairsWithLengths = for (inst <- instances(values); s <- choose(0, inst.size))
- yield (inst, fromTraversable(inst), s)
-
- def collectionPairsWith2Indices = for (
- inst <- instances(values);
- f <- choose(0, inst.size);
- s <- choose(0, inst.size))
- yield (inst, fromTraversable(inst), f, s)
-
- def collectionTriplets = for (inst <- instances(values);
- updStart <- choose(0, inst.size); howMany <- choose(0, inst.size)) yield {
- val modif = inst.toSeq.patch(updStart, inst.toSeq, howMany)
- (inst, fromTraversable(inst), modif)
- }
-
- def areEqual(t1: GenTraversable[T], t2: GenTraversable[T]) = if (hasStrictOrder) {
- t1 == t2 && t2 == t1
- } else (t1, t2) match { // it is slightly delicate what `equal` means if the order is not strict
- case (m1: GenMap[_, _], m2: GenMap[_, _]) => m1 == m2 && m2 == m1
- case (i1: GenIterable[_], i2: GenIterable[_]) =>
- val i1s = i1.toSet
- val i2s = i2.toSet
- i1s == i2s && i2s == i1s
- case _ => t1 == t2 && t2 == t1
- }
-
- def printDebugInfo(coll: ParIterableLike[_, _, _]) {
- println("Collection debug info: ")
- coll.printDebugBuffer
- println("Task debug info: ")
- println(coll.tasksupport.debugMessages.mkString("\n"))
- }
-
- def printComparison(t: Traversable[_], coll: ParIterable[_], tf: Traversable[_], cf: ParIterable[_], ind: Int) {
- printDebugInfo(coll)
- println("Operator: " + ind)
- println("sz: " + t.size)
- println(t)
- println
- println("sz: " + coll.size)
- println(coll)
- println("transformed to:")
- println
- println("size: " + tf.size)
- println(tf)
- println
- println("size: " + cf.size)
- println(cf)
- println
- println("tf == cf - " + (tf == cf))
- println("cf == tf - " + (cf == tf))
- }
-
- property("reductions must be equal for assoc. operators") = forAll(collectionPairs) { case (t, coll) =>
- if (t.size != 0) {
- val results = for ((op, ind) <- reduceOperators.zipWithIndex) yield {
- val tr = t.reduceLeft(op)
- val cr = coll.reduce(op)
- if (tr != cr) {
- println("from: " + t)
- println("and: " + coll)
- println("reducing with " + ind)
- println(tr)
- println(cr)
- }
- ("op index: " + ind) |: tr == cr
- }
- results.reduceLeft(_ && _)
- } else "has size 0" |: true
- }
-
- property("counts must be equal") = forAll(collectionPairs) { case (t, coll) =>
- val results = for ((pred, ind) <- countPredicates.zipWithIndex) yield {
- val tc = t.count(pred)
- val cc = coll.count(pred)
- if (tc != cc) {
- println("from: " + t + " - size: " + t.size)
- println("and: " + coll + " - size: " + coll.toList.size)
- println(tc)
- println(cc)
- printDebugInfo(coll)
- }
- ("op index: " + ind) |: tc == cc
- }
- results.reduceLeft(_ && _)
- }
-
- property("forall must be equal") = forAll(collectionPairs) { case (t, coll) =>
- val results = for ((pred, ind) <- forallPredicates.zipWithIndex)
- yield ("op index: " + ind) |: t.forall(pred) == coll.forall(pred)
- results.reduceLeft(_ && _)
- }
-
- property("exists must be equal") = forAll(collectionPairs) { case (t, coll) =>
- val results = for ((pred, ind) <- existsPredicates.zipWithIndex)
- yield ("op index: " + ind) |: t.exists(pred) == coll.exists(pred)
- results.reduceLeft(_ && _)
- }
-
- property("both must find or not find an element") = forAll(collectionPairs) { case (t, coll) =>
- val results = for ((pred, ind) <- findPredicates.zipWithIndex) yield {
- val ft = t.find(pred)
- val fcoll = coll.find(pred)
- ("op index: " + ind) |: ((ft == None && fcoll == None) || (ft != None && fcoll != None))
- }
- results.reduceLeft(_ && _)
- }
-
- property("mappings must be equal") = forAll(collectionPairs) { case (t, coll) =>
- val results = for ((f, ind) <- mapFunctions.zipWithIndex) yield {
- val ms = t.map(f)
- val mp = coll.map(f)
- val invs = checkDataStructureInvariants(ms, mp)
- if (!areEqual(ms, mp) || !invs) {
- println(t)
- println(coll)
- println("mapped to: ")
- println(ms)
- println(mp)
- println("sizes: ")
- println(ms.size)
- println(mp.size)
- println("valid: " + invs)
- }
- ("op index: " + ind) |: (areEqual(ms, mp) && invs)
- }
- results.reduceLeft(_ && _)
- }
-
- property("collects must be equal") = forAll(collectionPairs) { case (t, coll) =>
- val results = for ((f, ind) <- partialMapFunctions.zipWithIndex) yield {
- val ps = t.collect(f)
- val pp = coll.collect(f)
- if (!areEqual(ps, pp)) {
- println(t)
- println(coll)
- println("collected to: ")
- println(ps)
- println(pp)
- }
- ("op index: " + ind) |: areEqual(ps, pp)
- }
- results.reduceLeft(_ && _)
- }
-
- property("flatMaps must be equal") = forAll(collectionPairs) { case (t, coll) =>
- (for ((f, ind) <- flatMapFunctions.zipWithIndex)
- yield ("op index: " + ind) |: areEqual(t.flatMap(f), coll.flatMap(f))).reduceLeft(_ && _)
- }
-
- property("filters must be equal") = forAll(collectionPairs) { case (t, coll) =>
- (for ((p, ind) <- filterPredicates.zipWithIndex) yield {
- val tf = t.filter(p)
- val cf = coll.filter(p)
- val invs = checkDataStructureInvariants(tf, cf)
- if (tf != cf || cf != tf || !invs) {
- printDebugInfo(coll)
- println("Operator: " + ind)
- println("sz: " + t.size)
- println(t)
- println
- println("sz: " + coll.size)
- println(coll)
- println
- println("filtered to:")
- println
- println(cf)
- println
- println(tf)
- println
- println("tf == cf - " + (tf == cf))
- println("cf == tf - " + (cf == tf))
- printDataStructureDebugInfo(cf)
- println("valid: " + invs)
- }
- ("op index: " + ind) |: tf == cf && cf == tf && invs
- }).reduceLeft(_ && _)
- }
-
- property("filterNots must be equal") = forAll(collectionPairs) { case (t, coll) =>
- (for ((p, ind) <- filterNotPredicates.zipWithIndex) yield {
- val tf = t.filterNot(p)
- val cf = coll.filterNot(p)
- if (tf != cf || cf != tf) printComparison(t, coll, tf, cf, ind)
- ("op index: " + ind) |: tf == cf && cf == tf
- }).reduceLeft(_ && _)
- }
-
- if (!isCheckingViews) property("partitions must be equal") = forAll(collectionPairs) { case (t, coll) =>
- (for ((p, ind) <- partitionPredicates.zipWithIndex) yield {
- val tpart = t.partition(p)
- val cpart = coll.partition(p)
- if (tpart != cpart) {
- println("from: " + t)
- println("and: " + coll)
- println(cpart)
- println(tpart)
- }
- ("op index: " + ind) |: tpart == cpart
- }).reduceLeft(_ && _)
- }
-
- if (hasStrictOrder) property("takes must be equal") = forAll(collectionPairsWithLengths) { case (t, coll, n) =>
- ("take " + n + " elements") |: t.take(n) == coll.take(n)
- }
-
- if (hasStrictOrder) property("drops must be equal") = forAll(collectionPairsWithLengths) { case (t, coll, n) =>
- ("drop " + n + " elements") |: t.drop(n) == coll.drop(n)
- }
-
- if (hasStrictOrder) property("slices must be equal") = forAll(collectionPairsWith2Indices)
- { case (t, coll, fr, slicelength) =>
- val from = if (fr < 0) 0 else fr
- val until = if (from + slicelength > t.size) t.size else from + slicelength
- val tsl = t.slice(from, until)
- val collsl = coll.slice(from, until)
- if (tsl != collsl) {
- println("---------------------- " + from + ", " + until)
- println("from: " + t)
- println("and: " + coll)
- println(tsl)
- println(collsl)
- println("as list: " + collsl.toList)
- println(collsl.iterator.hasNext)
- println(collsl.iterator.next)
- println(collsl.iterator.hasNext)
- println(collsl.iterator.next)
- println(collsl.iterator.hasNext)
- println(collsl.iterator.next)
- println(collsl.iterator.hasNext)
- }
- ("slice from " + from + " until " + until) |: tsl == collsl
- }
-
- if (hasStrictOrder) property("splits must be equal") = forAll(collectionPairsWithLengths) { case (t, coll, n) =>
- val tspl = t.splitAt(n)
- val cspl = coll.splitAt(n)
- if (tspl != cspl) {
- println("at: " + n)
- println("from: " + t)
- println("and: " + coll)
- println(tspl)
- println(cspl)
- }
- ("splitAt " + n) |: tspl == cspl
- }
-
- if (hasStrictOrder) property("takeWhiles must be equal") = forAll(collectionPairs) { case (t, coll) =>
- (for ((pred, ind) <- takeWhilePredicates.zipWithIndex) yield {
- val tt = t.takeWhile(pred)
- val ct = coll.takeWhile(pred)
- if (tt != ct) {
- println("from: " + t)
- println("and: " + coll)
- println("taking while...")
- println(tt)
- println(ct)
- }
- ("operator " + ind) |: tt == ct
- }).reduceLeft(_ && _)
- }
-
- if (hasStrictOrder) property("spans must be equal") = forAll(collectionPairs) { case (t, coll) =>
- (for ((pred, ind) <- spanPredicates.zipWithIndex) yield {
- val tsp = t.span(pred)
- val csp = coll.span(pred)
- if (tsp != csp) {
- println("from: " + t)
- println("and: " + coll)
- println("span with predicate " + ind)
- println(tsp)
- println(csp)
- println("---------------------------------")
- println(coll.span(pred))
- println("---------------------------------")
- }
- ("operator " + ind) |: tsp == csp
- }).reduceLeft(_ && _)
- }
-
- if (hasStrictOrder) property("dropWhiles must be equal") = forAll(collectionPairs) { case (t, coll) =>
- (for ((pred, ind) <- dropWhilePredicates.zipWithIndex) yield {
- ("operator " + ind) |: t.dropWhile(pred) == coll.dropWhile(pred)
- }).reduceLeft(_ && _)
- }
-
- property("folds must be equal for assoc. operators") = forAll(collectionPairs) { case (t, coll) =>
- (for (((first, op), ind) <- foldArguments.zipWithIndex) yield {
- val tres = t.foldLeft(first)(op)
- val cres = coll.fold(first)(op)
- if (cres != tres) {
- println("from: " + t)
- println("and: " + coll)
- println("folds are: ")
- println(tres)
- println(cres)
- }
- ("operator " + ind) |: tres == cres
- }).reduceLeft(_ && _)
- }
-
- property("++s must be equal") = forAll(collectionTriplets) { case (t, coll, colltoadd) =>
- try {
- val toadd = colltoadd
- val tr = t ++ toadd.iterator
- val cr = coll ++ toadd.iterator
- if (!areEqual(tr, cr)) {
- println("from: " + t)
- println("and: " + coll.iterator.toList)
- println("adding: " + toadd)
- println(tr.toList)
- println(cr.iterator.toList)
- }
- ("adding " |: areEqual(tr, cr)) &&
- (for ((trav, ind) <- (addAllTraversables).zipWithIndex) yield {
- val tadded = t ++ trav
- val cadded = coll ++ collection.parallel.mutable.ParArray(trav.toSeq: _*)
- if (!areEqual(tadded, cadded)) {
- println("----------------------")
- println("from: " + t)
- println("and: " + coll)
- println("adding: " + trav)
- println(tadded)
- println(cadded)
- }
- ("traversable " + ind) |: areEqual(tadded, cadded)
- }).reduceLeft(_ && _)
- } catch {
- case e: java.lang.Exception =>
- throw e
- }
- }
-
- if (hasStrictOrder) property("copies to array must be equal") = forAll(collectionPairs) { case (t, coll) =>
- val tarr = newArray(t.size)
- val collarr = newArray(coll.size)
- t.copyToArray(tarr, 0, t.size)
- coll.copyToArray(collarr, 0, coll.size)
- if (tarr.toSeq != collarr.toSeq) {
- println("from: " + t)
- println("and: " + coll)
- println(tarr.toSeq)
- println(collarr.toSeq)
- }
- tarr.toSeq == collarr.toSeq
- }
-
- if (hasStrictOrder) property("scans must be equal") = forAll(collectionPairs) {
- case (t, coll) =>
- (for (((first, op), ind) <- foldArguments.zipWithIndex) yield {
- val tscan = t.scanLeft(first)(op)
- val cscan = coll.scan(first)(op)
- if (tscan != cscan || cscan != tscan) {
- println("from: " + t)
- println("and: " + coll)
- println("scans are: ")
- println(tscan)
- println(cscan)
- }
- ("operator " + ind) |: tscan == cscan && cscan == tscan
- }).reduceLeft(_ && _)
- }
-
- property("groupBy must be equal") = forAll(collectionPairs) {
- case (t, coll) =>
- (for ((f, ind) <- groupByFunctions.zipWithIndex) yield {
- val tgroup = t.groupBy(f)
- val cgroup = coll.groupBy(f)
- if (tgroup != cgroup || cgroup != tgroup) {
- println("from: " + t)
- println("and: " + coll)
- println("groups are: ")
- println(tgroup)
- println(cgroup)
- }
- ("operator " + ind) |: tgroup == cgroup && cgroup == tgroup
- }).reduceLeft(_ && _)
- }
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala b/test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala
deleted file mode 100644
index d4643e7f2c..0000000000
--- a/test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala
+++ /dev/null
@@ -1,67 +0,0 @@
-package scala.collection.parallel
-
-
-
-import org.scalacheck._
-import org.scalacheck.Gen
-import org.scalacheck.Gen._
-import org.scalacheck.Prop._
-import org.scalacheck.Properties
-
-import scala.collection._
-import scala.collection.parallel._
-
-
-
-
-abstract class ParallelMapCheck[K, V](collname: String) extends ParallelIterableCheck[(K, V)](collname) {
- type CollType <: ParMap[K, V]
-
- property("gets iterated keys") = forAll(collectionPairs) {
- case (t, coll) =>
- val containsT = for ((k, v) <- t) yield (coll.get(k) == Some(v))
- val containsSelf = coll.map { case (k, v) => coll.get(k) == Some(v) }
- ("Par contains elements of seq map" |: containsT.forall(_ == true)) &&
- ("Par contains elements of itself" |: containsSelf.forall(_ == true))
- }
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/files/scalacheck/parallel-collections/ParallelRangeCheck.scala b/test/files/scalacheck/parallel-collections/ParallelRangeCheck.scala
deleted file mode 100644
index f490d9490a..0000000000
--- a/test/files/scalacheck/parallel-collections/ParallelRangeCheck.scala
+++ /dev/null
@@ -1,75 +0,0 @@
-package scala.collection.parallel
-package immutable
-
-
-
-
-import org.scalacheck._
-import org.scalacheck.Gen
-import org.scalacheck.Gen._
-import org.scalacheck.Prop._
-import org.scalacheck.Properties
-import org.scalacheck.Arbitrary._
-
-import scala.collection._
-import scala.collection.parallel.ops._
-
-
-
-
-class ParallelRangeCheck(val tasksupport: TaskSupport) extends ParallelSeqCheck[Int]("ParallelRange[Int]") with ops.IntSeqOperators {
- // ForkJoinTasks.defaultForkJoinPool.setMaximumPoolSize(Runtime.getRuntime.availableProcessors * 2)
- // ForkJoinTasks.defaultForkJoinPool.setParallelism(Runtime.getRuntime.availableProcessors * 2)
-
- type CollType = collection.parallel.ParSeq[Int]
-
- def hasStrictOrder = true
-
- def isCheckingViews = false
-
- def ofSize(vals: Seq[Gen[Int]], sz: Int) = unsupported
-
- override def instances(vals: Seq[Gen[Int]]): Gen[Seq[Int]] = sized { start =>
- sized { end =>
- sized { step =>
- new Range(start, end, if (step != 0) step else 1)
- }
- }
- }
-
- def fromSeq(a: Seq[Int]) = a match {
- case r: Range =>
- val pr = ParRange(r.start, r.end, r.step, false)
- pr.tasksupport = tasksupport
- pr
- case _ =>
- val pa = new parallel.mutable.ParArray[Int](a.length)
- pa.tasksupport = tasksupport
- for (i <- 0 until a.length) pa(i) = a(i)
- pa
- }
-
- override def traversable2Seq(t: Traversable[Int]): Seq[Int] = t match {
- case r: Range => r
- case _ => t.toSeq
- }
-
- def values = Seq(choose(-100, 100))
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/files/scalacheck/parallel-collections/ParallelSeqCheck.scala b/test/files/scalacheck/parallel-collections/ParallelSeqCheck.scala
deleted file mode 100644
index 3f8a8ad4f5..0000000000
--- a/test/files/scalacheck/parallel-collections/ParallelSeqCheck.scala
+++ /dev/null
@@ -1,299 +0,0 @@
-package scala.collection.parallel
-
-
-
-import org.scalacheck._
-import org.scalacheck.Gen
-import org.scalacheck.Gen._
-import org.scalacheck.Prop._
-import org.scalacheck.Properties
-
-import scala.collection._
-import scala.collection.parallel._
-
-
-
-
-
-abstract class ParallelSeqCheck[T](collName: String) extends ParallelIterableCheck[T](collName) with SeqOperators[T] {
-
- type CollType <: collection.parallel.ParSeq[T]
-
-
- def ofSize(vals: Seq[Gen[T]], sz: Int): Seq[T]
- def fromSeq(s: Seq[T]): CollType
-
- override def instances(vals: Seq[Gen[T]]): Gen[Seq[T]] = oneOf(
- sized(
- sz =>
- ofSize(vals, sz)
- ),
- for (sz <- choose(1000, 2000)) yield ofSize(vals, sz)
- )
-
-
- def fromTraversable(t: Traversable[T]) = fromSeq(traversable2Seq(t))
- def traversable2Seq(t: Traversable[T]): Seq[T] = {
- if (t.isInstanceOf[Iterable[_]]) t.asInstanceOf[Iterable[T]].iterator.toList else t.toList
- }
-
- override def collectionPairs: Gen[(Seq[T], CollType)] = for (inst <- instances(values)) yield (inst, fromSeq(inst))
-
- override def collectionPairsWithLengths: Gen[(Seq[T], CollType, Int)] =
- for (inst <- instances(values); s <- choose(0, inst.size)) yield (inst, fromSeq(inst), s);
-
- def collectionPairsWithModifiedWithLengths: Gen[(Seq[T], CollType, ParSeq[T], Int)] =
- for (inst <- instances(values); s <- choose(0, inst.size);
- updateStart <- choose(0, inst.size); howMany <- choose(0, inst.size)) yield {
- val parcoll = fromSeq(inst)
- val parcollmodif = fromSeq(modifySlightly(inst, updateStart, howMany))
- (inst, parcoll, parcollmodif, s)
- }
-
- def collectionPairsWithModified: Gen[(Seq[T], CollType, ParSeq[T])] =
- for (inst <- instances(values); updateStart <- choose(0, inst.size); howMany <- choose(0, inst.size)) yield {
- val parcoll = fromSeq(inst)
- val parcollmodif = fromSeq(modifySlightly(inst, updateStart, howMany))
- (inst, parcoll, parcollmodif)
- }
-
- def collectionPairsWithSliced: Gen[(Seq[T], CollType, ParSeq[T])] =
- for (inst <- instances(values); sliceStart <- choose(0, inst.size); howMany <- choose(0, inst.size)) yield {
- val parcoll = fromSeq(inst)
- val parcollsliced = fromSeq(inst.slice(sliceStart, sliceStart + howMany))
- (inst, parcoll, parcollsliced)
- }
-
- def collectionTripletsWith2Indices: Gen[(Seq[T], CollType, Seq[T], Int, Int)] =
- for (inst <- instances(values); f <- choose(0, inst.size); s <- choose(0, inst.size - f);
- third <- instances(values); sliceStart <- choose(0, inst.size); howMany <- choose(0, inst.size)) yield {
- (inst, fromSeq(inst), inst.slice(sliceStart, sliceStart + howMany), f, s)
- }
-
- private def modifySlightly(coll: Seq[T], updateStart: Int, howMany: Int) = {
- coll.patch(updateStart, coll, howMany)
- }
-
- property("segmentLengths must be equal") = forAll(collectionPairsWithLengths) { case (s, coll, len) =>
- (for ((pred, ind) <- segmentLengthPredicates.zipWithIndex) yield {
- val slen = s.segmentLength(pred, if (len < 0) 0 else len)
- val clen = coll.segmentLength(pred, len)
- if (slen != clen) {
- println("from: " + s)
- println("and: " + coll)
- println(slen)
- println(clen)
- }
- ("operator " + ind) |: slen == clen
- }).reduceLeft(_ && _)
- }
-
- property("prefixLengths must be equal") = forAll(collectionPairs) { case (s, coll) =>
- (for ((pred, ind) <- segmentLengthPredicates.zipWithIndex) yield {
- ("operator " + ind) |: s.prefixLength(pred) == coll.prefixLength(pred)
- }).reduceLeft(_ && _)
- }
-
- property("indexWheres must be equal") = forAll(collectionPairsWithLengths) { case (s, coll, len) =>
- (for ((pred, ind) <- indexWherePredicates.zipWithIndex) yield {
- val sind = s.indexWhere(pred, len)
- val cind = coll.indexWhere(pred, len)
- if (sind != cind) {
- println("from: " + s)
- println("and: " + coll)
- println("at: " + len)
- println(sind)
- println(cind)
- }
- ("operator " + ind) |: sind == cind
- }).reduceLeft(_ && _)
- }
-
- property("lastIndexWheres must be equal") = forAll(collectionPairsWithLengths) { case (s, coll, len) =>
- (for ((pred, ind) <- lastIndexWherePredicates.zipWithIndex) yield {
- val end = if (len >= s.size) s.size - 1 else len
- val sind = s.lastIndexWhere(pred, end)
- val cind = coll.lastIndexWhere(pred, end)
- ("operator " + ind) |: sind == cind
- }).reduceLeft(_ && _)
- }
-
- property("reverses must be equal") = forAll(collectionPairs) { case (s, coll) =>
- (s.length == 0 && s.getClass == classOf[collection.immutable.Range]) ||
- {
- val sr = s.reverse
- val cr = coll.reverse
- if (sr != cr) {
- println("from: " + s)
- println("and: " + coll)
- println(sr)
- println(cr)
- }
- sr == cr
- }
- }
-
- property("reverseMaps must be equal") = forAll(collectionPairs) { case (s, coll) =>
- (for ((f, ind) <- reverseMapFunctions.zipWithIndex) yield {
- ("operator " + ind) |: s.reverseMap(f) == coll.reverseMap(f)
- }).reduceLeft(_ && _)
- }
-
- property("sameElements must be equal") = forAll(collectionPairsWithModifiedWithLengths) {
- case (s, coll, collmodif, len) =>
- val pos = if (len < 0) 0 else len
- val scm = s.sameElements(collmodif)
- val ccm = coll.sameElements(collmodif)
- if (scm != ccm) {
- println("Comparing: " + s)
- println("and: " + coll)
- println("with: " + collmodif)
- println(scm)
- println(ccm)
- }
- ("Nil" |: s.sameElements(Nil) == coll.sameElements(Nil)) &&
- ("toList" |: s.sameElements(s.toList) == coll.sameElements(coll.toList)) &&
- ("identity" |: s.sameElements(s.map(e => e)) == coll.sameElements(coll.map(e => e))) &&
- ("vice-versa" |: s.sameElements(coll) == coll.sameElements(s)) &&
- ("equal" |: s.sameElements(coll)) &&
- ("modified" |: scm == ccm) &&
- (for ((it, ind) <- sameElementsSeqs.zipWithIndex) yield {
- val sres = s.sameElements(it)
- val pres = coll.sameElements(it)
- if (sres != pres) {
- println("Comparing: " + s)
- println("and: " + coll)
- println("with: " + it)
- println(sres)
- println(pres)
- }
- ("collection " + ind) |: sres == pres
- }).reduceLeft(_ && _)
- }
-
- property("startsWiths must be equal") = forAll(collectionPairsWithModifiedWithLengths) {
- case (s, coll, collmodif, len) =>
- val pos = if (len < 0) 0 else len
- ("start with self" |: s.startsWith(s) == coll.startsWith(coll)) &&
- ("tails correspond" |: (s.length == 0 || s.startsWith(s.tail, 1) == coll.startsWith(coll.tail, 1))) &&
- ("with each other" |: coll.startsWith(s)) &&
- ("modified" |: s.startsWith(collmodif) == coll.startsWith(collmodif)) &&
- ("modified2" |: s.startsWith(collmodif, pos) == coll.startsWith(collmodif, pos)) &&
- (for (sq <- startEndSeqs) yield {
- val ss = s.startsWith(sq, pos)
- val cs = coll.startsWith(fromSeq(sq), pos)
- if (ss != cs) {
- println("from: " + s)
- println("and: " + coll)
- println("test seq: " + sq)
- println("from pos: " + pos)
- println(ss)
- println(cs)
- println(coll.iterator.psplit(pos, coll.length - pos)(1).toList)
- }
- ("seq " + sq) |: ss == cs
- }).reduceLeft(_ && _)
- }
-
- property("endsWiths must be equal") = forAll(collectionPairsWithModified) {
- case (s, coll, collmodif) =>
- ("ends with self" |: s.endsWith(s) == coll.endsWith(s)) &&
- ("ends with tail" |: (s.length == 0 || s.endsWith(s.tail) == coll.endsWith(coll.tail))) &&
- ("with each other" |: coll.endsWith(s)) &&
- ("modified" |: s.startsWith(collmodif) == coll.endsWith(collmodif)) &&
- (for (sq <- startEndSeqs) yield {
- val sew = s.endsWith(sq)
- val cew = coll.endsWith(fromSeq(sq))
- if (sew != cew) {
- println("from: " + s)
- println("and: " + coll)
- println(sew)
- println(cew)
- }
- ("seq " + sq) |: sew == cew
- }).reduceLeft(_ && _)
- }
-
- property("unions must be equal") = forAll(collectionPairsWithModified) { case (s, coll, collmodif) =>
- ("modified" |: s.union(collmodif.seq) == coll.union(collmodif)) &&
- ("empty" |: s.union(Nil) == coll.union(fromSeq(Nil)))
- }
-
- // This is failing with my views patch: array index out of bounds in the array iterator.
- // Couldn't see why this and only this was impacted, could use a second pair of eyes.
- //
- // This was failing because some corner cases weren't added to the patch method in ParSeqLike.
- // Curiously, this wasn't detected before.
- //
- if (!isCheckingViews) property("patches must be equal") = forAll(collectionTripletsWith2Indices) {
- case (s, coll, pat, from, repl) =>
- ("with seq" |: s.patch(from, pat, repl) == coll.patch(from, pat, repl)) &&
- ("with par" |: s.patch(from, pat, repl) == coll.patch(from, fromSeq(pat), repl)) &&
- ("with empty" |: s.patch(from, Nil, repl) == coll.patch(from, fromSeq(Nil), repl)) &&
- ("with one" |: (s.length == 0 || s.patch(from, List(s(0)), 1) == coll.patch(from, fromSeq(List(coll(0))), 1)))
- }
-
- if (!isCheckingViews) property("updates must be equal") = forAll(collectionPairsWithLengths) { case (s, coll, len) =>
- val pos = if (len >= s.length) s.length - 1 else len
- if (s.length > 0) {
- val supd = s.updated(pos, s(0))
- val cupd = coll.updated(pos, coll(0))
- if (supd != cupd) {
- println("from: " + s)
- println("and: " + coll)
- println(supd)
- println(cupd)
- }
- "from first" |: (supd == cupd)
- } else "trivially" |: true
- }
-
- property("prepends must be equal") = forAll(collectionPairs) { case (s, coll) =>
- s.length == 0 || s(0) +: s == coll(0) +: coll
- }
-
- property("appends must be equal") = forAll(collectionPairs) { case (s, coll) =>
- s.length == 0 || s :+ s(0) == coll :+ coll(0)
- }
-
- property("padTos must be equal") = forAll(collectionPairsWithLengths) { case (s, coll, len) =>
- val someValue = sampleValue
- val sdoub = s.padTo(len * 2, someValue)
- val cdoub = coll.padTo(len * 2, someValue)
- if (sdoub != cdoub) {
- println("from: " + s)
- println("and: " + coll)
- println(sdoub)
- println(cdoub)
- }
- ("smaller" |: s.padTo(len / 2, someValue) == coll.padTo(len / 2, someValue)) &&
- ("bigger" |: sdoub == cdoub)
- }
-
- property("corresponds must be equal") = forAll(collectionPairsWithModified) { case (s, coll, modified) =>
- val modifcut = modified.toSeq.slice(0, modified.length)
- ("self" |: s.corresponds(s)(_ == _) == coll.corresponds(coll)(_ == _)) &&
- ("modified" |: s.corresponds(modified.seq)(_ == _) == coll.corresponds(modified)(_ == _)) &&
- ("modified2" |: s.corresponds(modifcut)(_ == _) == coll.corresponds(modifcut)(_ == _))
- }
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/files/scalacheck/parallel-collections/ParallelSetCheck.scala b/test/files/scalacheck/parallel-collections/ParallelSetCheck.scala
deleted file mode 100644
index 56f7832fed..0000000000
--- a/test/files/scalacheck/parallel-collections/ParallelSetCheck.scala
+++ /dev/null
@@ -1,62 +0,0 @@
-package scala.collection.parallel
-
-
-
-import org.scalacheck._
-import org.scalacheck.Gen
-import org.scalacheck.Gen._
-import org.scalacheck.Prop._
-import org.scalacheck.Properties
-
-import scala.collection._
-import scala.collection.parallel._
-
-
-
-
-abstract class ParallelSetCheck[T](collname: String) extends ParallelIterableCheck[T](collname) {
- type CollType <: ParSet[T]
-
- property("gets iterated keys") = forAll(collectionPairs) {
- case (t, coll) =>
- val containsT = for (elem <- t) yield (coll.contains(elem))
- val containsSelf = for (elem <- coll) yield (coll.contains(elem))
- ("Par contains elements of seq map" |: containsT.forall(_ == true)) &&
- ("Par contains elements of itself" |: containsSelf.forall(_ == true))
- }
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/files/scalacheck/parallel-collections/ParallelVectorCheck.scala b/test/files/scalacheck/parallel-collections/ParallelVectorCheck.scala
deleted file mode 100644
index bbebd51919..0000000000
--- a/test/files/scalacheck/parallel-collections/ParallelVectorCheck.scala
+++ /dev/null
@@ -1,67 +0,0 @@
-package scala.collection
-package parallel.immutable
-
-
-
-import org.scalacheck._
-import org.scalacheck.Gen
-import org.scalacheck.Gen._
-import org.scalacheck.Prop._
-import org.scalacheck.Properties
-import org.scalacheck.Arbitrary._
-
-import scala.collection._
-import scala.collection.parallel.ops._
-
-
-import immutable.Vector
-import immutable.VectorBuilder
-
-import scala.collection.parallel.TaskSupport
-
-
-
-
-abstract class ParallelVectorCheck[T](tp: String) extends collection.parallel.ParallelSeqCheck[T]("ParVector[" + tp + "]") {
- // ForkJoinTasks.defaultForkJoinPool.setMaximumPoolSize(Runtime.getRuntime.availableProcessors * 2)
- // ForkJoinTasks.defaultForkJoinPool.setParallelism(Runtime.getRuntime.availableProcessors * 2)
-
- type CollType = ParVector[T]
-
- def isCheckingViews = false
-
- def hasStrictOrder = true
-
- def tasksupport: TaskSupport
-
- def ofSize(vals: Seq[Gen[T]], sz: Int) = {
- val vb = new immutable.VectorBuilder[T]()
- val gen = vals(rnd.nextInt(vals.size))
- for (i <- 0 until sz) vb += sample(gen)
- vb.result
- }
-
- def fromSeq(a: Seq[T]) = {
- val pc = ParVector.newCombiner[T]
- for (elem <- a.toList) pc += elem
- val pv = pc.result
- pv.tasksupport = tasksupport
- pv
- }
-
-}
-
-
-
-class IntParallelVectorCheck(val tasksupport: TaskSupport) extends ParallelVectorCheck[Int]("Int") with IntSeqOperators with IntValues {
- override def instances(vals: Seq[Gen[Int]]) = oneOf(super.instances(vals), sized { sz =>
- (0 until sz).toArray.toSeq
- }, sized { sz =>
- (-sz until 0).toArray.toSeq
- })
-}
-
-
-
-
-
diff --git a/test/files/scalacheck/parallel-collections/pc.scala b/test/files/scalacheck/parallel-collections/pc.scala
deleted file mode 100644
index a3c1df4054..0000000000
--- a/test/files/scalacheck/parallel-collections/pc.scala
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * scalac: -deprecation
- * scalacheck: -workers 1 -minSize 0 -maxSize 4000 -minSuccessfulTests 5
- */
-
-import org.scalacheck._
-import scala.collection.parallel._
-
-// package here to be able access the package-private implementation and shutdown the pool
-package scala {
-
- class ParCollProperties extends Properties("Parallel collections") {
-
- def includeAllTestsWith(support: TaskSupport) {
- // parallel arrays with default task support
- include(new mutable.IntParallelArrayCheck(support))
-
- // parallel ranges
- include(new immutable.ParallelRangeCheck(support))
-
- // parallel immutable hash maps (tries)
- include(new immutable.IntIntParallelHashMapCheck(support))
-
- // parallel immutable hash sets (tries)
- include(new immutable.IntParallelHashSetCheck(support))
-
- // parallel mutable hash maps (tables)
- include(new mutable.IntIntParallelHashMapCheck(support))
-
- // parallel ctrie
- include(new mutable.IntIntParallelConcurrentTrieMapCheck(support))
-
- // parallel mutable hash sets (tables)
- include(new mutable.IntParallelHashSetCheck(support))
-
- // parallel vectors
- include(new immutable.IntParallelVectorCheck(support))
- }
-
- includeAllTestsWith(defaultTaskSupport)
-
- val ec = scala.concurrent.ExecutionContext.fromExecutorService(java.util.concurrent.Executors.newFixedThreadPool(5))
- val ectasks = new collection.parallel.ExecutionContextTaskSupport(ec)
- includeAllTestsWith(ectasks)
-
- // no post test hooks in scalacheck, so cannot do:
- // ec.shutdown()
-
- }
-
-}
-
-
-object Test extends scala.ParCollProperties {
- /*
- def main(args: Array[String]) {
- val pc = new ParCollProperties
- org.scalacheck.Test.checkProperties(
- org.scalacheck.Test.Params(
- rng = new java.util.Random(5134L),
- testCallback = new ConsoleReporter(0),
- workers = 1,
- minSize = 0,
- maxSize = 4000,
- minSuccessfulTests = 5
- ),
- pc
- )
- }
- */
-}
diff --git a/test/files/scalacheck/primitive-eqeq.scala b/test/files/scalacheck/primitive-eqeq.scala
deleted file mode 100644
index 60fe63c207..0000000000
--- a/test/files/scalacheck/primitive-eqeq.scala
+++ /dev/null
@@ -1,37 +0,0 @@
-import org.scalacheck._
-import Prop._
-import Gen._
-
-object Test extends Properties("==") {
- def equalObjectsEqualHashcodes(x: Any, y: Any) = (x != y) || (x == y && x.## == y.##)
-
- // ticket #2087
- property("short/char") = forAll { (x: Short) => {
- val ch: Char = x.toChar
- (x == ch) == (ch == x)
- }
- }
-
- property("symmetry") = forAll { (x: AnyVal, y: AnyVal) => (x == y) == (y == x) }
- property("transitivity") = forAll { (x: AnyVal, y: AnyVal, z: AnyVal) => x != y || y != z || x == z }
-
- property("##") = forAll {
- (x: Short) => {
- val anyvals = List(x.toByte, x.toChar, x, x.toInt, x.toLong, x.toFloat, x.toDouble, BigInt(x), BigDecimal(x))
- val shortAndLarger = anyvals drop 2
-
- val result = (
- ((anyvals, anyvals).zipped forall equalObjectsEqualHashcodes) &&
- ((shortAndLarger, shortAndLarger).zipped forall (_ == _)) &&
- ((shortAndLarger, shortAndLarger).zipped forall ((x, y) => (x: Any) == (y: Any)))
- )
- result
- }
- }
- property("## 2") = forAll {
- (dv: Double) => {
- val fv = dv.toFloat
- (fv != dv) || (fv.## == dv.##)
- }
- }
-}
diff --git a/test/files/scalacheck/quasiquotes/ArbitraryTreesAndNames.scala b/test/files/scalacheck/quasiquotes/ArbitraryTreesAndNames.scala
deleted file mode 100644
index ab1056dd86..0000000000
--- a/test/files/scalacheck/quasiquotes/ArbitraryTreesAndNames.scala
+++ /dev/null
@@ -1,295 +0,0 @@
-import org.scalacheck._, Prop._, Gen._, Arbitrary._
-import scala.reflect.runtime.universe._, internal._, Flag._
-
-trait ArbitraryTreesAndNames {
- def smallList[T](size: Int, g: Gen[T]) = {
- val n: Int = choose(0, size / 2 + 1).sample match {
- case Some(i) => i
- case None => 0
- }
- containerOfN[List, T](n, g)
- }
-
- def shortIdent(len: Int) =
- for(name <- identifier)
- yield if(name.length <= len) name
- else name.substring(0, len - 1)
-
- def genTermName = for(name <- shortIdent(8)) yield TermName(name)
- def genTypeName = for(name <- shortIdent(8)) yield TypeName(name)
- def genName = oneOf(genTermName, genTypeName)
-
- def genFlagSet = oneOf(
- TRAIT, INTERFACE, MUTABLE, MACRO,
- DEFERRED, ABSTRACT, FINAL, SEALED,
- IMPLICIT, LAZY, OVERRIDE, PRIVATE,
- PROTECTED, LOCAL, CASE, ABSOVERRIDE,
- BYNAMEPARAM, PARAM, COVARIANT, CONTRAVARIANT,
- DEFAULTPARAM, PRESUPER, DEFAULTINIT
- )
-
- def genModifiers = for(flagset <- genFlagSet) yield Modifiers(flagset)
-
- def genConstant =
- for(value <- oneOf(arbitrary[Byte], arbitrary[Short], arbitrary[Char],
- arbitrary[Int], arbitrary[Long], arbitrary[Float],
- arbitrary[Double], arbitrary[Boolean], arbitrary[String]))
- yield Constant(value)
-
- def genAnnotated(size: Int, argGen: Int => Gen[Tree]) =
- for(annot <- genTree(size - 1); arg <- argGen(size - 1))
- yield Annotated(annot, arg)
-
- def genAlternative(size: Int): Gen[Alternative] =
- for(trees <- smallList(size, genTree(size - 1)))
- yield Alternative(trees)
-
- def genAppliedTypeTree(size: Int) =
- for(tpt <- genTree(size - 1) if tpt.isType;
- args <- smallList(size, genTree(size - 1)))
- yield AppliedTypeTree(tpt, args)
-
- def genApply(size: Int) =
- for(fun <- genTree(size - 1);
- args <- smallList(size, genTree(size - 1)))
- yield Apply(fun, args)
-
- def genAssign(size: Int) =
- for(lhs <- genTree(size - 1); rhs <- genTree(size - 1))
- yield Assign(lhs, rhs)
-
- def genAssignOrNamedArg(size: Int) =
- for(lhs <- genTree(size - 1); rhs <- genTree(size - 1))
- yield AssignOrNamedArg(lhs, rhs)
-
- def genBind(size: Int, nameGen: Gen[Name]) =
- for(name <- nameGen; body <- genTree(size - 1))
- yield Bind(name, body)
-
- def genBlock(size: Int) =
- for(stats <- smallList(size, genTree(size - 1)); expr <- genTree(size - 1))
- yield Block(stats, expr)
-
- def genCaseDef(size: Int) =
- for(pat <- genTree(size - 1); guard <- genTree(size - 1); body <- genTree(size - 1))
- yield CaseDef(pat, guard, body)
-
- def genClassDef(size: Int) =
- for(mods <- genModifiers; name <- genTypeName;
- tparams <- smallList(size, genTypeDef(size - 1));
- impl <- genTemplate(size - 1))
- yield ClassDef(mods, name, tparams, impl)
-
- def genCompoundTypeTree(size: Int) =
- for(templ <- genTemplate(size - 1))
- yield CompoundTypeTree(templ)
-
- def genDefDef(size: Int) =
- for(mods <- genModifiers; name <- genTermName;
- tpt <- genTree(size -1); rhs <- genTree(size - 1);
- tparams <- smallList(size, genTypeDef(size - 1));
- vparamss <- smallList(size, smallList(size, genValDef(size - 1))))
- yield DefDef(mods, name, tparams, vparamss, tpt, rhs)
-
- def genExistentialTypeTree(size: Int) =
- for(tpt <- genTree(size - 1); where <- smallList(size, oneOf(genValDef(size - 1), genTypeDef(size - 1))))
- yield ExistentialTypeTree(tpt, where)
-
- def genFunction(size: Int) =
- for(vparams <- smallList(size, genValDef(size - 1)); body <- genTree(size - 1))
- yield Function(vparams, body)
-
- def genIdent(nameGen: Gen[Name] = genName) =
- for(name <- nameGen) yield Ident(name)
-
- def genIf(size: Int) =
- for(cond <- genTree(size - 1); thenp <- genTree(size - 1); elsep <- genTree(size - 1))
- yield If(cond, thenp, elsep)
-
- def genImport(size: Int) =
- for(expr <- genTree(size - 1); selectors <- smallList(size, genImportSelector(size - 1)))
- yield Import(expr, selectors)
-
- def genImportSelector(size: Int) =
- for(name <- genName; namePos <- arbitrary[Int]; rename <- genName; renamePos <- arbitrary[Int])
- yield ImportSelector(name, namePos, rename, renamePos)
-
- def genTemplate(size: Int) =
- for(parents <- smallList(size, genTree(size - 1));
- self <- genValDef(size - 1);
- body <- smallList(size, genTree(size - 1)))
- yield Template(parents, self, body)
-
- def genLabelDef(size: Int) =
- for(name <- genTermName; params <- smallList(size, genIdent()); rhs <- genTree(size - 1))
- yield LabelDef(name, params, rhs)
-
- def genLiteral =
- for(const <- genConstant) yield Literal(const)
-
- def genMatch(size: Int) =
- for(selector <- genTree(size - 1); cases <- smallList(size, genCaseDef(size - 1)))
- yield Match(selector, cases)
-
- def genModuleDef(size: Int) =
- for(mods <- genModifiers; name <- genTermName; impl <- genTemplate(size - 1))
- yield ModuleDef(mods, name, impl)
-
- def genNew(size: Int) =
- for(tpt <- genTree(size - 1))
- yield New(tpt)
-
- def genRefTree(size: Int) =
- oneOf(genSelect(size), genIdent(), genSelectFromTypeTree(size))
-
- def genPackageDef(size: Int) =
- for(reftree <- genRefTree(size - 1); stats <- smallList(size, genTree(size - 1)))
- yield PackageDef(reftree, stats)
-
- def genTypeSelect(size: Int) =
- for(qual <- genTree(size - 1); name <- genTypeName)
- yield Select(qual, name)
-
- def genSelect(size: Int, nameGen: Gen[Name] = genName) =
- for(qual <- genTree(size - 1); name <- nameGen)
- yield Select(qual, name)
-
- def genSelectFromTypeTree(size: Int) =
- for(qual <- genTreeIsType(size - 1); name <- genTypeName)
- yield SelectFromTypeTree(qual, name)
-
- def genReferenceToBoxed(size: Int) =
- for(ident <- genIdent())
- yield ReferenceToBoxed(ident)
-
- def genReturn(size: Int) =
- for(expr <- genTree(size - 1))
- yield Return(expr)
-
- def genSingletonTypeTree(size: Int) =
- for(expr <- genTree(size - 1))
- yield SingletonTypeTree(expr)
-
- def genStar(size: Int) =
- for(expr <- genTree(size - 1))
- yield Star(expr)
-
- def genSuper(size: Int) =
- for(qual <- genTree(size - 1); mix <- genTypeName)
- yield Super(qual, mix)
-
- def genThis(size: Int) =
- for(qual <- genTypeName)
- yield This(qual)
-
- def genThrow(size: Int) =
- for(expr <- genTree(size - 1))
- yield Throw(expr)
-
- def genTry(size: Int) =
- for(block <- genTree(size - 1);
- catches <- smallList(size, genCaseDef(size - 1));
- finalizer <- genTree(size - 1))
- yield Try(block, catches, finalizer)
-
- def genTypeApply(size: Int) =
- for(fun <- genTreeIsTerm(size - 1); args <- smallList(size, genTree(size - 1)))
- yield TypeApply(fun, args)
-
- def genTypeBoundsTree(size: Int) =
- for(lo <- genTree(size - 1); hi <- genTree(size - 1))
- yield TypeBoundsTree(lo, hi)
-
- def genTypeDef(size: Int): Gen[TypeDef] =
- for(mods <- genModifiers; name <- genTypeName;
- tparams <- smallList(size, genTypeDef(size - 1)); rhs <- genTree(size - 1))
- yield TypeDef(mods, name, tparams, rhs)
-
- def genTypeTree: Gen[TypeTree] = TypeTree()
-
- def genTyped(size: Int) =
- for(expr <- genTree(size - 1); tpt <- genTree(size - 1))
- yield Typed(expr, tpt)
-
- def genUnApply(size: Int) =
- for(fun <- genTree(size - 1); args <- smallList(size, genTree(size - 1)))
- yield UnApply(fun, args)
-
- def genValDef(size: Int) =
- for(mods <- genModifiers; name <- genTermName;
- tpt <- genTree(size - 1); rhs <- genTree(size - 1))
- yield ValDef(mods, name, tpt, rhs)
-
- def genTree(size: Int): Gen[Tree] =
- if (size <= 1) oneOf(EmptyTree: Gen[Tree], genTreeIsTerm(size), genTreeIsType(size))
- else oneOf(genTree(1),
- // these trees are neither terms nor types
- genPackageDef(size - 1), genModuleDef(size - 1),
- genCaseDef(size - 1), genDefDef(size - 1),
- genTypeDef(size - 1), genTemplate(size - 1),
- genClassDef(size - 1), genValDef(size - 1),
- genImport(size - 1))
-
- def genTreeIsTerm(size: Int): Gen[Tree] =
- if (size <= 1) oneOf(genLiteral, genIdent(genTermName))
- else oneOf(genTreeIsTerm(1), genBind(size - 1, genTermName),
- genAnnotated(size - 1, genTreeIsTerm), genSelect(size - 1, genTermName),
- genAlternative(size - 1), genApply(size - 1), genAssign(size - 1),
- genAssignOrNamedArg(size - 1), genBlock(size - 1), genFunction(size - 1),
- genIf(size - 1), genLabelDef(size - 1), genMatch(size - 1), genNew(size - 1),
- genReturn(size - 1), genStar(size - 1), genSuper(size - 1), genThis(size - 1),
- genThrow(size - 1), genTry(size - 1), genTypeApply(size - 1),
- genTyped(size - 1), genUnApply(size - 1))
-
- def genTreeIsType(size: Int): Gen[Tree] =
- if (size <= 1) genIdent(genTypeName)
- else oneOf(genTreeIsType(1), genAnnotated(size - 1, genTreeIsType),
- genBind(size - 1, genTypeName), genSelect(size - 1, genTypeName),
- genSingletonTypeTree(size - 1), genSelectFromTypeTree(size - 1),
- genExistentialTypeTree(size - 1), genCompoundTypeTree(size - 1),
- genAppliedTypeTree(size - 1), genTypeBoundsTree(size - 1))
-
- /* These are marker types that allow to write tests that
- * depend specifically on Trees that are terms or types.
- * They are transparently transformed to trees through
- * implicit conversions and liftables for quasiquotes.
- */
-
- case class TreeIsTerm(tree: Tree) { require(tree.isTerm, showRaw(tree)) }
- case class TreeIsType(tree: Tree) { require(tree.isType, showRaw(tree)) }
-
- def genTreeIsTermWrapped(size: Int) =
- for(tit <- genTreeIsTerm(size)) yield TreeIsTerm(tit)
-
- def genTreeIsTypeWrapped(size: Int) =
- for(tit <- genTreeIsType(size)) yield TreeIsType(tit)
-
- implicit val liftTreeIsTerm = Liftable[TreeIsTerm] { _.tree }
- implicit val liftTreeIsType = Liftable[TreeIsType] { _.tree }
- implicit def treeIsTerm2tree(tit: TreeIsTerm): Tree = tit.tree
- implicit def treeIsType2tree(tit: TreeIsType): Tree = tit.tree
-
- implicit val arbConstant: Arbitrary[Constant] = Arbitrary(genConstant)
- implicit val arbModifiers: Arbitrary[Modifiers] = Arbitrary(genModifiers)
- implicit val arbTermName: Arbitrary[TermName] = Arbitrary(genTermName)
- implicit val arbTypeName: Arbitrary[TypeName] = Arbitrary(genTypeName)
- implicit val arbName: Arbitrary[Name] = Arbitrary(genName)
-
- // Trees generators are bound by this size to make
- // generation times shorter and less memory hungry.
- // TODO: is there any better solution?
- val maxTreeSize = 5
-
- def arbitrarySized[T](gen: Int => Gen[T]) =
- Arbitrary(sized(s => gen(s.min(maxTreeSize))))
-
- implicit val arbLiteral: Arbitrary[Literal] = Arbitrary(genLiteral)
- implicit val arbIdent: Arbitrary[Ident] = Arbitrary(genIdent())
- implicit val arbValDef: Arbitrary[ValDef] = arbitrarySized(genValDef)
- implicit val arbDefDef: Arbitrary[DefDef] = arbitrarySized(genDefDef)
- implicit val arbTypeDef: Arbitrary[TypeDef] = arbitrarySized(genTypeDef)
- implicit val arbBind: Arbitrary[Bind] = arbitrarySized(genBind(_, genName))
- implicit val arbTree: Arbitrary[Tree] = arbitrarySized(genTree)
- implicit val arbTreeIsTerm: Arbitrary[TreeIsTerm] = arbitrarySized(genTreeIsTermWrapped)
- implicit val arbTreeIsType: Arbitrary[TreeIsType] = arbitrarySized(genTreeIsTypeWrapped)
-} \ No newline at end of file
diff --git a/test/files/scalacheck/quasiquotes/DefinitionConstructionProps.scala b/test/files/scalacheck/quasiquotes/DefinitionConstructionProps.scala
deleted file mode 100644
index 4ab8bb8531..0000000000
--- a/test/files/scalacheck/quasiquotes/DefinitionConstructionProps.scala
+++ /dev/null
@@ -1,453 +0,0 @@
-import org.scalacheck._, Prop._, Gen._, Arbitrary._
-import scala.reflect.runtime.universe._, Flag._, internal.reificationSupport.ScalaDot
-
-object DefinitionConstructionProps
- extends QuasiquoteProperties("definition construction")
- with ClassConstruction
- with TraitConstruction
- with TypeDefConstruction
- with ValDefConstruction
- with PatDefConstruction
- with DefConstruction
- with PackageConstruction
- with ImportConstruction {
-
- val x: Tree = q"val x: Int"
- property("SI-6842 a1") = test { assertEqAst(q"def f($x) = 0", "def f(x: Int) = 0") }
- property("SI-6842 a2") = test { assertEqAst(q"class C($x)", "class C(val x: Int)") }
- property("SI-6842 a3") = test { assertEqAst(q"class C { $x => }", "class C { x: Int => }") }
- property("SI-6842 a4") = test { assertEqAst(q"trait B { $x => }", "trait B { x: Int => }") }
- property("SI-6842 a5") = test { assertEqAst(q"object A { $x => }", "object A { x: Int => }") }
-
- val t: Tree = q"type T"
- property("SI-6842 b1") = test { assertEqAst(q"def f[$t] = 0", "def f[T] = 0") }
- property("SI-6842 b2") = test { assertEqAst(q"class C[$t]", "class C[T]") }
- property("SI-6842 b3") = test { assertEqAst(q"trait B[$t]", "trait B[T]") }
-}
-
-trait ClassConstruction { self: QuasiquoteProperties =>
- val anyRef = ScalaDot(TypeName("AnyRef"))
- val emtpyConstructor =
- DefDef(Modifiers(), termNames.CONSTRUCTOR, List(),
- List(List()), TypeTree(), Block(List(pendingSuperCall), Literal(Constant(()))))
- def classWith(name: TypeName, parents: List[Tree] = List(anyRef), body: List[DefDef] = Nil) =
- ClassDef(
- Modifiers(), name, List(),
- Template(parents, emptyValDef, emtpyConstructor :: body))
-
- property("construct case class") = test {
- val params = q"val x: Int" :: q"val y: Int" :: Nil
- val name = TypeName("Point")
- assertEqAst(q"$CASE class $name(..$params)", "case class Point(x: Int, y: Int)")
- }
-
- property("case class bare param") = test {
- assertEqAst(q"$CASE class Point(x: Int, y: Int)", "case class Point(private[this] val x: Int, private[this] val y: Int)")
- }
-
- property("generate default constructors automatically") = test {
- val parents = List.empty[Tree]
- assertEqAst(q"class Foo extends ..$parents", "class Foo")
- }
-
- property("unquote term name into class") = forAll { (rname: TypeName) =>
- // add prefix to avoid failure in case rname is keyword
- val name = TypeName("prefix$" + rname)
- eqAst(q"class $name", "class " + name.toString)
- }
-
- property("unquote method into class") = forAll { (name: TypeName, method: DefDef) =>
- q"class $name { $method }" ≈ classWith(name, body = List(method))
- }
-
- property("unquote members into class") = forAll { (name: TypeName, defs: List[DefDef], extra: DefDef) =>
- q"""class $name {
- ..$defs
- $extra
- }""" ≈ classWith(name, body = defs :+ extra)
- }
-
- property("unquote type name into class parents") = forAll { (name: TypeName, parent: TypeName) =>
- q"class $name extends $parent" ≈ classWith(name, parents = List(Ident(parent)))
- }
-
- property("param flags are consistent with raw code") = test {
- val pubx = q"val x: Int"
- val privx = q"private[this] val x: Int"
- assertEqAst(q" class C(x: Int)", " class C(x: Int) ")
- assertEqAst(q"case class C(x: Int)", "case class C(x: Int) ")
- assertEqAst(q" class C($pubx) ", " class C(val x: Int) ")
- assertEqAst(q"case class C($pubx) ", "case class C(x: Int) ")
- assertEqAst(q" class C($privx)", " class C(x: Int) ")
- assertEqAst(q"case class C($privx)", "case class C(private[this] val x: Int)")
- }
-
- property("SI-8333") = test {
- assertEqAst(q"{ $NoMods class C }", "{ class C }")
- }
-
- property("SI-8332") = test {
- val args = q"val a: Int; val b: Int"
- assertEqAst(q"class C(implicit ..$args)", "class C(implicit val a: Int, val b: Int)")
- }
-
- property("SI-8451: inline secondary constructors") = test {
- assertEqAst(q"class C(x: Int) { def this() = this(0) }", "class C(x: Int) { def this() = this(0) }")
- }
-
- property("SI-8451: unquoted secondary constructors") = test {
- val secondaryCtor = q"def this() = this(0)"
- assertEqAst(q"class C(x: Int) { $secondaryCtor }", "class C(x: Int) { def this() = this(0) }")
- }
-}
-
-trait TraitConstruction { self: QuasiquoteProperties =>
- property("unquote name into trait def") = test {
- val Foo = TypeName("Foo")
- assert(q"trait $Foo" ≈ q"trait Foo")
- }
-
- property("unquote type params into trait def") = test {
- val tparams = q"type A" :: q"type B" :: Nil
- assert(q"trait Foo[..$tparams]" ≈ q"trait Foo[A, B]")
- }
-
- property("unquote defs into trait body") = test {
- val body = q"def foo" :: q"val bar: Baz" :: Nil
- assert(q"trait Foo { ..$body }" ≈ q"trait Foo { def foo; val bar: Baz }")
- }
-
- property("unquote parents into trait") = test {
- val parents = tq"A" :: tq"B" :: Nil
- assert(q"trait Foo extends ..$parents" ≈ q"trait Foo extends A with B")
- }
-
- property("unquote early valdef into trait") = test {
- val x = q"val x: Int = 1"
- assertEqAst(q"trait T extends { $x } with Any", "trait T extends { val x: Int = 1} with Any")
- }
-
- property("construct trait with early valdef") = test {
- assertEqAst(q"trait T extends { val x: Int = 1 } with Any", "trait T extends { val x: Int = 1 } with Any")
- }
-
- property("unquote defs into early block") = test {
- val defs = q"val x: Int = 0" :: q"type Foo = Bar" :: Nil
- assert(q"trait T extends { ..$defs } with Bippy" ≈
- q"trait T extends { val x: Int = 0; type Foo = Bar} with Bippy")
- }
-
- property("fail on splicing of non-valid early tree") = test {
- val defn = q"def x: Int = 0"
- assertThrows[IllegalArgumentException] { q"trait T extends { $defn } with Bar" }
- }
-}
-
-trait TypeDefConstruction { self: QuasiquoteProperties =>
- property("unquote type name into typedef") = forAll { (name1: TypeName, name2: TypeName) =>
- q"type $name1 = $name2" ≈ TypeDef(Modifiers(), name1, List(), Ident(name2))
- }
-
- property("unquote type names into type bounds") = forAll { (T1: TypeName, T2: TypeName, T3: TypeName) =>
- q"type $T1 >: $T2 <: $T3" ≈
- TypeDef(
- Modifiers(DEFERRED), T1, List(),
- TypeBoundsTree(Ident(T2), Ident(T3)))
- }
-
- property("unquote trees names into type bounds") = forAll { (T: TypeName, t1: Tree, t2: Tree) =>
- q"type $T >: $t1 <: $t2" ≈
- TypeDef(
- Modifiers(DEFERRED), T, List(),
- TypeBoundsTree(t1, t2))
- }
-
- property("unquote tparams into typedef (1)") = forAll { (T: TypeName, targs: List[TypeDef], t: Tree) =>
- q"type $T[..$targs] = $t" ≈ TypeDef(Modifiers(), T, targs, t)
- }
-
- property("unquote tparams into typedef (2)") = forAll { (T: TypeName, targs1: List[TypeDef], targs2: List[TypeDef], t: Tree) =>
- q"type $T[..$targs1, ..$targs2] = $t" ≈ TypeDef(Modifiers(), T, targs1 ++ targs2, t)
- }
-
- property("unquote tparams into typedef (3)") = forAll { (T: TypeName, targ: TypeDef, targs: List[TypeDef], t: Tree) =>
- q"type $T[$targ, ..$targs] = $t" ≈ TypeDef(Modifiers(), T, targ :: targs, t)
- }
-
- property("unquote typename into typedef with default bounds") = forAll { (T1: TypeName, T2: TypeName, t: Tree) =>
- q"type $T1[$T2 >: Any <: Nothing] = $t" ≈
- TypeDef(
- Modifiers(), T1,
- List(TypeDef(
- Modifiers(PARAM), T2,
- List(),
- TypeBoundsTree(
- Ident(TypeName("Any")),
- Ident(TypeName("Nothing"))))),
- t)
- }
-
- property("unquote type names into compound type tree") = forAll { (T: TypeName, A: TypeName, B: TypeName) =>
- q"type $T = $A with $B" ≈
- TypeDef(
- Modifiers(), T, List(),
- CompoundTypeTree(
- Template(List(Ident(A), Ident(B)), ValDef(Modifiers(PRIVATE), termNames.WILDCARD, TypeTree(), EmptyTree), List())))
- }
-
- property("unquote trees into existential type tree") = forAll {
- (T1: TypeName, T2: TypeName, X: TypeName, Lo: TypeName, Hi: TypeName) =>
-
- q"type $T1 = $T2[$X] forSome { type $X >: $Lo <: $Hi }" ≈
- TypeDef(
- Modifiers(), T1, List(),
- ExistentialTypeTree(
- AppliedTypeTree(Ident(T2), List(Ident(X))),
- List(
- TypeDef(Modifiers(DEFERRED), X, List(), TypeBoundsTree(Ident(Lo), Ident(Hi))))))
- }
-
- property("unquote tree into singleton type tree") = forAll { (name: TypeName, t: Tree) =>
- q"type $name = $t.type" ≈ q"type $name = ${SingletonTypeTree(t)}"
- }
-
- property("unquote into applied type tree") = forAll { (T1: TypeName, T2: TypeName, args: List[Tree]) =>
- q"type $T1 = $T2[..$args]" ≈
- TypeDef(Modifiers(), T1, List(),
- if(args.nonEmpty) AppliedTypeTree(Ident(T2), args) else Ident(T2))
- }
-}
-
-trait ValDefConstruction { self: QuasiquoteProperties =>
- property("unquote into val") = forAll { (name: TermName, tpt: Tree, rhs: Tree) =>
- q"val $name: $tpt = $rhs" ≈ ValDef(Modifiers(), name, tpt, rhs)
- }
-
- property("unquote into var") = forAll { (name: TermName, tpt: Tree, rhs: Tree) =>
- q"var $name: $tpt = $rhs" ≈ ValDef(Modifiers(MUTABLE), name, tpt, rhs)
- }
-
- // left tree is not a pattern due to Si-8211
- property("SI-8202") = test {
- assertEqAst(q"val (x: Int) = 1", "val x: Int = 1")
- }
-}
-
-trait PatDefConstruction { self: QuasiquoteProperties =>
- property("unquote pattern into pat def") = test {
- val pat = pq"(a, b)"
- assertEqAst(q"val $pat = (1, 2)", "val (a, b) = (1, 2)")
- val tpt = tq"(Int, Int)"
- assertEqAst(q"val $pat: $tpt = (1, 2)", "val (a, b): (Int, Int) = (1, 2)")
- }
-
- property("unquote pattern into pat def within other pattern (1)") = test {
- val pat = pq"(a, b)"
- assertEqAst(q"val Foo($pat) = Foo((1, 2))", "val Foo((a, b)) = Foo((1, 2))")
- val tpt = tq"Foo"
- assertEqAst(q"val Foo($pat): $tpt = Foo((1, 2))", "val Foo((a, b)): Foo = Foo((1, 2))")
- }
-
- property("unquote patterns into pat def within other pattern (2)") = test {
- val pat1 = pq"(a, b)"; val pat2 = pq"(c, d)"
- assertEqAst(q"val ($pat1, $pat2) = ((1, 2), (3, 4))", "val ((a, b), (c, d)) = ((1, 2), (3, 4))")
- val tpt = tq"((Int, Int), (Int, Int))"
- assertEqAst(q"val ($pat1, $pat2): $tpt = ((1, 2), (3, 4))", "val ((a, b), (c, d)): ((Int, Int), (Int, Int)) = ((1, 2), (3, 4))")
- }
-
- property("unquote pattern without free vars into pat def") = test {
- val pat = pq"((1, 2), 3)"
- assertEqAst(q"val $pat = ((1, 2), 3)", "{ val ((1, 2), 3) = ((1, 2), 3) }")
- val tpt = tq"((Int, Int), Int)"
- assertEqAst(q"val $pat: $tpt = ((1, 2), 3)","{ val ((1, 2), 3): ((Int, Int), Int) = ((1, 2), 3) }")
- }
-
- // won't result into pattern match due to SI-8211
- property("unquote typed pat into pat def") = test {
- val pat = pq"x: Int"
- assertEqAst(q"val $pat = 2", "{ val x: Int = 2 }")
- }
-}
-
-trait MethodConstruction { self: QuasiquoteProperties =>
- property("unquote paramss into defdef") = test {
- val paramss = List(q"val x: Int") :: List(q"val y: Int = 1") :: Nil
- assert(q"def foo(...$paramss)" ≈ parse("def foo(x: Int)(y: Int = 1)"))
- }
-
- property("unquote tparams into defdef") = test {
- val tparams = q"type A" :: q"type B <: Bippy" :: Nil
- assert(q"def foo[..$tparams]" ≈ parse("def foo[A, B <: Bippy]"))
- }
-
- def assertSameAnnots(tree: {def mods: Modifiers}, annots: List[Tree]) =
- assert(tree.mods.annotations ≈ annots,
- s"${tree.mods.annotations} =/= ${annots}")
-
- def assertSameAnnots(tree1: {def mods: Modifiers}, tree2: {def mods: Modifiers}) =
- assert(tree1.mods.annotations ≈ tree2.mods.annotations,
- s"${tree1.mods.annotations} =/= ${tree2.mods.annotations}")
-
- property("unquote type name into annotation") = test {
- val name = TypeName("annot")
- assertSameAnnots(q"@$name def foo", List(q"new $name"))
- }
-
- property("unquote ident into annotation") = test {
- val name = TypeName("annot")
- val ident = Ident(name)
- assertSameAnnots(q"@$ident def foo", List(q"new $name"))
- }
-
- property("unquote idents into annotation") = test {
- val idents = List(Ident(TypeName("annot1")), Ident(TypeName("annot2")))
- assertSameAnnots(q"@..$idents def foo",
- idents.map { ident => Apply(Select(New(ident), termNames.CONSTRUCTOR), List()) })
- }
-
- property("unquote constructor calls into annotation") = test {
- val ctorcalls = List(q"new a1", q"new a2")
- assertSameAnnots(q"@..$ctorcalls def foo", ctorcalls)
- }
-
- property("unquote multiple annotations (1)") = test {
- val annot1 = q"new a1"
- val annot2 = q"new a2"
- val res = q"@$annot1 @$annot2 def foo"
- assertSameAnnots(res, List(annot1, annot2))
- }
-
- property("unquote multiple annotations (2)") = test {
- val annot1 = q"new a1"
- val annots = List(q"new a2", q"new a3")
- val res = q"@$annot1 @..$annots def foo"
- assertSameAnnots(res, annot1 :: annots)
- }
-
- property("unquote annotations with arguments (1)") = test {
- val a = q"new a(x)"
- assertSameAnnots(q"@$a def foo", q"@a(x) def foo")
- }
-
- property("unquote annotations with arguments (2)") = test {
- val a = TypeName("a")
- assertSameAnnots(q"@$a(x) def foo", q"@a(x) def foo")
- }
-
- property("unquote annotations with arguments (3") = test {
- val a = Ident(TypeName("a"))
- assertSameAnnots(q"@$a(x) def foo", q"@a(x) def foo")
- }
-
- property("unquote improper tree into annot") = test {
- val t = tq"Foo[Baz]"
- assertThrows[IllegalArgumentException] {
- q"@$t def foo"
- }
- }
-
- property("can't unquote annotations with arguments specified twice") = test {
- val a = q"new a(x)"
- assertThrows[IllegalArgumentException] {
- q"@$a(y) def foo"
- }
- }
-
- property("unquote annotation with targs") = test {
- val a = q"new Foo[A, B]"
- assertEqAst(q"@$a def foo", "@Foo[A,B] def foo")
- }
-
- property("unquote annotation with multiple argument lists") = test {
- val a = q"new Foo(a)(b)"
- assertEqAst(q"@$a def foo", "@Foo(a)(b) def foo")
- }
-}
-
-trait PackageConstruction { self: QuasiquoteProperties =>
- property("unquote select into package name") = test {
- val name = q"foo.bar"
- assertEqAst(q"package $name { }", "package foo.bar { }")
- }
-
- property("splice name into package name") = test{
- val name = TermName("bippy")
- assertEqAst(q"package $name { }", "package bippy { }")
- }
-
- property("unquote members into package body") = test {
- val members = q"class C" :: q"object O" :: Nil
- assertEqAst(q"package foo { ..$members }", "package foo { class C; object O }")
- }
-
- property("unquote illegal members into package body") = test {
- val f = q"def f"
- assertThrows[IllegalArgumentException] { q"package foo { $f }" }
- val v = q"val v = 0"
- assertThrows[IllegalArgumentException] { q"package foo { $v }" }
- val expr = q"x + 1"
- assertThrows[IllegalArgumentException] { q"package foo { $expr }" }
- }
-
- property("unquote name into package object") = test {
- val foo = TermName("foo")
- assertEqAst(q"package object $foo", "package object foo")
- }
-
- property("unquote parents into package object") = test {
- val parents = tq"a" :: tq"b" :: Nil
- assertEqAst(q"package object foo extends ..$parents",
- "package object foo extends a with b")
- }
-
- property("unquote members into package object") = test {
- val members = q"def foo" :: q"val x = 1" :: Nil
- assertEqAst(q"package object foo { ..$members }",
- "package object foo { def foo; val x = 1 }")
- }
-
- property("unquote early def into package object") = test {
- val edefs = q"val x = 1" :: q"type I = Int" :: Nil
- assertEqAst(q"package object foo extends { ..$edefs } with Any",
- "package object foo extends { val x = 1; type I = Int } with Any")
- }
-}
-
-trait DefConstruction { self: QuasiquoteProperties =>
- property("construct implicit args (1)") = test {
- val x = q"val x: Int"
- assertEqAst(q"def foo(implicit $x) = x", "def foo(implicit x: Int) = x")
- }
-
- property("construct implicit args (2)") = test {
- val xs = q"val x1: Int" :: q"val x2: Long" :: Nil
- assertEqAst(q"def foo(implicit ..$xs) = x1 + x2", "def foo(implicit x1: Int, x2: Long) = x1 + x2")
- }
-}
-
-trait ImportConstruction { self: QuasiquoteProperties =>
- property("construct wildcard import") = test {
- val sel = pq"_"
- assert(q"import foo.$sel" ≈ q"import foo._")
- }
-
- property("construct named import") = test {
- val sel = pq"bar"
- assert(q"import foo.$sel" ≈ q"import foo.bar")
- }
-
- property("construct renaming import") = test {
- val sel = pq"bar -> baz"
- assert(q"import foo.$sel" ≈ q"import foo.{bar => baz}")
- }
-
- property("construct unimport import") = test {
- val sels = pq"poison -> _" :: pq"_" :: Nil
- assert(q"import foo.{..$sels}" ≈ q"import foo.{poison => _, _}")
- }
-
- property("construct mixed import") = test {
- val sels = pq"a -> b" :: pq"c -> _" :: pq"_" :: Nil
- assert(q"import foo.{..$sels}" ≈ q"import foo.{a => b, c => _, _}")
- }
-}
diff --git a/test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala b/test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala
deleted file mode 100644
index 2c0e100b5a..0000000000
--- a/test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala
+++ /dev/null
@@ -1,290 +0,0 @@
-import org.scalacheck._, Prop._, Gen._, Arbitrary._
-import scala.reflect.runtime.universe._, Flag._, internal.reificationSupport.SyntacticClassDef
-
-object DefinitionDeconstructionProps
- extends QuasiquoteProperties("definition deconstruction")
- with TraitDeconstruction
- with ClassDeconstruction
- with ObjectDeconstruction
- with ModsDeconstruction
- with ValVarDeconstruction
- with DefDeconstruction
- with PackageDeconstruction
- with ImportDeconstruction
-
-trait TraitDeconstruction { self: QuasiquoteProperties =>
- property("exhaustive trait matcher") = test {
- def matches(line: String) {
- val q"""$mods trait $name[..$targs]
- extends { ..$early } with ..$parents { $self => ..$body }""" = parse(line)
- }
- matches("trait Foo")
- matches("trait Foo[T]")
- matches("trait Foo { def bar }")
- matches("trait Foo extends Bar with Baz")
- matches("trait Foo { self: Bippy => val x: Int = 1}")
- matches("trait Foo extends { val early: Int = 1 } with Bar { val late = early }")
- matches("private[Gap] trait Foo")
- }
-}
-
-trait ObjectDeconstruction { self: QuasiquoteProperties =>
- property("exhaustive object matcher") = test {
- def matches(line: String) = {
- val q"""$mods object $name extends { ..$early } with ..$parents { $self => ..$body }""" = parse(line)
- }
- matches("object Foo")
- matches("object Foo extends Bar[T]")
- matches("object Foo extends { val early: T = v } with Bar")
- matches("object Foo extends Foo { selfy => body }")
- matches("private[Bippy] object Foo extends Bar with Baz")
- }
-}
-
-trait ClassDeconstruction { self: QuasiquoteProperties =>
- property("class without params") = test {
- val q"class $name { ..$body }" = q"class Foo { def bar = 3 }"
- assert(body ≈ List(q"def bar = 3"))
- }
-
- property("class constructor") = test {
- val q"class $name(...$argss)" = q"class Foo(x: Int)(y: Int)"
- assert(argss.length == 2)
- }
-
- property("class parents") = test {
- val q"class $name extends ..$parents" = q"class Foo extends Bar with Blah"
- assert(parents ≈ List(tq"Bar", tq"Blah"))
- }
-
- property("class selfdef") = test {
- val q"class $name { $self => }" = q"class Foo { self: T => }"
- assert(self.name ≈ TermName("self") && self.tpt ≈ tq"T")
- }
-
- property("class tparams") = test {
- val q"class $name[..$tparams]" = q"class Foo[A, B]"
- assert(tparams.map { _.name } == List(TypeName("A"), TypeName("B")))
- }
-
- property("deconstruct bare case class") = test {
- val q"$mods class $name(..$args) extends ..$parents" = q"case class Foo(x: Int)"
- }
-
- property("exhaustive class matcher") = test {
- def matches(line: String) {
- val tree = parse(line)
- val q"""$classMods0 class $name0[..$targs0] $ctorMods0(...$argss0)
- extends { ..$early0 } with ..$parents0 { $self0 => ..$body0 }""" = tree
- val q"""$classMods1 class $name1[..$targs1] $ctorMods1(...$argss1)(implicit ..$impl)
- extends { ..$early1 } with ..$parents1 { $self1 => ..$body1 }""" = tree
- }
- matches("class Foo")
- matches("class Foo[T]")
- matches("class Foo[T] @annot")
- matches("class Foo extends Bar with Baz")
- matches("class Foo { body }")
- matches("class Foo extends { val early = 0 } with Any")
- matches("abstract class Foo")
- matches("private[Baz] class Foo")
- matches("class Foo(first: A)(second: B)")
- matches("class Foo(first: A) extends Bar(first) with Baz")
- matches("class Foo private (first: A) { def bar }")
- matches("class Foo { self => bar(self) }")
- matches("case class Foo(x: Int)")
- }
-
- property("SI-7979") = test {
- val PARAMACCESSOR = (1 << 29).toLong.asInstanceOf[FlagSet]
- assertThrows[MatchError] {
- val SyntacticClassDef(_, _, _, _, _, _, _, _, _) =
- ClassDef(
- Modifiers(), TypeName("Foo"), List(),
- Template(
- List(Select(Ident(TermName("scala")), TypeName("AnyRef"))),
- noSelfType,
- List(
- //ValDef(Modifiers(PRIVATE | LOCAL | PARAMACCESSOR), TermName("x"), Ident(TypeName("Int")), EmptyTree),
- DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List(ValDef(Modifiers(PARAM | PARAMACCESSOR), TermName("x"),
- Ident(TypeName("Int")), EmptyTree))), TypeTree(), Block(List(pendingSuperCall), Literal(Constant(())))))))
- }
- }
-
- property("SI-8332") = test {
- val q"class C(implicit ..$args)" = q"class C(implicit i: I, j: J)"
- val q"$imods val i: I" :: q"$jmods val j: J" :: Nil = args
- assert(imods.hasFlag(IMPLICIT))
- assert(jmods.hasFlag(IMPLICIT))
- }
-}
-
-trait ModsDeconstruction { self: QuasiquoteProperties =>
- property("deconstruct mods") = test {
- val mods = Modifiers(IMPLICIT | PRIVATE, TermName("foobar"), Nil)
- val q"$mods0 def foo" = q"$mods def foo"
- assert(mods0 ≈ mods)
- }
-
- property("@$annot def foo") = forAll { (annotName: TypeName) =>
- val q"@$annot def foo" = q"@$annotName def foo"
- annot ≈ Apply(Select(New(Ident(annotName)), termNames.CONSTRUCTOR), List())
- }
-
- property("@$annot(..$args) def foo") = forAll { (annotName: TypeName, tree: Tree) =>
- val q"@$annot(..$args) def foo" = q"@$annotName($tree) def foo"
- annot ≈ Ident(annotName) && args ≈ List(tree)
- }
-
- property("@..$annots def foo") = test {
- val a = q"new a"
- val b = q"new b"
- val q"@..$annots def foo" = q"@$a @$b def foo"
- annots ≈ List(a, b)
- }
-
- property("@$annot @..$annots def foo") = test {
- val a = q"new a"
- val b = q"new b"
- val c = q"new c"
- val q"@$first @..$rest def foo" = q"@$a @$b @$c def foo"
- assert(first ≈ a)
- assert(rest ≈ List(b, c))
- }
-
- property("@..$anots @$annot def foo") = test {
- val a = q"new a"
- val b = q"new b"
- val c = q"new c"
- val q"@..$init @$last def foo" = q"@$a @$b @$c def foo"
- assert(init ≈ List(a, b))
- assert(last ≈ c)
- }
-}
-
-trait ValVarDeconstruction { self: QuasiquoteProperties =>
- property("exhaustive val matcher") = test {
- def matches(line: String) { val q"$mods val $name: $tpt = $rhs" = parse(line) }
- matches("val x: Int")
- matches("val x: Int = 1")
- matches("lazy val x: Int = 1")
- matches("implicit val x = 1")
- assertThrows[MatchError] { matches("var x = 1") }
- }
-
- property("exhaustive var matcher") = test {
- def matches(line: String) { val q"$mods var $name: $tpt = $rhs" = parse(line) }
- matches("var x: Int")
- matches("var x: Int = 1")
- matches("var x = 1")
- assertThrows[MatchError] { matches("val x = 1") }
- }
-}
-
-trait PackageDeconstruction { self: QuasiquoteProperties =>
- property("exhaustive package matcher") = test {
- def matches(line: String) { val q"package $name { ..$body }" = parse(line) }
- matches("package foo { }")
- matches("package foo { class C }")
- matches("package foo.bar { }")
- matches("package bippy.bongo { object A; object B }")
- matches("package bippy { package bongo { object O } }")
- }
-
- property("exhaustive package object matcher") = test {
- def matches(line: String) {
- val q"package object $name extends { ..$early } with ..$parents { $self => ..$body }" = parse(line)
- }
- matches("package object foo")
- matches("package object foo { def baz }")
- matches("package object foo { self => }")
- matches("package object foo extends mammy with daddy { def baz }")
- matches("package object foo extends { val early = 1 } with daddy")
- assertThrows[MatchError] { matches("object foo") }
- }
-}
-
-trait DefDeconstruction { self: QuasiquoteProperties =>
- property("exhaustive def matcher") = test {
- def matches(line: String) = {
- val t = parse(line)
- val q"$mods0 def $name0[..$targs0](...$argss0): $restpe0 = $body0" = t
- val q"$mods1 def $name1[..$targs1](...$argss1)(implicit ..$impl1): $restpe1 = $body1" = t
- }
- matches("def foo = foo")
- matches("implicit def foo: Int = 2")
- matches("def foo[T](x: T): T = x")
- matches("def foo[A: B] = implicitly[B[A]]")
- matches("private def foo = 0")
- matches("def foo[A <% B] = null")
- matches("def foo(one: One)(two: Two) = (one, two)")
- matches("def foo[T](args: T*) = args.toList")
- }
-
- property("extract implicit arg list (1)") = test {
- val q"def foo(...$argss)(implicit ..$impl)" = q"def foo(x: Int)(implicit y: Int)"
- assert(impl ≈ List(q"${Modifiers(IMPLICIT | PARAM)} val y: Int"))
- }
-
- property("extract implicit arg list (2)") = test {
- val q"def foo(...$argss)(implicit ..$impl)" = q"def foo(x: Int)"
- assert(impl.isEmpty)
- }
-
- property("SI-8451") = test {
- val q"def this(..$params) = this(..$args)" = q"def this(x: Int) = this(0)"
- assert(params ≈ List(q"${Modifiers(PARAM)} val x: Int"))
- assert(args ≈ List(q"0"))
- }
-}
-
-trait ImportDeconstruction { self: QuasiquoteProperties =>
- property("exhaustive import matcher") = test {
- def matches(line: String) = {
- val q"import $ref.{..$sels}" = parse(line)
- }
- matches("import foo.bar")
- matches("import foo.{bar, baz}")
- matches("import foo.{a => b, c => d}")
- matches("import foo.{poision => _, _}")
- matches("import foo.bar.baz._")
- }
-
- property("extract import binding") = test {
- val q"import $_.$sel" = q"import foo.bar"
- val pq"bar" = sel
- }
-
- property("extract import wildcard") = test {
- val q"import $_.$sel" = q"import foo._"
- val pq"_" = sel
- }
-
- property("extract import rename") = test {
- val q"import $_.$sel" = q"import foo.{bar => baz}"
- val pq"bar -> baz" = sel
- val pq"$left -> $right" = sel
- val pq"bar" = left
- val pq"baz" = right
- }
-
- property("extract import unimport") = test {
- val q"import $_.$sel" = q"import foo.{bar => _}"
- val pq"bar -> _" = sel
- val pq"$left -> $right" = sel
- val pq"bar" = left
- val pq"_" = right
- }
-
- property("unquote names into import selector") = forAll {
- (expr: Tree, plain: TermName, oldname: TermName, newname: TermName, discard: TermName) =>
-
- val Import(expr1, List(
- ImportSelector(plain11, _, plain12, _),
- ImportSelector(oldname1, _, newname1, _),
- ImportSelector(discard1, _, wildcard, _))) =
- q"import $expr.{$plain, $oldname => $newname, $discard => _}"
-
- expr1 ≈ expr && plain11 == plain12 && plain12 == plain &&
- oldname1 == oldname && newname1 == newname && discard1 == discard && wildcard == termNames.WILDCARD
- }
-}
diff --git a/test/files/scalacheck/quasiquotes/DeprecationProps.scala b/test/files/scalacheck/quasiquotes/DeprecationProps.scala
deleted file mode 100644
index 8e1601cf9d..0000000000
--- a/test/files/scalacheck/quasiquotes/DeprecationProps.scala
+++ /dev/null
@@ -1,52 +0,0 @@
-import org.scalacheck._, Prop._, Gen._, Arbitrary._
-import scala.reflect.runtime.universe._
-
-object DeprecationProps extends QuasiquoteProperties("deprecation") {
- val tname = TypeName("Foo")
- val tpt = tq"Foo"
- val tpe = typeOf[Int]
- val sym = tpe.typeSymbol.asType
- val argss = List(q"x") :: List(q"y") :: Nil
- val args = q"x" :: q"y" :: Nil
-
- property("new tpt argss") = test {
- assert(q"new $tpt(...$argss)" ≈ New(tpt, argss))
- }
-
- property("new tpe args") = test {
- assert(q"new $tpe(..$args)" ≈ New(tpe, args: _*))
- }
-
- property("new tpe args") = test {
- assert(q"new ${sym.toType}(..$args)" ≈ New(sym, args: _*))
- }
-
- property("apply sym args") = test {
- assert(q"$sym(..$args)" ≈ Apply(sym, args: _*))
- }
-
- property("applyconstructor") = test {
- assert(q"new $tpt(..$args)" ≈ ApplyConstructor(tpt, args))
- }
-
- property("super sym name") = test {
- assert(q"$sym.super[$tname].x".qualifier ≈ Super(sym, tname))
- }
-
- property("throw tpe args") = test {
- assert(q"throw new $tpe(..$args)" ≈ Throw(tpe, args: _*))
- }
-
- property("casedef pat body") = test {
- val pat = pq"foo"
- val body = q"bar"
- assert(cq"$pat => $body" ≈ CaseDef(pat, body))
- }
-
- property("try body cases") = test {
- val cases = (pq"a", q"b") :: (pq"c", q"d") :: Nil
- val newcases = cases.map { case (pat, body) => cq"$pat => $body" }
- val body = q"foo"
- assert(q"try $body catch { case ..$newcases }" ≈ Try(body, cases: _*))
- }
-} \ No newline at end of file
diff --git a/test/files/scalacheck/quasiquotes/ErrorProps.scala b/test/files/scalacheck/quasiquotes/ErrorProps.scala
deleted file mode 100644
index 0c24149372..0000000000
--- a/test/files/scalacheck/quasiquotes/ErrorProps.scala
+++ /dev/null
@@ -1,213 +0,0 @@
-import org.scalacheck._, Prop._, Gen._, Arbitrary._
-
-object ErrorProps extends QuasiquoteProperties("errors") {
- property("can't extract two .. rankinalities in a row") = fails(
- "Can't extract with .. here",
- """
- val xs = List(q"x1", q"x2")
- val q"f(..$xs1, ..$xs2)" = xs
- """)
-
- property("can't unquote with given rank") = fails(
- "Can't unquote List[StringBuilder], consider using .. or providing an implicit instance of Liftable[List[StringBuilder]]",
- """
- import java.lang.StringBuilder
- val xs: List[StringBuilder] = Nil
- q"$xs"
- """)
-
- property("unquote typename into typedef with default bounds") = fails(
- "reflect.runtime.universe.Name expected but reflect.runtime.universe.TypeDef found",
- """
- val T1 = TypeName("T1")
- val T2 = q"type T"
- val t = EmptyTree
- q"type $T1[$T2 >: _root_.scala.Any <: _root_.scala.Nothing] = $t" ≈
- TypeDef(Modifiers(), T1, List(T2), t)
- """)
-
- property("can't unquote annotations with ... rank") = fails(
- "Can't unquote with ... here",
- """
- val annots = List(List(q"Foo"))
- q"@...$annots def foo"
- """)
-
- property("only literal string arguments") = fails(
- "Quasiquotes can only be used with literal strings",
- """
- val s: String = "foo"
- StringContext(s).q()
- """)
-
- property("don't know how to unquote inside of strings") = fails(
- "Don't know how to unquote here",
- """
- val x: Tree = EmptyTree
- StringContext("\"", "\"").q(x)
- """)
-
- property("non-liftable type ..") = fails(
- "Can't unquote List[StringBuilder] with .., consider omitting the dots or providing an implicit instance of Liftable[StringBuilder]",
- """
- import java.lang.StringBuilder
- val bazs = List(new StringBuilder)
- q"f(..$bazs)"
- """)
-
- property("non-liftable type ...") = fails(
- "Can't unquote List[List[StringBuilder]] with .., consider using ... or providing an implicit instance of Liftable[StringBuilder]",
- """
- import java.lang.StringBuilder
- val bazs = List(List(new StringBuilder))
- q"f(..$bazs)"
- """)
-
- property("use .. rank or provide liftable") = fails(
- "Can't unquote List[StringBuilder], consider using .. or providing an implicit instance of Liftable[List[StringBuilder]]",
- """
- import java.lang.StringBuilder
- val lst: List[StringBuilder] = Nil
- q"f($lst)"
- """)
-
- property("use ... rank or provide liftable") = fails(
- "Can't unquote List[List[StringBuilder]], consider using ... or providing an implicit instance of Liftable[List[List[StringBuilder]]]",
- """
- import java.lang.StringBuilder
- val xs: List[List[StringBuilder]] = Nil
- q"$xs"
- """)
-
- property("not liftable or natively supported") = fails(
- "Can't unquote StringBuilder, consider providing an implicit instance of Liftable[StringBuilder]",
- """
- import java.lang.StringBuilder
- val sb = new StringBuilder
- q"f($sb)"
- """)
-
- property("can't unquote with ... rank here") = fails(
- "Can't unquote with ... here",
- """
- val lst: List[List[Tree]] = Nil; val t = EmptyTree
- q"f(...$lst, $t)"
- """)
-
- property("name expected") = fails(
- "reflect.runtime.universe.Name expected but reflect.runtime.universe.Tree found",
- """
- val t = EmptyTree
- q"class $t"
- """)
-
- property("flags or mods expected") = fails(
- "reflect.runtime.universe.FlagSet or reflect.runtime.universe.Modifiers expected but reflect.runtime.universe.Tree found",
- """
- val t = EmptyTree
- q"$t def foo"
- """)
-
- property("cant unquote flags together with mods") = fails(
- "Can't unquote flags together with modifiers, consider merging flags into modifiers",
- """
- val f = Flag.IMPLICIT; val m = NoMods
- q"$f $m def foo"
- """)
-
- property("can't unquote mods with annots") = fails(
- "Can't unquote modifiers together with annotations, consider merging annotations into modifiers",
- """
- val m = NoMods
- q"@annot $m def foo"
- """)
-
- property("can't unquote modifiers with inline flags") = fails(
- "Can't unquote modifiers together with flags, consider merging flags into modifiers",
- """
- val m = NoMods
- q"$m implicit def foo"
- """)
-
- property("can't unquote multiple mods") = fails(
- "Can't unquote multiple modifiers, consider merging them into a single modifiers instance",
- """
- val m1 = NoMods; val m2 = NoMods
- q"$m1 $m2 def foo"
- """)
-
- property("can't extract mods with annots") = fails(
- "Can't extract modifiers together with annotations, consider extracting just modifiers",
- """
- val q"@$annot $mods def foo" = EmptyTree
- """)
-
- property("can't extract multiple mods") = fails(
- "Can't extract multiple modifiers together, consider extracting a single modifiers instance",
- """
- val q"$m1 $m2 def foo" = EmptyTree
- """)
-
- property("can't unquote values of Null") = fails(
- "Can't unquote Null, bottom type values often indicate programmer mistake",
- """
- val n = null
- q"$n"
- """)
-
- property("can't unquote values of Nothing") = fails(
- "Can't unquote Nothing, bottom type values often indicate programmer mistake",
- """
- def n = ???
- q"$n"
- """)
-
- property("SI-8211: check unbound placeholder parameters") = fails(
- "unbound placeholder parameter",
- """
- q"_"
- """)
-
- property("SI-8211: check unbound wildcard types") = fails(
- "unbound wildcard type",
- """
- tq"_"
- """)
-
- property("SI-8420: don't crash on splicing of non-unliftable native type (1)") = fails(
- "Can't unquote List[reflect.runtime.universe.Symbol] with .., consider omitting the dots or providing an implicit instance of Liftable[reflect.runtime.universe.Symbol]",
- """
- val l: List[Symbol] = Nil
- q"f(..$l)"
- """)
-
- property("SI-8420: don't crash on splicing of non-unliftable native type (2)") = fails(
- "Can't unquote List[reflect.runtime.universe.FlagSet] with .., consider omitting the dots or providing an implicit instance of Liftable[reflect.runtime.universe.FlagSet]",
- """
- val l: List[FlagSet] = Nil
- q"f(..$l)"
- """)
-
- property("SI-8420: don't crash on splicing of non-unliftable native type (3)") = fails(
- "Can't unquote List[reflect.runtime.universe.Modifiers] with .., consider omitting the dots or providing an implicit instance of Liftable[reflect.runtime.universe.Modifiers]",
- """
- val l: List[Modifiers] = Nil
- q"f(..$l)"
- """)
-
- property("SI-8451 construction: disallow everything except for constructor calls in secondary constructor bodies") = fails(
- "'this' expected but unquotee found",
- """
- val rhs1 = q"this(0)"
- val ctor1 = q"def this(x: Int) = $rhs1"
- """)
-
- property("SI-8451 deconstruction: disallow everything except for constructor calls in secondary constructor bodies") = fails(
- "'this' expected but unquotee found",
- """
- val q"def this(..$params) = $rhs2" = q"def this(x: Int) = this(0)"
- """)
-
- // // Make sure a nice error is reported in this case
- // { import Flag._; val mods = NoMods; q"lazy $mods val x: Int" }
-}
diff --git a/test/files/scalacheck/quasiquotes/ForProps.scala b/test/files/scalacheck/quasiquotes/ForProps.scala
deleted file mode 100644
index b14d345edd..0000000000
--- a/test/files/scalacheck/quasiquotes/ForProps.scala
+++ /dev/null
@@ -1,70 +0,0 @@
-import org.scalacheck._, Prop._, Gen._, Arbitrary._
-import scala.reflect.runtime.universe._, Flag._, internal.reificationSupport._
-
-object ForProps extends QuasiquoteProperties("for") {
- case class ForEnums(val value: List[Tree])
-
- def genSimpleBind: Gen[Bind] =
- for(name <- genTermName)
- yield pq"$name @ _"
-
- def genForFilter: Gen[Tree] =
- for(cond <- genIdent(genTermName))
- yield fq"if $cond"
-
- def genForFrom: Gen[Tree] =
- for(lhs <- genSimpleBind; rhs <- genIdent(genTermName))
- yield fq"$lhs <- $rhs"
-
- def genForEq: Gen[Tree] =
- for(lhs <- genSimpleBind; rhs <- genIdent(genTermName))
- yield fq"$lhs = $rhs"
-
- def genForEnums(size: Int): Gen[ForEnums] =
- for(first <- genForFrom; rest <- listOfN(size, oneOf(genForFrom, genForFilter, genForEq)))
- yield new ForEnums(first :: rest)
-
- implicit val arbForEnums: Arbitrary[ForEnums] = arbitrarySized(genForEnums)
-
- property("construct-reconstruct for") = forAll { (enums: ForEnums, body: Tree) =>
- val SyntacticFor(recoveredEnums, recoveredBody) = SyntacticFor(enums.value, body)
- recoveredEnums ≈ enums.value && recoveredBody ≈ body
- }
-
- property("construct-reconstruct for-yield") = forAll { (enums: ForEnums, body: Tree) =>
- val SyntacticForYield(recoveredEnums, recoveredBody) = SyntacticForYield(enums.value, body)
- recoveredEnums ≈ enums.value && recoveredBody ≈ body
- }
-
- val abcde = List(fq"a <-b", fq"if c", fq"d = e")
- val foobarbaz = pq"foo @ Bar(baz)"
- val fv = q"f(v)"
-
- property("construct/deconstruct for loop with fq") = test {
- val for0 = q"for(..$abcde) $fv"
- assertEqAst(for0, "for(a <- b; if c; d = e) f(v)")
- val q"for(..$enums) $body" = for0
- assert(enums ≈ abcde)
- assert(body ≈ fv)
- }
-
- property("construct/deconstruct valfrom with fq") = test {
- assert(fq"$foobarbaz <- $fv" ≈ fq"foo @ Bar(baz) <- f(v)")
- val fq"$lhs <- $rhs" = fq"$foobarbaz <- $fv"
- assert(lhs ≈ foobarbaz)
- assert(rhs ≈ fv)
- }
-
- property("construct/deconstruct valeq with fq") = test {
- assert(fq"$foobarbaz = $fv" ≈ fq"foo @ Bar(baz) = f(v)")
- val fq"$lhs = $rhs" = fq"$foobarbaz = $fv"
- assert(lhs ≈ foobarbaz)
- assert(rhs ≈ fv)
- }
-
- property("construct/deconstruct filter with fq") = test {
- assert(fq"if $fv" ≈ fq"if f(v)")
- val fq"if $cond" = fq"if $fv"
- assert(cond ≈ fv)
- }
-} \ No newline at end of file
diff --git a/test/files/scalacheck/quasiquotes/LiftableProps.scala b/test/files/scalacheck/quasiquotes/LiftableProps.scala
deleted file mode 100644
index a4c57ac359..0000000000
--- a/test/files/scalacheck/quasiquotes/LiftableProps.scala
+++ /dev/null
@@ -1,174 +0,0 @@
-import org.scalacheck._, Prop._, Gen._, Arbitrary._
-import scala.reflect.runtime.universe._, Flag._
-
-object LiftableProps extends QuasiquoteProperties("liftable") {
- property("unquote byte") = test {
- val c: Byte = 0
- assert(q"$c" ≈ Literal(Constant(c)))
- assert(q"${0: Byte}" ≈ Literal(Constant(c)))
- }
-
- property("unquote short") = test {
- val c: Short = 0
- assert(q"$c" ≈ Literal(Constant(c)))
- assert(q"${0: Short}" ≈ Literal(Constant(c)))
- }
-
- property("unquote char") = test {
- val c: Char = 'c'
- assert(q"$c" ≈ Literal(Constant(c)))
- assert(q"${'c'}" ≈ Literal(Constant(c)))
- }
-
- property("unquote int") = test {
- val c: Int = 0
- assert(q"$c" ≈ Literal(Constant(c)))
- assert(q"${0: Int}" ≈ Literal(Constant(c)))
- }
-
- property("unquote long") = test {
- val c: Long = 0
- assert(q"$c" ≈ Literal(Constant(c)))
- assert(q"${0: Long}" ≈ Literal(Constant(c)))
- }
-
- property("unquote float") = test {
- val c: Float = 0.0f
- assert(q"$c" ≈ Literal(Constant(c)))
- assert(q"${0.0f: Float}" ≈ Literal(Constant(c)))
- }
-
- property("unquote double") = test {
- val c: Double = 0.0
- assert(q"$c" ≈ Literal(Constant(c)))
- assert(q"${0.0: Double}" ≈ Literal(Constant(c)))
- }
-
- property("unquote boolean") = test {
- val c: Boolean = false
- assert(q"$c" ≈ Literal(Constant(c)))
- assert(q"${true}" ≈ Literal(Constant(true)))
- assert(q"${false}" ≈ Literal(Constant(false)))
- }
-
- property("unquote string") = test {
- val c: String = "s"
- assert(q"$c" ≈ Literal(Constant(c)))
- assert(q"${"s"}" ≈ Literal(Constant(c)))
- }
-
- property("unquote unit") = test {
- val c: Unit = ()
- assert(q"$c" ≈ Literal(Constant(c)))
- assert(q"${()}" ≈ Literal(Constant(c)))
- }
-
- property("lift symbol") = test {
- val s = rootMirror.staticClass("scala.Int")
- assert(q"$s" ≈ Ident(s))
- }
-
- property("lift type") = test {
- val tpe = rootMirror.staticClass("scala.Int").toType
- assert(q"$tpe" ≈ TypeTree(tpe))
- }
-
- property("lift type tag") = test {
- val tag = TypeTag.Int
- assert(q"$tag" ≈ TypeTree(tag.tpe))
- }
-
- property("lift weak type tag") = test {
- val tag = WeakTypeTag.Int
- assert(q"$tag" ≈ TypeTree(tag.tpe))
- }
-
- property("lift constant") = test {
- val const = Constant(0)
- assert(q"$const" ≈ q"0")
- }
-
- val immutable = q"$scalapkg.collection.immutable"
-
- property("lift list variants") = test {
- val lst = List(1, 2)
- assert(q"$lst" ≈ q"$immutable.List(1, 2)")
- assert(q"f(..$lst)" ≈ q"f(1, 2)")
- val llst = List(List(1), List(2))
- assert(q"f(..$llst)" ≈ q"f($immutable.List(1), $immutable.List(2))")
- assert(q"f(...$llst)" ≈ q"f(1)(2)")
- }
-
- property("lift list of tree") = test {
- val lst = List(q"a", q"b")
- assert(q"$lst" ≈ q"$immutable.List(a, b)")
- }
-
- property("lift tuple") = test {
- assert(q"${(1, 2)}" ≈ q"(1, 2)")
- assert(q"${(1, 2, 3)}" ≈ q"(1, 2, 3)")
- assert(q"${(1, 2, 3, 4)}" ≈ q"(1, 2, 3, 4)")
- assert(q"${(1, 2, 3, 4, 5)}" ≈ q"(1, 2, 3, 4, 5)")
- assert(q"${(1, 2, 3, 4, 5, 6)}" ≈ q"(1, 2, 3, 4, 5, 6)")
- assert(q"${(1, 2, 3, 4, 5, 6, 7)}" ≈ q"(1, 2, 3, 4, 5, 6, 7)")
- assert(q"${(1, 2, 3, 4, 5, 6, 7, 8)}" ≈ q"(1, 2, 3, 4, 5, 6, 7, 8)")
- assert(q"${(1, 2, 3, 4, 5, 6, 7, 8, 9)}" ≈ q"(1, 2, 3, 4, 5, 6, 7, 8, 9)")
- assert(q"${(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)}" ≈ q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)")
- assert(q"${(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)}" ≈ q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)")
- assert(q"${(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)}" ≈ q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)")
- assert(q"${(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)}" ≈ q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)")
- assert(q"${(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)}" ≈ q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)")
- assert(q"${(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)}" ≈ q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)")
- assert(q"${(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)}" ≈ q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)")
- assert(q"${(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)}" ≈ q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)")
- assert(q"${(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)}" ≈ q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)")
- assert(q"${(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19)}" ≈ q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19)")
- assert(q"${(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)}" ≈ q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)")
- assert(q"${(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21)}" ≈ q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21)")
- assert(q"${(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22)}" ≈ q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22)")
- }
-
- property("lift nil") = test {
- val nil = Nil
- assert(q"$nil" ≈ q"scala.collection.immutable.Nil")
- }
-
- property("lift some") = test {
- val some1 = Some(1)
- assert(q"$some1" ≈ q"scala.Some(1)")
- val some2: Option[Int] = Some(1)
- assert(q"$some2" ≈ q"scala.Some(1)")
- }
-
- property("lift none") = test {
- val none1 = None
- assert(q"$none1" ≈ q"scala.None")
- val none2: Option[Int] = None
- assert(q"$none2" ≈ q"scala.None")
- }
-
- property("lift left") = test {
- val left1 = Left(1)
- assert(q"$left1" ≈ q"scala.util.Left(1)")
- val left2: Left[Int, Int] = Left(1)
- assert(q"$left2" ≈ q"scala.util.Left(1)")
- val left3: Either[Int, Int] = Left(1)
- assert(q"$left3" ≈ q"scala.util.Left(1)")
- }
-
- property("lift right") = test {
- val right1 = Right(1)
- assert(q"$right1" ≈ q"scala.util.Right(1)")
- val right2: Right[Int, Int] = Right(1)
- assert(q"$right2" ≈ q"scala.util.Right(1)")
- val right3: Either[Int, Int] = Right(1)
- assert(q"$right3" ≈ q"scala.util.Right(1)")
- }
-
- property("lift xml comment") = test {
- implicit val liftXmlComment = Liftable[xml.Comment] { comment =>
- q"new _root_.scala.xml.Comment(${comment.commentText})"
- }
- assert(q"${xml.Comment("foo")}" ≈ q"<!--foo-->")
- }
-}
diff --git a/test/files/scalacheck/quasiquotes/PatternConstructionProps.scala b/test/files/scalacheck/quasiquotes/PatternConstructionProps.scala
deleted file mode 100644
index 7ed95fa984..0000000000
--- a/test/files/scalacheck/quasiquotes/PatternConstructionProps.scala
+++ /dev/null
@@ -1,36 +0,0 @@
-import org.scalacheck._, Prop._, Gen._, Arbitrary._
-import scala.reflect.runtime.universe._, Flag._
-
-object PatternConstructionProps extends QuasiquoteProperties("pattern construction") {
- property("unquote bind") = forAll { (bind: Bind) =>
- pq"$bind" ≈ bind
- }
-
- property("unquote name into bind") = forAll { (name: TermName) =>
- pq"$name" ≈ Bind(name, Ident(termNames.WILDCARD))
- }
-
- property("unquote name and tree into bind") = forAll { (name: TermName, tree: Tree) =>
- pq"$name @ $tree" ≈ Bind(name, tree)
- }
-
- property("unquote type name into typed") = forAll { (name: TypeName) =>
- pq"_ : $name" ≈ Typed(Ident(termNames.WILDCARD), Ident(name))
- }
-
- property("unquote tree into typed") = forAll { (typ: Tree) =>
- pq"_ : $typ" ≈ Typed(Ident(termNames.WILDCARD), typ)
- }
-
- property("unquote into apply") = forAll { (pat: Tree, subpat: Tree) =>
- pq"$pat($subpat)" ≈ Apply(pat, List(subpat))
- }
-
- property("unquote into casedef") = forAll { (pat: Tree, cond: Tree, body: Tree) =>
- cq"$pat if $cond => $body" ≈ CaseDef(pat, cond, body)
- }
-
- property("unquote into alternative") = forAll { (first: Tree, rest: List[Tree]) =>
- pq"$first | ..$rest" ≈ Alternative(first :: rest)
- }
-}
diff --git a/test/files/scalacheck/quasiquotes/PatternDeconstructionProps.scala b/test/files/scalacheck/quasiquotes/PatternDeconstructionProps.scala
deleted file mode 100644
index ad3266bcec..0000000000
--- a/test/files/scalacheck/quasiquotes/PatternDeconstructionProps.scala
+++ /dev/null
@@ -1,44 +0,0 @@
-import org.scalacheck._, Prop._, Gen._, Arbitrary._
-import scala.reflect.runtime.universe._, Flag._
-
-object PatternDeconstructionProps extends QuasiquoteProperties("pattern deconstruction") {
- property("extract bind") = forAll { (bind: Bind) =>
- val pq"$bind0" = pq"$bind"
- bind0 ≈ bind
- }
-
- property("extract bind and subpattern") = forAll { (name: TermName, subp: Tree) =>
- val pq"$name0 @ $subp0" = pq"$name @ $subp"
- name0 ≈ name && subp0 ≈ subp
- }
-
- property("extract typed") = forAll { (typ: Tree) =>
- val pq"_ : $typ0" = pq"_ : $typ"
- typ0 ≈ typ
- }
-
- property("extract apply") = forAll { (pat: Tree, subpat: Tree) =>
- val pq"$pat0($subpat0)" = pq"$pat($subpat)"
- pat0 ≈ pat && subpat0 ≈ subpat
- }
-
- property("extract apply many") = forAll { (pat: Tree, subpats: List[Tree]) =>
- val pq"$pat0(..$subpats0)" = pq"$pat(..$subpats)"
- pat0 ≈ pat && subpats0 ≈ subpats
- }
-
- property("extract apply last") = forAll { (pat: Tree, subpats: List[Tree], subpatlast: Tree) =>
- val pq"$pat0(..$subpats0, $subpatlast0)" = pq"$pat(..$subpats, $subpatlast)"
- pat0 ≈ pat && subpats0 ≈ subpats && subpatlast0 ≈ subpatlast
- }
-
- property("extract casedef") = forAll { (pat: Tree, cond: Tree, body: Tree) =>
- val cq"$pat0 if $cond0 => $body0" = cq"$pat if $cond => $body"
- pat0 ≈ pat && cond0 ≈ cond && body0 ≈ body
- }
-
- property("extract alternative") = forAll { (first: Tree, rest: List[Tree]) =>
- val pq"$first1 | ..$rest1" = pq"$first | ..$rest"
- first1 ≈ first && rest1 ≈ rest
- }
-}
diff --git a/test/files/scalacheck/quasiquotes/QuasiquoteProperties.scala b/test/files/scalacheck/quasiquotes/QuasiquoteProperties.scala
deleted file mode 100644
index 6132244227..0000000000
--- a/test/files/scalacheck/quasiquotes/QuasiquoteProperties.scala
+++ /dev/null
@@ -1,120 +0,0 @@
-import org.scalacheck._, Prop._, Gen._, Arbitrary._
-import scala.tools.reflect.{ToolBox, ToolBoxError}
-import scala.reflect.runtime.currentMirror
-import scala.reflect.runtime.universe._, Flag._, internal.reificationSupport.setSymbol
-
-class QuasiquoteProperties(name: String) extends Properties(name) with ArbitraryTreesAndNames with Helpers
-
-trait Helpers {
- /** Runs a code block and returns proof confirmation
- * if no exception has been thrown while executing code
- * block. This is useful for simple one-off tests.
- */
- def test[T](block: => T) =
- Prop { params =>
- block
- Result(Prop.Proof)
- }
-
- object simplify extends Transformer {
- object SimplifiedName {
- val st = scala.reflect.runtime.universe.asInstanceOf[scala.reflect.internal.SymbolTable]
- val FreshName = new st.FreshNameExtractor
- def unapply[T <: Name](name: T): Option[T] = name.asInstanceOf[st.Name] match {
- case FreshName(prefix) =>
- Some((if (name.isTermName) TermName(prefix) else TypeName(prefix)).asInstanceOf[T])
- }
- }
-
- override def transform(tree: Tree): Tree = tree match {
- case Ident(SimplifiedName(name)) => Ident(name)
- case ValDef(mods, SimplifiedName(name), tpt, rhs) => ValDef(mods, name, transform(tpt), transform(rhs))
- case Bind(SimplifiedName(name), rhs) => Bind(name, rhs)
- case _ =>
- super.transform(tree)
- }
-
- def apply(tree: Tree): Tree = transform(tree)
- }
-
- implicit class TestSimilarTree(tree1: Tree) {
- def ≈(tree2: Tree) = simplify(tree1).equalsStructure(simplify(tree2))
- }
-
- implicit class TestSimilarListTree(lst: List[Tree]) {
- def ≈(other: List[Tree]) = (lst.length == other.length) && lst.zip(other).forall { case (t1, t2) => t1 ≈ t2 }
- }
-
- implicit class TestSimilarListListTree(lst: List[List[Tree]]) {
- def ≈(other: List[List[Tree]]) = (lst.length == other.length) && lst.zip(other).forall { case (l1, l2) => l1 ≈ l2 }
- }
-
- implicit class TestSimilarName(name: Name) {
- def ≈(other: Name) = name == other
- }
-
- implicit class TestSimilarMods(mods: Modifiers) {
- def ≈(other: Modifiers) = (mods.flags == other.flags) && (mods.privateWithin ≈ other.privateWithin) && (mods.annotations ≈ other.annotations)
- }
-
- def assertThrows[T <: AnyRef](f: => Any)(implicit manifest: Manifest[T]): Unit = {
- val clazz = manifest.runtimeClass.asInstanceOf[Class[T]]
- val thrown =
- try {
- f
- false
- } catch {
- case u: Throwable =>
- if (!clazz.isAssignableFrom(u.getClass))
- assert(false, s"wrong exception: $u")
- true
- }
- if(!thrown)
- assert(false, "exception wasn't thrown")
- }
-
- def assertEqAst(tree: Tree, code: String) = assert(eqAst(tree, code))
- def eqAst(tree: Tree, code: String) = tree ≈ parse(code)
-
- val toolbox = currentMirror.mkToolBox()
- val parse = toolbox.parse(_)
- val compile = toolbox.compile(_)
- val eval = toolbox.eval(_)
-
- def typecheck(tree: Tree) = toolbox.typecheck(tree)
-
- def typecheckTyp(tree: Tree) = {
- val q"type $_ = $res" = typecheck(q"type T = $tree")
- res
- }
-
- def typecheckPat(tree: Tree) = {
- val q"$_ match { case $res => }" = typecheck(q"((): Any) match { case $tree => }")
- res
- }
-
- def fails(msg: String, block: String) = {
- def result(ok: Boolean, description: String = "") = {
- val status = if (ok) Prop.Proof else Prop.False
- val labels = if (description != "") Set(description) else Set.empty[String]
- Prop { new Prop.Result(status, Nil, Set.empty, labels) }
- }
- try {
- compile(parse(s"""
- object Wrapper extends Helpers {
- import scala.reflect.runtime.universe._
- $block
- }
- """))
- result(false, "given code doesn't fail to typecheck")
- } catch {
- case ToolBoxError(emsg, _) =>
- if (!emsg.contains(msg))
- result(false, s"error message '${emsg}' is not the same as expected '$msg'")
- else
- result(true)
- }
- }
-
- val scalapkg = setSymbol(Ident(TermName("scala")), definitions.ScalaPackage)
-}
diff --git a/test/files/scalacheck/quasiquotes/RuntimeErrorProps.scala b/test/files/scalacheck/quasiquotes/RuntimeErrorProps.scala
deleted file mode 100644
index 40fb42d63c..0000000000
--- a/test/files/scalacheck/quasiquotes/RuntimeErrorProps.scala
+++ /dev/null
@@ -1,75 +0,0 @@
-import org.scalacheck._, Prop._, Gen._, Arbitrary._
-import scala.reflect.runtime.universe._, Flag._
-
-object RuntimeErrorProps extends QuasiquoteProperties("errors") {
- def testFails[T](block: =>T) = test {
- assertThrows[IllegalArgumentException] {
- block
- }
- }
-
- property("default param anon function") = testFails {
- val param = q"val x: Int = 1"
- q"{ $param => x + 1 }"
- }
-
- property("non-casedef case") = testFails {
- val x = q"x"
- q"foo match { case $x }"
- }
-
- property("non-new annotation") = testFails {
- val annot = q"foo"
- q"@$annot def foo"
- }
-
- property("non-valdef param") = testFails {
- val param = q"foo"
- q"def foo($param)"
- }
-
- property("non-valdef class param") = testFails {
- val param = q"foo"
- q"class Foo($param)"
- }
-
- property("non-typedef type param") = testFails {
- val tparam = tq"T"
- q"class C[$tparam]"
- }
-
- property("non-definition refine stat") = testFails {
- val stat = q"foo"
- tq"Foo { $stat }"
- }
-
- property("non-definition early def") = testFails {
- val stat = q"foo"
- q"class Foo extends { $stat } with Bar"
- }
-
- property("type apply for definition") = testFails {
- val defn = q"def foo"
- q"$defn[foo]"
- }
-
- property("non-val selftype") = testFails {
- val foo = q"foo"
- q"class Foo { $foo => }"
- }
-
- property("for empty enums") = testFails {
- val enums = List.empty[Tree]
- q"for(..$enums) 0"
- }
-
- property("for starts with non-from enum") = testFails {
- val enums = fq"foo = bar" :: Nil
- q"for(..$enums) 0"
- }
-
- property("for invalid enum") = testFails {
- val enums = q"foo" :: Nil
- q"for(..$enums) 0"
- }
-}
diff --git a/test/files/scalacheck/quasiquotes/TermConstructionProps.scala b/test/files/scalacheck/quasiquotes/TermConstructionProps.scala
deleted file mode 100644
index 409f07037e..0000000000
--- a/test/files/scalacheck/quasiquotes/TermConstructionProps.scala
+++ /dev/null
@@ -1,325 +0,0 @@
-import org.scalacheck._, Prop._, Gen._, Arbitrary._
-import scala.reflect.runtime.universe._, Flag._
-
-object TermConstructionProps extends QuasiquoteProperties("term construction") {
- property("unquote single tree return tree itself") = forAll { (t: Tree) =>
- q"$t" ≈ t
- }
-
- property("unquote trees into if expression") = forAll { (t1: Tree, t2: Tree, t3: Tree) =>
- q"if($t1) $t2 else $t3" ≈ If(t1, t2, t3)
- }
-
- property("unquote trees into ascriptiopn") = forAll { (t1: Tree, t2: Tree) =>
- q"$t1 : $t2" ≈ Typed(t1, t2)
- }
-
- property("unquote trees into apply") = forAll { (t1: Tree, t2: Tree, t3: Tree) =>
- q"$t1($t2, $t3)" ≈ Apply(t1, List(t2, t3))
- }
-
- property("unquote trees with .. rank into apply") = forAll { (ts: List[Tree]) =>
- q"f(..$ts)" ≈ Apply(q"f", ts)
- }
-
- property("unquote iterable into apply") = forAll { (trees: List[Tree]) =>
- val itrees: Iterable[Tree] = trees
- q"f(..$itrees)" ≈ Apply(q"f", trees)
- }
-
- property("unquote trees with ... rank into apply") = forAll { (ts1: List[Tree], ts2: List[Tree]) =>
- val argss = List(ts1, ts2)
- q"f(...$argss)" ≈ Apply(Apply(q"f", ts1), ts2)
- }
-
- property("unquote term name into assign") = forAll { (name: TermName, t: Tree) =>
- q"$name = $t" ≈ Assign(Ident(name), t)
- }
-
- property("unquote trees into block") = forAll { (t1: Tree, t2: Tree, t3: Tree) =>
- blockInvariant(q"""{
- $t1
- $t2
- $t3
- }""", List(t1, t2, t3))
- }
-
-
- property("unquote tree into new") = forAll { (tree: Tree) =>
- q"new $tree" ≈ Apply(Select(New(tree), termNames.CONSTRUCTOR), List())
- }
-
- property("unquote tree into return") = forAll { (tree: Tree) =>
- q"return $tree" ≈ Return(tree)
- }
-
- property("unquote a list of arguments") = forAll { (fun: Tree, args: List[Tree]) =>
- q"$fun(..$args)" ≈ Apply(fun, args)
- }
-
- property("unquote list and non-list fun arguments") = forAll { (fun: Tree, arg1: Tree, arg2: Tree, args: List[Tree]) =>
- q"$fun(..$args, $arg1, $arg2)" ≈ Apply(fun, args ++ List(arg1) ++ List(arg2)) &&
- q"$fun($arg1, ..$args, $arg2)" ≈ Apply(fun, List(arg1) ++ args ++ List(arg2)) &&
- q"$fun($arg1, $arg2, ..$args)" ≈ Apply(fun, List(arg1) ++ List(arg2) ++ args)
- }
-
- property("unquote into new") = forAll { (name: TypeName, body: List[Tree]) =>
- q"new $name { ..$body }" ≈
- q"""{
- final class $$anon extends $name {
- ..$body
- }
- new $$anon
- }"""
- }
-
- property("unquote type name into this") = forAll { (T: TypeName) =>
- q"$T.this" ≈ This(T)
- }
-
- property("unquote tree into throw") = forAll { (t: Tree) =>
- q"throw $t" ≈ Throw(t)
- }
-
- property("unquote trees into type apply") = forAll { (fun: TreeIsTerm, types: List[Tree]) =>
- q"$fun[..$types]" ≈ (if (types.nonEmpty) TypeApply(fun, types) else fun)
- }
-
- property("unquote trees into while loop") = forAll { (cond: Tree, body: Tree) =>
- val LabelDef(_, List(), If(cond1, Block(List(body1), Apply(_, List())), Literal(Constant(())))) = q"while($cond) $body"
- body1 ≈ body && cond1 ≈ cond
- }
-
- property("unquote trees into do while loop") = forAll { (cond: Tree, body: Tree) =>
- val LabelDef(_, List(), Block(List(body1), If(cond1, Apply(_, List()), Literal(Constant(()))))) = q"do $body while($cond)"
- body1 ≈ body && cond1 ≈ cond
- }
-
- def blockInvariant(quote: Tree, trees: List[Tree]) =
- quote ≈ (trees match {
- case Nil => q"{}"
- case _ :+ last if !last.isTerm => Block(trees, q"()")
- case head :: Nil => head
- case init :+ last => Block(init, last)
- })
-
- property("unquote list of trees into block (1)") = forAll { (trees: List[Tree]) =>
- blockInvariant(q"{ ..$trees }", trees)
- }
-
- property("unquote list of trees into block (2)") = forAll { (trees1: List[Tree], trees2: List[Tree]) =>
- blockInvariant(q"{ ..$trees1 ; ..$trees2 }", trees1 ++ trees2)
- }
-
- property("unquote list of trees into block (3)") = forAll { (trees: List[Tree], tree: Tree) =>
- blockInvariant(q"{ ..$trees; $tree }", trees :+ tree)
- }
-
- property("unquote term into brackets") = test {
- val a = q"a"
- assert(q"($a)" ≈ a)
- }
-
- property("unquote terms into tuple") = test {
- val a1 = q"a1"
- val a2 = q"a2"
- val as = List(a1, a2)
- assert(q"(..$as)" ≈ q"scala.Tuple2($a1, $a2)")
- assert(q"(a0, ..$as)" ≈ q"scala.Tuple3(a0, $a1, $a2)")
- }
-
- property("unquote empty list into tuple") = test {
- val empty = List[Tree]()
- assert(q"(..$empty)" ≈ q"()")
- }
-
- property("unquote single element list into tuple") = test {
- val xs = q"x" :: Nil
- assert(q"(..$xs)" ≈ xs.head)
- }
-
- property("function param flags are the same") = test {
- val xy = q"val x: A" :: q"val y: B" :: Nil
- assertEqAst(q"(..$xy) => x + y", "(x: A, y: B) => x + y")
- }
-
- property("anonymous functions don't support default values") = test {
- val x = q"val x: Int = 1"
- assertThrows[IllegalArgumentException] { q"($x) => x" }
- }
-
- property("assign variable") = test {
- val v = q"v"
- val value = q"foo"
- assertEqAst(q"$v = $value", "v = foo")
- }
-
- property("assign update 1") = test {
- val v = q"v"
- val args = q"1" :: q"2" :: Nil
- val value = q"foo"
- assertEqAst(q"$v(..$args) = $value", "v(1, 2) = foo")
- }
-
- property("assign update 2") = test {
- val a = q"v(0)"
- val value = q"foo"
- assertEqAst(q"$a = $value", "v(0) = foo")
- }
-
- property("assign or named arg") = test {
- val assignx = q"x = 1"
- assertEqAst(q"f($assignx)", "f(x = 1)")
- }
-
- property("fresh names are regenerated at each evaluation") = test {
- def plusOne = q"{ _ + 1 }"
- assert(!plusOne.equalsStructure(plusOne))
- def whileTrue = q"while(true) false"
- assert(!whileTrue.equalsStructure(whileTrue))
- def withEvidence = q"def foo[T: X]"
- assert(!withEvidence.equalsStructure(withEvidence))
- }
-
- property("make sure inference doesn't infer any") = test {
- val l1 = List(q"foo")
- val l2 = List(q"bar")
- val baz = q"baz"
- assert(q"f(..${l1 ++ l2})" ≈ q"f(foo, bar)")
- assert(q"f(..${l1 ++ l2}, $baz)" ≈ q"f(foo, bar, baz)")
- assert(q"f(${if (true) q"a" else q"b"})" ≈ q"f(a)")
- }
-
- property("unquote iterable of non-parametric type") = test {
- object O extends Iterable[Tree] { def iterator = List(q"foo").iterator }
- q"f(..$O)"
- }
-
- property("SI-8016") = test {
- val xs = q"1" :: q"2" :: Nil
- assertEqAst(q"..$xs", "{1; 2}")
- assertEqAst(q"{..$xs}", "{1; 2}")
- }
-
- property("SI-6842") = test {
- val cases: List[Tree] = cq"a => b" :: cq"_ => c" :: Nil
- assertEqAst(q"1 match { case ..$cases }", "1 match { case a => b case _ => c }")
- assertEqAst(q"try 1 catch { case ..$cases }", "try 1 catch { case a => b case _ => c }")
- }
-
- property("SI-8009") = test {
- q"`foo`".asInstanceOf[reflect.internal.SymbolTable#Ident].isBackquoted
- }
-
- property("SI-8148") = test {
- val q"($a, $b) => $_" = q"_ + _"
- assert(a.name != b.name)
- }
-
- property("SI-7275 a") = test {
- val t = q"stat1; stat2"
- assertEqAst(q"..$t", "{stat1; stat2}")
- }
-
- property("SI-7275 b") = test {
- def f(t: Tree) = q"..$t"
- assertEqAst(f(q"stat1; stat2"), "{stat1; stat2}")
- }
-
- property("SI-7275 c1") = test {
- object O
- implicit val liftO = Liftable[O.type] { _ => q"foo; bar" }
- assertEqAst(q"f(..$O)", "f(foo, bar)")
- }
-
- property("SI-7275 c2") = test {
- object O
- implicit val liftO = Liftable[O.type] { _ => q"{ foo; bar }; { baz; bax }" }
- assertEqAst(q"f(...$O)", "f(foo, bar)(baz, bax)")
- }
-
- property("SI-7275 d") = test {
- val l = q"a; b" :: q"c; d" :: Nil
- assertEqAst(q"f(...$l)", "f(a, b)(c, d)")
- val l2: Iterable[Tree] = l
- assertEqAst(q"f(...$l2)", "f(a, b)(c, d)")
- }
-
- property("SI-7275 e") = test {
- val t = q"{ a; b }; { c; d }"
- assertEqAst(q"f(...$t)", "f(a, b)(c, d)")
- }
-
- property("SI-7275 e2") = test {
- val t = q"{ a; b }; c; d"
- assertEqAst(q"f(...$t)", "f(a, b)(c)(d)")
- }
-
- property("remove synthetic unit") = test {
- val q"{ ..$stats1 }" = q"{ def x = 2 }"
- assert(stats1 ≈ List(q"def x = 2"))
- val q"{ ..$stats2 }" = q"{ class X }"
- assert(stats2 ≈ List(q"class X"))
- val q"{ ..$stats3 }" = q"{ type X = Int }"
- assert(stats3 ≈ List(q"type X = Int"))
- val q"{ ..$stats4 }" = q"{ val x = 2 }"
- assert(stats4 ≈ List(q"val x = 2"))
- }
-
- property("don't remove user-defined unit") = test {
- val q"{ ..$stats }" = q"{ def x = 2; () }"
- assert(stats ≈ List(q"def x = 2", q"()"))
- }
-
- property("empty-tree is not a block") = test {
- assertThrows[MatchError] {
- val q"{ ..$stats1 }" = q" "
- }
- }
-
- property("empty block is synthetic unit") = test {
- val q"()" = q"{}"
- val q"{..$stats}" = q"{}"
- assert(stats.isEmpty)
- assertEqAst(q"{..$stats}", "{}")
- assertEqAst(q"{..$stats}", "()")
- }
-
- property("consistent variable order") = test {
- val q"$a = $b = $c = $d = $e = $f = $g = $h = $k = $l" = q"a = b = c = d = e = f = g = h = k = l"
- assert(a ≈ q"a" && b ≈ q"b" && c ≈ q"c" && d ≈ q"d" && e ≈ q"e" && g ≈ q"g" && h ≈ q"h" && k ≈ q"k" && l ≈ q"l")
- }
-
- property("SI-8385 a") = test {
- assertEqAst(q"(foo.x = 1)(2)", "(foo.x = 1)(2)")
- }
-
- property("SI-8385 b") = test {
- assertEqAst(q"(() => ())()", "(() => ())()")
- }
-
- property("match scrutinee may not be empty") = test {
- assertThrows[IllegalArgumentException] {
- val scrutinee = q""
- val cases = List(cq"_ =>")
- q"$scrutinee match { case ..$cases }"
- }
- }
-
- property("construct partial function") = test {
- val cases = List(cq"a => b", cq"c => d")
- assertEqAst(q"{ case ..$cases }", "{ case a => b case c => d }")
- }
-
- property("SI-8609 a") = test {
- val q1 = q"val x = 1"
- val q2 = q"..$q1; val y = 2"
- assert(q2 ≈ q"{ val x = 1; val y = 2 }")
- }
-
- property("SI-8609 b") = test {
- val q1 = q"import foo.bar"
- val q2 = q"..$q1; val y = 2"
- assert(q2 ≈ q"{ import foo.bar; val y = 2 }")
- }
-}
diff --git a/test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala b/test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala
deleted file mode 100644
index 07e8f3faac..0000000000
--- a/test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala
+++ /dev/null
@@ -1,256 +0,0 @@
-import org.scalacheck._, Prop._, Gen._, Arbitrary._
-import scala.reflect.runtime.universe._, Flag._
-
-object TermDeconstructionProps extends QuasiquoteProperties("term deconstruction") {
- property("f(..x) = f") = test {
- // see SI-8008
- assertThrows[MatchError] {
- val q"f(..$args)" = q"f"
- }
- }
-
- property("f(x)") = forAll { (x: Tree) =>
- val q"f($x1)" = q"f($x)"
- x1 ≈ x
- }
-
- property("f(..xs)") = forAll { (x1: Tree, x2: Tree) =>
- val q"f(..$xs)" = q"f($x1, $x2)"
- xs ≈ List(x1, x2)
- }
-
- property("f(y, ..ys)") = forAll { (x1: Tree, x2: Tree, x3: Tree) =>
- val q"f($y, ..$ys)" = q"f($x1, $x2, $x3)"
- y ≈ x1 && ys ≈ List(x2, x3)
- }
-
- property("f(y1, y2, ..ys)") = forAll { (x1: Tree, x2: Tree, x3: Tree) =>
- val q"f($y1, $y2, ..$ys)" = q"f($x1, $x2, $x3)"
- y1 ≈ x1 && y2 ≈ x2 && ys ≈ List(x3)
- }
-
- property("f(y1, ..ys, yn)") = forAll { (x1: Tree, x2: Tree, x3: Tree, x4: Tree) =>
- val q"f($y1, ..$ys, $yn)" = q"f($x1, $x2, $x3, $x4)"
- y1 ≈ x1 && ys ≈ List(x2, x3) && yn ≈ x4
- }
-
- property("f(..ys, y_{n-1}, y_n)") = forAll { (x1: Tree, x2: Tree, x3: Tree, x4: Tree) =>
- val q"f(..$ys, $yn1, $yn)" = q"f($x1, $x2, $x3, $x4)"
- ys ≈ List(x1, x2) && yn1 ≈ x3 && yn ≈ x4
- }
-
- property("f(...xss)") = forAll { (x1: Tree, x2: Tree) =>
- val q"f(...$xss)" = q"f($x1)($x2)"
- xss ≈ List(List(x1), List(x2))
- }
-
- property("f(...$xss)(..$last)") = forAll { (x1: Tree, x2: Tree, x3: Tree) =>
- val q"f(...$xss)(..$last)" = q"f($x1)($x2)($x3)"
- xss ≈ List(List(x1), List(x2)) && last ≈ List(x3)
- }
-
- property("f(...$xss)(..$lastinit, $lastlast)") = forAll { (x1: Tree, x2: Tree, x3: Tree, x4: Tree) =>
- val q"f(...$xss)(..$lastinit, $lastlast)" = q"f($x1)($x2, $x3, $x4)"
- xss ≈ List(List(x1)) && lastinit ≈ List(x2, x3) && lastlast ≈ x4
- }
-
- property("f(...xss) = f") = forAll { (x1: Tree, x2: Tree) =>
- val q"f(...$xss)" = q"f"
- xss ≈ List()
- }
-
- property("deconstruct unit as tuple") = test {
- val q"(..$xs)" = q"()"
- assert(xs.isEmpty)
- }
-
- property("deconstruct tuple") = test {
- val q"(..$xs)" = q"(a, b)"
- assert(xs ≈ List(q"a", q"b"))
- }
-
- property("deconstruct tuple mixed") = test {
- val q"($first, ..$rest)" = q"(a, b, c)"
- assert(first ≈ q"a")
- assert(rest ≈ List(q"b", q"c"))
- }
-
- property("deconstruct tuple last element") = test {
- val q"($first, ..$rest, $last)" = q"(a, b, c, d)"
- assert(first ≈ q"a")
- assert(rest ≈ List(q"b", q"c"))
- assert(last ≈ q"d")
- }
-
- property("deconstruct expr as tuple") = test {
- val q"(..$elems)" = q"foo"
- assert(elems ≈ List(q"foo"))
- }
-
- property("deconstruct cases") = test {
- val q"$x match { case ..$cases }" = q"x match { case 1 => case 2 => }"
- assert(x ≈ q"x")
- assert(cases ≈ List(cq"1 =>", cq"2 =>"))
- }
-
- property("deconstruct splitting last case") = test {
- val q"$_ match { case ..$cases case $last }" = q"x match { case 1 => case 2 => case 3 => }"
- assert(cases ≈ List(cq"1 =>", cq"2 =>"))
- assert(last ≈ cq"3 =>")
- }
-
- property("deconstruct block") = test {
- val q"{ ..$xs }" = q"{ x1; x2; x3 }"
- assert(xs ≈ List(q"x1", q"x2", q"x3"))
- }
-
- property("deconstruct last element of a block") = test {
- val q"{ ..$xs; $x }" = q"x1; x2; x3; x4"
- assert(xs ≈ List(q"x1", q"x2", q"x3"))
- assert(x ≈ q"x4")
- }
-
- property("exhaustive function matcher") = test {
- def matches(line: String) { val q"(..$args) => $body" = parse(line) }
- matches("() => bippy")
- matches("(y: Y) => y oh y")
- matches("(x: X, y: Y) => x and y")
- }
-
- property("exhaustive new pattern") = test {
- def matches(line: String) {
- val q"new { ..$early } with $name[..$targs](...$vargss) with ..$mixin { $self => ..$body }" = parse(line)
- }
- matches("new foo")
- matches("new foo { body }")
- matches("new foo[t]")
- matches("new foo(x)")
- matches("new foo[t](x)")
- matches("new foo[t](x) { body }")
- matches("new foo with bar")
- matches("new foo with bar { body }")
- matches("new { anonymous }")
- matches("new { val early = 1 } with Parent[Int] { body }")
- matches("new Foo { selfie => }")
- }
-
- property("exhaustive assign pattern") = test {
- def matches(tree: Tree) { val q"$rhs = $lhs" = tree }
- matches(parse("left = right"))
- matches(parse("arr(1) = 2"))
- matches(AssignOrNamedArg(EmptyTree, EmptyTree))
- }
-
- property("deconstruct update 1") = test {
- val q"$obj(..$args) = $value" = q"foo(bar) = baz"
- assert(obj ≈ q"foo")
- assert(args ≈ List(q"bar"))
- assert(value ≈ q"baz")
- }
-
- property("deconstruct update 2") = test {
- val q"$left = $value" = q"foo(bar) = baz"
- assert(left ≈ q"foo(bar)")
- assert(value ≈ q"baz")
- }
-
- property("deconstruct while loop") = test {
- val q"while($cond) $body" = parse("while(cond) body")
- assert(cond ≈ q"cond")
- assert(body ≈ q"body")
- }
-
- property("deconstruct do while loop") = test {
- val q"do $body while($cond)" = parse("do body while(cond)")
- assert(cond ≈ q"cond")
- assert(body ≈ q"body")
- }
-
- property("deconstruct anonymous function with placeholders") = test {
- val q"{ $f(_) }" = q"{ foo(_) }"
- assert(f ≈ q"foo")
- val q"{ _.$member }" = q"{ _.foo }"
- assert(member ≈ TermName("foo"))
- val q"{ _ + $x }" = q"{ _ + x }"
- assert(x ≈ q"x")
- val q"{ _ * _ }" = q"{ _ * _ }"
- }
-
- property("si-8275 a") = test {
- val cq"_ => ..$stats" = cq"_ => foo; bar"
- assert(stats ≈ List(q"foo", q"bar"))
- }
-
- property("si-8275 b") = test {
- val cq"_ => ..$init; $last" = cq"_ => a; b; c"
- assert(init ≈ List(q"a", q"b"))
- assert(last ≈ q"c")
- }
-
- property("si-8275 c") = test {
- val cq"_ => ..$stats" = cq"_ =>"
- assert(stats.isEmpty)
- assertEqAst(q"{ case _ => ..$stats }", "{ case _ => }")
- }
-
- property("can't flatten type into block") = test {
- assertThrows[IllegalArgumentException] {
- val tpt = tq"List[Int]"
- q"..$tpt; ()"
- }
- }
-
- property("term select doesn't match type select") = test {
- assertThrows[MatchError] {
- val q"$qual.$name" = tq"foo.bar"
- }
- }
-
- property("type application doesn't match applied type") = test {
- assertThrows[MatchError] {
- val q"$f[..$targs]" = tq"foo[bar]"
- }
- }
-
- property("match doesn't match partial function") = test {
- assertThrows[MatchError] {
- val q"$_ match { case ..$_ }" = q"{ case _ => }"
- }
- }
-
- property("deconstruct partial function") = test {
- val q"{ case ..$cases }" = q"{ case a => b case c => d }"
- val List(cq"a => b", cq"c => d") = cases
- }
-
- property("SI-8350 `new C` and `new C()` are equivalent") = test {
- val q"new C" = q"new C()"
- val q"new C()" = q"new C"
- }
-
- property("SI-8350 new applications extracted only for non-empty ctor calls") = test{
- val q"new $c1" = q"new C()"
- assert(c1 ≈ tq"C")
- val q"new $c2" = q"new C(x)"
- assert(c2 ≈ q"${tq"C"}(x)")
- }
-
- property("SI-8350 original test case") = test {
- val q"new ..$parents" = q"new Foo with Bar"
- assert(parents ≈ List(tq"Foo", tq"Bar"))
- }
-
- property("SI-8387 new is not an application") = test {
- val `new` = q"new F(x)"
- val q"$f(...$argss)" = `new`
- assert(f ≈ `new`)
- assert(argss.isEmpty)
- }
-
- property("SI-8703 extract block with single expression") = test {
- val q"{ $a }" = Block(Nil, q"1")
- val Literal(Constant(1)) = a
- val q"{ $b }" = q"2"
- val Literal(Constant(2)) = b
- }
-}
diff --git a/test/files/scalacheck/quasiquotes/Test.scala b/test/files/scalacheck/quasiquotes/Test.scala
deleted file mode 100644
index 7a26fa4923..0000000000
--- a/test/files/scalacheck/quasiquotes/Test.scala
+++ /dev/null
@@ -1,19 +0,0 @@
-import org.scalacheck._
-
-object Test extends Properties("quasiquotes") {
- include(TermConstructionProps)
- include(TermDeconstructionProps)
- include(TypeConstructionProps)
- include(TypeDeconstructionProps)
- include(PatternConstructionProps)
- include(PatternDeconstructionProps)
- include(LiftableProps)
- include(UnliftableProps)
- include(ErrorProps)
- include(RuntimeErrorProps)
- include(DefinitionConstructionProps)
- include(DefinitionDeconstructionProps)
- include(DeprecationProps)
- include(ForProps)
- include(TypecheckedProps)
-}
diff --git a/test/files/scalacheck/quasiquotes/TypeConstructionProps.scala b/test/files/scalacheck/quasiquotes/TypeConstructionProps.scala
deleted file mode 100644
index 27ad4c50e9..0000000000
--- a/test/files/scalacheck/quasiquotes/TypeConstructionProps.scala
+++ /dev/null
@@ -1,42 +0,0 @@
-import org.scalacheck._, Prop._, Gen._, Arbitrary._
-import scala.reflect.runtime.universe._, Flag._, internal.reificationSupport.ScalaDot
-
-object TypeConstructionProps extends QuasiquoteProperties("type construction") {
- property("bare idents contain type names") = test {
- tq"x" ≈ Ident(TypeName("x"))
- }
-
- property("unquote type names into AppliedTypeTree") = forAll { (name1: TypeName, name2: TypeName) =>
- tq"$name1[$name2]" ≈ AppliedTypeTree(Ident(name1), List(Ident(name2)))
- }
-
- property("tuple type") = test {
- val empty = List[Tree]()
- val ts = List(tq"t1", tq"t2")
- assert(tq"(..$empty)" ≈ ScalaDot(TypeName("Unit")))
- assert(tq"(..$ts)" ≈ tq"scala.Tuple2[t1, t2]")
- assert(tq"(t0, ..$ts)" ≈ tq"scala.Tuple3[t0, t1, t2]")
- }
-
- property("single-element tuple type") = test {
- val ts = q"T" :: Nil
- assert(tq"(..$ts)" ≈ ts.head)
- }
-
- property("refined type") = test {
- val stats = q"def foo" :: q"val x: Int" :: q"type Y = String" :: Nil
- assert(tq"T { ..$stats }" ≈ tq"T { def foo; val x: Int; type Y = String }")
- }
-
- property("function type") = test {
- val argtpes = tq"A" :: tq"B" :: Nil
- val restpe = tq"C"
- assert(tq"..$argtpes => $restpe" ≈ tq"(A, B) => C")
- }
-
- property("empty tq") = test {
- val tt: TypeTree = tq""
- assert(tt.tpe == null)
- assert(tt.original == null)
- }
-}
diff --git a/test/files/scalacheck/quasiquotes/TypeDeconstructionProps.scala b/test/files/scalacheck/quasiquotes/TypeDeconstructionProps.scala
deleted file mode 100644
index 7572b27b52..0000000000
--- a/test/files/scalacheck/quasiquotes/TypeDeconstructionProps.scala
+++ /dev/null
@@ -1,78 +0,0 @@
-import org.scalacheck._, Prop._, Gen._, Arbitrary._
-import scala.reflect.runtime.universe._, Flag._
-
-object TypeDeconstructionProps extends QuasiquoteProperties("type deconstruction") {
- property("ident(type name)") = forAll { (name: TypeName) =>
- val t = Ident(name)
- val tq"$t1" = t
- t1 ≈ t
- }
-
- property("applied type tree") = forAll { (name1: TypeName, name2: TypeName) =>
- val tq"$a[$b]" = AppliedTypeTree(Ident(name1), List(Ident(name2)))
- a ≈ Ident(name1) && b ≈ Ident(name2)
- }
-
- property("tuple type (1)") = test {
- val tq"(..$empty)" = tq"_root_.scala.Unit"
- assert(empty.isEmpty)
- }
-
- property("tuple type (2)") = test {
- val tq"(..$ts)" = tq"(t1, t2)"
- assert(ts ≈ List(tq"t1", tq"t2"))
- }
-
- property("tuple type (3)") = test {
- val tq"($head, ..$tail)" = tq"(t0, t1, t2)"
- assert(head ≈ tq"t0")
- assert(tail ≈ List(tq"t1", tq"t2"))
- }
-
- property("tuple type (4)") = test {
- val tq"(..$init, $last)" = tq"(t0, t1, t2)"
- assert(init ≈ List(tq"t0", tq"t1"))
- assert(last ≈ tq"t2")
- }
-
- property("tuple type (5)") = test {
- val tq"(..$ts)" = tq"T"
- assert(ts ≈ List(tq"T"))
- }
-
- property("refined type") = test {
- val tq"T { ..$stats }" = tq"T { def foo; val x: Int; type Y = String }"
- assert(stats ≈ List(q"def foo", q"val x: Int", q"type Y = String"))
- }
-
- property("function type (1)") = test {
- val tq"..$argtpes => $restpe" = tq"(A, B) => C"
- assert(argtpes ≈ List(tq"A", tq"B"))
- assert(restpe ≈ tq"C")
- }
-
- property("function type (2)") = test {
- val tq"(..$argtpes, $arglast) => $restpe" = tq"(A, B, C) => D"
- assert(argtpes ≈ List(tq"A", tq"B"))
- assert(arglast ≈ tq"C")
- assert(restpe ≈ tq"D")
- }
-
- property("match empty type tree") = test {
- val tq"" = TypeTree()
- // matches because type tree isn't syntactic without original
- val tq"" = tq"${typeOf[Int]}"
- }
-
- property("type select doesn't match term select") = test {
- assertThrows[MatchError] {
- val tq"$qual.$name" = q"foo.bar"
- }
- }
-
- property("applied type doesn't match type appliction") = test {
- assertThrows[MatchError] {
- val tq"$tpt[..$tpts]" = q"foo[bar]"
- }
- }
-}
diff --git a/test/files/scalacheck/quasiquotes/TypecheckedProps.scala b/test/files/scalacheck/quasiquotes/TypecheckedProps.scala
deleted file mode 100644
index f84df269ca..0000000000
--- a/test/files/scalacheck/quasiquotes/TypecheckedProps.scala
+++ /dev/null
@@ -1,215 +0,0 @@
-import org.scalacheck._, Prop._, Gen._, Arbitrary._
-import scala.reflect.runtime.universe._, Flag._, internal.reificationSupport._
-
-object TypecheckedProps extends QuasiquoteProperties("typechecked")
- with TypecheckedTypes {
- property("tuple term") = test {
- val q"(..$elements)" = typecheck(q"(1, 2)")
- assert(elements ≈ List(q"1", q"2"))
- }
-
- property("for/for-yield") = test {
- val enums = fq"x <- xs" :: fq"x1 = x + 1" :: fq"if x1 % 2 == 0" :: Nil
- val body = q"x1"
- val xs = q"val xs = List(1, 2, 3)"
- val q"$_; for(..$enums0) yield $body0" = typecheck(q"$xs; for(..$enums) yield $body")
- assert(enums0 ≈ enums)
- assert(body0 ≈ body)
- val q"$_; for(..$enums1) $body1" = typecheck(q"$xs; for(..$enums) $body")
- assert(enums1 ≈ enums)
- assert(body1 ≈ body)
- }
-
- property("for .filter instead of .withFilter") = test {
- val enums = fq"foo <- new Foo" :: fq"if foo != null" :: Nil
- val body = q"foo"
- val q"$_; for(..$enums1) yield $body1" = typecheck(q"""
- class Foo { def map(f: Any => Any) = this; def withFilter(cond: Any => Boolean) = this }
- for(..$enums) yield $body
- """)
- assert(enums1 ≈ enums)
- assert(body1 ≈ body)
- }
-
- property("extract UnApply (1)") = test {
- val q"object $_ { $_; $_; $m }" = typecheck(q"""
- object Test {
- class Cell(val x: Int)
- object Cell { def unapply(c: Cell) = Some(c.x) }
- new Cell(0) match { case Cell(v) => v }
- }
- """)
- val q"$_ match { case $f(..$args) => $_ }" = m
- assert(f ≈ pq"Test.this.Cell")
- assert(args ≈ List(pq"v"))
- }
-
- property("extract UnApply (2)") = test {
- val q"object $_ { $_; $m }" = typecheck(q"""
- object Test {
- case class Cell(val x: Int)
- new Cell(0) match { case Cell(v) => v }
- }
- """)
- val q"$_ match { case ${f: TypeTree}(..$args) => $_ }" = m
- assert(f.original ≈ pq"Test.this.Cell")
- assert(args ≈ List(pq"v"))
- }
-
- property("extract inferred val type") = test {
- val typechecked = typecheck(q"val x = 42")
- val q"val x = 42" = typechecked
- val q"val x: ${tq""} = 42" = typechecked
- val q"val x: ${t: Type} = 42" = typechecked
- }
-
- property("class with param (1)") = test {
- val paramName = TermName("x")
- val q"class $_($param)" = typecheck(q"class Test(val $paramName: Int)")
-
- assert(param.name == paramName)
- }
-
- property("class with param (2)") = test {
- val paramName = TermName("y")
- val q"{class $_($param)}" = typecheck(q"class Test(val $paramName: Int = 3)")
-
- assert(param.name == paramName)
- assert(param.rhs ≈ q"3")
- }
-
- property("class with params") = test {
- val pName1 = TermName("x1")
- val pName2 = TermName("x2")
- val q"{class $_($param1)(..$params2)}" = typecheck(q"class Test(val x0: Float)(val $pName1: Int = 3, $pName2: String)")
-
- val List(p1, p2, _*) = params2
-
- assert(p1.name == pName1)
- assert(p2.name == pName2)
- assert(params2.size == 2)
- }
-
- property("implicit class") = test {
- val clName = TypeName("Test")
- val paramName = TermName("x")
- val q"{implicit class $name($param)}" = typecheck(q"implicit class $clName(val $paramName: String)")
-
- assert(name == clName)
- assert(param.name == paramName)
- }
-
- property("block with lazy") = test {
- val lazyName = TermName("x")
- val lazyRhsVal = 42
- val lazyRhs = Literal(Constant(lazyRhsVal))
- val q"{lazy val $pname = $rhs}" = typecheck(q"{lazy val $lazyName = $lazyRhsVal}")
-
- assert(pname == lazyName)
- assert(rhs ≈ lazyRhs)
- }
-
- property("class with lazy") = test {
- val clName = TypeName("Test")
- val paramName = TermName("x")
- val q"class $name{lazy val $pname = $_}" = typecheck(q"class $clName {lazy val $paramName = 42}")
-
- assert(name == clName)
- assert(pname == paramName)
- }
-
- property("case class with object") = test {
- val defName = TermName("z")
- val defRhsVal = 42
- val defRhs = Literal(Constant(defRhsVal))
- val q"object $_{ $_; object $_ extends ..$_ {def $name = $rhs} }" =
- typecheck(q"""
- object Test{
- case class C(x: Int) { def y = x };
- object C { def $defName = $defRhsVal }
- }""")
-
- assert(name == defName)
- assert(rhs ≈ defRhs)
- }
-
- property("partial function") = test {
- val q"{ case ..$cases }: $ascr" = typecheck(q"{ case 1 => () }: PartialFunction[Int, Unit]")
- assert(cases ≈ q"{ case 1 => () }".cases)
- }
-}
-
-trait TypecheckedTypes { self: QuasiquoteProperties =>
- property("type ident") = test {
- val q"$_; type $_ = $tpt" = typecheck(q"class C; type T = C")
- val tq"C" = tpt
- }
-
- property("type select") = test {
- val tq"scala.Int" = typecheckTyp(tq"Int")
- }
-
- property("this type select") = test {
- val q"class $_ { $_; type $_ = $tpt }" = typecheck(q"class C { type A = Int; type B = this.A }")
- val tq"this.$name" = tpt
- val TypeName("A") = name
- }
-
- property("super type select") = test {
- val q"$_; class $_ extends $_ { type $_ = $tpt }" =
- typecheck(q"class C1 { type A = Int }; class C2 extends C1 { type B = super[C1].A }")
- val tq"$empty.super[$c1].$a" = tpt
- val TypeName("") = empty
- val TypeName("C1") = c1
- val TypeName("A") = a
- }
-
- property("applied type") = test {
- val tt = typecheckTyp(tq"Map[Int, Int]")
- val tq"$tpt[..$tpts]" = tt
- val tq"scala.this.Predef.Map" = tpt
- val List(tq"scala.Int", tq"scala.Int") = tpts
- }
-
- property("tuple type") = test {
- val tq"(..$els0)" = typecheckTyp(tq"Unit")
- assert(els0.isEmpty)
- val tq"(..$els1)" = typecheckTyp(tq"(Int, Int)")
- val List(tq"scala.Int", tq"scala.Int") = els1
- }
-
- property("function type") = test {
- val tq"(..$argtpes) => $restpe" = typecheckTyp(tq"(Int, Int) => Int")
- val List(tq"scala.Int", tq"scala.Int") = argtpes
- val tq"scala.Int" = restpe
- }
-
- property("compound type") = test {
- val tq"..$parents { ..$defns }" = typecheckTyp(tq"Int { def x: Int }")
- val List(tq"Int") = parents
- val List(q"def x: Int") = defns
- }
-
- property("singleton type") = test {
- val tq"$ref.type" = typecheckTyp(tq"scala.Predef.type")
- val q"scala.Predef" = ref
- }
-
- property("type projection") = test {
- val tq"$tpt#$name" = typecheckTyp(tq"({ type T = Int })#T")
- val TypeName("T") = name
- val tq"{ type T = Int }" = tpt
- }
-
- property("annotated type") = test {
- val tq"$tpt @$annot" = typecheckTyp(tq"Int @unchecked")
- val tq"scala.Int" = tpt
- val tq"unchecked" = annot
- }
-
- property("existential type") = test {
- val tq"$tpt forSome { ..$defns }" = typecheckTyp(tq"T forSome { type T }")
- val tq"T" = tpt
- val q"type T" :: Nil = defns
- }
-}
diff --git a/test/files/scalacheck/quasiquotes/UnliftableProps.scala b/test/files/scalacheck/quasiquotes/UnliftableProps.scala
deleted file mode 100644
index 659b18edab..0000000000
--- a/test/files/scalacheck/quasiquotes/UnliftableProps.scala
+++ /dev/null
@@ -1,166 +0,0 @@
-import org.scalacheck._, Prop._, Gen._, Arbitrary._
-import scala.reflect.runtime.universe._, Flag._
-
-object UnliftableProps extends QuasiquoteProperties("unliftable") {
- property("unlift name") = test {
- val termname0 = TermName("foo")
- val typename0 = TypeName("foo")
- val q"${termname1: TermName}" = Ident(termname0)
- assert(termname1 == termname0)
- val q"${typename1: TypeName}" = Ident(typename0)
- assert(typename1 == typename0)
- val q"${name1: Name}" = Ident(termname0)
- assert(name1 == termname0)
- val q"${name2: Name}" = Ident(typename0)
- assert(name2 == typename0)
- }
-
- property("unlift type") = test {
- val q"${tpe: Type}" = TypeTree(typeOf[Int])
- assert(tpe =:= typeOf[Int])
- }
-
- property("unlift constant") = test {
- val q"${const: Constant}" = Literal(Constant("foo"))
- assert(const == Constant("foo"))
- }
-
- property("unlift char") = test {
- val q"${c: Char}" = Literal(Constant('0'))
- assert(c.isInstanceOf[Char] && c == '0')
- }
-
- property("unlift byte") = test {
- val q"${b: Byte}" = Literal(Constant(0: Byte))
- assert(b.isInstanceOf[Byte] && b == 0)
- }
-
- property("unlift short") = test {
- val q"${s: Short}" = Literal(Constant(0: Short))
- assert(s.isInstanceOf[Short] && s == 0)
- }
-
- property("unlift int") = test {
- val q"${i: Int}" = Literal(Constant(0: Int))
- assert(i.isInstanceOf[Int] && i == 0)
- }
-
- property("unlift long") = test {
- val q"${l: Long}" = Literal(Constant(0L: Long))
- assert(l.isInstanceOf[Long] && l == 0L)
- }
-
- property("unlift float") = test {
- val q"${f: Float}" = Literal(Constant(0.0f: Float))
- assert(f.isInstanceOf[Float] && f == 0.0f)
- }
-
- property("unlift double") = test {
- val q"${d: Double}" = Literal(Constant(0.0: Double))
- assert(d.isInstanceOf[Double] && d == 0.0)
- }
-
- property("unlift bool") = test {
- val q"${b: Boolean}" = q"true"
- assert(b.isInstanceOf[Boolean] && b == true)
- }
-
- property("unlift string") = test {
- val q"${s: String}" = q""" "foo" """
- assert(s.isInstanceOf[String] && s == "foo")
- }
-
- property("unlift scala.symbol") = test {
- val q"${s: scala.Symbol}" = q"'foo"
- assert(s.isInstanceOf[scala.Symbol] && s == 'foo)
- }
-
- implicit def unliftList[T: Unliftable]: Unliftable[List[T]] = Unliftable {
- case q"scala.collection.immutable.List(..$args)" if args.forall { implicitly[Unliftable[T]].unapply(_).nonEmpty } =>
- val ut = implicitly[Unliftable[T]]
- args.flatMap { ut.unapply(_) }
- }
-
- property("unlift list (1)") = test {
- val orig = List(1, 2)
- val q"${l1: List[Int]}" = q"$orig" // q"List(1, 2)"
- assert(l1 == orig)
- val q"f(..${l2: List[Int]})" = q"f(..$orig)" // q"f(1, 2)
- assert(l2 == orig)
- }
-
- property("unlift list (2)") = test {
- val orig2 = List(List(1, 2), List(3))
- val q"f(${l3: List[List[Int]]})" = q"f($orig2)" // q"f(List(List(1, 2), List(3)))
- assert(l3 == orig2)
- val q"f(..${l4: List[List[Int]]})" = q"f(..$orig2)" // q"f(List(1, 2), List(3))"
- assert(l4 == orig2)
- val q"f(...${l5: List[List[Int]]})" = q"f(...$orig2)" // q"f(1, 2)(3)
- assert(l5 == orig2)
- }
-
- property("don't unlift non-tree unquotee (1)") = test {
- val q"${a: TermName}.${b: TermName}" = q"a.b"
- assert(a == TermName("a"))
- assert(b == TermName("b"))
- }
-
- property("don't unlift non-tree unquotee (2)") = test {
- val q"${mods: Modifiers} def foo" = q"def foo"
- assert(mods == Modifiers(DEFERRED))
- }
-
- property("unlift tuple") = test {
- val q"${t2: (Int, Int)}" = q"(1, 2)"
- val q"${t3: (Int, Int, Int)}" = q"(1, 2, 3)"
- val q"${t4: (Int, Int, Int, Int)}" = q"(1, 2, 3, 4)"
- val q"${t5: (Int, Int, Int, Int, Int)}" = q"(1, 2, 3, 4, 5)"
- val q"${t6: (Int, Int, Int, Int, Int, Int)}" = q"(1, 2, 3, 4, 5, 6)"
- val q"${t7: (Int, Int, Int, Int, Int, Int, Int)}" = q"(1, 2, 3, 4, 5, 6, 7)"
- val q"${t8: (Int, Int, Int, Int, Int, Int, Int, Int)}" = q"(1, 2, 3, 4, 5, 6, 7, 8)"
- val q"${t9: (Int, Int, Int, Int, Int, Int, Int, Int, Int)}" = q"(1, 2, 3, 4, 5, 6, 7, 8, 9)"
- val q"${t10: (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)}" = q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)"
- val q"${t11: (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)}" = q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)"
- val q"${t12: (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)}" = q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)"
- val q"${t13: (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)}" = q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)"
- val q"${t14: (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)}" = q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)"
- val q"${t15: (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)}" = q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)"
- val q"${t16: (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)}" = q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)"
- val q"${t17: (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)}" = q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)"
- val q"${t18: (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)}" = q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)"
- val q"${t19: (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)}" = q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19)"
- val q"${t20: (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)}" = q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)"
- val q"${t21: (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)}" = q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21)"
- val q"${t22: (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)}" = q"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22)"
- // assert(t1 == Tuple1(1))
- assert(t2 == (1, 2))
- assert(t3 == (1, 2, 3))
- assert(t4 == (1, 2, 3, 4))
- assert(t5 == (1, 2, 3, 4, 5))
- assert(t6 == (1, 2, 3, 4, 5, 6))
- assert(t7 == (1, 2, 3, 4, 5, 6, 7))
- assert(t8 == (1, 2, 3, 4, 5, 6, 7, 8))
- assert(t9 == (1, 2, 3, 4, 5, 6, 7, 8, 9))
- assert(t10 == (1, 2, 3, 4, 5, 6, 7, 8, 9, 10))
- assert(t11 == (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11))
- assert(t12 == (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))
- assert(t13 == (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13))
- assert(t14 == (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14))
- assert(t15 == (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15))
- assert(t16 == (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16))
- assert(t17 == (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17))
- assert(t18 == (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18))
- assert(t19 == (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19))
- assert(t20 == (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20))
- assert(t21 == (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21))
- assert(t22 == (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22))
- }
-
- property("unlift xml comment") = test {
- implicit val unliftXmlComment = Unliftable[xml.Comment] {
- case q"new _root_.scala.xml.Comment(${value: String})" => xml.Comment(value)
- }
- val q"${comment: xml.Comment}" = q"<!--foo-->"
- assert(comment.commentText == "foo")
- }
-}
diff --git a/test/files/scalacheck/range.scala b/test/files/scalacheck/range.scala
deleted file mode 100644
index ac24b52f8d..0000000000
--- a/test/files/scalacheck/range.scala
+++ /dev/null
@@ -1,314 +0,0 @@
-import org.scalacheck._
-import Prop._
-import Gen._
-import Arbitrary._
-
-class Counter(r: Range) {
- var cnt = 0L
- var last: Option[Int] = None
- val str = "Range["+r.start+", "+r.end+", "+r.step+(if (r.isInclusive) "]" else ")")
- def apply(x: Int) = {
- cnt += 1L
- if (cnt % 500000000L == 0L) {
- println("Working: %s %d %d" format (str, cnt, x))
- }
- if (cnt > (Int.MaxValue.toLong + 1) * 2) {
- val msg = "Count exceeds maximum possible for an Int Range: %s" format str
- println(msg) // exception is likely to be eaten by an out of memory error
- sys error msg
- }
- if ((r.step > 0 && last.exists(_ > x)) || (r.step < 0 && last.exists(_ < x))) {
- val msg = "Range %s wrapped: %d %s" format (str, x, last.toString)
- println(msg) // exception is likely to be eaten by an out of memory error
- sys error msg
- }
- last = Some(x)
- }
-}
-
-abstract class RangeTest(kind: String) extends Properties("Range "+kind) {
- def myGen: Gen[Range]
-
- def genReasonableSizeRange = oneOf(genArbitraryRange, genBoundaryRange)
-
- def genArbitraryRange = for {
- start <- choose(Int.MinValue, Int.MaxValue)
- end <- choose(Int.MinValue, Int.MaxValue)
- step <- choose(-Int.MaxValue, Int.MaxValue)
- } yield Range(start, end, if (step == 0) 100 else step)
-
- def genBoundaryRange = for {
- boundary <- oneOf(Int.MinValue, -1, 0, 1, Int.MaxValue)
- isStart <- arbitrary[Boolean]
- size <- choose(1, 100)
- step <- choose(1, 101)
- } yield {
- val signum = if (boundary == 0) 1 else boundary.signum
- if (isStart) Range(boundary, boundary - size * boundary.signum, - step * signum)
- else Range(boundary - size * boundary.signum, boundary, step * signum)
- }
-
-
- def genSmallRange = for {
- start <- choose(-100, 100)
- end <- choose(-100, 100)
- step <- choose(1, 1)
- } yield if (start < end) Range(start, end, step) else Range(start, end, -step)
-
- def genRangeByOne = oneOf(genRangeOpenByOne, genRangeClosedByOne)
-
- def genRangeOpenByOne = for {
- r <- oneOf(genSmallRange, genBoundaryRange)
- if (r.end.toLong - r.start.toLong).abs <= 10000000L
- } yield if (r.start < r.end) Range(r.start, r.end) else Range(r.end, r.start)
-
- def genRangeClosedByOne = for (r <- genRangeOpenByOne) yield r.start to r.end
-
- def str(r: Range) = "Range["+r.start+", "+r.end+", "+r.step+(if (r.isInclusive) "]" else ")")
-
- def expectedSize(r: Range): Long = if (r.isInclusive) {
- (r.end.toLong - r.start.toLong < 0, r.step < 0) match {
- case (true, true) | (false, false) => (r.end.toLong - r.start.toLong).abs / r.step.abs.toLong + 1L
- case _ => if (r.start == r.end) 1L else 0L
- }
- } else {
- (r.end.toLong - r.start.toLong < 0, r.step < 0) match {
- case (true, true) | (false, false) => (
- (r.end.toLong - r.start.toLong).abs / r.step.abs.toLong
- + (if ((r.end.toLong - r.start.toLong).abs % r.step.abs.toLong > 0L) 1L else 0L)
- )
- case _ => 0L
- }
- }
-
- def within(r: Range, x: Int) = if (r.step > 0)
- r.start <= x && (if (r.isInclusive) x <= r.end else x < r.end)
- else
- r.start >= x && (if (r.isInclusive) x >= r.end else x > r.end)
-
- def multiple(r: Range, x: Int) = (x.toLong - r.start) % r.step == 0
-
- property("foreach.step") = forAllNoShrink(myGen) { r =>
-// println("foreach.step "+str(r))
- var allValid = true
- val cnt = new Counter(r)
-// println("--------------------")
-// println(r)
- r foreach { x => cnt(x)
-// println(x + ", " + (x - r.start) + ", " + (x.toLong - r.start) + ", " + ((x.toLong - r.start) % r.step))
- allValid &&= multiple(r, x)
- }
- allValid :| str(r)
- }
-
- property("foreach.inside.range") = forAll(myGen) { r =>
-// println("foreach.inside.range "+str(r))
- var allValid = true
- var last: Option[Int] = None
- val cnt = new Counter(r)
- r foreach { x => cnt(x)
- allValid &&= within(r, x)
- }
- allValid :| str(r)
- }
-
- property("foreach.visited.size") = forAll(myGen) { r =>
-// println("foreach.visited.size "+str(r))
- var visited = 0L
- val cnt = new Counter(r)
- r foreach { x => cnt(x)
- visited += 1L
- }
-// println("----------")
-// println(str(r))
-// println("size: " + r.size)
-// println("expected: " + expectedSize(r))
-// println("visited: " + visited)
- (visited == expectedSize(r)) :| str(r)
- }
-
- property("sum") = forAll(myGen) { r =>
-// println("----------")
-// println("sum "+str(r))
- val rSum = r.sum
- val expected = r.length match {
- case 0 => 0
- case 1 => r.head
- case x if x < 1000 =>
- // Explicit sum, to guard against having the same mistake in both the
- // range implementation and test implementation of sum formula.
- // (Yes, this happened before.)
- var i = r.head
- var s = 0L
- var n = x
- while (n > 0) {
- s += i
- i += r.step
- n -= 1
- }
- s.toInt
- case _ =>
- // Make sure head + last doesn't overflow!
- ((r.head.toLong + r.last) * r.length / 2).toInt
- }
-// println("size: " + r.length)
-// println("expected: " + expected)
-// println("obtained: " + rSum)
-
- (rSum == expected) :| str(r)
- }
-
-/* checks that sum respects custom Numeric */
- property("sumCustomNumeric") = forAll(myGen) { r =>
- val mod = 65536
- object mynum extends Numeric[Int] {
- def plus(x: Int, y: Int): Int = (x + y) % mod
- override def zero = 0
-
- def fromInt(x: Int): Int = ???
- def minus(x: Int, y: Int): Int = ???
- def negate(x: Int): Int = ???
- def times(x: Int, y: Int): Int = ???
- def toDouble(x: Int): Double = ???
- def toFloat(x: Int): Float = ???
- def toInt(x: Int): Int = ((x % mod) + mod * 2) % mod
- def toLong(x: Int): Long = ???
- def compare(x: Int, y: Int): Int = ???
- }
-
- val rSum = r.sum(mynum)
- val expected = mynum.toInt(r.sum)
-
- (rSum == expected) :| str(r)
- }
-
-
- property("length") = forAll(myGen suchThat (r => expectedSize(r).toInt == expectedSize(r))) { r =>
-// println("length "+str(r))
- (r.length == expectedSize(r)) :| str(r)
- }
-
- property("isEmpty") = forAll(myGen suchThat (r => expectedSize(r).toInt == expectedSize(r))) { r =>
-// println("isEmpty "+str(r))
- (r.isEmpty == (expectedSize(r) == 0L)) :| str(r)
- }
-
- property("contains") = forAll(myGen, arbInt.arbitrary) { (r, x) =>
-// println("contains "+str(r))
-// println("----------------")
-// println(str(r))
-// println(x)
-// println("within: " + within(r, x))
-// println("multiple: " + multiple(r, x))
-// println("contains: " + r.contains(x))
- ((within(r, x) && multiple(r, x)) == r.contains(x)) :| str(r)+": "+x
- }
-
- property("take") = forAll(myGen suchThat (r => expectedSize(r).toInt == expectedSize(r)), arbInt.arbitrary) { (r, x) =>
-// println("take "+str(r))
- val t = r take x
- (t.size == (0 max x min r.size) && t.start == r.start && t.step == r.step) :| str(r)+" / "+str(t)+": "+x
- }
-
- property("init") = forAll(myGen suchThat (r => expectedSize(r).toInt == expectedSize(r))) { r =>
-// println("init "+str(r))
- (r.size == 0) || {
- val t = r.init
- (t.size + 1 == r.size) && (t.isEmpty || t.head == r.head)
- }
- }
-
- property("takeWhile") = forAll(myGen suchThat (r => expectedSize(r).toInt == expectedSize(r)), arbInt.arbitrary) { (r, x) =>
-// println("takeWhile "+str(r))
- val t = (if (r.step > 0) r takeWhile (_ <= x) else r takeWhile(_ >= x))
- if (r.size == 0) {
- (t.size == 0) :| str(r)+" / "+str(t)+": "+x
- } else {
- val t2 = (if (r.step > 0) Range(r.start, x min r.last, r.step).inclusive else Range(r.start, x max r.last, r.step).inclusive)
- (t.start == r.start && t.size == t2.size && t.step == r.step) :| str(r)+" / "+str(t)+" / "+str(t2)+": "+x
- }
- }
-
- property("reverse.toSet.equal") = forAll(myGen) { r =>
-// println("reverse.toSet.equal "+str(r))
- val reversed = r.reverse
- val aresame = r.toSet == reversed.toSet
- if (!aresame) {
- println(str(r))
- println(r)
- println(reversed)
- println(r.toSet)
- println(reversed.toSet)
- }
- aresame :| str(r)
- }
-}
-
-object NormalRangeTest extends RangeTest("normal") {
- override def myGen = genReasonableSizeRange
- def genOne = for {
- start <- arbitrary[Int]
- end <- arbitrary[Int]
- if (start.toLong - end.toLong).abs < Int.MaxValue.toLong
- } yield Range(start, end, if (start < end) 1 else - 1)
- property("by 1.size + 1 == inclusive.size") = forAll(genOne) { r =>
- (r.size + 1 == r.inclusive.size) :| str(r)
- }
-}
-
-object InclusiveRangeTest extends RangeTest("inclusive") {
- override def myGen = for (r <- genReasonableSizeRange) yield r.inclusive
-}
-
-object ByOneRangeTest extends RangeTest("byOne") {
- override def myGen = genRangeByOne
-}
-
-object InclusiveByOneRangeTest extends RangeTest("inclusiveByOne") {
- override def myGen = for (r <- genRangeByOne) yield r.inclusive
-}
-
-object SmallValuesRange extends RangeTest("smallValues") {
- override def myGen = genSmallRange
-}
-
-object TooLargeRange extends Properties("Too Large Range") {
- val genTooLargeStart = for {
- start <- choose(-Int.MinValue, 0)
- } yield start
-
- property("Too large range throws exception") = forAll(genTooLargeStart) { start =>
- try {
- val r = Range.inclusive(start, Int.MaxValue, 1)
- val l = r.length
- println("how here? length = " + l + ", r = " + r.toString)
- false
- }
- catch { case _: IllegalArgumentException => true }
- }
-}
-
-object Test extends Properties("Range") {
- import org.scalacheck.{ Test => STest }
-
- include(NormalRangeTest)
- include(InclusiveRangeTest)
- include(ByOneRangeTest)
- include(InclusiveByOneRangeTest)
- include(TooLargeRange)
-}
-
-/* Mini-benchmark
-def testRange(i: Int, j: Int, k: Int) = {
- var count = 0
- for {
- vi <- 0 to i
- vj <- 0 to j
- vk <- 0 to k
- } { count += 1 }
-}
-
-testRange(10, 1000, 10000)
-testRange(10000, 1000, 10)
-*/
-
diff --git a/test/files/scalacheck/redblacktree.scala b/test/files/scalacheck/redblacktree.scala
deleted file mode 100644
index 4ded37b35a..0000000000
--- a/test/files/scalacheck/redblacktree.scala
+++ /dev/null
@@ -1,258 +0,0 @@
-import collection.immutable.{RedBlackTree => RB}
-import org.scalacheck._
-import Prop._
-import Gen._
-
-/*
-Properties of a Red & Black Tree:
-
-A node is either red or black.
-The root is black. (This rule is used in some definitions and not others. Since the
-root can always be changed from red to black but not necessarily vice-versa this
-rule has little effect on analysis.)
-All leaves are black.
-Both children of every red node are black.
-Every simple path from a given node to any of its descendant leaves contains the same number of black nodes.
-*/
-
-package scala.collection.immutable.redblacktree {
- abstract class RedBlackTreeTest extends Properties("RedBlackTree") {
- def minimumSize = 0
- def maximumSize = 5
-
- import RB._
-
- def nodeAt[A](tree: Tree[String, A], n: Int): Option[(String, A)] = if (n < iterator(tree).size && n >= 0)
- Some(iterator(tree).drop(n).next)
- else
- None
-
- def treeContains[A](tree: Tree[String, A], key: String) = iterator(tree).map(_._1) contains key
-
- def height(tree: Tree[_, _]): Int = if (tree eq null) 0 else (1 + math.max(height(tree.left), height(tree.right)))
-
- def mkTree(level: Int, parentIsBlack: Boolean = false, label: String = ""): Gen[Tree[String, Int]] =
- if (level == 0) {
- const(null)
- } else {
- for {
- oddOrEven <- choose(0, 2)
- tryRed = oddOrEven.sample.get % 2 == 0 // work around arbitrary[Boolean] bug
- isRed = parentIsBlack && tryRed
- nextLevel = if (isRed) level else level - 1
- left <- mkTree(nextLevel, !isRed, label + "L")
- right <- mkTree(nextLevel, !isRed, label + "R")
- } yield {
- if (isRed)
- RedTree(label + "N", 0, left, right)
- else
- BlackTree(label + "N", 0, left, right)
- }
- }
-
- def genTree = for {
- depth <- choose(minimumSize, maximumSize + 1)
- tree <- mkTree(depth)
- } yield tree
-
- type ModifyParm
- def genParm(tree: Tree[String, Int]): Gen[ModifyParm]
- def modify(tree: Tree[String, Int], parm: ModifyParm): Tree[String, Int]
-
- def genInput: Gen[(Tree[String, Int], ModifyParm, Tree[String, Int])] = for {
- tree <- genTree
- parm <- genParm(tree)
- } yield (tree, parm, modify(tree, parm))
- }
-
- trait RedBlackTreeInvariants {
- self: RedBlackTreeTest =>
-
- import RB._
-
- def rootIsBlack[A](t: Tree[String, A]) = isBlack(t)
-
- def areAllLeavesBlack[A](t: Tree[String, A]): Boolean = t match {
- case null => isBlack(t)
- case ne => List(ne.left, ne.right) forall areAllLeavesBlack
- }
-
- def areRedNodeChildrenBlack[A](t: Tree[String, A]): Boolean = t match {
- case RedTree(_, _, left, right) => List(left, right) forall (t => isBlack(t) && areRedNodeChildrenBlack(t))
- case BlackTree(_, _, left, right) => List(left, right) forall areRedNodeChildrenBlack
- case null => true
- }
-
- def blackNodesToLeaves[A](t: Tree[String, A]): List[Int] = t match {
- case null => List(1)
- case BlackTree(_, _, left, right) => List(left, right) flatMap blackNodesToLeaves map (_ + 1)
- case RedTree(_, _, left, right) => List(left, right) flatMap blackNodesToLeaves
- }
-
- def areBlackNodesToLeavesEqual[A](t: Tree[String, A]): Boolean = t match {
- case null => true
- case ne =>
- (
- blackNodesToLeaves(ne).distinct.size == 1
- && areBlackNodesToLeavesEqual(ne.left)
- && areBlackNodesToLeavesEqual(ne.right)
- )
- }
-
- def orderIsPreserved[A](t: Tree[String, A]): Boolean =
- iterator(t) zip iterator(t).drop(1) forall { case (x, y) => x._1 < y._1 }
-
- def heightIsBounded(t: Tree[_, _]): Boolean = height(t) <= (2 * (32 - Integer.numberOfLeadingZeros(count(t) + 2)) - 2)
-
- def setup(invariant: Tree[String, Int] => Boolean) = forAll(genInput) { case (tree, parm, newTree) =>
- invariant(newTree)
- }
-
- property("root is black") = setup(rootIsBlack)
- property("all leaves are black") = setup(areAllLeavesBlack)
- property("children of red nodes are black") = setup(areRedNodeChildrenBlack)
- property("black nodes are balanced") = setup(areBlackNodesToLeavesEqual)
- property("ordering of keys is preserved") = setup(orderIsPreserved)
- property("height is bounded") = setup(heightIsBounded)
- }
-
- object TestInsert extends RedBlackTreeTest with RedBlackTreeInvariants {
- import RB._
-
- override type ModifyParm = Int
- override def genParm(tree: Tree[String, Int]): Gen[ModifyParm] = choose(0, iterator(tree).size + 1)
- override def modify(tree: Tree[String, Int], parm: ModifyParm): Tree[String, Int] = update(tree, generateKey(tree, parm), 0, true)
-
- def generateKey(tree: Tree[String, Int], parm: ModifyParm): String = nodeAt(tree, parm) match {
- case Some((key, _)) => key.init.mkString + "MN"
- case None => nodeAt(tree, parm - 1) match {
- case Some((key, _)) => key.init.mkString + "RN"
- case None => "N"
- }
- }
-
- property("update adds elements") = forAll(genInput) { case (tree, parm, newTree) =>
- treeContains(newTree, generateKey(tree, parm))
- }
- }
-
- object TestModify extends RedBlackTreeTest {
- import RB._
-
- def newValue = 1
- override def minimumSize = 1
- override type ModifyParm = Int
- override def genParm(tree: Tree[String, Int]): Gen[ModifyParm] = choose(0, iterator(tree).size)
- override def modify(tree: Tree[String, Int], parm: ModifyParm): Tree[String, Int] = nodeAt(tree, parm) map {
- case (key, _) => update(tree, key, newValue, true)
- } getOrElse tree
-
- property("update modifies values") = forAll(genInput) { case (tree, parm, newTree) =>
- nodeAt(tree,parm) forall { case (key, _) =>
- iterator(newTree) contains (key, newValue)
- }
- }
- }
-
- object TestDelete extends RedBlackTreeTest with RedBlackTreeInvariants {
- import RB._
-
- override def minimumSize = 1
- override type ModifyParm = Int
- override def genParm(tree: Tree[String, Int]): Gen[ModifyParm] = choose(0, iterator(tree).size)
- override def modify(tree: Tree[String, Int], parm: ModifyParm): Tree[String, Int] = nodeAt(tree, parm) map {
- case (key, _) => delete(tree, key)
- } getOrElse tree
-
- property("delete removes elements") = forAll(genInput) { case (tree, parm, newTree) =>
- nodeAt(tree, parm) forall { case (key, _) =>
- !treeContains(newTree, key)
- }
- }
- }
-
- object TestRange extends RedBlackTreeTest with RedBlackTreeInvariants {
- import RB._
-
- override type ModifyParm = (Option[Int], Option[Int])
- override def genParm(tree: Tree[String, Int]): Gen[ModifyParm] = for {
- from <- choose(0, iterator(tree).size)
- to <- choose(0, iterator(tree).size) suchThat (from <=)
- optionalFrom <- oneOf(Some(from), None, Some(from)) // Double Some(n) to get around a bug
- optionalTo <- oneOf(Some(to), None, Some(to)) // Double Some(n) to get around a bug
- } yield (optionalFrom, optionalTo)
-
- override def modify(tree: Tree[String, Int], parm: ModifyParm): Tree[String, Int] = {
- val from = parm._1 flatMap (nodeAt(tree, _) map (_._1))
- val to = parm._2 flatMap (nodeAt(tree, _) map (_._1))
- rangeImpl(tree, from, to)
- }
-
- property("range boundaries respected") = forAll(genInput) { case (tree, parm, newTree) =>
- val from = parm._1 flatMap (nodeAt(tree, _) map (_._1))
- val to = parm._2 flatMap (nodeAt(tree, _) map (_._1))
- ("lower boundary" |: (from forall ( key => keysIterator(newTree) forall (key <=)))) &&
- ("upper boundary" |: (to forall ( key => keysIterator(newTree) forall (key >))))
- }
-
- property("range returns all elements") = forAll(genInput) { case (tree, parm, newTree) =>
- val from = parm._1 flatMap (nodeAt(tree, _) map (_._1))
- val to = parm._2 flatMap (nodeAt(tree, _) map (_._1))
- val filteredTree = (keysIterator(tree)
- .filter(key => from forall (key >=))
- .filter(key => to forall (key <))
- .toList)
- filteredTree == keysIterator(newTree).toList
- }
- }
-
- object TestDrop extends RedBlackTreeTest with RedBlackTreeInvariants {
- import RB._
-
- override type ModifyParm = Int
- override def genParm(tree: Tree[String, Int]): Gen[ModifyParm] = choose(0, iterator(tree).size)
- override def modify(tree: Tree[String, Int], parm: ModifyParm): Tree[String, Int] = drop(tree, parm)
-
- property("drop") = forAll(genInput) { case (tree, parm, newTree) =>
- iterator(tree).drop(parm).toList == iterator(newTree).toList
- }
- }
-
- object TestTake extends RedBlackTreeTest with RedBlackTreeInvariants {
- import RB._
-
- override type ModifyParm = Int
- override def genParm(tree: Tree[String, Int]): Gen[ModifyParm] = choose(0, iterator(tree).size)
- override def modify(tree: Tree[String, Int], parm: ModifyParm): Tree[String, Int] = take(tree, parm)
-
- property("take") = forAll(genInput) { case (tree, parm, newTree) =>
- iterator(tree).take(parm).toList == iterator(newTree).toList
- }
- }
-
- object TestSlice extends RedBlackTreeTest with RedBlackTreeInvariants {
- import RB._
-
- override type ModifyParm = (Int, Int)
- override def genParm(tree: Tree[String, Int]): Gen[ModifyParm] = for {
- from <- choose(0, iterator(tree).size)
- to <- choose(from, iterator(tree).size)
- } yield (from, to)
- override def modify(tree: Tree[String, Int], parm: ModifyParm): Tree[String, Int] = slice(tree, parm._1, parm._2)
-
- property("slice") = forAll(genInput) { case (tree, parm, newTree) =>
- iterator(tree).slice(parm._1, parm._2).toList == iterator(newTree).toList
- }
- }
-}
-
-object Test extends Properties("RedBlackTree") {
- import collection.immutable.redblacktree._
- include(TestInsert)
- include(TestModify)
- include(TestDelete)
- include(TestRange)
- include(TestDrop)
- include(TestTake)
- include(TestSlice)
-}
diff --git a/test/files/scalacheck/scan.scala b/test/files/scalacheck/scan.scala
deleted file mode 100644
index fc214d739c..0000000000
--- a/test/files/scalacheck/scan.scala
+++ /dev/null
@@ -1,19 +0,0 @@
-import org.scalacheck._
-import Prop._
-import Gen._
-
-
-
-
-object Test extends Properties("TraversableLike.scanLeft") {
- property("scanLeft") = forAll { (xs: List[Int], z: Int) => {
- val sums = xs.scanLeft(z)(_ + _)
- (xs.size == 0) || sums.zip(sums.tail).map(x => x._2 - x._1) == xs
- }}
-}
-
-
-
-
-
-
diff --git a/test/files/scalacheck/substringTests.scala b/test/files/scalacheck/substringTests.scala
deleted file mode 100644
index 76260b9dd2..0000000000
--- a/test/files/scalacheck/substringTests.scala
+++ /dev/null
@@ -1,20 +0,0 @@
-import org.scalacheck._
-
-
-object Test extends Properties("String") {
- property("startsWith") = Prop.forAll((a: String, b: String) => (a+b).startsWith(a))
-
- property("endsWith") = Prop.forAll((a: String, b: String) => (a+b).endsWith(b))
-
- property("concat") = Prop.forAll((a: String, b: String) =>
- (a+b).length >= a.length && (a+b).length >= b.length
- )
-
- property("substring") = Prop.forAll((a: String, b: String) =>
- (a+b).substring(a.length) == b
- )
-
- property("substring") = Prop.forAll((a: String, b: String, c: String) =>
- (a+b+c).substring(a.length, a.length+b.length) == b
- )
-}
diff --git a/test/files/scalacheck/t2460.scala b/test/files/scalacheck/t2460.scala
deleted file mode 100644
index ab2911447a..0000000000
--- a/test/files/scalacheck/t2460.scala
+++ /dev/null
@@ -1,27 +0,0 @@
-import org.scalacheck.Prop.forAll
-import org.scalacheck.Properties
-import org.scalacheck.{Test => SCTest}
-import org.scalacheck.Gen
-
-object Test extends Properties("Regex : Ticket 2460") {
-
- val vowel = Gen.oneOf("a", "z")
-
- val numberOfMatch = forAll(vowel) {
- (s: String) => "\\s*([a-z])\\s*".r("data").findAllMatchIn((1 to 20).map(_ => s).mkString).size == 20
- }
-
- val numberOfGroup = forAll(vowel) {
- (s: String) => "\\s*([a-z])\\s*([a-z])\\s*".r("data").findAllMatchIn((1 to 20).map(_ => s).mkString).next.groupCount == 2
- }
-
- val nameOfGroup = forAll(vowel) {
- (s: String) => "([a-z])".r("data").findAllMatchIn(s).next.group("data") == s
- }
-
- val tests = List(
- ("numberOfMatch", numberOfMatch),
- ("numberOfGroup", numberOfGroup),
- ("nameOfGroup", nameOfGroup)
- )
-}
diff --git a/test/files/scalacheck/t4147.scala b/test/files/scalacheck/t4147.scala
deleted file mode 100644
index 72f6e9afd5..0000000000
--- a/test/files/scalacheck/t4147.scala
+++ /dev/null
@@ -1,68 +0,0 @@
-import org.scalacheck.Prop.{forAll, throws}
-import org.scalacheck.Properties
-import org.scalacheck.Gen
-
-
-import collection.mutable
-
-
-object Test extends Properties("Mutable TreeSet") {
-
- val generator = Gen.listOfN(1000, Gen.chooseNum(0, 1000))
-
- val denseGenerator = Gen.listOfN(1000, Gen.chooseNum(0, 200))
-
- property("Insertion doesn't allow duplicates values.") = forAll(generator) { (s: List[Int]) =>
- {
- val t = mutable.TreeSet[Int](s: _*)
- t == s.toSet
- }
- }
-
- property("Verification of size method validity") = forAll(generator) { (s: List[Int]) =>
- {
- val t = mutable.TreeSet[Int](s: _*)
- for (a <- s) {
- t -= a
- }
- t.size == 0
- }
- }
-
- property("All inserted elements are removed") = forAll(generator) { (s: List[Int]) =>
- {
- val t = mutable.TreeSet[Int](s: _*)
- for (a <- s) {
- t -= a
- }
- t == Set()
- }
- }
-
- property("Elements are sorted.") = forAll(generator) { (s: List[Int]) =>
- {
- val t = mutable.TreeSet[Int](s: _*)
- t.toList == s.distinct.sorted
- }
- }
-
- property("Implicit CanBuildFrom resolution succeeds as well as the \"same-result-type\" principle.") =
- forAll(generator) { (s: List[Int]) =>
- {
- val t = mutable.TreeSet[Int](s: _*)
- val t2 = t.map(_ * 2)
- t2.isInstanceOf[collection.mutable.TreeSet[Int]]
- }
- }
-
- property("A view doesn't expose off bounds elements") = forAll(denseGenerator) { (s: List[Int]) =>
- {
- val t = mutable.TreeSet[Int](s: _*)
- val view = t.rangeImpl(Some(50), Some(150))
- view.filter(_ < 50) == Set[Int]() && view.filter(_ >= 150) == Set[Int]()
- }
- }
-
- property("ordering must not be null") =
- throws(classOf[NullPointerException])(mutable.TreeSet.empty[Int](null))
-}
diff --git a/test/files/scalacheck/test.scala b/test/files/scalacheck/test.scala
deleted file mode 100644
index f69c7fe211..0000000000
--- a/test/files/scalacheck/test.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-import org.scalacheck._
-
-
-
-
-
-
-object Test extends Properties("Nothing")
diff --git a/test/files/scalacheck/testdir/dep.scala b/test/files/scalacheck/testdir/dep.scala
deleted file mode 100644
index ab167cbc8b..0000000000
--- a/test/files/scalacheck/testdir/dep.scala
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-object Dependency {
- val v = 1
-}
diff --git a/test/files/scalacheck/testdir/test.scala b/test/files/scalacheck/testdir/test.scala
deleted file mode 100644
index d5a5056137..0000000000
--- a/test/files/scalacheck/testdir/test.scala
+++ /dev/null
@@ -1,10 +0,0 @@
-import org.scalacheck._
-
-
-
-
-
-
-object Test extends Properties("Nothing") {
- val d = Dependency.v
-}
diff --git a/test/files/scalacheck/treemap.scala b/test/files/scalacheck/treemap.scala
deleted file mode 100644
index f672637c57..0000000000
--- a/test/files/scalacheck/treemap.scala
+++ /dev/null
@@ -1,154 +0,0 @@
-import collection.immutable._
-import org.scalacheck._
-import Prop._
-import Gen._
-import Arbitrary._
-import util._
-import Buildable._
-
-object Test extends Properties("TreeMap") {
- def genTreeMap[A: Arbitrary: Ordering, B: Arbitrary]: Gen[TreeMap[A, B]] =
- for {
- keys <- listOf(arbitrary[A])
- values <- listOfN(keys.size, arbitrary[B])
- } yield TreeMap(keys zip values: _*)
- implicit def arbTreeMap[A : Arbitrary : Ordering, B : Arbitrary] = Arbitrary(genTreeMap[A, B])
-
- property("foreach/iterator consistency") = forAll { (subject: TreeMap[Int, String]) =>
- val it = subject.iterator
- var consistent = true
- subject.foreach { element =>
- consistent &&= it.hasNext && element == it.next
- }
- consistent
- }
-
- property("worst-case tree height is iterable") = forAll(choose(0, 10), arbitrary[Boolean]) { (n: Int, even: Boolean) =>
- /*
- * According to "Ralf Hinze. Constructing red-black trees" [http://www.cs.ox.ac.uk/ralf.hinze/publications/#P5]
- * you can construct a skinny tree of height 2n by inserting the elements [1 .. 2^(n+1) - 2] and a tree of height
- * 2n+1 by inserting the elements [1 .. 3 * 2^n - 2], both in reverse order.
- *
- * Since we allocate a fixed size buffer in the iterator (based on the tree size) we need to ensure
- * it is big enough for these worst-case trees.
- */
- val highest = if (even) (1 << (n+1)) - 2 else 3*(1 << n) - 2
- val values = (1 to highest).reverse
- val subject = TreeMap(values zip values: _*)
- val it = subject.iterator
- try { while (it.hasNext) it.next; true } catch { case _ => false }
- }
-
- property("sorted") = forAll { (subject: TreeMap[Int, String]) => (subject.size >= 3) ==> {
- subject.zip(subject.tail).forall { case (x, y) => x._1 < y._1 }
- }}
-
- property("contains all") = forAll { (arr: List[(Int, String)]) =>
- val subject = TreeMap(arr: _*)
- arr.map(_._1).forall(subject.contains(_))
- }
-
- property("size") = forAll { (elements: List[(Int, Int)]) =>
- val subject = TreeMap(elements: _*)
- elements.map(_._1).distinct.size == subject.size
- }
-
- property("toSeq") = forAll { (elements: List[(Int, Int)]) =>
- val subject = TreeMap(elements: _*)
- elements.map(_._1).distinct.sorted == subject.toSeq.map(_._1)
- }
-
- property("head") = forAll { (elements: List[Int]) => elements.nonEmpty ==> {
- val subject = TreeMap(elements zip elements: _*)
- elements.min == subject.head._1
- }}
-
- property("last") = forAll { (elements: List[Int]) => elements.nonEmpty ==> {
- val subject = TreeMap(elements zip elements: _*)
- elements.max == subject.last._1
- }}
-
- property("head/tail identity") = forAll { (subject: TreeMap[Int, String]) => subject.nonEmpty ==> {
- subject == (subject.tail + subject.head)
- }}
-
- property("init/last identity") = forAll { (subject: TreeMap[Int, String]) => subject.nonEmpty ==> {
- subject == (subject.init + subject.last)
- }}
-
- property("take") = forAll { (subject: TreeMap[Int, String]) =>
- val n = choose(0, subject.size).sample.get
- n == subject.take(n).size && subject.take(n).forall(elt => subject.get(elt._1) == Some(elt._2))
- }
-
- property("drop") = forAll { (subject: TreeMap[Int, String]) =>
- val n = choose(0, subject.size).sample.get
- (subject.size - n) == subject.drop(n).size && subject.drop(n).forall(elt => subject.get(elt._1) == Some(elt._2))
- }
-
- property("take/drop identity") = forAll { (subject: TreeMap[Int, String]) =>
- val n = choose(-1, subject.size + 1).sample.get
- subject == subject.take(n) ++ subject.drop(n)
- }
-
- property("splitAt") = forAll { (subject: TreeMap[Int, String]) =>
- val n = choose(-1, subject.size + 1).sample.get
- val (prefix, suffix) = subject.splitAt(n)
- prefix == subject.take(n) && suffix == subject.drop(n)
- }
-
- def genSliceParms = for {
- tree <- genTreeMap[Int, String]
- from <- choose(0, tree.size)
- until <- choose(from, tree.size)
- } yield (tree, from, until)
-
- property("slice") = forAll(genSliceParms) { case (subject, from, until) =>
- val slice = subject.slice(from, until)
- slice.size == until - from && subject.toSeq == subject.take(from).toSeq ++ slice ++ subject.drop(until)
- }
-
- property("takeWhile") = forAll { (subject: TreeMap[Int, String]) =>
- val result = subject.takeWhile(_._1 < 0)
- result.forall(_._1 < 0) && result == subject.take(result.size)
- }
-
- property("dropWhile") = forAll { (subject: TreeMap[Int, String]) =>
- val result = subject.dropWhile(_._1 < 0)
- result.forall(_._1 >= 0) && result == subject.takeRight(result.size)
- }
-
- property("span identity") = forAll { (subject: TreeMap[Int, String]) =>
- val (prefix, suffix) = subject.span(_._1 < 0)
- prefix.forall(_._1 < 0) && suffix.forall(_._1 >= 0) && subject == prefix ++ suffix
- }
-
- property("from is inclusive") = forAll { (subject: TreeMap[Int, String]) => subject.nonEmpty ==> {
- val n = choose(0, subject.size - 1).sample.get
- val from = subject.drop(n).firstKey
- subject.from(from).firstKey == from && subject.from(from).forall(_._1 >= from)
- }}
-
- property("to is inclusive") = forAll { (subject: TreeMap[Int, String]) => subject.nonEmpty ==> {
- val n = choose(0, subject.size - 1).sample.get
- val to = subject.drop(n).firstKey
- subject.to(to).lastKey == to && subject.to(to).forall(_._1 <= to)
- }}
-
- property("until is exclusive") = forAll { (subject: TreeMap[Int, String]) => subject.size > 1 ==> {
- val n = choose(1, subject.size - 1).sample.get
- val until = subject.drop(n).firstKey
- subject.until(until).lastKey == subject.take(n).lastKey && subject.until(until).forall(_._1 <= until)
- }}
-
- property("remove single") = forAll { (subject: TreeMap[Int, String]) => subject.nonEmpty ==> {
- val key = oneOf(subject.keys.toSeq).sample.get
- val removed = subject - key
- subject.contains(key) && !removed.contains(key) && subject.size - 1 == removed.size
- }}
-
- property("remove all") = forAll { (subject: TreeMap[Int, String]) =>
- val result = subject.foldLeft(subject)((acc, elt) => acc - elt._1)
- result.isEmpty
- }
-}
diff --git a/test/files/scalacheck/treeset.scala b/test/files/scalacheck/treeset.scala
deleted file mode 100644
index 4b9b77dd7e..0000000000
--- a/test/files/scalacheck/treeset.scala
+++ /dev/null
@@ -1,155 +0,0 @@
-import collection.immutable._
-import org.scalacheck._
-import Prop._
-import Gen._
-import Arbitrary._
-import util._
-
-object Test extends Properties("TreeSet") {
- def genTreeSet[A: Arbitrary: Ordering]: Gen[TreeSet[A]] =
- for {
- elements <- listOf(arbitrary[A])
- } yield TreeSet(elements: _*)
- implicit def arbTreeSet[A : Arbitrary : Ordering]: Arbitrary[TreeSet[A]] = Arbitrary(genTreeSet)
-
- property("foreach/iterator consistency") = forAll { (subject: TreeSet[Int]) =>
- val it = subject.iterator
- var consistent = true
- subject.foreach { element =>
- consistent &&= it.hasNext && element == it.next
- }
- consistent
- }
-
- property("worst-case tree height is iterable") = forAll(choose(0, 10), arbitrary[Boolean]) { (n: Int, even: Boolean) =>
- /*
- * According to "Ralf Hinze. Constructing red-black trees" [http://www.cs.ox.ac.uk/ralf.hinze/publications/#P5]
- * you can construct a skinny tree of height 2n by inserting the elements [1 .. 2^(n+1) - 2] and a tree of height
- * 2n+1 by inserting the elements [1 .. 3 * 2^n - 2], both in reverse order.
- *
- * Since we allocate a fixed size buffer in the iterator (based on the tree size) we need to ensure
- * it is big enough for these worst-case trees.
- */
- val highest = if (even) (1 << (n+1)) - 2 else 3*(1 << n) - 2
- val values = (1 to highest).reverse
- val subject = TreeSet(values: _*)
- val it = subject.iterator
- try { while (it.hasNext) it.next; true } catch { case _ => false }
- }
-
- property("sorted") = forAll { (subject: TreeSet[Int]) => (subject.size >= 3) ==> {
- subject.zip(subject.tail).forall { case (x, y) => x < y }
- }}
-
- property("contains all") = forAll { (elements: List[Int]) =>
- val subject = TreeSet(elements: _*)
- elements.forall(subject.contains)
- }
-
- property("size") = forAll { (elements: List[Int]) =>
- val subject = TreeSet(elements: _*)
- elements.distinct.size == subject.size
- }
-
- property("toSeq") = forAll { (elements: List[Int]) =>
- val subject = TreeSet(elements: _*)
- elements.distinct.sorted == subject.toSeq
- }
-
- property("head") = forAll { (elements: List[Int]) => elements.nonEmpty ==> {
- val subject = TreeSet(elements: _*)
- elements.min == subject.head
- }}
-
- property("last") = forAll { (elements: List[Int]) => elements.nonEmpty ==> {
- val subject = TreeSet(elements: _*)
- elements.max == subject.last
- }}
-
- property("head/tail identity") = forAll { (subject: TreeSet[Int]) => subject.nonEmpty ==> {
- subject == (subject.tail + subject.head)
- }}
-
- property("init/last identity") = forAll { (subject: TreeSet[Int]) => subject.nonEmpty ==> {
- subject == (subject.init + subject.last)
- }}
-
- property("take") = forAll { (subject: TreeSet[Int]) =>
- val n = choose(0, subject.size).sample.get
- n == subject.take(n).size && subject.take(n).forall(subject.contains)
- }
-
- property("drop") = forAll { (subject: TreeSet[Int]) =>
- val n = choose(0, subject.size).sample.get
- (subject.size - n) == subject.drop(n).size && subject.drop(n).forall(subject.contains)
- }
-
- property("take/drop identity") = forAll { (subject: TreeSet[Int]) =>
- val n = choose(-1, subject.size + 1).sample.get
- subject == subject.take(n) ++ subject.drop(n)
- }
-
- property("splitAt") = forAll { (subject: TreeSet[Int]) =>
- val n = choose(-1, subject.size + 1).sample.get
- val (prefix, suffix) = subject.splitAt(n)
- prefix == subject.take(n) && suffix == subject.drop(n)
- }
-
- def genSliceParms = for {
- tree <- genTreeSet[Int]
- from <- choose(0, tree.size)
- until <- choose(from, tree.size)
- } yield (tree, from, until)
-
- property("slice") = forAll(genSliceParms) { case (subject, from, until) =>
- val slice = subject.slice(from, until)
- slice.size == until - from && subject.toSeq == subject.take(from).toSeq ++ slice ++ subject.drop(until)
- }
-
- property("takeWhile") = forAll { (subject: TreeSet[Int]) =>
- val result = subject.takeWhile(_ < 0)
- result.forall(_ < 0) && result == subject.take(result.size)
- }
-
- property("dropWhile") = forAll { (subject: TreeSet[Int]) =>
- val result = subject.dropWhile(_ < 0)
- result.forall(_ >= 0) && result == subject.takeRight(result.size)
- }
-
- property("span identity") = forAll { (subject: TreeSet[Int]) =>
- val (prefix, suffix) = subject.span(_ < 0)
- prefix.forall(_ < 0) && suffix.forall(_ >= 0) && subject == prefix ++ suffix
- }
-
- property("from is inclusive") = forAll { (subject: TreeSet[Int]) => subject.nonEmpty ==> {
- val n = choose(0, subject.size - 1).sample.get
- val from = subject.drop(n).firstKey
- subject.from(from).firstKey == from && subject.from(from).forall(_ >= from)
- }}
-
- property("to is inclusive") = forAll { (subject: TreeSet[Int]) => subject.nonEmpty ==> {
- val n = choose(0, subject.size - 1).sample.get
- val to = subject.drop(n).firstKey
- subject.to(to).lastKey == to && subject.to(to).forall(_ <= to)
- }}
-
- property("until is exclusive") = forAll { (subject: TreeSet[Int]) => subject.size > 1 ==> {
- val n = choose(1, subject.size - 1).sample.get
- val until = subject.drop(n).firstKey
- subject.until(until).lastKey == subject.take(n).lastKey && subject.until(until).forall(_ <= until)
- }}
-
- property("remove single") = forAll { (subject: TreeSet[Int]) => subject.nonEmpty ==> {
- val element = oneOf(subject.toSeq).sample.get
- val removed = subject - element
- subject.contains(element) && !removed.contains(element) && subject.size - 1 == removed.size
- }}
-
- property("remove all") = forAll { (subject: TreeSet[Int]) =>
- val result = subject.foldLeft(subject)((acc, elt) => acc - elt)
- result.isEmpty
- }
-
- property("ordering must not be null") =
- throws(classOf[NullPointerException])(TreeSet.empty[Int](null))
-}
diff --git a/test/files/specialized/SI-7343.scala b/test/files/specialized/SI-7343.scala
index 8d14a2c1c5..a5fc547868 100644
--- a/test/files/specialized/SI-7343.scala
+++ b/test/files/specialized/SI-7343.scala
@@ -48,7 +48,7 @@ object Test extends App {
new Val(101, "Parent$mcI$sp")
/**
- * NOTE: The the same check, only modified to affect constructors, won't
+ * NOTE: The same check, only modified to affect constructors, won't
* work since the class X definition will always be lifted to become a
* member of the class, making it impossible to force its duplication.
*/
diff --git a/test/files/specialized/fft.check b/test/files/specialized/fft.check
index 74cb9bb3b5..5283c6cbe2 100644
--- a/test/files/specialized/fft.check
+++ b/test/files/specialized/fft.check
@@ -1,4 +1,4 @@
Processing 65536 items
Boxed doubles: 0
-Boxed ints: 2
+Boxed ints: 0
Boxed longs: 1179811
diff --git a/test/files/specialized/tb3651.check b/test/files/specialized/tb3651.check
index 8a3f686ef5..8e104f13ff 100644
--- a/test/files/specialized/tb3651.check
+++ b/test/files/specialized/tb3651.check
@@ -1,4 +1,4 @@
-tb3651.scala:8: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+tb3651.scala:8: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
lk.a
^
0
diff --git a/test/files/specialized/tc3651.check b/test/files/specialized/tc3651.check
index e2dbadf22c..1e56d196fd 100644
--- a/test/files/specialized/tc3651.check
+++ b/test/files/specialized/tc3651.check
@@ -1,4 +1,4 @@
-tc3651.scala:12: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+tc3651.scala:12: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
lk.a
^
0
diff --git a/test/files/specialized/td3651.check b/test/files/specialized/td3651.check
index 1a709fd0a7..697443ffe9 100644
--- a/test/files/specialized/td3651.check
+++ b/test/files/specialized/td3651.check
@@ -1,7 +1,7 @@
-td3651.scala:12: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+td3651.scala:12: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
b.a
^
-td3651.scala:16: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+td3651.scala:16: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
der.a
^
0