summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild.xml12
-rw-r--r--src/actors/scala/actors/scheduler/ForkJoinScheduler.scala2
-rw-r--r--src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala2
-rw-r--r--src/actors/scala/actors/scheduler/TerminationService.scala2
-rw-r--r--src/compiler/scala/reflect/reify/phases/Metalevels.scala4
-rw-r--r--src/compiler/scala/tools/nsc/CompileSocket.scala8
-rw-r--r--src/compiler/scala/tools/nsc/ast/TreeDSL.scala2
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Parsers.scala6
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Scanners.scala4
-rw-r--r--src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala20
-rw-r--r--src/compiler/scala/tools/nsc/backend/icode/GenICode.scala15
-rw-r--r--src/compiler/scala/tools/nsc/backend/icode/Opcodes.scala2
-rw-r--r--src/compiler/scala/tools/nsc/backend/icode/analysis/CopyPropagation.scala2
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala7
-rw-r--r--src/compiler/scala/tools/nsc/io/Lexer.scala4
-rw-r--r--src/compiler/scala/tools/nsc/io/PrettyWriter.scala2
-rw-r--r--src/compiler/scala/tools/nsc/javac/JavaParsers.scala22
-rw-r--r--src/compiler/scala/tools/nsc/javac/JavaScanners.scala2
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala57
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala3
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala2
-rw-r--r--src/compiler/scala/tools/nsc/transform/AddInterfaces.scala6
-rw-r--r--src/compiler/scala/tools/nsc/transform/CleanUp.scala14
-rw-r--r--src/compiler/scala/tools/nsc/transform/Constructors.scala8
-rw-r--r--src/compiler/scala/tools/nsc/transform/Erasure.scala63
-rw-r--r--src/compiler/scala/tools/nsc/transform/LambdaLift.scala2
-rw-r--r--src/compiler/scala/tools/nsc/transform/LazyVals.scala2
-rw-r--r--src/compiler/scala/tools/nsc/transform/Mixin.scala2
-rw-r--r--src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala47
-rw-r--r--src/compiler/scala/tools/nsc/transform/UnCurry.scala10
-rw-r--r--src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala6
-rw-r--r--src/compiler/scala/tools/nsc/transform/patmat/MatchCodeGen.scala2
-rw-r--r--src/compiler/scala/tools/nsc/transform/patmat/MatchOptimization.scala14
-rw-r--r--src/compiler/scala/tools/nsc/transform/patmat/MatchTranslation.scala22
-rw-r--r--src/compiler/scala/tools/nsc/transform/patmat/MatchTreeMaking.scala8
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/AnalyzerPlugins.scala2
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Checkable.scala2
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala8
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Duplicators.scala8
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Implicits.scala9
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Infer.scala12
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala4
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala12
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/RefChecks.scala14
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala4
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala33
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Tags.scala6
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala4
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala76
-rw-r--r--src/compiler/scala/tools/nsc/util/ShowPickled.scala2
-rw-r--r--src/compiler/scala/tools/nsc/util/package.scala9
-rw-r--r--src/compiler/scala/tools/reflect/ToolBoxFactory.scala8
-rw-r--r--src/compiler/scala/tools/reflect/WrappedProperties.scala1
-rw-r--r--src/compiler/scala/tools/util/PathResolver.scala147
-rw-r--r--src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala4
-rw-r--r--src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala8
-rw-r--r--src/interactive/scala/tools/nsc/interactive/Global.scala2
-rw-r--r--src/interactive/scala/tools/nsc/interactive/REPL.scala2
-rw-r--r--src/interactive/scala/tools/nsc/interactive/tests/Tester.scala2
-rw-r--r--src/library/scala/collection/JavaConversions.scala45
-rwxr-xr-xsrc/library/scala/collection/JavaConverters.scala13
-rw-r--r--src/library/scala/collection/mutable/StringBuilder.scala8
-rw-r--r--src/library/scala/concurrent/duration/package.scala14
-rw-r--r--src/library/scala/io/BufferedSource.scala2
-rw-r--r--src/library/scala/math/BigDecimal.scala10
-rw-r--r--src/library/scala/math/BigInt.scala4
-rw-r--r--src/library/scala/math/Numeric.scala18
-rw-r--r--src/library/scala/math/package.scala32
-rwxr-xr-xsrc/library/scala/reflect/NameTransformer.scala8
-rw-r--r--src/library/scala/runtime/RichFloat.scala8
-rw-r--r--src/library/scala/runtime/WorksheetSupport.scala2
-rw-r--r--src/library/scala/util/MurmurHash.scala2
-rw-r--r--src/library/scala/util/Properties.scala2
-rw-r--r--src/library/scala/util/hashing/MurmurHash3.scala2
-rw-r--r--src/library/scala/util/parsing/json/JSON.scala1
-rw-r--r--src/library/scala/util/parsing/json/Lexer.scala1
-rw-r--r--src/library/scala/util/parsing/json/Parser.scala7
-rw-r--r--src/library/scala/xml/include/sax/XIncluder.scala2
-rw-r--r--src/library/scala/xml/persistent/CachedFileStorage.scala2
-rw-r--r--src/partest/scala/tools/partest/nest/PathSettings.scala31
-rw-r--r--src/partest/scala/tools/partest/nest/Runner.scala152
-rw-r--r--src/partest/scala/tools/partest/package.scala4
-rw-r--r--src/reflect/scala/reflect/internal/BaseTypeSeqs.scala2
-rw-r--r--src/reflect/scala/reflect/internal/Constants.scala24
-rw-r--r--src/reflect/scala/reflect/internal/Definitions.scala104
-rw-r--r--src/reflect/scala/reflect/internal/Symbols.scala55
-rw-r--r--src/reflect/scala/reflect/internal/TreeGen.scala4
-rw-r--r--src/reflect/scala/reflect/internal/Trees.scala1
-rw-r--r--src/reflect/scala/reflect/internal/Types.scala26
-rw-r--r--src/reflect/scala/reflect/internal/pickling/ByteCodecs.scala4
-rw-r--r--src/reflect/scala/reflect/internal/pickling/PickleBuffer.scala4
-rw-r--r--src/reflect/scala/reflect/internal/tpe/GlbLubs.scala26
-rw-r--r--src/reflect/scala/reflect/internal/tpe/TypeConstraints.scala4
-rw-r--r--src/reflect/scala/reflect/internal/tpe/TypeMaps.scala6
-rw-r--r--src/reflect/scala/reflect/internal/transform/Erasure.scala28
-rw-r--r--src/reflect/scala/reflect/internal/transform/UnCurry.scala2
-rw-r--r--src/reflect/scala/reflect/internal/util/AbstractFileClassLoader.scala (renamed from src/compiler/scala/tools/nsc/util/AbstractFileClassLoader.scala)6
-rw-r--r--src/reflect/scala/reflect/internal/util/ScalaClassLoader.scala (renamed from src/compiler/scala/tools/nsc/util/ScalaClassLoader.scala)6
-rw-r--r--src/reflect/scala/reflect/internal/util/Statistics.scala6
-rw-r--r--src/reflect/scala/reflect/runtime/JavaMirrors.scala2
-rw-r--r--src/reflect/scala/reflect/runtime/ReflectionUtils.scala3
-rw-r--r--src/repl/scala/tools/nsc/interpreter/ILoop.scala10
-rw-r--r--src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala6
-rw-r--r--src/scaladoc/scala/tools/nsc/doc/html/SyntaxHigh.scala4
-rw-r--r--src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotRunner.scala2
-rw-r--r--src/scaladoc/scala/tools/nsc/doc/model/ModelFactoryImplicitSupport.scala4
-rw-r--r--src/scalap/scala/tools/scalap/Classfile.scala10
-rw-r--r--src/scalap/scala/tools/scalap/CodeWriter.scala4
-rw-r--r--src/swing/scala/swing/Component.scala4
-rwxr-xr-xtest/files/continuations-run/basics.scala2
-rw-r--r--test/files/continuations-run/function1.scala4
-rw-r--r--test/files/continuations-run/function4.scala4
-rw-r--r--test/files/continuations-run/function5.scala4
-rw-r--r--test/files/continuations-run/function6.scala4
-rw-r--r--test/files/continuations-run/ifelse0.scala4
-rw-r--r--test/files/continuations-run/ifelse1.scala4
-rw-r--r--test/files/continuations-run/ifelse2.scala4
-rw-r--r--test/files/continuations-run/ifelse3.scala4
-rw-r--r--test/files/continuations-run/ifelse4.scala4
-rw-r--r--test/files/continuations-run/infer1.scala4
-rw-r--r--test/files/continuations-run/match0.scala4
-rw-r--r--test/files/continuations-run/match1.scala4
-rw-r--r--test/files/continuations-run/patvirt.scala2
-rw-r--r--test/files/continuations-run/t1820.scala4
-rw-r--r--test/files/continuations-run/t1821.scala4
-rw-r--r--test/files/continuations-run/t3199b.scala4
-rw-r--r--test/files/continuations-run/t3223.scala4
-rw-r--r--test/files/continuations-run/t3225.scala2
-rw-r--r--test/files/continuations-run/t5314.check6
-rw-r--r--test/files/continuations-run/t5472.check14
-rw-r--r--test/files/continuations-run/t5472.scala5
-rw-r--r--test/files/continuations-run/t5506.scala2
-rw-r--r--test/files/continuations-run/t5538.check1
-rw-r--r--test/files/continuations-run/t5538.scala6
-rw-r--r--test/files/continuations-run/trycatch0.scala6
-rw-r--r--test/files/continuations-run/trycatch1.check8
-rw-r--r--test/files/continuations-run/trycatch1.scala10
-rw-r--r--test/files/continuations-run/while0.scala4
-rw-r--r--test/files/continuations-run/while1.scala4
-rw-r--r--test/files/continuations-run/while2.scala4
-rw-r--r--test/files/filters3
-rw-r--r--test/files/jvm/actor-exceptions.scala4
-rw-r--r--test/files/jvm/actor-executor.scala5
-rw-r--r--test/files/jvm/actor-executor2.scala6
-rw-r--r--test/files/jvm/actor-executor3.scala6
-rw-r--r--test/files/jvm/actor-getstate.scala6
-rw-r--r--test/files/jvm/actor-link-getstate.scala9
-rw-r--r--test/files/jvm/actor-looping.scala3
-rw-r--r--test/files/jvm/actor-normal-exit.scala4
-rw-r--r--test/files/jvm/actor-receivewithin.scala5
-rw-r--r--test/files/jvm/actor-sync-send-timeout.scala5
-rw-r--r--test/files/jvm/actor-termination.scala3
-rw-r--r--test/files/jvm/actor-uncaught-exception.scala3
-rw-r--r--test/files/jvm/actor-uncaught-exception2.check4
-rw-r--r--test/files/jvm/actor-uncaught-exception2.scala4
-rw-r--r--test/files/jvm/annotations.scala3
-rw-r--r--test/files/jvm/daemon-actor-termination.scala4
-rw-r--r--test/files/jvm/deprecation.check3
-rw-r--r--test/files/jvm/duration-tck.scala2
-rw-r--r--test/files/jvm/future-alarm.scala4
-rw-r--r--test/files/jvm/future-awaitall-zero.scala6
-rw-r--r--test/files/jvm/future-spec/main.scala10
-rw-r--r--test/files/jvm/future-termination.scala4
-rw-r--r--test/files/jvm/reactor-exceptionOnSend.scala5
-rw-r--r--test/files/jvm/reactor-producer-consumer.scala4
-rw-r--r--test/files/jvm/reactor.scala16
-rw-r--r--test/files/jvm/replyablereactor.scala5
-rw-r--r--test/files/jvm/replyablereactor2.scala5
-rw-r--r--test/files/jvm/replyablereactor3.scala5
-rw-r--r--test/files/jvm/replyablereactor4.scala5
-rw-r--r--test/files/jvm/replyreactor-react-sender.scala6
-rw-r--r--test/files/jvm/replyreactor.scala4
-rw-r--r--test/files/jvm/scala-concurrent-tck.check3
-rw-r--r--test/files/jvm/scala-concurrent-tck.scala2
-rw-r--r--test/files/jvm/scheduler-adapter.scala5
-rw-r--r--test/files/jvm/serialization.scala4
-rw-r--r--test/files/jvm/stringbuilder.scala1
-rw-r--r--test/files/jvm/t1449.scala9
-rw-r--r--test/files/jvm/t1948.scala6
-rw-r--r--test/files/jvm/t2163/t2163.scala7
-rw-r--r--test/files/jvm/t2359.scala4
-rw-r--r--test/files/jvm/t2530.scala6
-rw-r--r--test/files/jvm/t3102.scala7
-rw-r--r--test/files/jvm/t3356.scala5
-rw-r--r--test/files/jvm/t3365.scala5
-rw-r--r--test/files/jvm/t3407.scala4
-rw-r--r--test/files/jvm/t3412-channel.scala4
-rw-r--r--test/files/jvm/t3412.scala4
-rw-r--r--test/files/jvm/t3470.scala4
-rw-r--r--test/files/jvm/t3838.scala4
-rw-r--r--test/files/jvm/t560bis.scala2
-rw-r--r--test/files/jvm/t6941/Analyzed_1.flags1
-rw-r--r--test/files/jvm/t7006.check28
-rw-r--r--test/files/jvm/t7146.scala2
-rw-r--r--test/files/jvm/try-type-tests.scala3
-rw-r--r--test/files/jvm/unreachable/Foo_1.scala4
-rw-r--r--test/files/jvm/xml01.scala2
-rwxr-xr-xtest/files/jvm/xml03syntax.check1
-rw-r--r--test/files/jvm/xml03syntax.scala2
-rw-r--r--test/files/neg/raw-types-stubs.check11
-rw-r--r--test/files/neg/raw-types-stubs/M_1.java3
-rw-r--r--test/files/neg/raw-types-stubs/Raw_2.java4
-rw-r--r--test/files/neg/raw-types-stubs/S_3.scala1
-rw-r--r--test/files/neg/t4584.check6
-rw-r--r--test/files/neg/unicode-unterminated-quote.check4
-rw-r--r--test/files/pos/t3688-redux.scala8
-rwxr-xr-xtest/files/presentation/doc/doc.scala13
-rw-r--r--test/files/presentation/memory-leaks/MemoryLeaksTest.scala2
-rw-r--r--test/files/run/Course-2002-01.check3
-rw-r--r--test/files/run/Meter.check3
-rw-r--r--test/files/run/MeterCaseClass.check3
-rw-r--r--test/files/run/Predef.readLine.scala3
-rw-r--r--test/files/run/SymbolsTest.scala3
-rw-r--r--test/files/run/abstypetags_serialize.scala3
-rw-r--r--test/files/run/array-existential-bound.scala4
-rw-r--r--test/files/run/arrays.check6
-rw-r--r--test/files/run/bitsets.scala2
-rw-r--r--test/files/run/bridges.scala2
-rw-r--r--test/files/run/bugs.scala2
-rw-r--r--test/files/run/classmanifests_new_alias.scala4
-rw-r--r--test/files/run/classmanifests_new_core.scala3
-rw-r--r--test/files/run/collections.scala3
-rw-r--r--test/files/run/colltest1.scala6
-rw-r--r--test/files/run/comparable-comparator.scala3
-rw-r--r--test/files/run/compiler-asSeenFrom.scala5
-rw-r--r--test/files/run/concurrent-stream.scala45
-rw-r--r--test/files/run/contrib674.check3
-rw-r--r--test/files/run/contrib674.scala4
-rw-r--r--test/files/run/ctries-new/main.scala7
-rw-r--r--test/files/run/ctries-old/concmap.scala1
-rw-r--r--test/files/run/ctries-old/iterator.scala1
-rw-r--r--test/files/run/ctries-old/lnode.scala1
-rw-r--r--test/files/run/ctries-old/main.scala8
-rw-r--r--test/files/run/ctries-old/snapshot.scala1
-rw-r--r--test/files/run/delay-bad.check6
-rw-r--r--test/files/run/delay-good.check6
-rw-r--r--test/files/run/distinct.scala2
-rw-r--r--test/files/run/enrich-gentraversable.scala3
-rw-r--r--test/files/run/eta-expand-star2.check1
-rw-r--r--test/files/run/exceptions-2.check3
-rw-r--r--test/files/run/exceptions-2.scala12
-rw-r--r--test/files/run/exceptions-nest.scala30
-rw-r--r--test/files/run/exceptions.scala2
-rw-r--r--test/files/run/existentials-in-compiler.scala8
-rw-r--r--test/files/run/existentials.scala3
-rw-r--r--test/files/run/existentials3-new.scala3
-rw-r--r--test/files/run/existentials3-old.scala2
-rw-r--r--test/files/run/finally.scala18
-rw-r--r--test/files/run/genericValueClass.scala2
-rw-r--r--test/files/run/getClassTest-old.scala1
-rw-r--r--test/files/run/global-showdef.scala7
-rw-r--r--test/files/run/impconvtimes.scala2
-rw-r--r--test/files/run/implicits.scala2
-rw-r--r--test/files/run/indexedSeq.scala7
-rw-r--r--test/files/run/inner-obj-auto.scala130
-rw-r--r--test/files/run/interop_classtags_are_classmanifests.scala5
-rw-r--r--test/files/run/interop_manifests_are_classtags.scala3
-rw-r--r--test/files/run/interpolationArgs.scala4
-rw-r--r--test/files/run/interpolationMultiline2.scala17
-rw-r--r--test/files/run/io-position.scala4
-rw-r--r--test/files/run/is-valid-num.scala3
-rw-r--r--test/files/run/issue192.scala2
-rw-r--r--test/files/run/iterator-from.scala4
-rw-r--r--test/files/run/iterator-iterate-lazy.scala2
-rw-r--r--test/files/run/iterators.scala2
-rw-r--r--test/files/run/json.scala8
-rw-r--r--test/files/run/lazy-exprs.check8
-rw-r--r--test/files/run/lazy-locals.check6
-rw-r--r--test/files/run/lists-run.scala4
-rw-r--r--test/files/run/literals.check4
-rw-r--r--test/files/run/literals.scala6
-rw-r--r--test/files/run/macro-declared-in-anonymous/Macros_Test_2.scala4
-rw-r--r--test/files/run/macro-declared-in-refinement/Macros_Test_2.scala5
-rw-r--r--test/files/run/macro-duplicate.check3
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala3
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-view.flags1
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala5
-rw-r--r--test/files/run/manifests-new.scala5
-rw-r--r--test/files/run/manifests-old.scala5
-rw-r--r--test/files/run/mapConserve.scala5
-rw-r--r--test/files/run/misc.check24
-rw-r--r--test/files/run/names-defaults.check4
-rw-r--r--test/files/run/names-defaults.scala3
-rw-r--r--test/files/run/no-pickle-skolems/Test_2.scala2
-rw-r--r--test/files/run/option-fold.scala11
-rw-r--r--test/files/run/patmat-exprs.scala4
-rw-r--r--test/files/run/patmat_unapp_abstype-new.check6
-rw-r--r--test/files/run/patmatnew.check15
-rw-r--r--test/files/run/patmatnew.scala3
-rw-r--r--test/files/run/pc-conversions.scala4
-rw-r--r--test/files/run/pf-catch.scala4
-rw-r--r--test/files/run/preinits.check6
-rw-r--r--test/files/run/primitive-sigs-2-new.scala4
-rw-r--r--test/files/run/primitive-sigs-2-old.scala2
-rw-r--r--test/files/run/private-inline.check6
-rw-r--r--test/files/run/private-inline.flags2
-rw-r--r--test/files/run/private-inline.scala2
-rw-r--r--test/files/run/programmatic-main.scala2
-rw-r--r--test/files/run/records.scala3
-rw-r--r--test/files/run/reflection-allmirrors-tostring.scala4
-rw-r--r--test/files/run/reflection-implicit.scala4
-rw-r--r--test/files/run/reflection-magicsymbols-vanilla.scala2
-rw-r--r--test/files/run/reify-each-node-type.scala2
-rw-r--r--test/files/run/reify_ann1b.check5
-rw-r--r--test/files/run/reify_classfileann_a.check5
-rw-r--r--test/files/run/reify_classfileann_b.check5
-rw-r--r--test/files/run/reify_extendbuiltins.scala4
-rw-r--r--test/files/run/reify_implicits-new.scala4
-rw-r--r--test/files/run/reify_implicits-old.scala4
-rw-r--r--test/files/run/reify_lazyevaluation.scala2
-rw-r--r--test/files/run/reify_lazyunit.check3
-rw-r--r--test/files/run/reify_printf.check1
-rw-r--r--test/files/run/reify_printf.scala8
-rw-r--r--test/files/run/repl-backticks.scala2
-rw-r--r--test/files/run/repl-power.check1
-rw-r--r--test/files/run/resetattrs-this.scala4
-rw-r--r--test/files/run/richs.scala4
-rw-r--r--test/files/run/runtime.check6
-rw-r--r--test/files/run/runtime.scala2
-rw-r--r--test/files/run/sequenceComparisons.scala2
-rw-r--r--test/files/run/settings-parse.scala2
-rw-r--r--test/files/run/si5045.scala3
-rw-r--r--test/files/run/slices.scala3
-rw-r--r--test/files/run/spec-nlreturn.scala3
-rw-r--r--test/files/run/stream_flatmap_odds.scala2
-rw-r--r--test/files/run/stringbuilder-drop.scala4
-rw-r--r--test/files/run/stringbuilder.scala7
-rw-r--r--test/files/run/stringinterpolation_macro-run.scala3
-rw-r--r--test/files/run/structural.scala5
-rw-r--r--test/files/run/synchronized.check1
-rw-r--r--test/files/run/synchronized.flags2
-rw-r--r--test/files/run/t0325.scala2
-rw-r--r--test/files/run/t0421-old.scala2
-rw-r--r--test/files/run/t0432.scala3
-rw-r--r--test/files/run/t0528.scala2
-rw-r--r--test/files/run/t0677-old.scala3
-rw-r--r--test/files/run/t1005.scala9
-rw-r--r--test/files/run/t1110.scala6
-rw-r--r--test/files/run/t1141.scala4
-rw-r--r--test/files/run/t1195-new.scala4
-rw-r--r--test/files/run/t1195-old.scala3
-rw-r--r--test/files/run/t1368.check3
-rw-r--r--test/files/run/t1427.check3
-rw-r--r--test/files/run/t1427.scala3
-rw-r--r--test/files/run/t1500.scala2
-rw-r--r--test/files/run/t1501.scala2
-rw-r--r--test/files/run/t153.scala2
-rw-r--r--test/files/run/t1766.scala3
-rw-r--r--test/files/run/t2106.check3
-rw-r--r--test/files/run/t2106.flags2
-rw-r--r--test/files/run/t2106.scala2
-rw-r--r--test/files/run/t2308a.scala2
-rw-r--r--test/files/run/t2318.scala2
-rw-r--r--test/files/run/t2333.scala4
-rw-r--r--test/files/run/t2417.scala2
-rw-r--r--test/files/run/t2514.scala6
-rw-r--r--test/files/run/t2594_tcpoly.scala5
-rw-r--r--test/files/run/t2636.scala5
-rw-r--r--test/files/run/t3038d.scala2
-rw-r--r--test/files/run/t3050.scala2
-rw-r--r--test/files/run/t3175.scala3
-rw-r--r--test/files/run/t3232.scala2
-rw-r--r--test/files/run/t3242.scala3
-rw-r--r--test/files/run/t3361.scala4
-rw-r--r--test/files/run/t3425.check4
-rw-r--r--test/files/run/t3425.scala41
-rw-r--r--test/files/run/t3425b.check152
-rw-r--r--test/files/run/t3425b/Base_1.scala89
-rw-r--r--test/files/run/t3425b/Generated_2.scala886
-rw-r--r--test/files/run/t3488.check6
-rw-r--r--test/files/run/t3507-new.scala4
-rw-r--r--test/files/run/t3529.scala1
-rw-r--r--test/files/run/t3651.scala2
-rw-r--r--test/files/run/t3705.scala4
-rw-r--r--test/files/run/t3758-old.scala4
-rw-r--r--test/files/run/t3855.scala4
-rw-r--r--test/files/run/t3888.check1
-rw-r--r--test/files/run/t3888.scala5
-rw-r--r--test/files/run/t3935.scala2
-rw-r--r--test/files/run/t3964.scala3
-rw-r--r--test/files/run/t4047.check12
-rw-r--r--test/files/run/t4072.scala2
-rw-r--r--test/files/run/t4080.scala5
-rw-r--r--test/files/run/t4148.scala6
-rw-r--r--test/files/run/t4171.scala3
-rw-r--r--test/files/run/t4398.scala2
-rw-r--r--test/files/run/t4560.scala3
-rw-r--r--test/files/run/t4660.scala2
-rw-r--r--test/files/run/t4680.check6
-rw-r--r--test/files/run/t4729/S_2.scala1
-rw-r--r--test/files/run/t4766.scala4
-rw-r--r--test/files/run/t4777.scala4
-rw-r--r--test/files/run/t4794.scala3
-rw-r--r--test/files/run/t4929.scala1
-rw-r--r--test/files/run/t498.scala3
-rw-r--r--test/files/run/t5053.scala3
-rw-r--r--test/files/run/t5080.scala4
-rw-r--r--test/files/run/t5224.check5
-rw-r--r--test/files/run/t5277_1.scala3
-rw-r--r--test/files/run/t5284b.check3
-rw-r--r--test/files/run/t5284c.check3
-rw-r--r--test/files/run/t5353.scala9
-rw-r--r--test/files/run/t5356.scala2
-rw-r--r--test/files/run/t5375.scala2
-rw-r--r--test/files/run/t5380.check9
-rw-r--r--test/files/run/t5380.scala2
-rw-r--r--test/files/run/t5428.scala2
-rw-r--r--test/files/run/t5568.flags1
-rw-r--r--test/files/run/t5629b.scala2
-rwxr-xr-xtest/files/run/t5699.scala2
-rw-r--r--test/files/run/t576.scala2
-rw-r--r--test/files/run/t5881.scala3
-rw-r--r--test/files/run/t5912.scala3
-rw-r--r--test/files/run/t5942.scala2
-rw-r--r--test/files/run/t6011c.check3
-rw-r--r--test/files/run/t603.scala2
-rw-r--r--test/files/run/t6102.check30
-rw-r--r--test/files/run/t6113.scala4
-rw-r--r--test/files/run/t6146b.check4
-rw-r--r--test/files/run/t6246.scala3
-rw-r--r--test/files/run/t6329_vanilla.scala1
-rw-r--r--test/files/run/t6443.scala2
-rw-r--r--test/files/run/t657.scala2
-rw-r--r--test/files/run/t6690.scala2
-rw-r--r--test/files/run/t6731.scala2
-rw-r--r--test/files/run/t6863.check12
-rw-r--r--test/files/run/t6863.scala4
-rw-r--r--test/files/run/t6969.scala4
-rw-r--r--test/files/run/t7047.check3
-rw-r--r--test/files/run/t7096.scala3
-rw-r--r--test/files/run/t7120b.scala3
-rw-r--r--test/files/run/t7171.check3
-rw-r--r--test/files/run/t7171.flags1
-rw-r--r--test/files/run/t7171.scala2
-rw-r--r--test/files/run/t7198.check2
-rw-r--r--test/files/run/t7198.scala9
-rw-r--r--test/files/run/t7240/Test_2.scala4
-rw-r--r--test/files/run/t7271.check8
-rw-r--r--test/files/run/t7271.scala3
-rw-r--r--test/files/run/t7290.check6
-rw-r--r--test/files/run/t7291.scala3
-rw-r--r--test/files/run/t7319.check9
-rw-r--r--test/files/run/t7319.scala1
-rw-r--r--test/files/run/t7436.scala9
-rw-r--r--test/files/run/t874.scala2
-rw-r--r--test/files/run/tcpoly_monads.scala3
-rw-r--r--test/files/run/tcpoly_overriding.scala3
-rw-r--r--test/files/run/tcpoly_parseridioms.check20
-rw-r--r--test/files/run/tcpoly_parseridioms.scala3
-rw-r--r--test/files/run/toolbox_console_reporter.scala13
-rw-r--r--test/files/run/tpeCache-tyconCache.check19
-rw-r--r--test/files/run/tpeCache-tyconCache.scala10
-rw-r--r--test/files/run/transform.scala2
-rw-r--r--test/files/run/try-2.check3
-rw-r--r--test/files/run/try-2.scala12
-rw-r--r--test/files/run/try-catch-unify.scala2
-rw-r--r--test/files/run/try.check3
-rw-r--r--test/files/run/try.scala8
-rw-r--r--test/files/run/tuple-zipped.scala3
-rw-r--r--test/files/run/tuples.scala1
-rw-r--r--test/files/run/type-currying.scala3
-rw-r--r--test/files/run/unapply.check3
-rw-r--r--test/files/run/unittest_io.scala2
-rw-r--r--test/files/run/unreachable.scala19
-rw-r--r--test/files/run/valueclasses-classmanifest-basic.scala3
-rw-r--r--test/files/run/valueclasses-classmanifest-existential.scala3
-rw-r--r--test/files/run/valueclasses-classmanifest-generic.scala3
-rw-r--r--test/files/run/vector1.scala2
-rw-r--r--test/files/run/view-iterator-stream.scala3
-rw-r--r--test/files/run/virtpatmat_alts.check6
-rw-r--r--test/files/run/virtpatmat_alts.flags1
-rw-r--r--test/files/run/virtpatmat_alts.scala5
-rw-r--r--test/files/run/virtpatmat_nested_lists.check5
-rw-r--r--test/files/run/virtpatmat_nested_lists.flags1
-rw-r--r--test/files/run/virtpatmat_nested_lists.scala3
-rw-r--r--test/files/run/virtpatmat_opt_sharing.check3
-rw-r--r--test/files/run/virtpatmat_opt_sharing.flags1
-rw-r--r--test/files/run/virtpatmat_opt_sharing.scala5
-rw-r--r--test/files/run/virtpatmat_staging.scala7
-rw-r--r--test/files/run/virtpatmat_stringinterp.scala5
-rw-r--r--test/files/run/virtpatmat_try.scala8
-rw-r--r--test/files/run/virtpatmat_typed.check3
-rw-r--r--test/files/run/xml-loop-bug.scala14
-rw-r--r--test/files/specialized/spec-matrix-old.scala2
-rw-r--r--test/files/specialized/spec-super.check5
-rw-r--r--test/files/specialized/spec-t3896.scala2
-rw-r--r--test/files/specialized/tb3651.check5
-rw-r--r--test/files/specialized/tc3651.check5
-rw-r--r--test/files/specialized/td3651.check8
489 files changed, 3300 insertions, 1205 deletions
diff --git a/build.xml b/build.xml
index 075caf0384..ea213d2d6e 100755
--- a/build.xml
+++ b/build.xml
@@ -1782,10 +1782,16 @@ TODO:
<fileset dir="${src.dir}/library"/>
<fileset dir="${src.dir}/continuations/library"/>
</jar>
- <jar whenmanifestonly="fail" destfile="${dist.dir}/src/scala-reflect-src.jar" basedir="${src.dir}/reflect"/>
- <jar whenmanifestonly="fail" destfile="${dist.dir}/src/scala-swing-src.jar" basedir="${src.dir}/swing"/>
- <jar whenmanifestonly="fail" destfile="${dist.dir}/src/scala-compiler-src.jar" basedir="${src.dir}/compiler"/>
<jar whenmanifestonly="fail" destfile="${dist.dir}/src/scala-actors-src.jar" basedir="${src.dir}/actors"/>
+ <jar whenmanifestonly="fail" destfile="${dist.dir}/src/scala-compiler-src.jar">
+ <fileset dir="${src.dir}/compiler"/>
+ <fileset dir="${src.dir}/repl"/>
+ <fileset dir="${src.dir}/scaladoc"/>
+ <fileset dir="${src.dir}/interactive"/>
+ <fileset dir="${src.dir}/continuations/plugin"/>
+ </jar>
+ <jar whenmanifestonly="fail" destfile="${dist.dir}/src/scala-swing-src.jar" basedir="${src.dir}/swing"/>
+ <jar whenmanifestonly="fail" destfile="${dist.dir}/src/scala-reflect-src.jar" basedir="${src.dir}/reflect"/>
<jar whenmanifestonly="fail" destfile="${dist.dir}/src/scalap-src.jar" basedir="${src.dir}/scalap"/>
<jar whenmanifestonly="fail" destfile="${dist.dir}/src/scala-partest-src.jar" basedir="${src.dir}/partest"/>
</target>
diff --git a/src/actors/scala/actors/scheduler/ForkJoinScheduler.scala b/src/actors/scala/actors/scheduler/ForkJoinScheduler.scala
index ac123cfe26..75a98db6c8 100644
--- a/src/actors/scala/actors/scheduler/ForkJoinScheduler.scala
+++ b/src/actors/scala/actors/scheduler/ForkJoinScheduler.scala
@@ -63,7 +63,7 @@ class ForkJoinScheduler(val initCoreSize: Int, val maxSize: Int, daemon: Boolean
while (true) {
this.synchronized {
try {
- wait(CHECK_FREQ)
+ wait(CHECK_FREQ.toLong)
} catch {
case _: InterruptedException =>
}
diff --git a/src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala b/src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala
index 2c4b7677b0..342579db6c 100644
--- a/src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala
+++ b/src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala
@@ -103,7 +103,7 @@ class ResizableThreadPoolScheduler(protected val terminate: Boolean,
while (true) {
this.synchronized {
try {
- wait(CHECK_FREQ)
+ wait(CHECK_FREQ.toLong)
} catch {
case _: InterruptedException =>
}
diff --git a/src/actors/scala/actors/scheduler/TerminationService.scala b/src/actors/scala/actors/scheduler/TerminationService.scala
index 280c8f4131..ed1805ee1e 100644
--- a/src/actors/scala/actors/scheduler/TerminationService.scala
+++ b/src/actors/scala/actors/scheduler/TerminationService.scala
@@ -39,7 +39,7 @@ private[scheduler] trait TerminationService extends TerminationMonitor {
while (true) {
this.synchronized {
try {
- wait(CHECK_FREQ)
+ wait(CHECK_FREQ.toLong)
} catch {
case _: InterruptedException =>
}
diff --git a/src/compiler/scala/reflect/reify/phases/Metalevels.scala b/src/compiler/scala/reflect/reify/phases/Metalevels.scala
index ea6b5886cc..c69263399f 100644
--- a/src/compiler/scala/reflect/reify/phases/Metalevels.scala
+++ b/src/compiler/scala/reflect/reify/phases/Metalevels.scala
@@ -33,7 +33,7 @@ trait Metalevels {
*
* 1) symbol.metalevel < curr_metalevel. In this case reifier will generate a free variable
* that captures both the name of the symbol (to be compiled successfully) and its value (to be run successfully).
- * For example, x in Example 1 will be reified as follows: Ident(newFreeVar("x", IntClass.tpe, x))
+ * For example, x in Example 1 will be reified as follows: Ident(newFreeVar("x", IntTpe, x))
*
* 2) symbol.metalevel > curr_metalevel. This leads to a metalevel breach that violates intuitive perception of splicing.
* As defined in macro spec, splicing takes a tree and inserts it into another tree - as simple as that.
@@ -72,7 +72,7 @@ trait Metalevels {
* Since the result of the inner reify is wrapped in a splice, it won't be reified
* together with the other parts of the outer reify, but will be inserted into that result verbatim.
*
- * The inner reify produces an Expr[Int] that wraps Ident(freeVar("x", IntClass.tpe, x)).
+ * The inner reify produces an Expr[Int] that wraps Ident(freeVar("x", IntTpe, x)).
* However the freevar the reification points to will vanish when the compiler processes the outer reify.
* That's why we need to replace that freevar with a regular symbol that will point to reified x.
*
diff --git a/src/compiler/scala/tools/nsc/CompileSocket.scala b/src/compiler/scala/tools/nsc/CompileSocket.scala
index 8087a31b45..88d5c31b5d 100644
--- a/src/compiler/scala/tools/nsc/CompileSocket.scala
+++ b/src/compiler/scala/tools/nsc/CompileSocket.scala
@@ -113,7 +113,7 @@ class CompileSocket extends CompileOutputCommon {
*/
def getPort(vmArgs: String): Int = {
val maxPolls = 300
- val sleepTime = 25
+ val sleepTime = 25L
var attempts = 0
var port = pollPort()
@@ -152,9 +152,9 @@ class CompileSocket extends CompileOutputCommon {
* cannot be established.
*/
def getOrCreateSocket(vmArgs: String, create: Boolean = true): Option[Socket] = {
- val maxMillis = 10 * 1000 // try for 10 seconds
- val retryDelay = 50
- val maxAttempts = maxMillis / retryDelay
+ val maxMillis = 10L * 1000 // try for 10 seconds
+ val retryDelay = 50L
+ val maxAttempts = (maxMillis / retryDelay).toInt
def getsock(attempts: Int): Option[Socket] = attempts match {
case 0 => warn("Unable to establish connection to compilation daemon") ; None
diff --git a/src/compiler/scala/tools/nsc/ast/TreeDSL.scala b/src/compiler/scala/tools/nsc/ast/TreeDSL.scala
index 7460d1ab31..b17de9b9d5 100644
--- a/src/compiler/scala/tools/nsc/ast/TreeDSL.scala
+++ b/src/compiler/scala/tools/nsc/ast/TreeDSL.scala
@@ -74,7 +74,7 @@ trait TreeDSL {
if (opSym == NoSymbol) ANY_==(other)
else fn(target, opSym, other)
}
- def ANY_EQ (other: Tree) = OBJ_EQ(other AS ObjectClass.tpe)
+ def ANY_EQ (other: Tree) = OBJ_EQ(other AS ObjectTpe)
def ANY_== (other: Tree) = fn(target, Any_==, other)
def ANY_!= (other: Tree) = fn(target, Any_!=, other)
def OBJ_!= (other: Tree) = fn(target, Object_!=, other)
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
index 76fe76315f..89f933f577 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -2067,7 +2067,7 @@ self =>
if (mods.isLazy) syntaxError("lazy modifier not allowed here. Use call-by-name parameters instead", skipIt = false)
in.token match {
case v @ (VAL | VAR) =>
- mods = mods withPosition (in.token, tokenRange(in))
+ mods = mods withPosition (in.token.toLong, tokenRange(in))
if (v == VAR) mods |= Flags.MUTABLE
in.nextToken()
case _ =>
@@ -2105,7 +2105,7 @@ self =>
expr()
} else EmptyTree
atPos(start, if (name == nme.ERROR) start else nameOffset) {
- ValDef((mods | implicitmod | bynamemod) withAnnotations annots, name.toTermName, tpt, default)
+ ValDef((mods | implicitmod.toLong | bynamemod) withAnnotations annots, name.toTermName, tpt, default)
}
}
def paramClause(): List[ValDef] = {
@@ -2970,7 +2970,7 @@ self =>
def localDef(implicitMod: Int): List[Tree] = {
val annots = annotations(skipNewLines = true)
val pos = in.offset
- val mods = (localModifiers() | implicitMod) withAnnotations annots
+ val mods = (localModifiers() | implicitMod.toLong) withAnnotations annots
val defs =
if (!(mods hasFlag ~(Flags.IMPLICIT | Flags.LAZY))) defOrDcl(pos, mods)
else List(tmplDef(pos, mods))
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala
index 6786d10036..82a3144304 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala
@@ -561,7 +561,7 @@ trait Scanners extends ScannersCommon {
nextChar()
getOperatorRest()
} else {
- syntaxError("illegal character '" + ("" + '\\' + 'u' + "%04x".format(ch: Int)) + "'")
+ syntaxError("illegal character '" + ("" + '\\' + 'u' + "%04x".format(ch.toInt)) + "'")
nextChar()
}
}
@@ -884,7 +884,7 @@ trait Scanners extends ScannersCommon {
*/
def intVal(negated: Boolean): Long = {
if (token == CHARLIT && !negated) {
- charVal
+ charVal.toLong
} else {
var value: Long = 0
val divider = if (base == 10) 1 else 2
diff --git a/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala b/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala
index 2007d799df..b8ddb65de9 100644
--- a/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala
+++ b/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala
@@ -442,15 +442,17 @@ abstract class ScalaPrimitives {
}
def addPrimitives(cls: Symbol, method: Name, code: Int) {
- val tpe = cls.info
- val sym = tpe.member(method)
- if (sym == NoSymbol)
- inform("Unknown primitive method " + cls + "." + method)
- for (s <- sym.alternatives)
- addPrimitive(
- s,
- if (code == ADD && s.info.paramTypes.head == definitions.StringClass.tpe) CONCAT
- else code)
+ val alts = (cls.info member method).alternatives
+ if (alts.isEmpty)
+ inform(s"Unknown primitive method $cls.$method")
+ else alts foreach (s =>
+ addPrimitive(s,
+ s.info.paramTypes match {
+ case tp :: _ if code == ADD && tp =:= StringTpe => CONCAT
+ case _ => code
+ }
+ )
+ )
}
def isCoercion(code: Int): Boolean = (code >= B2B) && (code <= D2D)
diff --git a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
index cc4d97253f..7263a0d0b9 100644
--- a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
+++ b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
@@ -23,12 +23,7 @@ abstract class GenICode extends SubComponent {
import global._
import icodes._
import icodes.opcodes._
- import definitions.{
- ArrayClass, ObjectClass, ThrowableClass, StringClass, StringModule, AnyRefClass,
- Object_equals, Object_isInstanceOf, Object_asInstanceOf, ScalaRunTimeModule,
- BoxedNumberClass, BoxedCharacterClass,
- getMember
- }
+ import definitions._
import scalaPrimitives.{
isArrayOp, isComparisonOp, isLogicalOp,
isUniversalEqualityOp, isReferenceEqualityOp
@@ -182,7 +177,7 @@ abstract class GenICode extends SubComponent {
}
private def genThrow(expr: Tree, ctx: Context): (Context, TypeKind) = {
- require(expr.tpe <:< ThrowableClass.tpe, expr.tpe)
+ require(expr.tpe <:< ThrowableTpe, expr.tpe)
val thrownKind = toTypeKind(expr.tpe)
val ctx1 = genLoad(expr, ctx, thrownKind)
@@ -302,7 +297,7 @@ abstract class GenICode extends SubComponent {
}
private def genSynchronized(tree: Apply, ctx: Context, expectedType: TypeKind): (Context, TypeKind) = {
val Apply(fun, args) = tree
- val monitor = ctx.makeLocal(tree.pos, ObjectClass.tpe, "monitor")
+ val monitor = ctx.makeLocal(tree.pos, ObjectTpe, "monitor")
var monitorResult: Local = null
val argTpe = args.head.tpe
val hasResult = expectedType != UNIT
@@ -1468,7 +1463,7 @@ abstract class GenICode extends SubComponent {
*/
def genEqEqPrimitive(l: Tree, r: Tree, ctx: Context)(thenCtx: Context, elseCtx: Context): Boolean = {
def getTempLocal = ctx.method.lookupLocal(nme.EQEQ_LOCAL_VAR) getOrElse {
- ctx.makeLocal(l.pos, AnyRefClass.tpe, nme.EQEQ_LOCAL_VAR.toString)
+ ctx.makeLocal(l.pos, AnyRefTpe, nme.EQEQ_LOCAL_VAR.toString)
}
/* True if the equality comparison is between values that require the use of the rich equality
@@ -2039,7 +2034,7 @@ abstract class GenICode extends SubComponent {
this.addActiveHandler(exh) // .. and body aswell
val exhStartCtx = finalizerCtx.enterExceptionHandler(exh)
exhStartCtx.bb killIf outerCtx.bb.ignore
- val exception = exhStartCtx.makeLocal(finalizer.pos, ThrowableClass.tpe, "exc")
+ val exception = exhStartCtx.makeLocal(finalizer.pos, ThrowableTpe, "exc")
loadException(exhStartCtx, exh, finalizer.pos)
exhStartCtx.bb.emit(STORE_LOCAL(exception))
val exhEndCtx = genLoad(finalizer, exhStartCtx, UNIT)
diff --git a/src/compiler/scala/tools/nsc/backend/icode/Opcodes.scala b/src/compiler/scala/tools/nsc/backend/icode/Opcodes.scala
index 925775adb9..57a768d9cb 100644
--- a/src/compiler/scala/tools/nsc/backend/icode/Opcodes.scala
+++ b/src/compiler/scala/tools/nsc/backend/icode/Opcodes.scala
@@ -407,7 +407,7 @@ trait Opcodes { self: ICodes =>
* there's been a serious misunderstanding
*/
// TODO do the real thing
- case class INVOKE_DYNAMIC(poolEntry: Char) extends Instruction {
+ case class INVOKE_DYNAMIC(poolEntry: Int) extends Instruction {
private def error = sys.error("INVOKE_DYNAMIC is not fully implemented and should not be analyzed")
override def consumed = error
override def produced = error
diff --git a/src/compiler/scala/tools/nsc/backend/icode/analysis/CopyPropagation.scala b/src/compiler/scala/tools/nsc/backend/icode/analysis/CopyPropagation.scala
index 192890a509..0c3f92f13f 100644
--- a/src/compiler/scala/tools/nsc/backend/icode/analysis/CopyPropagation.scala
+++ b/src/compiler/scala/tools/nsc/backend/icode/analysis/CopyPropagation.scala
@@ -457,7 +457,7 @@ abstract class CopyPropagation {
final def simulateCall(state: copyLattice.State, method: Symbol, static: Boolean): copyLattice.State = {
val out = new copyLattice.State(state.bindings, state.stack)
out.stack = out.stack.drop(method.info.paramTypes.length + (if (static) 0 else 1))
- if (method.info.resultType != definitions.UnitClass.tpe && !method.isConstructor)
+ if (method.info.resultType != definitions.UnitTpe && !method.isConstructor)
out.stack = Unknown :: out.stack
if (!isPureMethod(method))
invalidateRecords(out)
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
index e50b73dcc3..7edcc944e1 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
@@ -1661,8 +1661,8 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
case BooleanTag => jcode.boolconst(const.booleanValue)
- case ByteTag => jcode.iconst(const.byteValue)
- case ShortTag => jcode.iconst(const.shortValue)
+ case ByteTag => jcode.iconst(const.byteValue.toInt)
+ case ShortTag => jcode.iconst(const.shortValue.toInt)
case CharTag => jcode.iconst(const.charValue)
case IntTag => jcode.iconst(const.intValue)
@@ -1709,6 +1709,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
final def boolconst(b: Boolean) { iconst(if(b) 1 else 0) }
+ def iconst(cst: Char) { iconst(cst.toInt) }
def iconst(cst: Int) {
if (cst >= -1 && cst <= 5) {
jmethod.visitInsn(Opcodes.ICONST_0 + cst)
@@ -1859,7 +1860,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
val isDenseEnough: Boolean = {
/* Calculate in long to guard against overflow. TODO what overflow??? */
val keyRangeD: Double = (keyMax.asInstanceOf[Long] - keyMin + 1).asInstanceOf[Double]
- val klenD: Double = keys.length
+ val klenD: Double = keys.length.toDouble
val kdensity: Double = (klenD / keyRangeD)
kdensity >= minDensity
diff --git a/src/compiler/scala/tools/nsc/io/Lexer.scala b/src/compiler/scala/tools/nsc/io/Lexer.scala
index 7c6dbe2e60..1c926aff6b 100644
--- a/src/compiler/scala/tools/nsc/io/Lexer.scala
+++ b/src/compiler/scala/tools/nsc/io/Lexer.scala
@@ -23,7 +23,7 @@ object Lexer {
/** A subclass of `Token` representing single-character delimiters
* @param char the delimiter character making up this token
*/
- case class Delim(char: Char) extends Token("'"+char.toString+"'")
+ case class Delim(char: Char) extends Token(s"'$char'")
/** A subclass of token representing integer literals */
case class IntLit(override val str: String) extends Token(str)
@@ -88,7 +88,7 @@ object Lexer {
case '\\' => buf ++= "\\\\"
case _ =>
if (' ' <= ch && ch < 128) buf += ch
- else buf ++= "\\u" += toUDigit(ch >>> 12) += toUDigit(ch >>> 8) += toUDigit(ch >>> 4) += toUDigit(ch)
+ else buf ++= "\\u" += toUDigit(ch >>> 12) += toUDigit(ch >>> 8) += toUDigit(ch >>> 4) += toUDigit(ch.toInt)
}
}
diff --git a/src/compiler/scala/tools/nsc/io/PrettyWriter.scala b/src/compiler/scala/tools/nsc/io/PrettyWriter.scala
index acd4847469..11d3703983 100644
--- a/src/compiler/scala/tools/nsc/io/PrettyWriter.scala
+++ b/src/compiler/scala/tools/nsc/io/PrettyWriter.scala
@@ -16,7 +16,7 @@ class PrettyWriter(wr: Writer) extends Writer {
str(off) match {
case '{' | '[' | '(' =>
indent += 1
- wr.write(str(off))
+ wr.write(str(off).toInt)
newLine()
wr.write(str, off + 1, len - 1)
case '}' | ']' | ')' =>
diff --git a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala
index 1eecca28c5..2a799acbc7 100644
--- a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala
+++ b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala
@@ -251,15 +251,15 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
def basicType(): Tree =
atPos(in.pos) {
in.token match {
- case BYTE => in.nextToken(); TypeTree(ByteClass.tpe)
- case SHORT => in.nextToken(); TypeTree(ShortClass.tpe)
- case CHAR => in.nextToken(); TypeTree(CharClass.tpe)
- case INT => in.nextToken(); TypeTree(IntClass.tpe)
- case LONG => in.nextToken(); TypeTree(LongClass.tpe)
- case FLOAT => in.nextToken(); TypeTree(FloatClass.tpe)
- case DOUBLE => in.nextToken(); TypeTree(DoubleClass.tpe)
- case BOOLEAN => in.nextToken(); TypeTree(BooleanClass.tpe)
- case _ => syntaxError("illegal start of type", skipIt = true); errorTypeTree
+ case BYTE => in.nextToken(); TypeTree(ByteTpe)
+ case SHORT => in.nextToken(); TypeTree(ShortTpe)
+ case CHAR => in.nextToken(); TypeTree(CharTpe)
+ case INT => in.nextToken(); TypeTree(IntTpe)
+ case LONG => in.nextToken(); TypeTree(LongTpe)
+ case FLOAT => in.nextToken(); TypeTree(FloatTpe)
+ case DOUBLE => in.nextToken(); TypeTree(DoubleTpe)
+ case BOOLEAN => in.nextToken(); TypeTree(BooleanTpe)
+ case _ => syntaxError("illegal start of type", skipIt = true); errorTypeTree
}
}
@@ -462,7 +462,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
var rtpt =
if (isVoid) {
in.nextToken()
- TypeTree(UnitClass.tpe) setPos in.pos
+ TypeTree(UnitTpe) setPos in.pos
} else typ()
var pos = in.currentPos
val rtptName = rtpt match {
@@ -785,7 +785,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
blankExpr),
DefDef(
Modifiers(Flags.JAVA | Flags.STATIC), nme.valueOf, List(),
- List(List(makeParam("x", TypeTree(StringClass.tpe)))),
+ List(List(makeParam("x", TypeTree(StringTpe)))),
enumType,
blankExpr))
accept(RBRACE)
diff --git a/src/compiler/scala/tools/nsc/javac/JavaScanners.scala b/src/compiler/scala/tools/nsc/javac/JavaScanners.scala
index f9b1e57e66..e987b6de2f 100644
--- a/src/compiler/scala/tools/nsc/javac/JavaScanners.scala
+++ b/src/compiler/scala/tools/nsc/javac/JavaScanners.scala
@@ -724,7 +724,7 @@ trait JavaScanners extends ast.parser.ScannersCommon {
*/
def intVal(negated: Boolean): Long = {
if (token == CHARLIT && !negated) {
- if (name.length > 0) name.charAt(0) else 0
+ if (name.length > 0) name.charAt(0).toLong else 0
} else {
var value: Long = 0
val divider = if (base == 10) 1 else 2
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
index 9afa1ba10d..6948d02fd5 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
@@ -57,9 +57,9 @@ abstract class ClassfileParser {
// They are an unsigned byte, unsigned char, and unsigned int respectively.
// We bitmask u1 into an Int to make sure it's 0-255 (and u1 isn't used
// for much beyond tags) but leave u2 alone as it's already unsigned.
- protected final def u1(): Int = in.nextByte & 0xFF
- protected final def u2(): Char = in.nextChar
- protected final def u4(): Int = in.nextInt
+ protected final def u1(): Int = in.nextByte & 0xFF
+ protected final def u2(): Int = in.nextChar.toInt
+ protected final def u4(): Int = in.nextInt
private def readInnerClassFlags() = readClassFlags()
private def readClassFlags() = JavaAccFlags classFlags u2
@@ -145,7 +145,7 @@ abstract class ClassfileParser {
while (i < starts.length) {
starts(i) = in.bp
i += 1
- (u1.toInt: @switch) match {
+ (u1: @switch) match {
case CONSTANT_UTF8 | CONSTANT_UNICODE => in skip u2
case CONSTANT_CLASS | CONSTANT_STRING | CONSTANT_METHODTYPE => in skip 2
case CONSTANT_METHODHANDLE => in skip 3
@@ -177,7 +177,7 @@ abstract class ClassfileParser {
case name: Name => name
case _ =>
val start = firstExpecting(index, CONSTANT_UTF8)
- recordAtIndex(newTermName(in.buf, start + 2, in.getChar(start)), index)
+ recordAtIndex(newTermName(in.buf, start + 2, in.getChar(start).toInt), index)
}
)
@@ -210,7 +210,7 @@ abstract class ClassfileParser {
*/
def getClassName(index: Int): Name = {
val start = firstExpecting(index, CONSTANT_CLASS)
- getExternalName(in getChar start)
+ getExternalName((in getChar start).toInt)
}
/** Return the symbol of the class member at `index`.
@@ -231,16 +231,16 @@ abstract class ClassfileParser {
if (first != CONSTANT_FIELDREF &&
first != CONSTANT_METHODREF &&
first != CONSTANT_INTFMETHODREF) errorBadTag(start)
- val ownerTpe = getClassOrArrayType(in.getChar(start + 1))
+ val ownerTpe = getClassOrArrayType(in.getChar(start + 1).toInt)
debuglog("getMemberSymbol(static: " + static + "): owner type: " + ownerTpe + " " + ownerTpe.typeSymbol.originalName)
- val (name0, tpe0) = getNameAndType(in.getChar(start + 3), ownerTpe)
+ val (name0, tpe0) = getNameAndType(in.getChar(start + 3).toInt, ownerTpe)
debuglog("getMemberSymbol: name and tpe: " + name0 + ": " + tpe0)
forceMangledName(tpe0.typeSymbol.name, module = false)
- val (name, tpe) = getNameAndType(in.getChar(start + 3), ownerTpe)
+ val (name, tpe) = getNameAndType(in.getChar(start + 3).toInt, ownerTpe)
if (name == nme.MODULE_INSTANCE_FIELD) {
- val index = in.getChar(start + 1)
- val name = getExternalName(in.getChar(starts(index) + 1))
+ val index = in.getChar(start + 1).toInt
+ val name = getExternalName(in.getChar(starts(index).toInt + 1).toInt)
//assert(name.endsWith("$"), "Not a module class: " + name)
f = forceMangledName(name dropRight 1, module = true)
if (f == NoSymbol)
@@ -335,6 +335,7 @@ abstract class ClassfileParser {
case _ => errorBadTag(start)
})
}
+ def getConstant(index: Char): Constant = getConstant(index.toInt)
def getConstant(index: Int): Constant = (
if (index <= 0 || len <= index) errorBadIndex(index)
else values(index) match {
@@ -358,7 +359,7 @@ abstract class ClassfileParser {
case xs: Array[Byte] => xs
case _ =>
val start = firstExpecting(index, CONSTANT_UTF8)
- val len = in getChar start
+ val len = (in getChar start).toInt
val bytes = new Array[Byte](len)
System.arraycopy(in.buf, start + 2, bytes, 0, len)
recordAtIndex(getSubArray(bytes), index)
@@ -373,7 +374,7 @@ abstract class ClassfileParser {
val arr: Array[Byte] = indices.toArray flatMap { index =>
if (index <= 0 || ConstantPool.this.len <= index) errorBadIndex(index)
val start = firstExpecting(index, CONSTANT_UTF8)
- val len = in getChar start
+ val len = (in getChar start).toInt
in.buf drop start + 2 take len
}
recordAtIndex(getSubArray(arr), head)
@@ -478,7 +479,7 @@ abstract class ClassfileParser {
u2 // skip superclass
val ifaces = u2
in.bp += ifaces * 2 // .. and iface count interfaces
- List(AnyRefClass.tpe) // dummy superclass, will be replaced by pickled information
+ List(AnyRefTpe) // dummy superclass, will be replaced by pickled information
}
else raiseLoaderLevel {
val superType = if (jflags.isAnnotation) { u2; AnnotationClass.tpe }
@@ -657,15 +658,15 @@ abstract class ClassfileParser {
def sig2type(tparams: immutable.Map[Name,Symbol], skiptvs: Boolean): Type = {
val tag = sig.charAt(index); index += 1
tag match {
- case BYTE_TAG => ByteClass.tpe
- case CHAR_TAG => CharClass.tpe
- case DOUBLE_TAG => DoubleClass.tpe
- case FLOAT_TAG => FloatClass.tpe
- case INT_TAG => IntClass.tpe
- case LONG_TAG => LongClass.tpe
- case SHORT_TAG => ShortClass.tpe
- case VOID_TAG => UnitClass.tpe
- case BOOL_TAG => BooleanClass.tpe
+ case BYTE_TAG => ByteTpe
+ case CHAR_TAG => CharTpe
+ case DOUBLE_TAG => DoubleTpe
+ case FLOAT_TAG => FloatTpe
+ case INT_TAG => IntTpe
+ case LONG_TAG => LongTpe
+ case SHORT_TAG => ShortTpe
+ case VOID_TAG => UnitTpe
+ case BOOL_TAG => BooleanTpe
case 'L' =>
def processInner(tp: Type): Type = tp match {
case TypeRef(pre, sym, args) if (!sym.isStatic) =>
@@ -739,8 +740,8 @@ abstract class ClassfileParser {
// NOTE that the comparison to Object only works for abstract types bounded by classes that are strict subclasses of Object
// if the bound is exactly Object, it will have been converted to Any, and the comparison will fail
// see also RestrictJavaArraysMap (when compiling java sources directly)
- if (elemtp.typeSymbol.isAbstractType && !(elemtp <:< ObjectClass.tpe)) {
- elemtp = intersectionType(List(elemtp, ObjectClass.tpe))
+ if (elemtp.typeSymbol.isAbstractType && !(elemtp <:< ObjectTpe)) {
+ elemtp = intersectionType(List(elemtp, ObjectTpe))
}
arrayType(elemtp)
@@ -761,7 +762,7 @@ abstract class ClassfileParser {
case 'T' =>
val n = subName(';'.==).toTypeName
index += 1
- if (skiptvs) AnyClass.tpe
+ if (skiptvs) AnyTpe
else tparams(n).typeConstructor
}
} // sig2type(tparams, skiptvs)
@@ -951,7 +952,7 @@ abstract class ClassfileParser {
for (i <- 0 until stringCount) yield {
val stag = u1
assert(stag == STRING_TAG, stag)
- u2.toInt
+ u2
}
Some(ScalaSigBytes(pool.getBytes(entries.toList)))
}
@@ -959,7 +960,7 @@ abstract class ClassfileParser {
/* Parse and return a single annotation. If it is malformed,
* return None.
*/
- def parseAnnotation(attrNameIndex: Char): Option[AnnotationInfo] = try {
+ def parseAnnotation(attrNameIndex: Int): Option[AnnotationInfo] = try {
val attrType = pool.getType(attrNameIndex)
val nargs = u2
val nvpairs = new ListBuffer[(Name, ClassfileAnnotArg)]
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
index 52ebb3b0a2..01a117895f 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
@@ -505,7 +505,7 @@ abstract class ICodeReader extends ClassfileParser {
// TODO, this is just a place holder. A real implementation must parse the class constant entry
debuglog("Found JVM invokedynamic instructionm, inserting place holder ICode INVOKE_DYNAMIC.")
containsInvokeDynamic = true
- val poolEntry = in.nextChar
+ val poolEntry = in.nextChar.toInt
in.skip(2)
code.emit(INVOKE_DYNAMIC(poolEntry))
@@ -919,6 +919,7 @@ abstract class ICodeReader extends ClassfileParser {
}
/** Return the local at given index, with the given type. */
+ def getLocal(idx: Char, kind: TypeKind): Local = getLocal(idx.toInt, kind)
def getLocal(idx: Int, kind: TypeKind): Local = {
assert(idx < maxLocals, "Index too large for local variable.")
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala
index a5619871e6..3265af9f5b 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala
@@ -632,7 +632,7 @@ abstract class Pickler extends SubComponent {
case c @ Constant(_) =>
if (c.tag == BooleanTag) writeLong(if (c.booleanValue) 1 else 0)
else if (ByteTag <= c.tag && c.tag <= LongTag) writeLong(c.longValue)
- else if (c.tag == FloatTag) writeLong(floatToIntBits(c.floatValue))
+ else if (c.tag == FloatTag) writeLong(floatToIntBits(c.floatValue).toLong)
else if (c.tag == DoubleTag) writeLong(doubleToLongBits(c.doubleValue))
else if (c.tag == StringTag) writeRef(newTermName(c.stringValue))
else if (c.tag == ClazzTag) writeRef(c.typeValue)
diff --git a/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala b/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala
index ba75f40a3a..0dcf4d00b7 100644
--- a/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala
+++ b/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala
@@ -143,7 +143,7 @@ abstract class AddInterfaces extends InfoTransform { self: Erasure =>
decls enter (
implClass.newMethod(nme.MIXIN_CONSTRUCTOR, implClass.pos)
- setInfo MethodType(Nil, UnitClass.tpe)
+ setInfo MethodType(Nil, UnitTpe)
)
}
@@ -189,7 +189,7 @@ abstract class AddInterfaces extends InfoTransform { self: Erasure =>
case ClassInfoType(parents, decls, _) =>
assert(phase == implClassPhase, tp)
// Impl class parents: Object first, matching interface last.
- val implParents = ObjectClass.tpe +: (parents.tail map mixinToImplClass filter (_.typeSymbol != ObjectClass)) :+ iface.tpe
+ val implParents = ObjectTpe +: (parents.tail map mixinToImplClass filter (_.typeSymbol != ObjectClass)) :+ iface.tpe
ClassInfoType(implParents, implDecls(implSym, decls), implSym)
case PolyType(_, restpe) =>
implType(restpe)
@@ -209,7 +209,7 @@ abstract class AddInterfaces extends InfoTransform { self: Erasure =>
case Nil => Nil
case hd :: tl =>
assert(!hd.typeSymbol.isTrait, clazz)
- if (clazz.isTrait) erasedTypeRef(ObjectClass) :: tl
+ if (clazz.isTrait) ObjectTpe :: tl
else parents
}
val decls1 = scopeTransform(clazz)(
diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala
index d159408f55..a37ef29355 100644
--- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala
+++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala
@@ -78,7 +78,7 @@ abstract class CleanUp extends Transform with ast.TreeDSL {
if (isFinal) FINAL else 0
)
- val varSym = currentClass.newVariable(mkTerm("" + forName), ad.pos, flags) setInfoAndEnter forType
+ val varSym = currentClass.newVariable(mkTerm("" + forName), ad.pos, flags.toLong) setInfoAndEnter forType
if (!isFinal)
varSym.addAnnotation(VolatileAttr)
@@ -169,11 +169,11 @@ abstract class CleanUp extends Transform with ast.TreeDSL {
def testForName(name: Name): Tree => Tree = t => (
if (nme.CommonOpNames(name))
- gen.mkMethodCall(definitions.Boxes_isNumberOrBool, t :: Nil)
+ gen.mkMethodCall(Boxes_isNumberOrBool, t :: Nil)
else if (nme.BooleanOpNames(name))
t IS_OBJ BoxedBooleanClass.tpe
else
- gen.mkMethodCall(definitions.Boxes_isNumber, t :: Nil)
+ gen.mkMethodCall(Boxes_isNumber, t :: Nil)
)
/* The Tree => Tree function in the return is necessary to prevent the original qual
@@ -188,7 +188,7 @@ abstract class CleanUp extends Transform with ast.TreeDSL {
else if (params.tail.isEmpty) nme.primitiveInfixMethodName(name)
else nme.NO_NAME
)
- definitions.getDeclIfDefined(BoxesRunTimeClass, methodName) match {
+ getDeclIfDefined(BoxesRunTimeClass, methodName) match {
case NoSymbol => None
case sym => assert(!sym.isOverloaded, sym) ; Some((sym, testForName(name)))
}
@@ -226,11 +226,11 @@ abstract class CleanUp extends Transform with ast.TreeDSL {
// If there's any chance this signature could be met by an Array.
val isArrayMethodSignature = {
def typesMatchApply = paramTypes match {
- case List(tp) => tp <:< IntClass.tpe
+ case List(tp) => tp <:< IntTpe
case _ => false
}
def typesMatchUpdate = paramTypes match {
- case List(tp1, tp2) => (tp1 <:< IntClass.tpe) && isMaybeUnit
+ case List(tp1, tp2) => (tp1 <:< IntTpe) && isMaybeUnit
case _ => false
}
@@ -267,7 +267,7 @@ abstract class CleanUp extends Transform with ast.TreeDSL {
val invokeName = MethodClass.tpe member nme.invoke_ // scala.reflect.Method.invoke(...)
def cache = REF(reflectiveMethodCache(ad.symbol.name.toString, paramTypes)) // cache Symbol
def lookup = Apply(cache, List(qual1() GETCLASS())) // get Method object from cache
- def invokeArgs = ArrayValue(TypeTree(ObjectClass.tpe), params) // args for invocation
+ def invokeArgs = ArrayValue(TypeTree(ObjectTpe), params) // args for invocation
def invocation = (lookup DOT invokeName)(qual1(), invokeArgs) // .invoke(qual1, ...)
// exception catching machinery
diff --git a/src/compiler/scala/tools/nsc/transform/Constructors.scala b/src/compiler/scala/tools/nsc/transform/Constructors.scala
index 5079108c27..385bf2dade 100644
--- a/src/compiler/scala/tools/nsc/transform/Constructors.scala
+++ b/src/compiler/scala/tools/nsc/transform/Constructors.scala
@@ -165,7 +165,7 @@ abstract class Constructors extends Transform with ast.TreeDSL {
from.tpe.typeSymbol.isPrimitiveValueClass) result
else localTyper.typedPos(to.pos) {
// `throw null` has the same effect as `throw new NullPointerException`, see JVM spec on instruction `athrow`
- IF (from OBJ_EQ NULL) THEN Throw(gen.mkZero(ThrowableClass.tpe)) ELSE result
+ IF (from OBJ_EQ NULL) THEN Throw(gen.mkZero(ThrowableTpe)) ELSE result
}
}
@@ -469,10 +469,10 @@ abstract class Constructors extends Transform with ast.TreeDSL {
val methodName = currentUnit.freshTermName("delayedEndpoint$" + clazz.fullNameAsName('$').toString + "$")
val methodSym = clazz.newMethod(methodName, impl.pos, SYNTHETIC | FINAL)
- methodSym setInfoAndEnter MethodType(Nil, UnitClass.tpe)
+ methodSym setInfoAndEnter MethodType(Nil, UnitTpe)
// changeOwner needed because the `stats` contained in the DefDef were owned by the template, not long ago.
- val blk = Block(stats, gen.mkZero(UnitClass.tpe)).changeOwner(impl.symbol -> methodSym)
+ val blk = Block(stats, gen.mkZero(UnitTpe)).changeOwner(impl.symbol -> methodSym)
val delayedDD = localTyper typed { DefDef(methodSym, Nil, blk) }
delayedDD.asInstanceOf[DefDef]
@@ -495,7 +495,7 @@ abstract class Constructors extends Transform with ast.TreeDSL {
val applyMethod: MethodSymbol = (
closureClass
newMethod(nme.apply, impl.pos, FINAL)
- setInfoAndEnter MethodType(Nil, ObjectClass.tpe)
+ setInfoAndEnter MethodType(Nil, ObjectTpe)
)
val outerFieldDef = ValDef(outerField)
val closureClassTyper = localTyper.atOwner(closureClass)
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala
index ac79c60254..c9a7cc2e3f 100644
--- a/src/compiler/scala/tools/nsc/transform/Erasure.scala
+++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala
@@ -111,7 +111,7 @@ abstract class Erasure extends AddInterfaces
if (tpe1 eq tpe) t
else ExistentialType(tparams, tpe1)
case t =>
- if (boxedClass contains t.typeSymbol) ObjectClass.tpe
+ if (boxedClass contains t.typeSymbol) ObjectTpe
else tp
}
def apply(tp: Type): Type = tp.dealiasWiden match {
@@ -123,16 +123,16 @@ abstract class Erasure extends AddInterfaces
case tp1 @ TypeRef(pre, sym, args) =>
def argApply(tp: Type) = {
val tp1 = apply(tp)
- if (tp1.typeSymbol == UnitClass) ObjectClass.tpe
+ if (tp1.typeSymbol == UnitClass) ObjectTpe
else squashBoxed(tp1)
}
if (sym == ArrayClass && args.nonEmpty)
- if (unboundedGenericArrayLevel(tp1) == 1) ObjectClass.tpe
+ if (unboundedGenericArrayLevel(tp1) == 1) ObjectTpe
else mapOver(tp1)
else if (sym == AnyClass || sym == AnyValClass || sym == SingletonClass)
- ObjectClass.tpe
+ ObjectTpe
else if (sym == UnitClass)
- BoxedUnitClass.tpe
+ BoxedUnitTpe
else if (sym == NothingClass)
RuntimeNothingClass.tpe
else if (sym == NullClass)
@@ -145,7 +145,7 @@ abstract class Erasure extends AddInterfaces
}
case tp1 @ MethodType(params, restpe) =>
val params1 = mapOver(params)
- val restpe1 = if (restpe.typeSymbol == UnitClass) UnitClass.tpe else apply(restpe)
+ val restpe1 = if (restpe.typeSymbol == UnitClass) UnitTpe else apply(restpe)
if ((params1 eq params) && (restpe1 eq restpe)) tp1
else MethodType(params1, restpe1)
case tp1 @ RefinedType(parents, decls) =>
@@ -182,7 +182,7 @@ abstract class Erasure extends AddInterfaces
// java is unthrilled about seeing interfaces inherit from classes
val ok = parents filter (p => p.typeSymbol.isTrait || p.typeSymbol.isInterface)
// traits should always list Object.
- if (ok.isEmpty || ok.head.typeSymbol != ObjectClass) ObjectClass.tpe :: ok
+ if (ok.isEmpty || ok.head.typeSymbol != ObjectClass) ObjectTpe :: ok
else ok
}
else parents
@@ -193,7 +193,7 @@ abstract class Erasure extends AddInterfaces
def boundsSig(bounds: List[Type]) = {
val (isTrait, isClass) = bounds partition (_.typeSymbol.isTrait)
val classPart = isClass match {
- case Nil => ":" // + boxedSig(ObjectClass.tpe)
+ case Nil => ":" // + boxedSig(ObjectTpe)
case x :: _ => ":" + boxedSig(x)
}
classPart :: (isTrait map boxedSig) mkString ":"
@@ -220,8 +220,8 @@ abstract class Erasure extends AddInterfaces
def argSig(tp: Type) =
if (existentiallyBound contains tp.typeSymbol) {
val bounds = tp.typeSymbol.info.bounds
- if (!(AnyRefClass.tpe <:< bounds.hi)) "+" + boxedSig(bounds.hi)
- else if (!(bounds.lo <:< NullClass.tpe)) "-" + boxedSig(bounds.lo)
+ if (!(AnyRefTpe <:< bounds.hi)) "+" + boxedSig(bounds.hi)
+ else if (!(bounds.lo <:< NullTpe)) "-" + boxedSig(bounds.lo)
else "*"
} else {
boxedSig(tp)
@@ -247,7 +247,7 @@ abstract class Erasure extends AddInterfaces
// If args isEmpty, Array is being used as a type constructor
if (sym == ArrayClass && args.nonEmpty) {
- if (unboundedGenericArrayLevel(tp) == 1) jsig(ObjectClass.tpe)
+ if (unboundedGenericArrayLevel(tp) == 1) jsig(ObjectTpe)
else ARRAY_TAG.toString+(args map (jsig(_))).mkString
}
else if (isTypeParameterInSig(sym, sym0)) {
@@ -255,16 +255,16 @@ abstract class Erasure extends AddInterfaces
"" + TVAR_TAG + sym.name + ";"
}
else if (sym == AnyClass || sym == AnyValClass || sym == SingletonClass)
- jsig(ObjectClass.tpe)
+ jsig(ObjectTpe)
else if (sym == UnitClass)
- jsig(BoxedUnitClass.tpe)
+ jsig(BoxedUnitTpe)
else if (sym == NothingClass)
jsig(RuntimeNothingClass.tpe)
else if (sym == NullClass)
jsig(RuntimeNullClass.tpe)
else if (isPrimitiveValueClass(sym)) {
- if (!primitiveOK) jsig(ObjectClass.tpe)
- else if (sym == UnitClass) jsig(BoxedUnitClass.tpe)
+ if (!primitiveOK) jsig(ObjectTpe)
+ else if (sym == UnitClass) jsig(BoxedUnitTpe)
else abbrvTag(sym).toString
}
else if (sym.isDerivedValueClass) {
@@ -568,7 +568,7 @@ abstract class Erasure extends AddInterfaces
log(s"boxing an unbox: ${tree.symbol} -> ${arg.tpe}")
arg
case _ =>
- (REF(boxMethod(x)) APPLY tree) setPos (tree.pos) setType ObjectClass.tpe
+ (REF(boxMethod(x)) APPLY tree) setPos (tree.pos) setType ObjectTpe
}
}
}
@@ -688,7 +688,7 @@ abstract class Erasure extends AddInterfaces
tree match {
case Apply(TypeApply(sel @ Select(qual, name), List(targ)), List())
if tree.symbol == Any_asInstanceOf =>
- val qual1 = typedQualifier(qual, NOmode, ObjectClass.tpe) // need to have an expected type, see #3037
+ val qual1 = typedQualifier(qual, NOmode, ObjectTpe) // need to have an expected type, see #3037
if (isPrimitiveValueType(targ.tpe) || isErasedValueType(targ.tpe)) {
val noNullCheckNeeded = targ.tpe match {
@@ -704,7 +704,7 @@ abstract class Erasure extends AddInterfaces
val untyped =
// util.trace("new asinstanceof test") {
gen.evalOnce(qual1, context.owner, context.unit) { qual =>
- If(Apply(Select(qual(), nme.eq), List(Literal(Constant(null)) setType NullClass.tpe)),
+ If(Apply(Select(qual(), nme.eq), List(Literal(Constant(null)) setType NullTpe)),
Literal(Constant(null)) setType targ.tpe,
unbox(qual(), targ.tpe))
}
@@ -974,7 +974,6 @@ abstract class Erasure extends AddInterfaces
case Select(qual, _) => qual
case TypeApply(Select(qual, _), _) => qual
}
-
def preEraseAsInstanceOf = {
(fn: @unchecked) match {
case TypeApply(Select(qual, _), List(targ)) =>
@@ -991,7 +990,7 @@ abstract class Erasure extends AddInterfaces
def preEraseIsInstanceOf = {
fn match {
case TypeApply(sel @ Select(qual, name), List(targ)) =>
- if (qual.tpe != null && isPrimitiveValueClass(qual.tpe.typeSymbol) && targ.tpe != null && targ.tpe <:< AnyRefClass.tpe)
+ if (qual.tpe != null && isPrimitiveValueClass(qual.tpe.typeSymbol) && targ.tpe != null && targ.tpe <:< AnyRefTpe)
unit.error(sel.pos, "isInstanceOf cannot test if value types are references.")
def mkIsInstanceOf(q: () => Tree)(tp: Type): Tree =
@@ -1002,7 +1001,7 @@ abstract class Erasure extends AddInterfaces
List()) setPos tree.pos
targ.tpe match {
case SingleType(_, _) | ThisType(_) | SuperType(_, _) =>
- val cmpOp = if (targ.tpe <:< AnyValClass.tpe) Any_equals else Object_eq
+ val cmpOp = if (targ.tpe <:< AnyValTpe) Any_equals else Object_eq
atPos(tree.pos) {
Apply(Select(qual, cmpOp), List(gen.mkAttributedQualifier(targ.tpe)))
}
@@ -1032,8 +1031,9 @@ abstract class Erasure extends AddInterfaces
preEraseAsInstanceOf
} else if (fn.symbol == Any_isInstanceOf) {
preEraseIsInstanceOf
- } else if (fn.symbol.owner.isRefinementClass && !fn.symbol.isOverridingSymbol) {
- // !!! Another spot where we produce overloaded types (see test run/t6301)
+ } else if (fn.symbol.isOnlyRefinementMember) {
+ // !!! Another spot where we produce overloaded types (see test pos/t6301)
+ log(s"${fn.symbol.fullLocationString} originates in refinement class - call will be implemented via reflection.")
ApplyDynamic(qualifier, args) setSymbol fn.symbol setPos tree.pos
} else if (fn.symbol.isMethodWithExtension && !fn.symbol.tpe.isErroneous) {
Apply(gen.mkAttributedRef(extensionMethods.extensionMethod(fn.symbol)), qualifier :: args)
@@ -1161,12 +1161,19 @@ abstract class Erasure extends AddInterfaces
preErase(fun)
case Select(qual, name) =>
- val owner = tree.symbol.owner
- // println("preXform: "+ (tree, tree.symbol, tree.symbol.owner, tree.symbol.owner.isRefinementClass))
+ val sym = tree.symbol
+ val owner = sym.owner
if (owner.isRefinementClass) {
- val overridden = tree.symbol.nextOverriddenSymbol
- assert(overridden != NoSymbol, tree.symbol)
- tree.symbol = overridden
+ sym.allOverriddenSymbols filterNot (_.owner.isRefinementClass) match {
+ case overridden :: _ =>
+ log(s"${sym.fullLocationString} originates in refinement class - replacing with ${overridden.fullLocationString}.")
+ tree.symbol = overridden
+ case Nil =>
+ // Ideally this should not be reached or reachable; anything which would
+ // get here should have been caught in the surrounding Apply.
+ devWarning(s"Failed to rewrite reflective apply - now don't know what to do with " + tree)
+ return treeCopy.Select(tree, gen.mkAttributedCast(qual, qual.tpe.widen), name)
+ }
}
def isAccessible(sym: Symbol) = localTyper.context.isAccessible(sym, sym.owner.thisType)
diff --git a/src/compiler/scala/tools/nsc/transform/LambdaLift.scala b/src/compiler/scala/tools/nsc/transform/LambdaLift.scala
index 868bbb1e42..7888198531 100644
--- a/src/compiler/scala/tools/nsc/transform/LambdaLift.scala
+++ b/src/compiler/scala/tools/nsc/transform/LambdaLift.scala
@@ -304,7 +304,7 @@ abstract class LambdaLift extends InfoTransform {
proxies(owner) =
for (fv <- freeValues.toList) yield {
val proxyName = proxyNames.getOrElse(fv, fv.name)
- val proxy = owner.newValue(proxyName.toTermName, owner.pos, newFlags) setInfo fv.info
+ val proxy = owner.newValue(proxyName.toTermName, owner.pos, newFlags.toLong) setInfo fv.info
if (owner.isClass) owner.info.decls enter proxy
proxy
}
diff --git a/src/compiler/scala/tools/nsc/transform/LazyVals.scala b/src/compiler/scala/tools/nsc/transform/LazyVals.scala
index 69a93b482c..15ca916ac1 100644
--- a/src/compiler/scala/tools/nsc/transform/LazyVals.scala
+++ b/src/compiler/scala/tools/nsc/transform/LazyVals.scala
@@ -277,7 +277,7 @@ abstract class LazyVals extends Transform with TypingTransformers with ast.TreeD
if (bmps.length > n)
bmps(n)
else {
- val sym = meth.newVariable(nme.newBitmapName(nme.BITMAP_NORMAL, n), meth.pos).setInfo(ByteClass.tpe)
+ val sym = meth.newVariable(nme.newBitmapName(nme.BITMAP_NORMAL, n), meth.pos).setInfo(ByteTpe)
enteringTyper {
sym addAnnotation VolatileAttr
}
diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala
index 7fe7947239..eca958fd8d 100644
--- a/src/compiler/scala/tools/nsc/transform/Mixin.scala
+++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala
@@ -213,7 +213,7 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL {
val newFlags = field.flags & ~PrivateLocal | ACCESSOR | lateDEFERRED
val setter = clazz.newMethod(setterName, field.pos, newFlags)
// TODO preserve pre-erasure info?
- setter setInfo MethodType(setter.newSyntheticValueParams(List(field.info)), UnitClass.tpe)
+ setter setInfo MethodType(setter.newSyntheticValueParams(List(field.info)), UnitTpe)
if (field.needsExpandedSetterName)
setter.name = nme.expandedSetterName(setter.name, clazz)
diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
index 90ca157090..cc4b2d544b 100644
--- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
+++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
@@ -52,7 +52,9 @@ import scala.annotation.tailrec
*/
abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
import global._
+ import definitions._
import Flags._
+
/** the name of the phase: */
val phaseName: String = "specialize"
@@ -68,13 +70,6 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
private implicit val typeOrdering: Ordering[Type] = Ordering[String] on ("" + _.typeSymbol.name)
- import definitions.{
- BooleanClass, UnitClass, ArrayClass,
- ScalaValueClasses, isPrimitiveValueClass, isPrimitiveValueType,
- SpecializedClass, UnspecializedClass, AnyRefClass, ObjectClass,
- GroupOfSpecializable, uncheckedVarianceClass, ScalaInlineClass
- }
- import rootMirror.RootClass
/** TODO - this is a lot of maps.
*/
@@ -136,14 +131,14 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
}
}
- // If we replace `isBoundedGeneric` with (tp <:< AnyRefClass.tpe),
+ // If we replace `isBoundedGeneric` with (tp <:< AnyRefTpe),
// then pos/spec-List.scala fails - why? Does this kind of check fail
// for similar reasons? Does `sym.isAbstractType` make a difference?
private def isSpecializedAnyRefSubtype(tp: Type, sym: Symbol) = {
specializedOn(sym).exists(s => !isPrimitiveValueClass(s)) &&
!isPrimitiveValueClass(tp.typeSymbol) &&
isBoundedGeneric(tp)
- //(tp <:< AnyRefClass.tpe)
+ //(tp <:< AnyRefTpe)
}
object TypeEnv {
@@ -164,7 +159,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
def includes(t1: TypeEnv, t2: TypeEnv) = t1 forall {
case (sym, tpe) =>
t2 get sym exists { t2tp =>
- (tpe == t2tp) || !(isPrimitiveValueType(tpe) || isPrimitiveValueType(t2tp)) // u.t.b. (t2tp <:< AnyRefClass.tpe)
+ (tpe == t2tp) || !(isPrimitiveValueType(tpe) || isPrimitiveValueType(t2tp)) // u.t.b. (t2tp <:< AnyRefTpe)
}
}
@@ -180,7 +175,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
env forall { case (tvar, tpe) =>
tvar.isSpecialized && (concreteTypes(tvar) contains tpe) && {
(sym.typeParams contains tvar) ||
- (sym.owner != RootClass && (sym.owner.typeParams contains tvar))
+ (sym.owner != rootMirror.RootClass && (sym.owner.typeParams contains tvar))
}
}
}
@@ -294,7 +289,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
// when searching for a specialized class, take care to map all
// type parameters that are subtypes of AnyRef to AnyRef
val args1 = map2(args, sym.info.typeParams)((tp, orig) =>
- if (isSpecializedAnyRefSubtype(tp, orig)) AnyRefClass.tpe
+ if (isSpecializedAnyRefSubtype(tp, orig)) AnyRefTpe
else tp
)
specializedClass.get((sym, TypeEnv.fromSpecialization(sym, args1))) match {
@@ -333,8 +328,8 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
else {
val (base, cs, ms) = nme.splitSpecializedName(name)
newTermName(base.toString + "$"
- + "m" + ms + types1.map(t => definitions.abbrvTag(t.typeSymbol)).mkString("", "", "")
- + "c" + cs + types2.map(t => definitions.abbrvTag(t.typeSymbol)).mkString("", "", "$sp"))
+ + "m" + ms + types1.map(t => abbrvTag(t.typeSymbol)).mkString("", "", "")
+ + "c" + cs + types2.map(t => abbrvTag(t.typeSymbol)).mkString("", "", "$sp"))
}
)
@@ -360,7 +355,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
specializedOn(sym) map (s => specializesClass(s).tpe) sorted
if (isBoundedGeneric(sym.tpe) && (types contains AnyRefClass))
- reporter.warning(sym.pos, sym + " is always a subtype of " + AnyRefClass.tpe + ".")
+ reporter.warning(sym.pos, sym + " is always a subtype of " + AnyRefTpe + ".")
types
}
@@ -380,7 +375,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
// zip the keys with each permutation to create a TypeEnv.
// If we don't exclude the "all AnyRef" specialization, we will
// incur duplicate members and crash during mixin.
- loop(keys map concreteTypes) filterNot (_ forall (_ <:< AnyRefClass.tpe)) map (xss => Map(keys zip xss: _*))
+ loop(keys map concreteTypes) filterNot (_ forall (_ <:< AnyRefTpe)) map (xss => Map(keys zip xss: _*))
}
/** Does the given 'sym' need to be specialized in the environment 'env'?
@@ -412,7 +407,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
loop(immutable.Set.empty, tpes)
}
def specializedTypeVars(sym: Symbol): immutable.Set[Symbol] = (
- if (definitions.neverHasTypeParameters(sym)) immutable.Set.empty
+ if (neverHasTypeParameters(sym)) immutable.Set.empty
else enteringTyper(specializedTypeVars(sym.info))
)
@@ -454,7 +449,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
sClassMap.getOrElseUpdate(tparam,
tparam.cloneSymbol(sClass, tparam.flags, tparam.name append tpnme.SPECIALIZED_SUFFIX)
- modifyInfo (info => TypeBounds(info.bounds.lo, AnyRefClass.tpe))
+ modifyInfo (info => TypeBounds(info.bounds.lo, AnyRefTpe))
).tpe
}
@@ -488,7 +483,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
foreach2(syms, cloned) { (orig, cln) =>
cln.removeAnnotation(SpecializedClass)
if (env.contains(orig))
- cln modifyInfo (info => TypeBounds(info.bounds.lo, AnyRefClass.tpe))
+ cln modifyInfo (info => TypeBounds(info.bounds.lo, AnyRefTpe))
}
cloned map (_ substInfo (syms, cloned))
}
@@ -497,7 +492,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
* the specialized symbol (class (specialization) or member (normalization)), leaves everything else as-is.
*/
private def mapAnyRefsInSpecSym(env: TypeEnv, origsym: Symbol, specsym: Symbol): TypeEnv = env map {
- case (sym, tp) if tp == AnyRefClass.tpe && sym.owner == origsym => (sym, typeParamSubAnyRef(sym, specsym))
+ case (sym, AnyRefTpe) if sym.owner == origsym => (sym, typeParamSubAnyRef(sym, specsym))
case x => x
}
@@ -505,8 +500,8 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
* the original class, leaves everything else as-is.
*/
private def mapAnyRefsInOrigCls(env: TypeEnv, origcls: Symbol): TypeEnv = env map {
- case (sym, tp) if (tp == AnyRefClass.tpe) && sym.owner == origcls => (sym, sym.tpe)
- case x => x
+ case (sym, AnyRefTpe) if sym.owner == origcls => (sym, sym.tpe)
+ case x => x
}
/** Specialize 'clazz', in the environment `outerEnv`. The outer
@@ -733,7 +728,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
val specSetter = mkAccessor(specVal, specGetter.setterName)
.resetFlag(STABLE)
specSetter.setInfo(MethodType(specSetter.newSyntheticValueParams(List(specVal.info)),
- UnitClass.tpe))
+ UnitTpe))
val origSetter = overrideIn(sClass, m.setter(clazz))
info(origSetter) = Forward(specSetter)
enterMember(specSetter)
@@ -1150,7 +1145,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
)
private def unspecializableClass(tp: Type) = (
- definitions.isRepeatedParamType(tp) // ???
+ isRepeatedParamType(tp) // ???
|| tp.typeSymbol.isJavaDefined
|| tp.typeSymbol.isPackageClass
)
@@ -1744,10 +1739,10 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
}
if (hasSpecializedFields) {
val isSpecializedInstance = sClass :: sClass.parentSymbols exists (_ hasFlag SPECIALIZED)
- val sym = sClass.newMethod(nme.SPECIALIZED_INSTANCE, sClass.pos) setInfoAndEnter MethodType(Nil, BooleanClass.tpe)
+ val sym = sClass.newMethod(nme.SPECIALIZED_INSTANCE, sClass.pos) setInfoAndEnter MethodType(Nil, BooleanTpe)
mbrs += atPos(sym.pos) {
- DefDef(sym, Literal(Constant(isSpecializedInstance)).setType(BooleanClass.tpe)).setType(NoType)
+ DefDef(sym, Literal(Constant(isSpecializedInstance)).setType(BooleanTpe)).setType(NoType)
}
}
mbrs.toList
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
index d7be0ed180..64f4e579e1 100644
--- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala
+++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
@@ -142,7 +142,7 @@ abstract class UnCurry extends InfoTransform
/** Return non-local return key for given method */
private def nonLocalReturnKey(meth: Symbol) =
nonLocalReturnKeys.getOrElseUpdate(meth,
- meth.newValue(unit.freshTermName("nonLocalReturnKey"), meth.pos, SYNTHETIC) setInfo ObjectClass.tpe
+ meth.newValue(unit.freshTermName("nonLocalReturnKey"), meth.pos, SYNTHETIC) setInfo ObjectTpe
)
/** Generate a non-local return throw with given return expression from given method.
@@ -184,7 +184,7 @@ abstract class UnCurry extends InfoTransform
THEN ((ex DOT nme.value)())
ELSE (Throw(Ident(ex)))
)
- val keyDef = ValDef(key, New(ObjectClass.tpe))
+ val keyDef = ValDef(key, New(ObjectTpe))
val tryCatch = Try(body, pat -> rhs)
for (Try(t, catches, _) <- body ; cdef <- catches ; if treeInfo catchesThrowable cdef)
@@ -291,7 +291,7 @@ abstract class UnCurry extends InfoTransform
def getClassTag(tp: Type): Tree = {
val tag = localTyper.resolveClassTag(tree.pos, tp)
// Don't want bottom types getting any further than this (SI-4024)
- if (tp.typeSymbol.isBottomClass) getClassTag(AnyClass.tpe)
+ if (tp.typeSymbol.isBottomClass) getClassTag(AnyTpe)
else if (!tag.isEmpty) tag
else if (tp.bounds.hi ne tp) getClassTag(tp.bounds.hi)
else localTyper.TyperErrorGen.MissingClassTagError(tree, tp)
@@ -547,7 +547,7 @@ abstract class UnCurry extends InfoTransform
def isThrowable(pat: Tree): Boolean = pat match {
case Typed(Ident(nme.WILDCARD), tpt) =>
- tpt.tpe =:= ThrowableClass.tpe
+ tpt.tpe =:= ThrowableTpe
case Bind(_, pat) =>
isThrowable(pat)
case _ =>
@@ -735,7 +735,7 @@ abstract class UnCurry extends InfoTransform
// becomes def foo[T](a: Int, b: Array[Object])
// instead of def foo[T](a: Int, b: Array[T]) ===> def foo[T](a: Int, b: Object)
arrayType(
- if (arg.typeSymbol.isTypeParameterOrSkolem) ObjectClass.tpe
+ if (arg.typeSymbol.isTypeParameterOrSkolem) ObjectTpe
else arg
)
}
diff --git a/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala b/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala
index 68883831a2..f527c30b8a 100644
--- a/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala
+++ b/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala
@@ -19,7 +19,7 @@ trait TreeAndTypeAnalysis extends Debugging {
// we use subtyping as a model for implication between instanceof tests
// i.e., when S <:< T we assume x.isInstanceOf[S] implies x.isInstanceOf[T]
// unfortunately this is not true in general:
- // SI-6022 expects instanceOfTpImplies(ProductClass.tpe, AnyRefClass.tpe)
+ // SI-6022 expects instanceOfTpImplies(ProductClass.tpe, AnyRefTpe)
def instanceOfTpImplies(tp: Type, tpImplied: Type) = {
val tpValue = tp.typeSymbol.isPrimitiveValueClass
@@ -28,7 +28,7 @@ trait TreeAndTypeAnalysis extends Debugging {
// this allows us to reuse subtyping as a model for implication between instanceOf tests
// the latter don't see a difference between AnyRef, Object or Any when comparing non-value types -- SI-6022
val tpImpliedNormalizedToAny =
- if (tpImplied =:= (if (tpValue) AnyValClass.tpe else AnyRefClass.tpe)) AnyClass.tpe
+ if (tpImplied =:= (if (tpValue) AnyValTpe else AnyRefTpe)) AnyTpe
else tpImplied
tp <:< tpImpliedNormalizedToAny
@@ -48,7 +48,7 @@ trait TreeAndTypeAnalysis extends Debugging {
tp.typeSymbol match {
// TODO case _ if tp.isTupleType => // recurse into component types?
case UnitClass =>
- Some(List(UnitClass.tpe))
+ Some(List(UnitTpe))
case BooleanClass =>
Some((List(ConstantType(Constant(true)), ConstantType(Constant(false)))))
// TODO case _ if tp.isTupleType => // recurse into component types
diff --git a/src/compiler/scala/tools/nsc/transform/patmat/MatchCodeGen.scala b/src/compiler/scala/tools/nsc/transform/patmat/MatchCodeGen.scala
index 889615a39f..1e4c56529c 100644
--- a/src/compiler/scala/tools/nsc/transform/patmat/MatchCodeGen.scala
+++ b/src/compiler/scala/tools/nsc/transform/patmat/MatchCodeGen.scala
@@ -128,7 +128,7 @@ trait MatchCodeGen extends Interface {
// __match.guard(`cond`, `res`).flatMap(`nextBinder` => `next`)
def flatMapCond(cond: Tree, res: Tree, nextBinder: Symbol, next: Tree): Tree = flatMap(guard(cond, res), nextBinder, next)
// __match.guard(`guardTree`, ()).flatMap((_: P[Unit]) => `next`)
- def flatMapGuard(guardTree: Tree, next: Tree): Tree = flatMapCond(guardTree, CODE.UNIT, freshSym(guardTree.pos, pureType(UnitClass.tpe)), next)
+ def flatMapGuard(guardTree: Tree, next: Tree): Tree = flatMapCond(guardTree, CODE.UNIT, freshSym(guardTree.pos, pureType(UnitTpe)), next)
}
}
diff --git a/src/compiler/scala/tools/nsc/transform/patmat/MatchOptimization.scala b/src/compiler/scala/tools/nsc/transform/patmat/MatchOptimization.scala
index 31b04d0bd6..9854e4ef62 100644
--- a/src/compiler/scala/tools/nsc/transform/patmat/MatchOptimization.scala
+++ b/src/compiler/scala/tools/nsc/transform/patmat/MatchOptimization.scala
@@ -143,7 +143,7 @@ trait MatchOptimization extends MatchTreeMaking with MatchAnalysis {
}
class ReusedCondTreeMaker(prevBinder: Symbol, val nextBinder: Symbol, cond: Tree, res: Tree, val pos: Position) extends TreeMaker { import CODE._
lazy val localSubstitution = Substitution(List(prevBinder), List(CODE.REF(nextBinder)))
- lazy val storedCond = freshSym(pos, BooleanClass.tpe, "rc") setFlag MUTABLE
+ lazy val storedCond = freshSym(pos, BooleanTpe, "rc") setFlag MUTABLE
lazy val treesToHoist: List[Tree] = {
nextBinder setFlag MUTABLE
List(storedCond, nextBinder) map { b => VAL(b) === codegen.mkZero(b.info) }
@@ -503,7 +503,7 @@ trait MatchOptimization extends MatchTreeMaking with MatchAnalysis {
}
class RegularSwitchMaker(scrutSym: Symbol, matchFailGenOverride: Option[Tree => Tree], val unchecked: Boolean) extends SwitchMaker {
- val switchableTpe = Set(ByteClass.tpe, ShortClass.tpe, IntClass.tpe, CharClass.tpe)
+ val switchableTpe = Set(ByteTpe, ShortTpe, IntTpe, CharTpe)
val alternativesSupported = true
val canJump = true
@@ -543,7 +543,7 @@ trait MatchOptimization extends MatchTreeMaking with MatchAnalysis {
else {
// match on scrutSym -- converted to an int if necessary -- not on scrut directly (to avoid duplicating scrut)
val scrutToInt: Tree =
- if (scrutSym.tpe =:= IntClass.tpe) REF(scrutSym)
+ if (scrutSym.tpe =:= IntTpe) REF(scrutSym)
else (REF(scrutSym) DOT (nme.toInt))
Some(BLOCK(
VAL(scrutSym) === scrut,
@@ -571,16 +571,16 @@ trait MatchOptimization extends MatchTreeMaking with MatchAnalysis {
}
def isDefault(x: CaseDef): Boolean = x match {
- case CaseDef(Typed(Ident(nme.WILDCARD), tpt), EmptyTree, _) if (tpt.tpe =:= ThrowableClass.tpe) => true
- case CaseDef(Bind(_, Typed(Ident(nme.WILDCARD), tpt)), EmptyTree, _) if (tpt.tpe =:= ThrowableClass.tpe) => true
+ case CaseDef(Typed(Ident(nme.WILDCARD), tpt), EmptyTree, _) if (tpt.tpe =:= ThrowableTpe) => true
+ case CaseDef(Bind(_, Typed(Ident(nme.WILDCARD), tpt)), EmptyTree, _) if (tpt.tpe =:= ThrowableTpe) => true
case CaseDef(Ident(nme.WILDCARD), EmptyTree, _) => true
case _ => false
}
- lazy val defaultSym: Symbol = freshSym(NoPosition, ThrowableClass.tpe)
+ lazy val defaultSym: Symbol = freshSym(NoPosition, ThrowableTpe)
def defaultBody: Tree = Throw(CODE.REF(defaultSym))
def defaultCase(scrutSym: Symbol = defaultSym, guard: Tree = EmptyTree, body: Tree = defaultBody): CaseDef = { import CODE._; atPos(body.pos) {
- (CASE (Bind(scrutSym, Typed(Ident(nme.WILDCARD), TypeTree(ThrowableClass.tpe)))) IF guard) ==> body
+ (CASE (Bind(scrutSym, Typed(Ident(nme.WILDCARD), TypeTree(ThrowableTpe)))) IF guard) ==> body
}}
}
diff --git a/src/compiler/scala/tools/nsc/transform/patmat/MatchTranslation.scala b/src/compiler/scala/tools/nsc/transform/patmat/MatchTranslation.scala
index c8c3b741f1..fcee142932 100644
--- a/src/compiler/scala/tools/nsc/transform/patmat/MatchTranslation.scala
+++ b/src/compiler/scala/tools/nsc/transform/patmat/MatchTranslation.scala
@@ -14,14 +14,8 @@ import scala.reflect.internal.util.Statistics
*/
trait MatchTranslation { self: PatternMatching =>
import PatternMatchingStats._
- import global.{phase, currentRun, Symbol,
- Apply, Bind, CaseDef, ClassInfoType, Ident, Literal, Match,
- Alternative, Constant, EmptyTree, Select, Star, This, Throw, Typed, UnApply,
- Type, MethodType, WildcardType, PolyType, ErrorType, NoType, TypeRef, typeRef,
- Name, NoSymbol, Position, Tree, atPos, glb, rootMirror, treeInfo, nme, Transformer,
- elimAnonymousClass, asCompactDebugString, hasLength, devWarning}
- import global.definitions.{ThrowableClass, SeqClass, ScalaPackageClass, BooleanClass, UnitClass, RepeatedParamClass,
- repeatedToSeq, isRepeatedParamType, getProductArgs}
+ import global._
+ import definitions._
import global.analyzer.{ErrorUtils, formalTypes}
trait MatchTranslator extends TreeMakers {
@@ -169,7 +163,7 @@ trait MatchTranslation { self: PatternMatching =>
val bindersAndCases = caseDefs map { caseDef =>
// generate a fresh symbol for each case, hoping we'll end up emitting a type-switch (we don't have a global scrut there)
// if we fail to emit a fine-grained switch, have to do translateCase again with a single scrutSym (TODO: uniformize substitution on treemakers so we can avoid this)
- val caseScrutSym = freshSym(pos, pureType(ThrowableClass.tpe))
+ val caseScrutSym = freshSym(pos, pureType(ThrowableTpe))
(caseScrutSym, propagateSubstitution(translateCase(caseScrutSym, pt)(caseDef), EmptySubstitution))
}
@@ -179,10 +173,10 @@ trait MatchTranslation { self: PatternMatching =>
}
val catches = if (swatches.nonEmpty) swatches else {
- val scrutSym = freshSym(pos, pureType(ThrowableClass.tpe))
+ val scrutSym = freshSym(pos, pureType(ThrowableTpe))
val casesNoSubstOnly = caseDefs map { caseDef => (propagateSubstitution(translateCase(scrutSym, pt)(caseDef), EmptySubstitution))}
- val exSym = freshSym(pos, pureType(ThrowableClass.tpe), "ex")
+ val exSym = freshSym(pos, pureType(ThrowableTpe), "ex")
List(
atPos(pos) {
@@ -194,7 +188,7 @@ trait MatchTranslation { self: PatternMatching =>
})
}
- typer.typedCases(catches, ThrowableClass.tpe, WildcardType)
+ typer.typedCases(catches, ThrowableTpe, WildcardType)
}
@@ -595,7 +589,7 @@ trait MatchTranslation { self: PatternMatching =>
def treeMaker(patBinderOrCasted: Symbol, binderKnownNonNull: Boolean, pos: Position): TreeMaker = {
// the extractor call (applied to the binder bound by the flatMap corresponding to the previous (i.e., enclosing/outer) pattern)
val extractorApply = atPos(pos)(spliceApply(patBinderOrCasted))
- val binder = freshSym(pos, pureType(resultInMonad)) // can't simplify this when subPatBinders.isEmpty, since UnitClass.tpe is definitely wrong when isSeq, and resultInMonad should always be correct since it comes directly from the extractor's result type
+ val binder = freshSym(pos, pureType(resultInMonad)) // can't simplify this when subPatBinders.isEmpty, since UnitTpe is definitely wrong when isSeq, and resultInMonad should always be correct since it comes directly from the extractor's result type
ExtractorTreeMaker(extractorApply, lengthGuard(binder), binder)(subPatBinders, subPatRefs(binder), resultType.typeSymbol == BooleanClass, checkedLength, patBinderOrCasted, ignoredSubPatBinders)
}
@@ -623,7 +617,7 @@ trait MatchTranslation { self: PatternMatching =>
// what's the extractor's result type in the monad?
// turn an extractor's result type into something `monadTypeToSubPatTypesAndRefs` understands
protected lazy val resultInMonad: Type = if(!hasLength(tpe.paramTypes, 1)) ErrorType else {
- if (resultType.typeSymbol == BooleanClass) UnitClass.tpe
+ if (resultType.typeSymbol == BooleanClass) UnitTpe
else matchMonadResult(resultType)
}
diff --git a/src/compiler/scala/tools/nsc/transform/patmat/MatchTreeMaking.scala b/src/compiler/scala/tools/nsc/transform/patmat/MatchTreeMaking.scala
index 4dff445fe8..bce0a077fb 100644
--- a/src/compiler/scala/tools/nsc/transform/patmat/MatchTreeMaking.scala
+++ b/src/compiler/scala/tools/nsc/transform/patmat/MatchTreeMaking.scala
@@ -19,7 +19,7 @@ import scala.reflect.internal.util.Position
*/
trait MatchTreeMaking extends MatchCodeGen with Debugging {
import global._
- import definitions.{SomeClass, AnyRefClass, UncheckedClass, BooleanClass}
+ import definitions._
final case class Suppression(exhaustive: Boolean, unreachable: Boolean)
object Suppression {
@@ -414,7 +414,7 @@ trait MatchTreeMaking extends MatchCodeGen with Debugging {
case SingleType(_, sym) => and(equalsTest(gen.mkAttributedQualifier(expectedTp), testedBinder), typeTest(testedBinder, expectedTp.widen))
// must use == to support e.g. List() == Nil
case ThisType(sym) if sym.isModule => and(equalsTest(CODE.REF(sym), testedBinder), typeTest(testedBinder, expectedTp.widen))
- case ConstantType(Constant(null)) if testedBinder.info.widen <:< AnyRefClass.tpe
+ case ConstantType(Constant(null)) if testedBinder.info.widen <:< AnyRefTpe
=> eqTest(expTp(CODE.NULL), testedBinder)
case ConstantType(const) => equalsTest(expTp(Literal(const)), testedBinder)
case ThisType(sym) => eqTest(expTp(This(sym)), testedBinder)
@@ -428,7 +428,7 @@ trait MatchTreeMaking extends MatchCodeGen with Debugging {
// since the types conform, no further checking is required
if (expectedTp.typeSymbol.isPrimitiveValueClass) tru
// have to test outer and non-null only when it's a reference type
- else if (expectedTp <:< AnyRefClass.tpe) {
+ else if (expectedTp <:< AnyRefTpe) {
// do non-null check first to ensure we won't select outer on null
if (outerTestNeeded) and(nonNullTest(testedBinder), outerTest(testedBinder, expectedTp))
else nonNullTest(testedBinder)
@@ -476,7 +476,7 @@ trait MatchTreeMaking extends MatchCodeGen with Debugging {
((casegen: Casegen) => combineExtractors(altTreeMakers :+ TrivialTreeMaker(casegen.one(mkTRUE)))(casegen))
)
- val findAltMatcher = codegenAlt.matcher(EmptyTree, NoSymbol, BooleanClass.tpe)(combinedAlts, Some(x => mkFALSE))
+ val findAltMatcher = codegenAlt.matcher(EmptyTree, NoSymbol, BooleanTpe)(combinedAlts, Some(x => mkFALSE))
codegenAlt.ifThenElseZero(findAltMatcher, substitution(next))
}
}
diff --git a/src/compiler/scala/tools/nsc/typechecker/AnalyzerPlugins.scala b/src/compiler/scala/tools/nsc/typechecker/AnalyzerPlugins.scala
index 4210d0b9fb..54e4fefc15 100644
--- a/src/compiler/scala/tools/nsc/typechecker/AnalyzerPlugins.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/AnalyzerPlugins.scala
@@ -146,7 +146,7 @@ trait AnalyzerPlugins { self: Analyzer =>
/**
* Modify the type of a return expression. By default, return expressions have type
- * NothingClass.tpe.
+ * NothingTpe.
*
* @param tpe The type of the return expression
* @param typer The typer that was used for typing the return tree
diff --git a/src/compiler/scala/tools/nsc/typechecker/Checkable.scala b/src/compiler/scala/tools/nsc/typechecker/Checkable.scala
index 0686b28079..31a31df764 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Checkable.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Checkable.scala
@@ -247,7 +247,7 @@ trait Checkable {
case TypeRef(_, NothingClass | NullClass | AnyValClass, _) => false
case RefinedType(_, decls) if !decls.isEmpty => false
case p =>
- new CheckabilityChecker(AnyClass.tpe, p) isCheckable
+ new CheckabilityChecker(AnyTpe, p) isCheckable
})
)
diff --git a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
index 9a18248929..dbcb6c19a0 100644
--- a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
@@ -71,7 +71,7 @@ trait ContextErrors {
extends TreeTypeError {
def errMsg: String = errMsgForPt(pt0)
def withPt(pt: Type): AbsTypeError = this.copy(pt0 = pt)
- private def errMsgForPt(pt: Type) =
+ private def errMsgForPt(pt: Type) =
s"diverging implicit expansion for type ${pt}\nstarting with ${sym.fullLocationString}"
}
@@ -1099,11 +1099,11 @@ trait ContextErrors {
def AbstractMemberWithModiferError(sym: Symbol, flag: Int) =
- issueSymbolTypeError(sym, "abstract member may not have " + Flags.flagsToString(flag) + " modifier")
+ issueSymbolTypeError(sym, "abstract member may not have " + Flags.flagsToString(flag.toLong) + " modifier")
def IllegalModifierCombination(sym: Symbol, flag1: Int, flag2: Int) =
issueSymbolTypeError(sym, "illegal combination of modifiers: %s and %s for: %s".format(
- Flags.flagsToString(flag1), Flags.flagsToString(flag2), sym))
+ Flags.flagsToString(flag1.toLong), Flags.flagsToString(flag2.toLong), sym))
def IllegalDependentMethTpeError(sym: Symbol)(context: Context) = {
val errorAddendum =
@@ -1145,7 +1145,7 @@ trait ContextErrors {
// failures which have nothing to do with implicit conversions
// per se, but which manifest as implicit conversion conflicts
// involving Any, are further explained from foundReqMsg.
- if (AnyRefClass.tpe <:< req) (
+ if (AnyRefTpe <:< req) (
if (sym == AnyClass || sym == UnitClass) (
sm"""|Note: ${sym.name} is not implicitly converted to AnyRef. You can safely
|pattern match `x: AnyRef` or cast `x.asInstanceOf[AnyRef]` to do so."""
diff --git a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
index aa05c97c08..95b771a8a5 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
@@ -17,7 +17,7 @@ import scala.collection.{ mutable, immutable }
*/
abstract class Duplicators extends Analyzer {
import global._
- import definitions.{ AnyRefClass, AnyValClass }
+ import definitions._
/** Retype the given tree in the given context. Use this method when retyping
* a method in a different class. The typer will replace references to the this of
@@ -346,8 +346,8 @@ abstract class Duplicators extends Analyzer {
// Without this, AnyRef specializations crash on patterns like
// case _: Boolean => ...
// Not at all sure this is safe.
- else if (scrutTpe <:< AnyRefClass.tpe)
- cases filterNot (_.pat.tpe <:< AnyValClass.tpe)
+ else if (scrutTpe <:< AnyRefTpe)
+ cases filterNot (_.pat.tpe <:< AnyValTpe)
else
cases
}
@@ -361,7 +361,7 @@ abstract class Duplicators extends Analyzer {
case _ =>
debuglog("Duplicators default case: " + tree.summaryString)
debuglog(" ---> " + tree)
- if (tree.hasSymbolField && tree.symbol != NoSymbol && (tree.symbol.owner == definitions.AnyClass)) {
+ if (tree.hasSymbolField && tree.symbol != NoSymbol && (tree.symbol.owner == AnyClass)) {
tree.symbol = NoSymbol // maybe we can find a more specific member in a subclass of Any (see AnyVal members, like ==)
}
val ntree = castType(tree, pt)
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
index 37257b4f4e..5622f67459 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
@@ -131,7 +131,7 @@ trait Implicits {
val tvars = tpars map (TypeVar untouchable _)
val tpSubsted = tp.subst(tpars, tvars)
- val search = new ImplicitSearch(EmptyTree, functionType(List(tpSubsted), AnyClass.tpe), true, context.makeImplicit(reportAmbiguousErrors = false))
+ val search = new ImplicitSearch(EmptyTree, functionType(List(tpSubsted), AnyTpe), true, context.makeImplicit(reportAmbiguousErrors = false))
search.allImplicitsPoly(tvars)
}
@@ -273,7 +273,8 @@ trait Implicits {
/** An extractor for types of the form ? { name: (? >: argtpe <: Any*)restp }
*/
object HasMethodMatching {
- val dummyMethod = NoSymbol.newTermSymbol(newTermName("typer$dummy"))
+ val dummyMethod = NoSymbol.newTermSymbol("typer$dummy") setInfo NullaryMethodType(AnyTpe)
+
def templateArgType(argtpe: Type) = new BoundedWildcardType(TypeBounds.lower(argtpe))
def apply(name: Name, argtpes: List[Type], restpe: Type): Type = {
@@ -1259,8 +1260,8 @@ trait Implicits {
// looking for a manifest of a type parameter that hasn't been inferred by now,
// can't do much, but let's not fail
else if (undetParams contains sym) {
- // #3859: need to include the mapping from sym -> NothingClass.tpe in the SearchResult
- mot(NothingClass.tpe, sym :: from, NothingClass.tpe :: to)
+ // #3859: need to include the mapping from sym -> NothingTpe in the SearchResult
+ mot(NothingTpe, sym :: from, NothingTpe :: to)
} else {
// a manifest should have been found by normal searchImplicit
EmptyTree
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
index 3abbfbd00c..961ef484d8 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
@@ -531,7 +531,7 @@ trait Infer extends Checkable {
def unapply(m: Result): Some[(List[Symbol], List[Type], List[Type], List[Symbol])] = Some(toLists{
val (ok, nok) = m.map{case (p, a) => (p, a.getOrElse(null))}.partition(_._2 ne null)
val (okArgs, okTparams) = ok.unzip
- (okArgs, okTparams, m.values.map(_.getOrElse(NothingClass.tpe)), nok.keys)
+ (okArgs, okTparams, m.values.map(_.getOrElse(NothingTpe)), nok.keys)
})
}
@@ -581,7 +581,7 @@ trait Infer extends Checkable {
/** Return inferred type arguments, given type parameters, formal parameters,
* argument types, result type and expected result type.
* If this is not possible, throw a `NoInstance` exception.
- * Undetermined type arguments are represented by `definitions.NothingClass.tpe`.
+ * Undetermined type arguments are represented by `definitions.NothingTpe`.
* No check that inferred parameters conform to their bounds is made here.
*
* @param tparams the type parameters of the method
@@ -725,7 +725,7 @@ trait Infer extends Checkable {
if (pos == -1) {
if (positionalAllowed) { // treat assignment as positional argument
argPos(index) = index
- res = UnitClass.tpe
+ res = UnitTpe
} else // unknown parameter name
namesOK = false
} else if (argPos.contains(pos)) { // parameter specified twice
@@ -773,10 +773,10 @@ trait Infer extends Checkable {
* @pre: the argument list is eligible for tuple conversion.
*/
private def typeAfterTupleConversion(argtpes: List[Type]): Type = (
- if (argtpes.isEmpty) UnitClass.tpe // aka "Tuple0"
+ if (argtpes.isEmpty) UnitTpe // aka "Tuple0"
else tupleType(argtpes map {
- case NamedType(name, tp) => UnitClass.tpe // not a named arg - only assignments here
- case RepeatedType(tp) => tp // but probably shouldn't be tupling a call containing :_*
+ case NamedType(name, tp) => UnitTpe // not a named arg - only assignments here
+ case RepeatedType(tp) => tp // but probably shouldn't be tupling a call containing :_*
case tp => tp
})
)
diff --git a/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala b/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala
index 50383a1e78..646bf3a153 100644
--- a/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala
@@ -103,7 +103,7 @@ trait MethodSynthesis {
createMethod(original)(m => gen.mkMethodCall(newMethod, transformArgs(m.paramss.head map Ident)))
def createSwitchMethod(name: Name, range: Seq[Int], returnType: Type)(f: Int => Tree) = {
- createMethod(name, List(IntClass.tpe), returnType) { m =>
+ createMethod(name, List(IntTpe), returnType) { m =>
val arg0 = Ident(m.firstParam)
val default = DEFAULT ==> THROW(IndexOutOfBoundsExceptionClass, arg0)
val cases = range.map(num => CASE(LIT(num)) ==> f(num)).toList :+ default
@@ -382,7 +382,7 @@ trait MethodSynthesis {
def name = tree.name
def category = GetterTargetClass
def flagsMask = GetterFlags
- def flagsExtra = ACCESSOR | ( if (tree.mods.isMutable) 0 else STABLE )
+ def flagsExtra = ACCESSOR.toLong | ( if (tree.mods.isMutable) 0 else STABLE )
override def validate() {
assert(derivedSym != NoSymbol, tree)
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index 55f144da13..4683fca192 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -765,7 +765,7 @@ trait Namers extends MethodSynthesis {
def accessorTypeCompleter(tree: ValDef, isSetter: Boolean) = mkTypeCompleter(tree) { sym =>
logAndValidate(sym) {
sym setInfo {
- val tp = if (isSetter) MethodType(List(sym.newSyntheticValueParam(typeSig(tree))), UnitClass.tpe)
+ val tp = if (isSetter) MethodType(List(sym.newSyntheticValueParam(typeSig(tree))), UnitTpe)
else NullaryMethodType(typeSig(tree))
pluginsTypeSigAccessor(tp, typer, tree, sym)
}
@@ -863,7 +863,7 @@ trait Namers extends MethodSynthesis {
private def templateSig(templ: Template): Type = {
val clazz = context.owner
def checkParent(tpt: Tree): Type = {
- if (tpt.tpe.isError) AnyRefClass.tpe
+ if (tpt.tpe.isError) AnyRefTpe
else tpt.tpe
}
@@ -1267,7 +1267,7 @@ trait Namers extends MethodSynthesis {
val defaultTree = atPos(vparam.pos.focus) {
DefDef(
- Modifiers(meth.flags & DefaultGetterFlags) | SYNTHETIC | DEFAULTPARAM | oflag,
+ Modifiers(meth.flags & DefaultGetterFlags) | (SYNTHETIC | DEFAULTPARAM | oflag).toLong,
name, deftParams, defvParamss, defTpt, defRhs)
}
if (!isConstr)
@@ -1493,8 +1493,8 @@ trait Namers extends MethodSynthesis {
private object RestrictJavaArraysMap extends TypeMap {
def apply(tp: Type): Type = tp match {
case TypeRef(pre, ArrayClass, List(elemtp))
- if elemtp.typeSymbol.isAbstractType && !(elemtp <:< ObjectClass.tpe) =>
- TypeRef(pre, ArrayClass, List(intersectionType(List(elemtp, ObjectClass.tpe))))
+ if elemtp.typeSymbol.isAbstractType && !(elemtp <:< ObjectTpe) =>
+ TypeRef(pre, ArrayClass, List(intersectionType(List(elemtp, ObjectTpe))))
case _ =>
mapOver(tp)
}
@@ -1516,7 +1516,7 @@ trait Namers extends MethodSynthesis {
AbstractMemberWithModiferError(sym, flag)
}
def checkNoConflict(flag1: Int, flag2: Int) {
- if (sym hasAllFlags flag1 | flag2)
+ if (sym hasAllFlags flag1.toLong | flag2)
IllegalModifierCombination(sym, flag1, flag2)
}
if (sym.isImplicit) {
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
index 50b92f13ab..4ccfb31878 100644
--- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
@@ -604,8 +604,10 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans
def stubImplementations: List[String] = {
// Grouping missing methods by the declaring class
val regrouped = missingMethods.groupBy(_.owner).toList
- def membersStrings(members: List[Symbol]) =
- members.sortBy("" + _.name) map (m => m.defStringSeenAs(clazz.tpe memberType m) + " = ???")
+ def membersStrings(members: List[Symbol]) = {
+ members foreach fullyInitializeSymbol
+ members.sortBy(_.name) map (m => m.defStringSeenAs(clazz.tpe_* memberType m) + " = ???")
+ }
if (regrouped.tail.isEmpty)
membersStrings(regrouped.head._2)
@@ -748,7 +750,7 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans
// Have to use matchingSymbol, not a method involving overridden symbols,
// because the scala type system understands that an abstract method here does not
// override a concrete method in Object. The jvm, however, does not.
- val overridden = decl.matchingSymbol(ObjectClass, ObjectClass.tpe)
+ val overridden = decl.matchingSymbol(ObjectClass, ObjectTpe)
if (overridden.isFinal)
unit.error(decl.pos, "trait cannot redefine final method from class AnyRef")
}
@@ -996,7 +998,7 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans
// equals method inherited from Object or a case class synthetic equals (for
// which we know the logic.)
def isWarnable = isReferenceOp || (isUsingDefaultScalaOp && isUsingWarnableEquals)
- def isEitherNullable = (NullClass.tpe <:< receiver.info) || (NullClass.tpe <:< actual.info)
+ def isEitherNullable = (NullTpe <:< receiver.info) || (NullTpe <:< actual.info)
def isEitherValueClass = actual.isDerivedValueClass || receiver.isDerivedValueClass
def isBoolean(s: Symbol) = unboxedValueClass(s) == BooleanClass
def isUnit(s: Symbol) = unboxedValueClass(s) == UnitClass
@@ -1081,7 +1083,7 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans
// better to have lubbed and lost
def warnIfLubless(): Unit = {
val common = global.lub(List(actual.tpe, receiver.tpe))
- if (ObjectClass.tpe <:< common)
+ if (ObjectTpe <:< common)
unrelatedTypes()
}
// warn if actual has a case parent that is not same as receiver's;
@@ -1533,7 +1535,7 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans
private def transformIf(tree: If): Tree = {
val If(cond, thenpart, elsepart) = tree
def unitIfEmpty(t: Tree): Tree =
- if (t == EmptyTree) Literal(Constant(())).setPos(tree.pos).setType(UnitClass.tpe) else t
+ if (t == EmptyTree) Literal(Constant(())).setPos(tree.pos).setType(UnitTpe) else t
cond.tpe match {
case ConstantType(value) =>
diff --git a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala
index 4e78cecd7d..6933b10a0a 100644
--- a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala
@@ -30,7 +30,7 @@ import symtab.Flags._
*/
abstract class SuperAccessors extends transform.Transform with transform.TypingTransformers {
import global._
- import definitions.{ UnitClass, ObjectClass, isRepeatedParamType, isByNameParamType, Any_asInstanceOf }
+ import definitions._
import analyzer.{ restrictionError }
/** the following two members override abstract members in Transform */
@@ -458,7 +458,7 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT
val protAcc = clazz.newMethod(accName, field.pos, newFlags = ARTIFACT)
val paramTypes = List(clazz.typeOfThis, field.tpe)
val params = protAcc newSyntheticValueParams paramTypes
- val accessorType = MethodType(params, UnitClass.tpe)
+ val accessorType = MethodType(params, UnitTpe)
protAcc setInfoAndEnter accessorType
val obj :: value :: Nil = params
diff --git a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
index 406bc445c9..61295b5abd 100644
--- a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
@@ -100,7 +100,7 @@ trait SyntheticMethods extends ast.TreeDSL {
case tp => tp
}
}
- else AnyClass.tpe
+ else AnyTpe
)
def forwardToRuntime(method: Symbol): Tree =
@@ -131,7 +131,7 @@ trait SyntheticMethods extends ast.TreeDSL {
def perElementMethod(name: Name, returnType: Type)(caseFn: Symbol => Tree): Tree =
createSwitchMethod(name, accessors.indices, returnType)(idx => caseFn(accessors(idx)))
- // def productElementNameMethod = perElementMethod(nme.productElementName, StringClass.tpe)(x => LIT(x.name.toString))
+ // def productElementNameMethod = perElementMethod(nme.productElementName, StringTpe)(x => LIT(x.name.toString))
var syntheticCanEqual = false
@@ -140,7 +140,7 @@ trait SyntheticMethods extends ast.TreeDSL {
*/
def canEqualMethod: Tree = {
syntheticCanEqual = true
- createMethod(nme.canEqual_, List(AnyClass.tpe), BooleanClass.tpe)(m =>
+ createMethod(nme.canEqual_, List(AnyTpe), BooleanTpe)(m =>
Ident(m.firstParam) IS_OBJ classExistentialType(clazz))
}
@@ -200,7 +200,7 @@ trait SyntheticMethods extends ast.TreeDSL {
* }
* }
*/
- def equalsCaseClassMethod: Tree = createMethod(nme.equals_, List(AnyClass.tpe), BooleanClass.tpe) { m =>
+ def equalsCaseClassMethod: Tree = createMethod(nme.equals_, List(AnyTpe), BooleanTpe) { m =>
if (accessors.isEmpty)
if (clazz.isFinal) thatTest(m)
else thatTest(m) AND ((thatCast(m) DOT nme.canEqual_)(mkThis))
@@ -214,14 +214,14 @@ trait SyntheticMethods extends ast.TreeDSL {
* val x$1 = that.asInstanceOf[this.C]
* (this.underlying == that.underlying
*/
- def equalsDerivedValueClassMethod: Tree = createMethod(nme.equals_, List(AnyClass.tpe), BooleanClass.tpe) { m =>
+ def equalsDerivedValueClassMethod: Tree = createMethod(nme.equals_, List(AnyTpe), BooleanTpe) { m =>
equalsCore(m, List(clazz.derivedValueClassUnbox))
}
/* The hashcode method for value classes
* def hashCode(): Int = this.underlying.hashCode
*/
- def hashCodeDerivedValueClassMethod: Tree = createMethod(nme.hashCode_, Nil, IntClass.tpe) { m =>
+ def hashCodeDerivedValueClassMethod: Tree = createMethod(nme.hashCode_, Nil, IntTpe) { m =>
Select(mkThisSelect(clazz.derivedValueClassUnbox), nme.hashCode_)
}
@@ -254,19 +254,20 @@ trait SyntheticMethods extends ast.TreeDSL {
def hashcodeImplementation(sym: Symbol): Tree = {
sym.tpe.finalResultType.typeSymbol match {
- case UnitClass | NullClass => Literal(Constant(0))
- case BooleanClass => If(Ident(sym), Literal(Constant(1231)), Literal(Constant(1237)))
- case IntClass | ShortClass | ByteClass | CharClass => Ident(sym)
- case LongClass => callStaticsMethod("longHash")(Ident(sym))
- case DoubleClass => callStaticsMethod("doubleHash")(Ident(sym))
- case FloatClass => callStaticsMethod("floatHash")(Ident(sym))
- case _ => callStaticsMethod("anyHash")(Ident(sym))
+ case UnitClass | NullClass => Literal(Constant(0))
+ case BooleanClass => If(Ident(sym), Literal(Constant(1231)), Literal(Constant(1237)))
+ case IntClass => Ident(sym)
+ case ShortClass | ByteClass | CharClass => Select(Ident(sym), nme.toInt)
+ case LongClass => callStaticsMethod("longHash")(Ident(sym))
+ case DoubleClass => callStaticsMethod("doubleHash")(Ident(sym))
+ case FloatClass => callStaticsMethod("floatHash")(Ident(sym))
+ case _ => callStaticsMethod("anyHash")(Ident(sym))
}
}
def specializedHashcode = {
- createMethod(nme.hashCode_, Nil, IntClass.tpe) { m =>
- val accumulator = m.newVariable(newTermName("acc"), m.pos, SYNTHETIC) setInfo IntClass.tpe
+ createMethod(nme.hashCode_, Nil, IntTpe) { m =>
+ val accumulator = m.newVariable(newTermName("acc"), m.pos, SYNTHETIC) setInfo IntTpe
val valdef = ValDef(accumulator, Literal(Constant(0xcafebabe)))
val mixes = accessors map (acc =>
Assign(
@@ -356,7 +357,7 @@ trait SyntheticMethods extends ast.TreeDSL {
// This method should be generated as private, but apparently if it is, then
// it is name mangled afterward. (Wonder why that is.) So it's only protected.
// For sure special methods like "readResolve" should not be mangled.
- List(createMethod(nme.readResolve, Nil, ObjectClass.tpe)(m => { m setFlag PRIVATE ; REF(clazz.sourceModule) }))
+ List(createMethod(nme.readResolve, Nil, ObjectTpe)(m => { m setFlag PRIVATE ; REF(clazz.sourceModule) }))
}
else Nil
)
diff --git a/src/compiler/scala/tools/nsc/typechecker/Tags.scala b/src/compiler/scala/tools/nsc/typechecker/Tags.scala
index d2d7f57aef..32a66aa4dd 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Tags.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Tags.scala
@@ -30,7 +30,7 @@ trait Tags {
* However we found out that we don't really need this concept, so it got removed.
*
* @param pos Position for error reporting. Please, provide meaningful value.
- * @param tp Type we're looking a ClassTag for, e.g. resolveClassTag(pos, IntClass.tpe) will look for ClassTag[Int].
+ * @param tp Type we're looking a ClassTag for, e.g. resolveClassTag(pos, IntTpe) will look for ClassTag[Int].
* @param allowMaterialization If true (default) then the resolver is allowed to launch materialization macros when there's no class tag in scope.
* If false then materialization macros are prohibited from running.
*
@@ -49,7 +49,7 @@ trait Tags {
* @param pre Prefix that represents a universe this type tag will be bound to.
* If `pre` is set to `NoType`, then any type tag in scope will do, regardless of its affiliation.
* If `pre` is set to `NoType`, and tag resolution involves materialization, then `mkRuntimeUniverseRef` will be used.
- * @param tp Type we're looking a TypeTag for, e.g. resolveTypeTag(pos, mkRuntimeUniverseRef, IntClass.tpe, false) will look for scala.reflect.runtime.universe.TypeTag[Int].
+ * @param tp Type we're looking a TypeTag for, e.g. resolveTypeTag(pos, mkRuntimeUniverseRef, IntTpe, false) will look for scala.reflect.runtime.universe.TypeTag[Int].
* @param concrete If true then the result must not contain unresolved (i.e. not spliced) type parameters and abstract type members.
* If false then the function will always succeed (abstract types will be reified as free types).
* @param allowMaterialization If true (default) then the resolver is allowed to launch materialization macros when there's no type tag in scope.
@@ -69,4 +69,4 @@ trait Tags {
resolveTag(pos, taggedTp, allowMaterialization)
}
}
-} \ No newline at end of file
+}
diff --git a/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala b/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
index b2a6e7340d..a93baabc51 100644
--- a/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
@@ -126,7 +126,7 @@ trait TypeDiagnostics {
else if (!member.isDeferred) member.accessed
else {
val getter = if (member.isSetter) member.getter(member.owner) else member
- val flags = if (getter.setter(member.owner) != NoSymbol) DEFERRED | MUTABLE else DEFERRED
+ val flags = if (getter.setter(member.owner) != NoSymbol) DEFERRED.toLong | MUTABLE else DEFERRED
getter.owner.newValue(getter.name.toTermName, getter.pos, flags) setInfo getter.tpe.resultType
}
@@ -253,7 +253,7 @@ trait TypeDiagnostics {
// For found/required errors where AnyRef would have sufficed:
// explain in greater detail.
def explainAnyVsAnyRef(found: Type, req: Type): String = {
- if (AnyRefClass.tpe <:< req) notAnyRefMessage(found) else ""
+ if (AnyRefTpe <:< req) notAnyRefMessage(found) else ""
}
// TODO - figure out how to avoid doing any work at all
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 8511428d90..238727d2e9 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1147,7 +1147,7 @@ trait Typers extends Adaptations with Tags {
if (mode.typingExprNotFun) {
// The <: Any requirement inhibits attempts to adapt continuation types
// to non-continuation types.
- if (tree.tpe <:< AnyClass.tpe) pt.dealias match {
+ if (tree.tpe <:< AnyTpe) pt.dealias match {
case TypeRef(_, UnitClass, _) => // (12)
if (settings.warnValueDiscard)
context.unit.warning(tree.pos, "discarded non-Unit value")
@@ -1284,10 +1284,10 @@ trait Typers extends Adaptations with Tags {
*/
def instantiateExpectingUnit(tree: Tree, mode: Mode): Tree = {
val savedUndetparams = context.undetparams
- silent(_.instantiate(tree, mode, UnitClass.tpe)) orElse { _ =>
+ silent(_.instantiate(tree, mode, UnitTpe)) orElse { _ =>
context.undetparams = savedUndetparams
val valueDiscard = atPos(tree.pos)(Block(List(instantiate(tree, mode, WildcardType)), Literal(Constant(()))))
- typed(valueDiscard, mode, UnitClass.tpe)
+ typed(valueDiscard, mode, UnitTpe)
}
}
@@ -1708,7 +1708,7 @@ trait Typers extends Adaptations with Tags {
}
def typedParentTypes(templ: Template): List[Tree] = templ.parents match {
- case Nil => List(atPos(templ.pos)(TypeTree(AnyRefClass.tpe)))
+ case Nil => List(atPos(templ.pos)(TypeTree(AnyRefTpe)))
case first :: rest =>
try {
val supertpts = fixDuplicateSyntheticParents(normalizeFirstParent(
@@ -1734,7 +1734,7 @@ trait Typers extends Adaptations with Tags {
log("Type error calculating parents in template " + templ)
log("Error: " + ex)
ParentTypesError(templ, ex)
- List(TypeTree(AnyRefClass.tpe))
+ List(TypeTree(AnyRefTpe))
}
}
@@ -1820,7 +1820,7 @@ trait Typers extends Adaptations with Tags {
for (tparam <- clazz.typeParams) {
if (classinfo.expansiveRefs(tparam) contains tparam) {
val newinfo = ClassInfoType(
- classinfo.parents map (_.instantiateTypeParams(List(tparam), List(AnyRefClass.tpe))),
+ classinfo.parents map (_.instantiateTypeParams(List(tparam), List(AnyRefTpe))),
classinfo.decls,
clazz)
clazz.setInfo {
@@ -1886,7 +1886,7 @@ trait Typers extends Adaptations with Tags {
if (noSerializable) Nil
else {
clazz.makeSerializable()
- List(TypeTree(SerializableClass.tpe) setPos clazz.pos.focus)
+ List(TypeTree(SerializableTpe) setPos clazz.pos.focus)
}
)
})
@@ -2143,7 +2143,7 @@ trait Typers extends Adaptations with Tags {
orElse (superAcc getter superAcc.owner)
filter (alias => superClazz.info.nonPrivateMember(alias.name) == alias)
)
- if (alias.exists && !alias.accessed.isVariable) {
+ if (alias.exists && !alias.accessed.isVariable && !isRepeatedParamType(alias.accessed.info)) {
val ownAcc = clazz.info decl name suchThat (_.isParamAccessor) match {
case acc if !acc.isDeferred && acc.hasAccessorFlag => acc.accessed
case acc => acc
@@ -2377,7 +2377,7 @@ trait Typers extends Adaptations with Tags {
case ldef @ LabelDef(_, _, _) =>
if (ldef.symbol == NoSymbol)
ldef.symbol = namer.enterInScope(
- context.owner.newLabel(ldef.name, ldef.pos) setInfo MethodType(List(), UnitClass.tpe))
+ context.owner.newLabel(ldef.name, ldef.pos) setInfo MethodType(List(), UnitTpe))
case _ =>
}
}
@@ -2500,7 +2500,7 @@ trait Typers extends Adaptations with Tags {
namer.enterIfNotThere(bind.symbol)
val guard1: Tree = if (cdef.guard == EmptyTree) EmptyTree
- else typed(cdef.guard, BooleanClass.tpe)
+ else typed(cdef.guard, BooleanTpe)
var body1: Tree = typed(cdef.body, pt)
if (context.enclosingCaseDef.savedTypeBounds.nonEmpty) {
@@ -2597,7 +2597,7 @@ trait Typers extends Adaptations with Tags {
val argTp :: resTp :: Nil = targs
// targs must conform to Any for us to synthesize an applyOrElse (fallback to apply otherwise -- typically for @cps annotated targs)
- val targsValidParams = targs forall (_ <:< AnyClass.tpe)
+ val targsValidParams = targs forall (_ <:< AnyTpe)
val anonClass = (context.owner
newAnonymousFunctionClass tree.pos
@@ -2725,12 +2725,12 @@ trait Typers extends Adaptations with Tags {
val methodBodyTyper = newTyper(context.makeNewScope(context.tree, methodSym)) // should use the DefDef for the context's tree, but it doesn't exist yet (we need the typer we're creating to create it)
methodBodyTyper.context.scope enter paramSym
- methodSym setInfo MethodType(List(paramSym), BooleanClass.tpe)
+ methodSym setInfo MethodType(List(paramSym), BooleanTpe)
val defaultCase = mkDefaultCase(FALSE)
- val match_ = methodBodyTyper.typedMatch(selector, casesTrue :+ defaultCase, mode, BooleanClass.tpe)
+ val match_ = methodBodyTyper.typedMatch(selector, casesTrue :+ defaultCase, mode, BooleanTpe)
- DefDef(methodSym, methodBodyTyper.virtualizedMatch(match_, mode, BooleanClass.tpe))
+ DefDef(methodSym, methodBodyTyper.virtualizedMatch(match_, mode, BooleanTpe))
}
// only used for @cps annotated partial functions
@@ -2739,7 +2739,7 @@ trait Typers extends Adaptations with Tags {
val methodSym = anonClass.newMethod(nme.apply, tree.pos, FINAL | OVERRIDE)
val paramSym = mkParam(methodSym)
- methodSym setInfo MethodType(List(paramSym), AnyClass.tpe)
+ methodSym setInfo MethodType(List(paramSym), AnyTpe)
val methodBodyTyper = newTyper(context.makeNewScope(context.tree, methodSym))
// should use the DefDef for the context's tree, but it doesn't exist yet (we need the typer we're creating to create it)
@@ -2873,8 +2873,8 @@ trait Typers extends Adaptations with Tags {
templ updateAttachment att.copy(stats = stats1)
for (stat <- stats1 if stat.isDef && stat.symbol.isOverridingSymbol)
stat.symbol setFlag OVERRIDE
- }
- }
+ }
+ }
def typedImport(imp : Import) : Import = (transformed remove imp) match {
case Some(imp1: Import) => imp1
@@ -3106,11 +3106,11 @@ trait Typers extends Adaptations with Tags {
// less expensive than including them in inferMethodAlternative (see below).
def shapeType(arg: Tree): Type = arg match {
case Function(vparams, body) =>
- functionType(vparams map (_ => AnyClass.tpe), shapeType(body))
+ functionType(vparams map (_ => AnyTpe), shapeType(body))
case AssignOrNamedArg(Ident(name), rhs) =>
NamedType(name, shapeType(rhs))
case _ =>
- NothingClass.tpe
+ NothingTpe
}
val argtypes = args map shapeType
val pre = fun.symbol.tpe.prefix
@@ -3872,7 +3872,7 @@ trait Typers extends Adaptations with Tags {
// as we don't know which alternative to choose... here we do
map2Conserve(args, tparams) {
//@M! the polytype denotes the expected kind
- (arg, tparam) => typedHigherKindedType(arg, mode, GenPolyType(tparam.typeParams, AnyClass.tpe))
+ (arg, tparam) => typedHigherKindedType(arg, mode, GenPolyType(tparam.typeParams, AnyTpe))
}
} else // @M: there's probably something wrong when args.length != tparams.length... (triggered by bug #320)
// Martin, I'm using fake trees, because, if you use args or arg.map(typedType),
@@ -3893,7 +3893,7 @@ trait Typers extends Adaptations with Tags {
if (!isPastTyper && fun.symbol == Any_isInstanceOf && targs.nonEmpty) {
val scrutineeType = fun match {
case Select(qual, _) => qual.tpe
- case _ => AnyClass.tpe
+ case _ => AnyTpe
}
checkCheckable(tree, targs.head, scrutineeType, inPattern = false)
}
@@ -4218,7 +4218,7 @@ trait Typers extends Adaptations with Tags {
// (phase.erasedTypes && varsym.isValue && !varsym.isMethod)) {
if (varsym.isVariable || varsym.isValue && phase.erasedTypes) {
val rhs1 = typedByValueExpr(rhs, lhs1.tpe)
- treeCopy.Assign(tree, lhs1, checkDead(rhs1)) setType UnitClass.tpe
+ treeCopy.Assign(tree, lhs1, checkDead(rhs1)) setType UnitTpe
}
else if(dyna.isDynamicallyUpdatable(lhs1)) {
val rhs1 = typedByValueExpr(rhs)
@@ -4229,10 +4229,10 @@ trait Typers extends Adaptations with Tags {
}
def typedIf(tree: If): If = {
- val cond1 = checkDead(typedByValueExpr(tree.cond, BooleanClass.tpe))
+ val cond1 = checkDead(typedByValueExpr(tree.cond, BooleanTpe))
// One-legged ifs don't need a lot of analysis
if (tree.elsep.isEmpty)
- return treeCopy.If(tree, cond1, typed(tree.thenp, UnitClass.tpe), tree.elsep) setType UnitClass.tpe
+ return treeCopy.If(tree, cond1, typed(tree.thenp, UnitTpe), tree.elsep) setType UnitTpe
val thenp1 = typed(tree.thenp, pt)
val elsep1 = typed(tree.elsep, pt)
@@ -4313,7 +4313,7 @@ trait Typers extends Adaptations with Tags {
unit.warning(tree.pos, "enclosing method " + name + " has result type Unit: return value discarded")
}
val res = treeCopy.Return(tree, checkDead(expr1)).setSymbol(enclMethod.owner)
- val tp = pluginsTypedReturn(NothingClass.tpe, this, res, restpt.tpe)
+ val tp = pluginsTypedReturn(NothingTpe, this, res, restpt.tpe)
res.setType(tp)
}
}
@@ -4916,7 +4916,7 @@ trait Typers extends Adaptations with Tags {
// if symbol hasn't been fully loaded, can't check kind-arity
else map2Conserve(args, tparams) { (arg, tparam) =>
//@M! the polytype denotes the expected kind
- typedHigherKindedType(arg, mode, GenPolyType(tparam.typeParams, AnyClass.tpe))
+ typedHigherKindedType(arg, mode, GenPolyType(tparam.typeParams, AnyTpe))
}
val argtypes = args1 map (_.tpe)
@@ -5038,8 +5038,8 @@ trait Typers extends Adaptations with Tags {
def typedTry(tree: Try) = {
val Try(block, catches, fin) = tree
val block1 = typed(block, pt)
- val catches1 = typedCases(catches, ThrowableClass.tpe, pt)
- val fin1 = if (fin.isEmpty) fin else typed(fin, UnitClass.tpe)
+ val catches1 = typedCases(catches, ThrowableTpe, pt)
+ val fin1 = if (fin.isEmpty) fin else typed(fin, UnitTpe)
def finish(ownType: Type) = treeCopy.Try(tree, block1, catches1, fin1) setType ownType
@@ -5058,8 +5058,8 @@ trait Typers extends Adaptations with Tags {
}
def typedThrow(tree: Throw) = {
- val expr1 = typedByValueExpr(tree.expr, ThrowableClass.tpe)
- treeCopy.Throw(tree, expr1) setType NothingClass.tpe
+ val expr1 = typedByValueExpr(tree.expr, ThrowableTpe)
+ treeCopy.Throw(tree, expr1) setType NothingTpe
}
def typedTyped(tree: Typed) = {
@@ -5145,7 +5145,7 @@ trait Typers extends Adaptations with Tags {
// @M maybe the well-kindedness check should be done when checking the type arguments conform to the type parameters' bounds?
val args1 = if (sameLength(args, tparams)) map2Conserve(args, tparams) {
//@M! the polytype denotes the expected kind
- (arg, tparam) => typedHigherKindedType(arg, mode, GenPolyType(tparam.typeParams, AnyClass.tpe))
+ (arg, tparam) => typedHigherKindedType(arg, mode, GenPolyType(tparam.typeParams, AnyTpe))
}
else {
//@M this branch is correctly hit for an overloaded polymorphic type. It also has to handle erroneous cases.
@@ -5163,9 +5163,9 @@ trait Typers extends Adaptations with Tags {
def typedApplyDynamic(tree: ApplyDynamic) = {
assert(phase.erasedTypes)
- val qual1 = typed(tree.qual, AnyRefClass.tpe)
- val args1 = tree.args mapConserve (arg => typed(arg, AnyRefClass.tpe))
- treeCopy.ApplyDynamic(tree, qual1, args1) setType AnyRefClass.tpe
+ val qual1 = typed(tree.qual, AnyRefTpe)
+ val args1 = tree.args mapConserve (arg => typed(arg, AnyRefTpe))
+ treeCopy.ApplyDynamic(tree, qual1, args1) setType AnyRefTpe
}
def typedReferenceToBoxed(tree: ReferenceToBoxed) = {
@@ -5207,14 +5207,14 @@ trait Typers extends Adaptations with Tags {
warnMissingInterpolator(tree)
tree setType (
- if (tree.value.tag == UnitTag) UnitClass.tpe
+ if (tree.value.tag == UnitTag) UnitTpe
else ConstantType(tree.value))
}
def typedSingletonTypeTree(tree: SingletonTypeTree) = {
val refTyped =
context.withImplicitsDisabled {
- typed(tree.ref, MonoQualifierModes | mode.onlyTypePat, AnyRefClass.tpe)
+ typed(tree.ref, MonoQualifierModes | mode.onlyTypePat, AnyRefTpe)
}
if (!refTyped.isErrorTyped)
@@ -5257,7 +5257,7 @@ trait Typers extends Adaptations with Tags {
// we should get here only when something before failed
// and we try again (@see tryTypedApply). In that case we can assign
// whatever type to tree; we just have to survive until a real error message is issued.
- tree setType AnyClass.tpe
+ tree setType AnyTpe
}
def typedFunction(fun: Function) = {
if (fun.symbol == NoSymbol)
@@ -5534,7 +5534,7 @@ trait Typers extends Adaptations with Tags {
val isMacroBodyOkay = !tree.symbol.isErroneous && !(tree1 exists (_.isErroneous)) && tree1 != EmptyTree
val shouldInheritMacroImplReturnType = ddef.tpt.isEmpty
- if (isMacroBodyOkay && shouldInheritMacroImplReturnType) computeMacroDefTypeFromMacroImpl(ddef, tree1.symbol) else AnyClass.tpe
+ if (isMacroBodyOkay && shouldInheritMacroImplReturnType) computeMacroDefTypeFromMacroImpl(ddef, tree1.symbol) else AnyTpe
}
def transformedOr(tree: Tree, op: => Tree): Tree = transformed remove tree match {
diff --git a/src/compiler/scala/tools/nsc/util/ShowPickled.scala b/src/compiler/scala/tools/nsc/util/ShowPickled.scala
index f9d706ae55..b804bfb842 100644
--- a/src/compiler/scala/tools/nsc/util/ShowPickled.scala
+++ b/src/compiler/scala/tools/nsc/util/ShowPickled.scala
@@ -108,7 +108,7 @@ object ShowPickled extends Names {
var result = 0L
var b = 0L
do {
- b = data(idx)
+ b = data(idx).toLong
idx += 1
result = (result << 7) + (b & 0x7f)
} while((b & 0x80) != 0L)
diff --git a/src/compiler/scala/tools/nsc/util/package.scala b/src/compiler/scala/tools/nsc/util/package.scala
index 5faa2f7513..1e43d18900 100644
--- a/src/compiler/scala/tools/nsc/util/package.scala
+++ b/src/compiler/scala/tools/nsc/util/package.scala
@@ -133,4 +133,13 @@ package object util {
@deprecated("Moved to scala.reflect.internal.util.BatchSourceFile", "2.10.0")
type BatchSourceFile = scala.reflect.internal.util.BatchSourceFile
+
+ @deprecated("Moved to scala.reflect.internal.util.AbstractFileClassLoader", "2.11.0")
+ type AbstractFileClassLoader = scala.reflect.internal.util.AbstractFileClassLoader
+
+ @deprecated("Moved to scala.reflect.internal.util.ScalaClassLoader", "2.11.0")
+ val ScalaClassLoader = scala.reflect.internal.util.ScalaClassLoader
+
+ @deprecated("Moved to scala.reflect.internal.util.ScalaClassLoader", "2.11.0")
+ type ScalaClassLoader = scala.reflect.internal.util.ScalaClassLoader
}
diff --git a/src/compiler/scala/tools/reflect/ToolBoxFactory.scala b/src/compiler/scala/tools/reflect/ToolBoxFactory.scala
index 59408096a3..6145e61c4f 100644
--- a/src/compiler/scala/tools/reflect/ToolBoxFactory.scala
+++ b/src/compiler/scala/tools/reflect/ToolBoxFactory.scala
@@ -129,7 +129,7 @@ abstract class ToolBoxFactory[U <: JavaUniverse](val u: U) { factorySelf =>
// it inaccessible then please put it somewhere designed for that
// rather than polluting the empty package with synthetics.
val ownerClass = rootMirror.EmptyPackageClass.newClassSymbol(newTypeName("<expression-owner>"))
- build.setTypeSignature(ownerClass, ClassInfoType(List(ObjectClass.tpe), newScope, ownerClass))
+ build.setTypeSignature(ownerClass, ClassInfoType(List(ObjectTpe), newScope, ownerClass))
val owner = ownerClass.newLocalDummy(expr.pos)
val currentTyper = analyzer.newTyper(analyzer.rootContext(NoCompilationUnit, EmptyTree).make(expr, owner))
val wrapper1 = if (!withImplicitViewsDisabled) (currentTyper.context.withImplicitsEnabled[Tree] _) else (currentTyper.context.withImplicitsDisabled[Tree] _)
@@ -196,7 +196,7 @@ abstract class ToolBoxFactory[U <: JavaUniverse](val u: U) { factorySelf =>
val (obj, _) = rootMirror.EmptyPackageClass.newModuleAndClassSymbol(
nextWrapperModuleName())
- val minfo = ClassInfoType(List(ObjectClass.tpe), newScope, obj.moduleClass)
+ val minfo = ClassInfoType(List(ObjectTpe), newScope, obj.moduleClass)
obj.moduleClass setInfo minfo
obj setInfo obj.moduleClass.tpe
@@ -206,7 +206,7 @@ abstract class ToolBoxFactory[U <: JavaUniverse](val u: U) { factorySelf =>
val (fv, name) = schema
meth.newValueParameter(name, newFlags = if (fv.hasStableFlag) STABLE else 0) setInfo appliedType(definitions.FunctionClass(0).tpe, List(fv.tpe.resultType))
}
- meth setInfo MethodType(freeTerms.map(makeParam).toList, AnyClass.tpe)
+ meth setInfo MethodType(freeTerms.map(makeParam).toList, AnyTpe)
minfo.decls enter meth
def defOwner(tree: Tree): Symbol = tree find (_.isDef) map (_.symbol) match {
case Some(sym) if sym != null && sym != NoSymbol => sym.owner
@@ -218,7 +218,7 @@ abstract class ToolBoxFactory[U <: JavaUniverse](val u: U) { factorySelf =>
val moduledef = ModuleDef(
obj,
Template(
- List(TypeTree(ObjectClass.tpe)),
+ List(TypeTree(ObjectTpe)),
emptyValDef,
NoMods,
List(),
diff --git a/src/compiler/scala/tools/reflect/WrappedProperties.scala b/src/compiler/scala/tools/reflect/WrappedProperties.scala
index c34edb8ba0..20567719be 100644
--- a/src/compiler/scala/tools/reflect/WrappedProperties.scala
+++ b/src/compiler/scala/tools/reflect/WrappedProperties.scala
@@ -25,6 +25,7 @@ trait WrappedProperties extends PropertiesTrait {
override def clearProp(name: String) = wrap(super.clearProp(name)).orNull
override def envOrElse(name: String, alt: String) = wrap(super.envOrElse(name, alt)) getOrElse alt
override def envOrNone(name: String) = wrap(super.envOrNone(name)).flatten
+ override def envOrSome(name: String, alt: Option[String]) = wrap(super.envOrNone(name)).flatten orElse alt
def systemProperties: Iterator[(String, String)] = {
import scala.collection.JavaConverters._
diff --git a/src/compiler/scala/tools/util/PathResolver.scala b/src/compiler/scala/tools/util/PathResolver.scala
index 863cbc5c1a..bdd6a02043 100644
--- a/src/compiler/scala/tools/util/PathResolver.scala
+++ b/src/compiler/scala/tools/util/PathResolver.scala
@@ -10,23 +10,38 @@ package util
import scala.tools.reflect.WrappedProperties.AccessControl
import scala.tools.nsc.{ Settings, GenericRunnerSettings }
import scala.tools.nsc.util.{ ClassPath, JavaClassPath, ScalaClassLoader }
-import scala.tools.nsc.io.{ File, Directory, Path, AbstractFile }
+import scala.reflect.io.{ File, Directory, Path, AbstractFile }
import ClassPath.{ JavaContext, DefaultJavaContext, join, split }
import PartialFunction.condOpt
import scala.language.postfixOps
// Loosely based on the draft specification at:
-// https://wiki.scala-lang.org/display/SW/Classpath
+// https://wiki.scala-lang.org/display/SIW/Classpath
object PathResolver {
// Imports property/environment functions which suppress security exceptions.
import AccessControl._
+ import scala.compat.Platform.EOL
+
+ implicit class MkLines(val t: TraversableOnce[_]) extends AnyVal {
+ def mkLines: String = t.mkString("", EOL, EOL)
+ def mkLines(header: String, indented: Boolean = false, embraced: Boolean = false): String = {
+ val space = "\u0020"
+ val sep = if (indented) EOL + space * 2 else EOL
+ val (lbrace, rbrace) = if (embraced) (space + "{", EOL + "}") else ("", "")
+ t.mkString(header + lbrace + sep, sep, rbrace + EOL)
+ }
+ }
+ implicit class AsLines(val s: String) extends AnyVal {
+ // sm"""...""" could do this in one pass
+ def asLines = s.trim.stripMargin.lines.mkLines
+ }
/** pretty print class path */
def ppcp(s: String) = split(s) match {
case Nil => ""
case Seq(x) => x
- case xs => xs map ("\n" + _) mkString
+ case xs => xs.mkString(EOL, EOL, "")
}
/** Values found solely by inspecting environment or property variables.
@@ -39,7 +54,7 @@ object PathResolver {
/** Environment variables which java pays attention to so it
* seems we do as well.
*/
- def sourcePathEnv = envOrElse("SOURCEPATH", "")
+ def sourcePathEnv = envOrElse("SOURCEPATH", "")
def javaBootClassPath = propOrElse("sun.boot.class.path", searchForBootClasspath)
def javaExtDirs = propOrEmpty("java.ext.dirs")
@@ -50,20 +65,14 @@ object PathResolver {
def javaUserClassPath = propOrElse("java.class.path", "")
def useJavaClassPath = propOrFalse("scala.usejavacp")
- override def toString = """
+ override def toString = s"""
|object Environment {
- | scalaHome = %s (useJavaClassPath = %s)
- | javaBootClassPath = <%d chars>
- | javaExtDirs = %s
- | javaUserClassPath = %s
- | scalaExtDirs = %s
- |}""".trim.stripMargin.format(
- scalaHome, useJavaClassPath,
- javaBootClassPath.length,
- ppcp(javaExtDirs),
- ppcp(javaUserClassPath),
- ppcp(scalaExtDirs)
- )
+ | scalaHome = $scalaHome (useJavaClassPath = $useJavaClassPath)
+ | javaBootClassPath = <${javaBootClassPath.length} chars>
+ | javaExtDirs = ${ppcp(javaExtDirs)}
+ | javaUserClassPath = ${ppcp(javaUserClassPath)}
+ | scalaExtDirs = ${ppcp(scalaExtDirs)}
+ |}""".asLines
}
/** Default values based on those in Environment as interpreted according
@@ -103,23 +112,59 @@ object PathResolver {
def scalaExtDirs = Environment.scalaExtDirs
def scalaPluginPath = (scalaHomeDir / "misc" / "scala-devel" / "plugins").path
- override def toString = """
+ override def toString = s"""
|object Defaults {
- | scalaHome = %s
- | javaBootClassPath = %s
- | scalaLibDirFound = %s
- | scalaLibFound = %s
- | scalaBootClassPath = %s
- | scalaPluginPath = %s
- |}""".trim.stripMargin.format(
- scalaHome,
- ppcp(javaBootClassPath),
- scalaLibDirFound, scalaLibFound,
- ppcp(scalaBootClassPath), ppcp(scalaPluginPath)
- )
+ | scalaHome = $scalaHome
+ | javaBootClassPath = ${ppcp(javaBootClassPath)}
+ | scalaLibDirFound = $scalaLibDirFound
+ | scalaLibFound = $scalaLibFound
+ | scalaBootClassPath = ${ppcp(scalaBootClassPath)}
+ | scalaPluginPath = ${ppcp(scalaPluginPath)}
+ |}""".asLines
+ }
+
+ /** Locations discovered by supplemental heuristics.
+ */
+ object SupplementalLocations {
+
+ /** The platform-specific support jar.
+ *
+ * Usually this is `tools.jar` in the jdk/lib directory of the platform distribution.
+ *
+ * The file location is determined by probing the lib directory under JDK_HOME or JAVA_HOME,
+ * if one of those environment variables is set, then the lib directory under java.home,
+ * and finally the lib directory under the parent of java.home. Or, as a last resort,
+ * search deeply under those locations (except for the parent of java.home, on the notion
+ * that if this is not a canonical installation, then that search would have little
+ * chance of succeeding).
+ */
+ def platformTools: Option[File] = {
+ val jarName = "tools.jar"
+ def jarPath(path: Path) = (path / "lib" / jarName).toFile
+ def jarAt(path: Path) = {
+ val f = jarPath(path)
+ if (f.isFile) Some(f) else None
+ }
+ val jdkDir = {
+ val d = Directory(jdkHome)
+ if (d.isDirectory) Some(d) else None
+ }
+ def deeply(dir: Directory) = dir.deepFiles find (_.name == jarName)
+
+ val home = envOrSome("JDK_HOME", envOrNone("JAVA_HOME")) map (p => Path(p))
+ val install = Some(Path(javaHome))
+
+ (home flatMap jarAt) orElse (install flatMap jarAt) orElse (install map (_.parent) flatMap jarAt) orElse
+ (jdkDir flatMap deeply)
+ }
+ override def toString = s"""
+ |object SupplementalLocations {
+ | platformTools = $platformTools
+ |}""".asLines
}
- def fromPathString(path: String, context: JavaContext = DefaultJavaContext): JavaClassPath = { // called from scalap
+ // called from scalap
+ def fromPathString(path: String, context: JavaContext = DefaultJavaContext): JavaClassPath = {
val s = new Settings()
s.classpath.value = path
new PathResolver(s, context) result
@@ -144,9 +189,10 @@ object PathResolver {
}
}
}
-import PathResolver.{ Defaults, Environment, ppcp }
class PathResolver(settings: Settings, context: JavaContext) {
+ import PathResolver.{ Defaults, Environment, AsLines, MkLines, ppcp }
+
def this(settings: Settings) = this(settings, if (settings.inline) new JavaContext else DefaultJavaContext)
private def cmdLineOrElse(name: String, alt: String) = {
@@ -217,24 +263,18 @@ class PathResolver(settings: Settings, context: JavaContext) {
lazy val containers = basis.flatten.distinct
- override def toString = """
+ override def toString = s"""
|object Calculated {
- | scalaHome = %s
- | javaBootClassPath = %s
- | javaExtDirs = %s
- | javaUserClassPath = %s
- | useJavaClassPath = %s
- | scalaBootClassPath = %s
- | scalaExtDirs = %s
- | userClassPath = %s
- | sourcePath = %s
- |}""".trim.stripMargin.format(
- scalaHome,
- ppcp(javaBootClassPath), ppcp(javaExtDirs), ppcp(javaUserClassPath),
- useJavaClassPath,
- ppcp(scalaBootClassPath), ppcp(scalaExtDirs), ppcp(userClassPath),
- ppcp(sourcePath)
- )
+ | scalaHome = $scalaHome
+ | javaBootClassPath = ${ppcp(javaBootClassPath)}
+ | javaExtDirs = ${ppcp(javaExtDirs)}
+ | javaUserClassPath = ${ppcp(javaUserClassPath)}
+ | useJavaClassPath = $useJavaClassPath
+ | scalaBootClassPath = ${ppcp(scalaBootClassPath)}
+ | scalaExtDirs = ${ppcp(scalaExtDirs)}
+ | userClassPath = ${ppcp(userClassPath)}
+ | sourcePath = ${ppcp(sourcePath)}
+ |}""".asLines
}
def containers = Calculated.containers
@@ -242,13 +282,12 @@ class PathResolver(settings: Settings, context: JavaContext) {
lazy val result = {
val cp = new JavaClassPath(containers.toIndexedSeq, context)
if (settings.Ylogcp) {
- Console.println("Classpath built from " + settings.toConciseString)
- Console.println("Defaults: " + PathResolver.Defaults)
- Console.println("Calculated: " + Calculated)
+ Console print f"Classpath built from ${settings.toConciseString} %n"
+ Console print s"Defaults: ${PathResolver.Defaults}"
+ Console print s"Calculated: $Calculated"
val xs = (Calculated.basis drop 2).flatten.distinct
- println("After java boot/extdirs classpath has %d entries:" format xs.size)
- xs foreach (x => println(" " + x))
+ Console print (xs mkLines (s"After java boot/extdirs classpath has ${xs.size} entries:", indented = true))
}
cp
}
diff --git a/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala b/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala
index e6153596f7..f260ee4093 100644
--- a/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala
+++ b/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala
@@ -95,7 +95,7 @@ abstract class CPSAnnotationChecker extends CPSUtils {
override def adaptBoundsToAnnotations(bounds: List[TypeBounds], tparams: List[Symbol], targs: List[Type]): List[TypeBounds] = {
if (!cpsEnabled) return bounds
- val anyAtCPS = newCpsParamsMarker(NothingClass.tpe, AnyClass.tpe)
+ val anyAtCPS = newCpsParamsMarker(NothingTpe, AnyTpe)
if (isFunctionType(tparams.head.owner.tpe_*) || isPartialFunctionType(tparams.head.owner.tpe_*)) {
vprintln("function bound: " + tparams.head.owner.tpe + "/"+bounds+"/"+targs)
if (hasCpsParamTypes(targs.last))
@@ -234,7 +234,7 @@ abstract class CPSAnnotationChecker extends CPSUtils {
}
/** Returns an adapted type for a return expression if the method's result type (pt) is a CPS type.
- * Otherwise, it returns the `default` type (`typedReturn` passes `NothingClass.tpe`).
+ * Otherwise, it returns the `default` type (`typedReturn` passes `NothingTpe`).
*
* A return expression in a method that has a CPS result type is an error unless the return
* is in tail position. Therefore, we are making sure that only the types of return expressions
diff --git a/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala b/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala
index 846ce01953..908ffb3713 100644
--- a/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala
+++ b/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala
@@ -189,7 +189,7 @@ abstract class SelectiveCPSTransform extends PluginComponent with
val targettp = transformCPSType(tree.tpe)
val pos = catches.head.pos
- val funSym = currentOwner.newValueParameter(cpsNames.catches, pos).setInfo(appliedType(PartialFunctionClass, ThrowableClass.tpe, targettp))
+ val funSym = currentOwner.newValueParameter(cpsNames.catches, pos).setInfo(appliedType(PartialFunctionClass, ThrowableTpe, targettp))
val funDef = localTyper.typedPos(pos) {
ValDef(funSym, Match(EmptyTree, catches1))
}
@@ -197,7 +197,7 @@ abstract class SelectiveCPSTransform extends PluginComponent with
Apply(Select(expr1, expr1.tpe.member(cpsNames.flatMapCatch)), List(Ident(funSym)))
}
- val exSym = currentOwner.newValueParameter(cpsNames.ex, pos).setInfo(ThrowableClass.tpe)
+ val exSym = currentOwner.newValueParameter(cpsNames.ex, pos).setInfo(ThrowableTpe)
import CODE._
// generate a case that is supported directly by the back-end
@@ -207,8 +207,8 @@ abstract class SelectiveCPSTransform extends PluginComponent with
IF ((REF(funSym) DOT nme.isDefinedAt)(REF(exSym))) THEN (REF(funSym) APPLY (REF(exSym))) ELSE Throw(REF(exSym))
)
- val catch2 = localTyper.typedCases(List(catchIfDefined), ThrowableClass.tpe, targettp)
- //typedCases(tree, catches, ThrowableClass.tpe, pt)
+ val catch2 = localTyper.typedCases(List(catchIfDefined), ThrowableTpe, targettp)
+ //typedCases(tree, catches, ThrowableTpe, pt)
patmatTransformer.transform(localTyper.typed(Block(List(funDef), treeCopy.Try(tree, treeCopy.Block(block1, stms, expr2), catch2, finalizer1))))
diff --git a/src/interactive/scala/tools/nsc/interactive/Global.scala b/src/interactive/scala/tools/nsc/interactive/Global.scala
index 6a833ab864..99f2cd4056 100644
--- a/src/interactive/scala/tools/nsc/interactive/Global.scala
+++ b/src/interactive/scala/tools/nsc/interactive/Global.scala
@@ -1089,7 +1089,7 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "")
val applicableViews: List[SearchResult] =
if (ownerTpe.isErroneous) List()
else new ImplicitSearch(
- tree, functionType(List(ownerTpe), AnyClass.tpe), isView = true,
+ tree, functionType(List(ownerTpe), AnyTpe), isView = true,
context0 = context.makeImplicit(reportAmbiguousErrors = false)).allImplicits
for (view <- applicableViews) {
val vtree = viewApply(view)
diff --git a/src/interactive/scala/tools/nsc/interactive/REPL.scala b/src/interactive/scala/tools/nsc/interactive/REPL.scala
index daa1c21c4a..33981771ec 100644
--- a/src/interactive/scala/tools/nsc/interactive/REPL.scala
+++ b/src/interactive/scala/tools/nsc/interactive/REPL.scala
@@ -165,7 +165,7 @@ object REPL {
show(reloadResult)
case "reloadAndAskType" :: file :: millis :: Nil =>
comp.askReload(List(toSourceFile(file)), reloadResult)
- Thread.sleep(millis.toInt)
+ Thread.sleep(millis.toLong)
println("ask type now")
comp.askLoadedTyped(toSourceFile(file), typedResult)
typedResult.get
diff --git a/src/interactive/scala/tools/nsc/interactive/tests/Tester.scala b/src/interactive/scala/tools/nsc/interactive/tests/Tester.scala
index a678c41718..4390d5dc54 100644
--- a/src/interactive/scala/tools/nsc/interactive/tests/Tester.scala
+++ b/src/interactive/scala/tools/nsc/interactive/tests/Tester.scala
@@ -26,7 +26,7 @@ class Tester(ntests: Int, inputs: Array[SourceFile], settings: Settings) {
while (!res.isComplete && !res.isCancelled) {
if (System.currentTimeMillis() > limit) {
print("c"); res.cancel()
- } else res.get(TIMEOUT) match {
+ } else res.get(TIMEOUT.toLong) match {
case Some(Left(t)) =>
/**/
if (settings.verbose) println(t)
diff --git a/src/library/scala/collection/JavaConversions.scala b/src/library/scala/collection/JavaConversions.scala
index b527b34f10..7bfa60771f 100644
--- a/src/library/scala/collection/JavaConversions.scala
+++ b/src/library/scala/collection/JavaConversions.scala
@@ -49,47 +49,4 @@ import convert._
* @author Martin Odersky
* @since 2.8
*/
-object JavaConversions extends WrapAsScala with WrapAsJava {
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type ConcurrentMapWrapper[A, B] = Wrappers.ConcurrentMapWrapper[A, B]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type DictionaryWrapper[A, B] = Wrappers.DictionaryWrapper[A, B]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type IterableWrapper[A] = Wrappers.IterableWrapper[A]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type IteratorWrapper[A] = Wrappers.IteratorWrapper[A]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type JCollectionWrapper[A] = Wrappers.JCollectionWrapper[A]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type JConcurrentMapWrapper[A, B] = Wrappers.JConcurrentMapWrapper[A, B]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type JDictionaryWrapper[A, B] = Wrappers.JDictionaryWrapper[A, B]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type JEnumerationWrapper[A] = Wrappers.JEnumerationWrapper[A]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type JIterableWrapper[A] = Wrappers.JIterableWrapper[A]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type JIteratorWrapper[A] = Wrappers.JIteratorWrapper[A]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type JListWrapper[A] = Wrappers.JListWrapper[A]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type JMapWrapper[A, B] = Wrappers.JMapWrapper[A, B]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type JPropertiesWrapper = Wrappers.JPropertiesWrapper
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type JSetWrapper[A] = Wrappers.JSetWrapper[A]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type MapWrapper[A, B] = Wrappers.MapWrapper[A, B]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type MutableBufferWrapper[A] = Wrappers.MutableBufferWrapper[A]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type MutableMapWrapper[A, B] = Wrappers.MutableMapWrapper[A, B]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type MutableSeqWrapper[A] = Wrappers.MutableSeqWrapper[A]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type MutableSetWrapper[A] = Wrappers.MutableSetWrapper[A]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type SeqWrapper[A] = Wrappers.SeqWrapper[A]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type SetWrapper[A] = Wrappers.SetWrapper[A]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") type ToIteratorWrapper[A] = Wrappers.ToIteratorWrapper[A]
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") val DictionaryWrapper = Wrappers.DictionaryWrapper
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") val IterableWrapper = Wrappers.IterableWrapper
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") val IteratorWrapper = Wrappers.IteratorWrapper
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") val JCollectionWrapper = Wrappers.JCollectionWrapper
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") val JConcurrentMapWrapper = Wrappers.JConcurrentMapWrapper
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") val JDictionaryWrapper = Wrappers.JDictionaryWrapper
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") val JEnumerationWrapper = Wrappers.JEnumerationWrapper
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") val JIterableWrapper = Wrappers.JIterableWrapper
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") val JIteratorWrapper = Wrappers.JIteratorWrapper
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") val JListWrapper = Wrappers.JListWrapper
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") val JMapWrapper = Wrappers.JMapWrapper
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") val JPropertiesWrapper = Wrappers.JPropertiesWrapper
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") val JSetWrapper = Wrappers.JSetWrapper
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") val MutableBufferWrapper = Wrappers.MutableBufferWrapper
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") val MutableMapWrapper = Wrappers.MutableMapWrapper
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") val MutableSeqWrapper = Wrappers.MutableSeqWrapper
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") val MutableSetWrapper = Wrappers.MutableSetWrapper
- @deprecated("Use a member of scala.collection.convert.Wrappers", "2.10.0") val SeqWrapper = Wrappers.SeqWrapper
-}
-
-
+object JavaConversions extends WrapAsScala with WrapAsJava
diff --git a/src/library/scala/collection/JavaConverters.scala b/src/library/scala/collection/JavaConverters.scala
index 80dbf4b19d..a4fa58b13c 100755
--- a/src/library/scala/collection/JavaConverters.scala
+++ b/src/library/scala/collection/JavaConverters.scala
@@ -55,15 +55,4 @@ import convert._
* @author Martin Odersky
* @since 2.8.1
*/
-object JavaConverters extends DecorateAsJava with DecorateAsScala {
- @deprecated("Don't access these decorators directly.", "2.10.0")
- type AsJava[A] = Decorators.AsJava[A]
- @deprecated("Don't access these decorators directly.", "2.10.0")
- type AsScala[A] = Decorators.AsScala[A]
- @deprecated("Don't access these decorators directly.", "2.10.0")
- type AsJavaCollection[A] = Decorators.AsJavaCollection[A]
- @deprecated("Don't access these decorators directly.", "2.10.0")
- type AsJavaEnumeration[A] = Decorators.AsJavaEnumeration[A]
- @deprecated("Don't access these decorators directly.", "2.10.0")
- type AsJavaDictionary[A, B] = Decorators.AsJavaDictionary[A, B]
-}
+object JavaConverters extends DecorateAsJava with DecorateAsScala
diff --git a/src/library/scala/collection/mutable/StringBuilder.scala b/src/library/scala/collection/mutable/StringBuilder.scala
index cfabd9171c..498e9e461e 100644
--- a/src/library/scala/collection/mutable/StringBuilder.scala
+++ b/src/library/scala/collection/mutable/StringBuilder.scala
@@ -256,8 +256,8 @@ final class StringBuilder(private val underlying: JavaStringBuilder)
* @return This StringBuilder.
*/
def append(x: Boolean): StringBuilder = { underlying append x ; this }
- def append(x: Byte): StringBuilder = { underlying append x ; this }
- def append(x: Short): StringBuilder = { underlying append x ; this }
+ def append(x: Byte): StringBuilder = append(x.toInt)
+ def append(x: Short): StringBuilder = append(x.toInt)
def append(x: Int): StringBuilder = { underlying append x ; this }
def append(x: Long): StringBuilder = { underlying append x ; this }
def append(x: Float): StringBuilder = { underlying append x ; this }
@@ -360,8 +360,8 @@ final class StringBuilder(private val underlying: JavaStringBuilder)
* @return this StringBuilder.
*/
def insert(index: Int, x: Boolean): StringBuilder = insert(index, String.valueOf(x))
- def insert(index: Int, x: Byte): StringBuilder = insert(index, String.valueOf(x))
- def insert(index: Int, x: Short): StringBuilder = insert(index, String.valueOf(x))
+ def insert(index: Int, x: Byte): StringBuilder = insert(index, x.toInt)
+ def insert(index: Int, x: Short): StringBuilder = insert(index, x.toInt)
def insert(index: Int, x: Int): StringBuilder = insert(index, String.valueOf(x))
def insert(index: Int, x: Long): StringBuilder = insert(index, String.valueOf(x))
def insert(index: Int, x: Float): StringBuilder = insert(index, String.valueOf(x))
diff --git a/src/library/scala/concurrent/duration/package.scala b/src/library/scala/concurrent/duration/package.scala
index 2fd735f19e..b32d2b20cb 100644
--- a/src/library/scala/concurrent/duration/package.scala
+++ b/src/library/scala/concurrent/duration/package.scala
@@ -36,12 +36,12 @@ package object duration {
final val NANOSECONDS = java.util.concurrent.TimeUnit.NANOSECONDS
final val SECONDS = java.util.concurrent.TimeUnit.SECONDS
- implicit def pairIntToDuration(p: (Int, TimeUnit)): Duration = Duration(p._1, p._2)
+ implicit def pairIntToDuration(p: (Int, TimeUnit)): Duration = Duration(p._1.toLong, p._2)
implicit def pairLongToDuration(p: (Long, TimeUnit)): FiniteDuration = Duration(p._1, p._2)
implicit def durationToPair(d: Duration): (Long, TimeUnit) = (d.length, d.unit)
implicit final class DurationInt(val n: Int) extends AnyVal with DurationConversions {
- override protected def durationIn(unit: TimeUnit): FiniteDuration = Duration(n, unit)
+ override protected def durationIn(unit: TimeUnit): FiniteDuration = Duration(n.toLong, unit)
}
implicit final class DurationLong(val n: Long) extends AnyVal with DurationConversions {
@@ -60,16 +60,16 @@ package object duration {
* Avoid reflection based invocation by using non-duck type
*/
implicit final class IntMult(val i: Int) extends AnyVal {
- def *(d: Duration) = d * i
- def *(d: FiniteDuration) = d * i
+ def *(d: Duration) = d * i.toDouble
+ def *(d: FiniteDuration) = d * i.toLong
}
implicit final class LongMult(val i: Long) extends AnyVal {
- def *(d: Duration) = d * i
- def *(d: FiniteDuration) = d * i
+ def *(d: Duration) = d * i.toDouble
+ def *(d: FiniteDuration) = d * i.toLong
}
implicit final class DoubleMult(val f: Double) extends AnyVal {
- def *(d: Duration) = d * f
+ def *(d: Duration) = d * f.toDouble
}
}
diff --git a/src/library/scala/io/BufferedSource.scala b/src/library/scala/io/BufferedSource.scala
index e250da27c3..c170d28127 100644
--- a/src/library/scala/io/BufferedSource.scala
+++ b/src/library/scala/io/BufferedSource.scala
@@ -55,7 +55,7 @@ class BufferedSource(inputStream: InputStream, bufferSize: Int)(implicit val cod
// immediately on the source.
if (charReaderCreated && iter.hasNext) {
val pb = new PushbackReader(charReader)
- pb unread iter.next()
+ pb unread iter.next().toInt
new BufferedReader(pb, bufferSize)
}
else charReader
diff --git a/src/library/scala/math/BigDecimal.scala b/src/library/scala/math/BigDecimal.scala
index f75cfad882..00a3686585 100644
--- a/src/library/scala/math/BigDecimal.scala
+++ b/src/library/scala/math/BigDecimal.scala
@@ -44,6 +44,7 @@ object BigDecimal {
*/
def valueOf(d: Double): BigDecimal = apply(BigDec valueOf d)
def valueOf(d: Double, mc: MathContext): BigDecimal = apply(BigDec valueOf d, mc)
+ def valueOf(x: Long): BigDecimal = apply(x.toDouble)
/** Constructs a `BigDecimal` whose value is equal to that of the
* specified `Integer` value.
@@ -56,10 +57,10 @@ object BigDecimal {
if (mc == defaultMathContext && minCached <= i && i <= maxCached) {
val offset = i - minCached
var n = cache(offset)
- if (n eq null) { n = new BigDecimal(BigDec.valueOf(i), mc); cache(offset) = n }
+ if (n eq null) { n = new BigDecimal(BigDec.valueOf(i.toLong), mc); cache(offset) = n }
n
}
- else new BigDecimal(BigDec.valueOf(i), mc)
+ else new BigDecimal(BigDec.valueOf(i.toLong), mc)
/** Constructs a `BigDecimal` whose value is equal to that of the
* specified long value.
@@ -99,6 +100,9 @@ object BigDecimal {
def apply(d: Double, mc: MathContext): BigDecimal =
new BigDecimal(new BigDec(jl.Double.toString(d), mc), mc)
+ def apply(x: Float): BigDecimal = apply(x.toDouble)
+ def apply(x: Float, mc: MathContext): BigDecimal = apply(x.toDouble, mc)
+
/** Translates a character array representation of a `BigDecimal`
* into a `BigDecimal`.
*/
@@ -193,7 +197,7 @@ extends ScalaNumber with ScalaNumericConversions with Serializable {
*/
def isValidFloat = {
val f = toFloat
- !f.isInfinity && bigDecimal.compareTo(new java.math.BigDecimal(f)) == 0
+ !f.isInfinity && bigDecimal.compareTo(new java.math.BigDecimal(f.toDouble)) == 0
}
/** Returns `true` iff this can be represented exactly by [[scala.Double]]; otherwise returns `false`.
*/
diff --git a/src/library/scala/math/BigInt.scala b/src/library/scala/math/BigInt.scala
index 4673aa5d48..afc4d5c535 100644
--- a/src/library/scala/math/BigInt.scala
+++ b/src/library/scala/math/BigInt.scala
@@ -34,9 +34,9 @@ object BigInt {
if (minCached <= i && i <= maxCached) {
val offset = i - minCached
var n = cache(offset)
- if (n eq null) { n = new BigInt(BigInteger.valueOf(i)); cache(offset) = n }
+ if (n eq null) { n = new BigInt(BigInteger.valueOf(i.toLong)); cache(offset) = n }
n
- } else new BigInt(BigInteger.valueOf(i))
+ } else new BigInt(BigInteger.valueOf(i.toLong))
/** Constructs a `BigInt` whose value is equal to that of the
* specified long value.
diff --git a/src/library/scala/math/Numeric.scala b/src/library/scala/math/Numeric.scala
index cb9f9deb70..e6644c0dfc 100644
--- a/src/library/scala/math/Numeric.scala
+++ b/src/library/scala/math/Numeric.scala
@@ -51,9 +51,9 @@ object Numeric {
def negate(x: Int): Int = -x
def fromInt(x: Int): Int = x
def toInt(x: Int): Int = x
- def toLong(x: Int): Long = x
- def toFloat(x: Int): Float = x
- def toDouble(x: Int): Double = x
+ def toLong(x: Int): Long = x.toLong
+ def toFloat(x: Int): Float = x.toFloat
+ def toDouble(x: Int): Double = x.toDouble
}
implicit object IntIsIntegral extends IntIsIntegral with Ordering.IntOrdering
@@ -109,11 +109,11 @@ object Numeric {
def quot(x: Long, y: Long): Long = x / y
def rem(x: Long, y: Long): Long = x % y
def negate(x: Long): Long = -x
- def fromInt(x: Int): Long = x
+ def fromInt(x: Int): Long = x.toLong
def toInt(x: Long): Int = x.toInt
def toLong(x: Long): Long = x
- def toFloat(x: Long): Float = x
- def toDouble(x: Long): Double = x
+ def toFloat(x: Long): Float = x.toFloat
+ def toDouble(x: Long): Double = x.toDouble
}
implicit object LongIsIntegral extends LongIsIntegral with Ordering.LongOrdering
@@ -122,11 +122,11 @@ object Numeric {
def minus(x: Float, y: Float): Float = x - y
def times(x: Float, y: Float): Float = x * y
def negate(x: Float): Float = -x
- def fromInt(x: Int): Float = x
+ def fromInt(x: Int): Float = x.toFloat
def toInt(x: Float): Int = x.toInt
def toLong(x: Float): Long = x.toLong
def toFloat(x: Float): Float = x
- def toDouble(x: Float): Double = x
+ def toDouble(x: Float): Double = x.toDouble
}
trait FloatIsFractional extends FloatIsConflicted with Fractional[Float] {
def div(x: Float, y: Float): Float = x / y
@@ -144,7 +144,7 @@ object Numeric {
def minus(x: Double, y: Double): Double = x - y
def times(x: Double, y: Double): Double = x * y
def negate(x: Double): Double = -x
- def fromInt(x: Int): Double = x
+ def fromInt(x: Int): Double = x.toDouble
def toInt(x: Double): Int = x.toInt
def toLong(x: Double): Long = x.toLong
def toFloat(x: Double): Float = x.toFloat
diff --git a/src/library/scala/math/package.scala b/src/library/scala/math/package.scala
index cb033bda2c..fc85bfdc28 100644
--- a/src/library/scala/math/package.scala
+++ b/src/library/scala/math/package.scala
@@ -62,7 +62,7 @@ package object math {
def sqrt(x: Double): Double = java.lang.Math.sqrt(x)
def IEEEremainder(x: Double, y: Double): Double = java.lang.Math.IEEEremainder(x, y)
- def ceil(x: Double): Double = java.lang.Math.ceil(x)
+ def ceil(x: Double): Double = java.lang.Math.ceil(x)
def floor(x: Double): Double = java.lang.Math.floor(x)
/** Returns the `double` value that is closest in value to the
@@ -100,24 +100,30 @@ package object math {
*/
def round(x: Float): Int = java.lang.Math.round(x)
def round(x: Double): Long = java.lang.Math.round(x)
- def abs(x: Int): Int = java.lang.Math.abs(x)
- def abs(x: Long): Long = java.lang.Math.abs(x)
- def abs(x: Float): Float = java.lang.Math.abs(x)
+
+ def abs(x: Int): Int = java.lang.Math.abs(x)
+ def abs(x: Long): Long = java.lang.Math.abs(x)
+ def abs(x: Float): Float = java.lang.Math.abs(x)
def abs(x: Double): Double = java.lang.Math.abs(x)
- def max(x: Int, y: Int): Int = java.lang.Math.max(x, y)
- def max(x: Long, y: Long): Long = java.lang.Math.max(x, y)
- def max(x: Float, y: Float): Float = java.lang.Math.max(x, y)
+ def max(x: Int, y: Int): Int = java.lang.Math.max(x, y)
+ def max(x: Long, y: Long): Long = java.lang.Math.max(x, y)
+ def max(x: Float, y: Float): Float = java.lang.Math.max(x, y)
def max(x: Double, y: Double): Double = java.lang.Math.max(x, y)
- def min(x: Int, y: Int): Int = java.lang.Math.min(x, y)
- def min(x: Long, y: Long): Long = java.lang.Math.min(x, y)
- def min(x: Float, y: Float): Float = java.lang.Math.min(x, y)
+ def min(x: Int, y: Int): Int = java.lang.Math.min(x, y)
+ def min(x: Long, y: Long): Long = java.lang.Math.min(x, y)
+ def min(x: Float, y: Float): Float = java.lang.Math.min(x, y)
def min(x: Double, y: Double): Double = java.lang.Math.min(x, y)
- def signum(x: Int): Int = java.lang.Integer.signum(x)
- def signum(x: Long): Long = java.lang.Long.signum(x)
- def signum(x: Float): Float = java.lang.Math.signum(x)
+ /** Note that these are not pure forwarders to the java versions.
+ * In particular, the return type of java.lang.Long.signum is Int,
+ * but here it is widened to Long so that each overloaded variant
+ * will return the same numeric type it is passed.
+ */
+ def signum(x: Int): Int = java.lang.Integer.signum(x)
+ def signum(x: Long): Long = java.lang.Long.signum(x)
+ def signum(x: Float): Float = java.lang.Math.signum(x)
def signum(x: Double): Double = java.lang.Math.signum(x)
// -----------------------------------------------------------------------
diff --git a/src/library/scala/reflect/NameTransformer.scala b/src/library/scala/reflect/NameTransformer.scala
index 6192971c74..a8430548f5 100755
--- a/src/library/scala/reflect/NameTransformer.scala
+++ b/src/library/scala/reflect/NameTransformer.scala
@@ -30,9 +30,9 @@ object NameTransformer {
private val op2code = new Array[String](nops)
private val code2op = new Array[OpCodes](ncodes)
private def enterOp(op: Char, code: String) = {
- op2code(op) = code
+ op2code(op.toInt) = code
val c = (code.charAt(1) - 'a') * 26 + code.charAt(2) - 'a'
- code2op(c) = new OpCodes(op, code, code2op(c))
+ code2op(c.toInt) = new OpCodes(op, code, code2op(c))
}
/* Note: decoding assumes opcodes are only ever lowercase. */
@@ -66,12 +66,12 @@ object NameTransformer {
var i = 0
while (i < len) {
val c = name charAt i
- if (c < nops && (op2code(c) ne null)) {
+ if (c < nops && (op2code(c.toInt) ne null)) {
if (buf eq null) {
buf = new StringBuilder()
buf.append(name.substring(0, i))
}
- buf.append(op2code(c))
+ buf.append(op2code(c.toInt))
/* Handle glyphs that are not valid Java/JVM identifiers */
}
else if (!Character.isJavaIdentifierPart(c)) {
diff --git a/src/library/scala/runtime/RichFloat.scala b/src/library/scala/runtime/RichFloat.scala
index cb0681bc19..0bca033b7b 100644
--- a/src/library/scala/runtime/RichFloat.scala
+++ b/src/library/scala/runtime/RichFloat.scala
@@ -15,22 +15,22 @@ final class RichFloat(val self: Float) extends AnyVal with FractionalProxy[Float
protected def integralNum = scala.math.Numeric.FloatAsIfIntegral
def round: Int = math.round(self)
- def ceil: Float = math.ceil(self).toFloat
- def floor: Float = math.floor(self).toFloat
+ def ceil: Float = math.ceil(self.toDouble).toFloat
+ def floor: Float = math.floor(self.toDouble).toFloat
/** Converts an angle measured in degrees to an approximately equivalent
* angle measured in radians.
*
* @return the measurement of the angle `x` in radians.
*/
- def toRadians: Float = math.toRadians(self).toFloat
+ def toRadians: Float = math.toRadians(self.toDouble).toFloat
/** Converts an angle measured in radians to an approximately equivalent
* angle measured in degrees.
*
* @return the measurement of the angle `x` in degrees.
*/
- def toDegrees: Float = math.toDegrees(self).toFloat
+ def toDegrees: Float = math.toDegrees(self.toDouble).toFloat
// isNaN is provided by the implicit conversion to java.lang.Float
// def isNaN: Boolean = java.lang.Float.isNaN(self)
diff --git a/src/library/scala/runtime/WorksheetSupport.scala b/src/library/scala/runtime/WorksheetSupport.scala
index 016a0d04e0..2a0064494b 100644
--- a/src/library/scala/runtime/WorksheetSupport.scala
+++ b/src/library/scala/runtime/WorksheetSupport.scala
@@ -21,7 +21,7 @@ object WorksheetSupport {
private var lastFlush: Long = 0L
private var col = -1
override def write(b: Array[Byte], off: Int, len: Int) = {
- for (idx <- off until (off + len min b.length)) writeOne(b(idx))
+ for (idx <- off until (off + len min b.length)) writeOne(b(idx).toInt)
flush()
}
override def write(c: Int) {
diff --git a/src/library/scala/util/MurmurHash.scala b/src/library/scala/util/MurmurHash.scala
index 6b306211dc..e05fe0875b 100644
--- a/src/library/scala/util/MurmurHash.scala
+++ b/src/library/scala/util/MurmurHash.scala
@@ -172,7 +172,7 @@ object MurmurHash {
k = nextMagicB(k)
j += 2
}
- if (j < s.length) h = extendHash(h,s.charAt(j),c,k)
+ if (j < s.length) h = extendHash(h,s.charAt(j).toInt,c,k)
finalizeHash(h)
}
diff --git a/src/library/scala/util/Properties.scala b/src/library/scala/util/Properties.scala
index d2d473bf98..73469a955d 100644
--- a/src/library/scala/util/Properties.scala
+++ b/src/library/scala/util/Properties.scala
@@ -60,6 +60,8 @@ private[scala] trait PropertiesTrait {
def envOrElse(name: String, alt: String) = Option(System getenv name) getOrElse alt
def envOrNone(name: String) = Option(System getenv name)
+ def envOrSome(name: String, alt: Option[String]) = envOrNone(name) orElse alt
+
// for values based on propFilename
def scalaPropOrElse(name: String, alt: String): String = scalaProps.getProperty(name, alt)
def scalaPropOrEmpty(name: String): String = scalaPropOrElse(name, "")
diff --git a/src/library/scala/util/hashing/MurmurHash3.scala b/src/library/scala/util/hashing/MurmurHash3.scala
index af0b12d8ba..c85664349e 100644
--- a/src/library/scala/util/hashing/MurmurHash3.scala
+++ b/src/library/scala/util/hashing/MurmurHash3.scala
@@ -77,7 +77,7 @@ private[hashing] class MurmurHash3 {
h = mix(h, data)
i += 2
}
- if (i < str.length) h = mixLast(h, str.charAt(i))
+ if (i < str.length) h = mixLast(h, str.charAt(i).toInt)
finalizeHash(h, str.length)
}
diff --git a/src/library/scala/util/parsing/json/JSON.scala b/src/library/scala/util/parsing/json/JSON.scala
index 6eaa47473f..b06dddf532 100644
--- a/src/library/scala/util/parsing/json/JSON.scala
+++ b/src/library/scala/util/parsing/json/JSON.scala
@@ -28,6 +28,7 @@ package util.parsing.json
*
* @author Derek Chen-Becker <"java"+@+"chen-becker"+"."+"org">
*/
+@deprecated("This object will be removed.", "2.11.0")
object JSON extends Parser {
/**
diff --git a/src/library/scala/util/parsing/json/Lexer.scala b/src/library/scala/util/parsing/json/Lexer.scala
index 63df9c28eb..7fc4e0bab6 100644
--- a/src/library/scala/util/parsing/json/Lexer.scala
+++ b/src/library/scala/util/parsing/json/Lexer.scala
@@ -18,6 +18,7 @@ import scala.util.parsing.input.CharArrayReader.EofCh
/**
* @author Derek Chen-Becker <"java"+@+"chen-becker"+"."+"org">
*/
+@deprecated("This class will be removed.", "2.11.0")
class Lexer extends StdLexical with ImplicitConversions {
override def token: Parser[Token] =
diff --git a/src/library/scala/util/parsing/json/Parser.scala b/src/library/scala/util/parsing/json/Parser.scala
index c61e3df181..521dfc6612 100644
--- a/src/library/scala/util/parsing/json/Parser.scala
+++ b/src/library/scala/util/parsing/json/Parser.scala
@@ -19,6 +19,7 @@ import scala.util.parsing.combinator.syntactical._
*
* @author Derek Chen-Becker <"java"+@+"chen-becker"+"."+"org">
*/
+@deprecated("This class will be removed.", "2.11.0")
sealed abstract class JSONType {
/**
* This version of toString allows you to provide your own value
@@ -40,6 +41,7 @@ sealed abstract class JSONType {
*
* @author Derek Chen-Becker <"java"+@+"chen-becker"+"."+"org">
*/
+@deprecated("This object will be removed.", "2.11.0")
object JSONFormat {
/**
* This type defines a function that can be used to
@@ -81,7 +83,7 @@ object JSONFormat {
* Per RFC4627, section 2.5, we're not technically required to
* encode the C1 codes, but we do to be safe.
*/
- case c if ((c >= '\u0000' && c <= '\u001f') || (c >= '\u007f' && c <= '\u009f')) => "\\u%04x".format(c: Int)
+ case c if ((c >= '\u0000' && c <= '\u001f') || (c >= '\u007f' && c <= '\u009f')) => "\\u%04x".format(c.toInt)
case c => c
}.mkString
}
@@ -91,6 +93,7 @@ object JSONFormat {
*
* @author Derek Chen-Becker <"java"+@+"chen-becker"+"."+"org">
*/
+@deprecated("This class will be removed.", "2.11.0")
case class JSONObject (obj : Map[String,Any]) extends JSONType {
def toString (formatter : JSONFormat.ValueFormatter) =
"{" + obj.map({ case (k,v) => formatter(k.toString) + " : " + formatter(v) }).mkString(", ") + "}"
@@ -100,6 +103,7 @@ case class JSONObject (obj : Map[String,Any]) extends JSONType {
* Represents a JSON Array (list).
* @author Derek Chen-Becker <"java"+@+"chen-becker"+"."+"org">
*/
+@deprecated("This class will be removed.", "2.11.0")
case class JSONArray (list : List[Any]) extends JSONType {
def toString (formatter : JSONFormat.ValueFormatter) =
"[" + list.map(formatter).mkString(", ") + "]"
@@ -110,6 +114,7 @@ case class JSONArray (list : List[Any]) extends JSONType {
*
* @author Derek Chen-Becker <"java"+@+"chen-becker"+"."+"org">
*/
+@deprecated("This class will be removed.", "2.11.0")
class Parser extends StdTokenParsers with ImplicitConversions {
// Fill in abstract defs
type Tokens = Lexer
diff --git a/src/library/scala/xml/include/sax/XIncluder.scala b/src/library/scala/xml/include/sax/XIncluder.scala
index 531b7196f2..1939fa1875 100644
--- a/src/library/scala/xml/include/sax/XIncluder.scala
+++ b/src/library/scala/xml/include/sax/XIncluder.scala
@@ -95,7 +95,7 @@ class XIncluder(outs: OutputStream, encoding: String) extends ContentHandler wit
// However, it is required if text contains ]]>
// (The end CDATA section delimiter)
else if (c == '>') out.write("&gt;")
- else out.write(c)
+ else out.write(c.toInt)
i += 1
}
}
diff --git a/src/library/scala/xml/persistent/CachedFileStorage.scala b/src/library/scala/xml/persistent/CachedFileStorage.scala
index 57d512a041..a1489ef3f4 100644
--- a/src/library/scala/xml/persistent/CachedFileStorage.scala
+++ b/src/library/scala/xml/persistent/CachedFileStorage.scala
@@ -112,7 +112,7 @@ abstract class CachedFileStorage(private val file1: File) extends Thread {
override def run = {
log("[run]\nstarting storage thread, checking every "+interval+" ms")
while (true) {
- Thread.sleep( this.interval )
+ Thread.sleep( this.interval.toLong )
save()
}
}
diff --git a/src/partest/scala/tools/partest/nest/PathSettings.scala b/src/partest/scala/tools/partest/nest/PathSettings.scala
index 8e454d8de8..030c515947 100644
--- a/src/partest/scala/tools/partest/nest/PathSettings.scala
+++ b/src/partest/scala/tools/partest/nest/PathSettings.scala
@@ -5,10 +5,8 @@
package scala.tools.partest
package nest
-import scala.tools.nsc.Properties.{ setProp, propOrEmpty, propOrNone, propOrElse }
import scala.tools.nsc.util.ClassPath
import scala.tools.nsc.io.{ Path, File, Directory }
-import scala.util.Properties.{ envOrElse, envOrNone, javaHome, jdkHome }
import Path._
object PathSettings {
@@ -80,34 +78,9 @@ object PathSettings {
lazy val diffUtils: File =
findJar(buildPackLibDir.files, "diffutils") getOrElse sys.error(s"No diffutils.jar found in '$buildPackLibDir'.")
- /** The platform-specific support jar.
- * Usually this is tools.jar in the jdk/lib directory of the platform distribution.
- * The file location is determined by probing the lib directory under JDK_HOME or JAVA_HOME,
- * if one of those environment variables is set, then the lib directory under java.home,
- * and finally the lib directory under the parent of java.home. Or, as a last resort,
- * search deeply under those locations (except for the parent of java.home, on the notion
- * that if this is not a canonical installation, then that search would have little
- * chance of succeeding).
+ /** The platform-specific support jar, `tools.jar`.
*/
- lazy val platformTools: Option[File] = {
- val jarName = "tools.jar"
- def jarPath(path: Path) = (path / "lib" / jarName).toFile
- def jarAt(path: Path) = {
- val f = jarPath(path)
- if (f.isFile) Some(f) else None
- }
- val jdkDir = {
- val d = Directory(jdkHome)
- if (d.isDirectory) Some(d) else None
- }
- def deeply(dir: Directory) = dir.deepFiles find (_.name == jarName)
-
- val home = envOrNone("JDK_HOME") orElse envOrNone("JAVA_HOME") map (p => Path(p))
- val install = Some(Path(javaHome))
-
- (home flatMap jarAt) orElse (install flatMap jarAt) orElse (install map (_.parent) flatMap jarAt) orElse
- (jdkDir flatMap deeply)
- }
+ lazy val platformTools: Option[File] = PathResolver.SupplementalLocations.platformTools
}
class PathSettings() {
diff --git a/src/partest/scala/tools/partest/nest/Runner.scala b/src/partest/scala/tools/partest/nest/Runner.scala
index 01e4f50981..1034d724d2 100644
--- a/src/partest/scala/tools/partest/nest/Runner.scala
+++ b/src/partest/scala/tools/partest/nest/Runner.scala
@@ -14,7 +14,7 @@ import scala.collection.mutable.ListBuffer
import scala.concurrent.duration.Duration
import scala.io.Codec
import scala.reflect.internal.FatalError
-import scala.sys.process.Process
+import scala.sys.process.{ Process, ProcessLogger }
import scala.tools.nsc.Properties.{ envOrElse, isWin, jdkHome, javaHome, propOrElse, propOrEmpty, setProp }
import scala.tools.nsc.{ Settings, CompilerCommand, Global }
import scala.tools.nsc.io.{ AbstractFile, PlainFile }
@@ -222,7 +222,25 @@ class Runner(val testFile: File, fileManager: FileManager, val testRunParams: Te
* error out to output file.
*/
private def runCommand(args: Seq[String], outFile: File): Boolean = {
- (Process(args) #> outFile !) == 0
+ //(Process(args) #> outFile !) == 0 or (Process(args) ! pl) == 0
+ val pl = ProcessLogger(outFile)
+ val nonzero = 17 // rounding down from 17.3
+ def run: Int = {
+ val p = Process(args) run pl
+ try p.exitValue
+ catch {
+ case e: InterruptedException =>
+ NestUI verbose s"Interrupted waiting for command to finish (${args mkString " "})"
+ p.destroy
+ nonzero
+ case t: Throwable =>
+ NestUI verbose s"Exception waiting for command to finish: $t (${args mkString " "})"
+ p.destroy
+ throw t
+ }
+ finally pl.close()
+ }
+ (pl buffer run) == 0
}
private def execTest(outDir: File, logFile: File): Boolean = {
@@ -272,11 +290,17 @@ class Runner(val testFile: File, fileManager: FileManager, val testRunParams: Te
val prefix = "#partest"
val margin = "> "
val leader = margin + prefix
- // use lines in block so labeled? Default to sure, go ahead.
- def retainOn(f: String) = f match {
- case "java7" => javaVersion startsWith "1.7"
- case "java6" => javaVersion startsWith "1.6"
- case _ => true
+ // use lines in block so labeled? Default to sorry, Charlie.
+ def retainOn(f: String) = {
+ val (invert, token) =
+ if (f startsWith "!") (true, f drop 1) else (false, f)
+ val cond = token match {
+ case "java7" => javaVersion startsWith "1.7"
+ case "java6" => javaVersion startsWith "1.6"
+ case "true" => true
+ case _ => false
+ }
+ if (invert) !cond else cond
}
if (d contains prefix) {
val sb = new StringBuilder
@@ -314,23 +338,62 @@ class Runner(val testFile: File, fileManager: FileManager, val testRunParams: Te
catch { case t: Exception => None }
}
- /** This does something about absolute paths and file separator
- * chars before diffing.
+ /** Normalize the log output by applying test-specific filters
+ * and fixing filesystem-specific paths.
+ *
+ * Line filters are picked up from `filter: pattern` at the top of sources.
+ * The filtered line is detected with a simple "contains" test,
+ * and yes, "filter" means "filter out" in this context.
+ *
+ * File paths are detected using the absolute path of the test root.
+ * A string that looks like a file path is normalized by replacing
+ * the leading segments (the root) with "$ROOT" and by replacing
+ * any Windows backslashes with the one true file separator char.
*/
def normalizeLog() {
- // squashing // in paths also munges line comments, so save this innovation for another time.
- // (There are line comments in the "stub implementations" error output.)
- //val slashes = """[/\\]+""".r
- //def squashSlashes(s: String) = slashes replaceAllIn (s, "/")
- def squashSlashes(s: String) = s replace ('\\', '/')
- val base = squashSlashes(parentFile.getAbsolutePath + File.separator)
- val quoted = """\Q%s\E""" format base
- val baseless = (if (isWin) "(?i)" + quoted else quoted).r
- def canonicalize(s: String) = baseless replaceAllIn (squashSlashes(s), "")
- logFile mapInPlace canonicalize
+ // Apply judiciously; there are line comments in the "stub implementations" error output.
+ val slashes = """[/\\]+""".r
+ def squashSlashes(s: String) = slashes replaceAllIn (s, "/")
+
+ // this string identifies a path and is also snipped from log output.
+ // to preserve more of the path, could use fileManager.testRootPath
+ val elided = parentFile.getAbsolutePath
+
+ // something to mark the elision in the log file (disabled)
+ val ellipsis = "" //".../" // using * looks like a comment
+
+ // no spaces in test file paths below root, because otherwise how to detect end of path string?
+ val pathFinder = raw"""(?i)\Q${elided}${File.separator}\E([\${File.separator}\w]*)""".r
+ def canonicalize(s: String): String = (
+ pathFinder replaceAllIn (s, m => ellipsis + squashSlashes(m group 1))
+ )
+
+ def masters = {
+ val files = List(new File(parentFile, "filters"), new File(PathSettings.srcDir.path, "filters"))
+ files filter (_.exists) flatMap (_.fileLines) map (_.trim) filter (s => !(s startsWith "#"))
+ }
+ val filters = toolArgs("filter", split = false) ++ masters
+ val elisions = ListBuffer[String]()
+ //def lineFilter(s: String): Boolean = !(filters exists (s contains _))
+ def lineFilter(s: String): Boolean = (
+ filters map (_.r) forall { r =>
+ val res = (r findFirstIn s).isEmpty
+ if (!res) elisions += s
+ res
+ }
+ )
+
+ logFile.mapInPlace(canonicalize)(lineFilter)
+ if (isPartestVerbose && elisions.nonEmpty) {
+ import NestUI.color._
+ val emdash = bold(yellow("--"))
+ pushTranscript(s"filtering ${logFile.getName}$EOL${elisions mkString (emdash, EOL + emdash, EOL)}")
+ }
}
def diffIsOk: Boolean = {
+ // always normalize the log first
+ normalizeLog()
val diff = currentDiff
// if diff is not empty, is update needed?
val updating: Option[Boolean] = (
@@ -372,16 +435,21 @@ class Runner(val testFile: File, fileManager: FileManager, val testRunParams: Te
}
/** Grouped files in group order, and lex order within each group. */
- def groupedFiles(files: List[File]): List[List[File]] = (
- if (files.tail.nonEmpty) {
- val grouped = files filter (_.isJavaOrScala) groupBy (_.group)
+ def groupedFiles(sources: List[File]): List[List[File]] = (
+ if (sources.tail.nonEmpty) {
+ val grouped = sources groupBy (_.group)
grouped.keys.toList.sorted map (k => grouped(k) sortBy (_.getName))
}
- else List(files)
+ else List(sources)
)
/** Source files for the given test file. */
- def sources(file: File): List[File] = if (file.isDirectory) file.listFiles.toList else List(file)
+ def sources(file: File): List[File] = (
+ if (file.isDirectory)
+ file.listFiles.toList filter (_.isJavaOrScala)
+ else
+ List(file)
+ )
def newCompiler = new DirectCompiler(fileManager)
@@ -403,6 +471,23 @@ class Runner(val testFile: File, fileManager: FileManager, val testRunParams: Te
perTest ++ perGroup
}
+ def toolArgs(tool: String, split: Boolean = true): List[String] = {
+ def argsplitter(s: String) = if (split) words(s) filter (_.nonEmpty) else List(s)
+ def argsFor(f: File): List[String] = {
+ import scala.util.matching.Regex
+ val p = new Regex(s"(?:.*\\s)?${tool}:(?:\\s*)(.*)?", "args")
+ val max = 10
+ val src = Path(f).toFile.chars(codec)
+ val args = try {
+ src.getLines take max collectFirst {
+ case s if (p findFirstIn s).nonEmpty => for (m <- p findFirstMatchIn s) yield m group "args"
+ }
+ } finally src.close()
+ args.flatten map argsplitter getOrElse Nil
+ }
+ sources(testFile) flatMap argsFor
+ }
+
abstract class CompileRound {
def fs: List[File]
def result: TestState
@@ -455,7 +540,7 @@ class Runner(val testFile: File, fileManager: FileManager, val testRunParams: Te
// or, OK, we'll let you crash the compiler with a FatalError if you supply a check file
def checked(r: CompileRound) = r.result match {
case Crash(_, t, _) if !checkFile.canRead || !t.isInstanceOf[FatalError] => false
- case _ => normalizeLog(); diffIsOk
+ case _ => diffIsOk
}
failing map (checked) getOrElse nextTestActionFailing("expected compilation failure")
@@ -529,22 +614,6 @@ class Runner(val testFile: File, fileManager: FileManager, val testRunParams: Te
}
val logWriter = new PrintStream(new FileOutputStream(logFile), true)
- def toolArgs(tool: String): List[String] = {
- def argsplitter(s: String) = words(s) filter (_.nonEmpty)
- def argsFor(f: File): List[String] = {
- import scala.util.matching.Regex
- val p = new Regex(s"(?:.*\\s)?${tool}:(.*)?", "args")
- val max = 10
- val src = Path(f).toFile.chars(codec)
- val args = try {
- src.getLines take max collectFirst {
- case s if (p findFirstIn s).nonEmpty => for (m <- p findFirstMatchIn s) yield m group "args"
- }
- } finally src.close()
- args.flatten map argsplitter getOrElse Nil
- }
- sources(testFile) flatMap argsFor
- }
def runInFramework(): Boolean = {
import org.scalatools.testing._
val f: Framework = loader.instantiate[Framework]("org.scalacheck.ScalaCheckFramework")
@@ -647,7 +716,6 @@ class Runner(val testFile: File, fileManager: FileManager, val testRunParams: Te
if (!Output.withRedirected(logWriter)(try loop() finally resReader.close()))
setLastState(genPass())
- normalizeLog // put errors in a normal form
(diffIsOk, LogContext(logFile, swr, wr))
}
diff --git a/src/partest/scala/tools/partest/package.scala b/src/partest/scala/tools/partest/package.scala
index 4a516d620b..5a1afeb77f 100644
--- a/src/partest/scala/tools/partest/package.scala
+++ b/src/partest/scala/tools/partest/package.scala
@@ -56,8 +56,8 @@ package object partest {
f.toString split """[/\\]+""" takeRight 2 mkString "/" // e.g. pos/t1234
}
- def mapInPlace(mapFn: String => String): Unit =
- writeAll(fileLines.map(x => mapFn(x) + "\n"): _*)
+ def mapInPlace(mapFn: String => String)(filterFn: String => Boolean = _ => true): Unit =
+ writeAll(fileLines filter filterFn map (x => mapFn(x) + EOL): _*)
def appendAll(strings: String*): Unit = sf.appendAll(strings: _*)
def writeAll(strings: String*): Unit = sf.writeAll(strings: _*)
diff --git a/src/reflect/scala/reflect/internal/BaseTypeSeqs.scala b/src/reflect/scala/reflect/internal/BaseTypeSeqs.scala
index 66eddd7ec0..368e1cde30 100644
--- a/src/reflect/scala/reflect/internal/BaseTypeSeqs.scala
+++ b/src/reflect/scala/reflect/internal/BaseTypeSeqs.scala
@@ -181,7 +181,7 @@ trait BaseTypeSeqs {
def nextRawElem(i: Int): Type = {
val j = index(i)
val pbts = pbtss(i)
- if (j < pbts.length) pbts.rawElem(j) else AnyClass.tpe
+ if (j < pbts.length) pbts.rawElem(j) else AnyTpe
}
var minSym: Symbol = NoSymbol
while (minSym != AnyClass) {
diff --git a/src/reflect/scala/reflect/internal/Constants.scala b/src/reflect/scala/reflect/internal/Constants.scala
index 905c7caa52..511b39b8c6 100644
--- a/src/reflect/scala/reflect/internal/Constants.scala
+++ b/src/reflect/scala/reflect/internal/Constants.scala
@@ -63,17 +63,17 @@ trait Constants extends api.Constants {
def isAnyVal = UnitTag <= tag && tag <= DoubleTag
def tpe: Type = tag match {
- case UnitTag => UnitClass.tpe
- case BooleanTag => BooleanClass.tpe
- case ByteTag => ByteClass.tpe
- case ShortTag => ShortClass.tpe
- case CharTag => CharClass.tpe
- case IntTag => IntClass.tpe
- case LongTag => LongClass.tpe
- case FloatTag => FloatClass.tpe
- case DoubleTag => DoubleClass.tpe
- case StringTag => StringClass.tpe
- case NullTag => NullClass.tpe
+ case UnitTag => UnitTpe
+ case BooleanTag => BooleanTpe
+ case ByteTag => ByteTpe
+ case ShortTag => ShortTpe
+ case CharTag => CharTpe
+ case IntTag => IntTpe
+ case LongTag => LongTpe
+ case FloatTag => FloatTpe
+ case DoubleTag => DoubleTpe
+ case StringTag => StringTpe
+ case NullTag => NullTpe
case ClazzTag => ClassType(typeValue)
case EnumTag => EnumType(symbolValue)
}
@@ -212,7 +212,7 @@ trait Constants extends api.Constants {
case '"' => "\\\""
case '\'' => "\\\'"
case '\\' => "\\\\"
- case _ => if (ch.isControl) "\\0" + toOctalString(ch) else String.valueOf(ch)
+ case _ => if (ch.isControl) "\\0" + toOctalString(ch.toInt) else String.valueOf(ch)
}
def escapedStringValue: String = {
diff --git a/src/reflect/scala/reflect/internal/Definitions.scala b/src/reflect/scala/reflect/internal/Definitions.scala
index b32d439426..5cd86b7eed 100644
--- a/src/reflect/scala/reflect/internal/Definitions.scala
+++ b/src/reflect/scala/reflect/internal/Definitions.scala
@@ -127,15 +127,15 @@ trait Definitions extends api.StandardDefinitions {
lazy val Boolean_or = getMemberMethod(BooleanClass, nme.ZOR)
lazy val Boolean_not = getMemberMethod(BooleanClass, nme.UNARY_!)
- lazy val UnitTpe = UnitClass.toTypeConstructor
- lazy val ByteTpe = ByteClass.toTypeConstructor
- lazy val ShortTpe = ShortClass.toTypeConstructor
- lazy val CharTpe = CharClass.toTypeConstructor
- lazy val IntTpe = IntClass.toTypeConstructor
- lazy val LongTpe = LongClass.toTypeConstructor
- lazy val FloatTpe = FloatClass.toTypeConstructor
- lazy val DoubleTpe = DoubleClass.toTypeConstructor
- lazy val BooleanTpe = BooleanClass.toTypeConstructor
+ lazy val UnitTpe = UnitClass.tpe
+ lazy val ByteTpe = ByteClass.tpe
+ lazy val ShortTpe = ShortClass.tpe
+ lazy val CharTpe = CharClass.tpe
+ lazy val IntTpe = IntClass.tpe
+ lazy val LongTpe = LongClass.tpe
+ lazy val FloatTpe = FloatClass.tpe
+ lazy val DoubleTpe = DoubleClass.tpe
+ lazy val BooleanTpe = BooleanClass.tpe
lazy val ScalaNumericValueClasses = ScalaValueClasses filterNot Set[Symbol](UnitClass, BooleanClass)
lazy val ScalaValueClassesNoUnit = ScalaValueClasses filterNot (_ eq UnitClass)
@@ -178,16 +178,6 @@ trait Definitions extends api.StandardDefinitions {
lazy val RuntimePackage = getPackage("scala.runtime")
lazy val RuntimePackageClass = RuntimePackage.moduleClass.asClass
- // convenient one-argument parameter lists
- lazy val anyparam = List(AnyClass.tpe)
- lazy val anyvalparam = List(AnyValClass.typeConstructor)
- lazy val anyrefparam = List(AnyRefClass.typeConstructor)
-
- // private parameter conveniences
- private def booltype = BooleanClass.tpe
- private def inttype = IntClass.tpe
- private def stringtype = StringClass.tpe
-
def javaTypeToValueClass(jtype: Class[_]): Symbol = jtype match {
case java.lang.Void.TYPE => UnitClass
case java.lang.Byte.TYPE => ByteClass
@@ -217,13 +207,17 @@ trait Definitions extends api.StandardDefinitions {
*/
def fullyInitializeSymbol(sym: Symbol): Symbol = {
sym.initialize
+ // Watch out for those darn raw types on method parameters
+ if (sym.owner.initialize.isJavaDefined)
+ sym.cookJavaRawInfo()
+
fullyInitializeType(sym.info)
fullyInitializeType(sym.tpe_*)
sym
}
def fullyInitializeType(tp: Type): Type = {
tp.typeParams foreach fullyInitializeSymbol
- tp.paramss.flatten foreach fullyInitializeSymbol
+ mforeach(tp.paramss)(fullyInitializeSymbol)
tp
}
def fullyInitializeScope(scope: Scope): Scope = {
@@ -252,9 +246,9 @@ trait Definitions extends api.StandardDefinitions {
/** Is this type equivalent to Any, AnyVal, or AnyRef? */
def isTrivialTopType(tp: Type) = (
- tp =:= AnyClass.tpe
- || tp =:= AnyValClass.tpe
- || tp =:= AnyRefClass.tpe
+ tp =:= AnyTpe
+ || tp =:= AnyValTpe
+ || tp =:= AnyRefTpe
)
private def fixupAsAnyTrait(tpe: Type): Type = tpe match {
@@ -262,7 +256,7 @@ trait Definitions extends api.StandardDefinitions {
if (parents.head.typeSymbol == AnyClass) tpe
else {
assert(parents.head.typeSymbol == ObjectClass, parents)
- ClassInfoType(AnyClass.tpe :: parents.tail, decls, clazz)
+ ClassInfoType(AnyTpe :: parents.tail, decls, clazz)
}
case PolyType(tparams, restpe) =>
PolyType(tparams, fixupAsAnyTrait(restpe))
@@ -270,11 +264,20 @@ trait Definitions extends api.StandardDefinitions {
// top types
lazy val AnyClass = enterNewClass(ScalaPackageClass, tpnme.Any, Nil, ABSTRACT)
- lazy val AnyRefClass = newAlias(ScalaPackageClass, tpnme.AnyRef, ObjectClass.tpe)
+ lazy val AnyRefClass = newAlias(ScalaPackageClass, tpnme.AnyRef, ObjectTpe)
lazy val ObjectClass = getRequiredClass(sn.Object.toString)
- lazy val AnyTpe = definitions.AnyClass.toTypeConstructor
- lazy val AnyRefTpe = definitions.AnyRefClass.toTypeConstructor
- lazy val ObjectTpe = definitions.ObjectClass.toTypeConstructor
+
+ // Cached types for core monomorphic classes
+ lazy val AnyRefTpe = AnyRefClass.tpe
+ lazy val AnyTpe = AnyClass.tpe
+ lazy val AnyValTpe = AnyValClass.tpe
+ lazy val BoxedUnitTpe = BoxedUnitClass.tpe
+ lazy val NothingTpe = NothingClass.tpe
+ lazy val NullTpe = NullClass.tpe
+ lazy val ObjectTpe = ObjectClass.tpe
+ lazy val SerializableTpe = SerializableClass.tpe
+ lazy val StringTpe = StringClass.tpe
+ lazy val ThrowableTpe = ThrowableClass.tpe
// Note: this is not the type alias AnyRef, it's a companion-like
// object used by the @specialize annotation.
@@ -283,12 +286,11 @@ trait Definitions extends api.StandardDefinitions {
def Predef_AnyRef = AnyRefModule
lazy val AnyValClass: ClassSymbol = (ScalaPackageClass.info member tpnme.AnyVal orElse {
- val anyval = enterNewClass(ScalaPackageClass, tpnme.AnyVal, AnyClass.tpe :: Nil, ABSTRACT)
+ val anyval = enterNewClass(ScalaPackageClass, tpnme.AnyVal, AnyTpe :: Nil, ABSTRACT)
val av_constr = anyval.newClassConstructor(NoPosition)
anyval.info.decls enter av_constr
anyval
}).asInstanceOf[ClassSymbol]
- lazy val AnyValTpe = definitions.AnyValClass.toTypeConstructor
def AnyVal_getClass = getMemberMethod(AnyValClass, nme.getClass_)
// bottom types
@@ -311,8 +313,6 @@ trait Definitions extends api.StandardDefinitions {
|| (that ne NothingClass) && (that isSubClass ObjectClass)
)
}
- lazy val NothingTpe = definitions.NothingClass.toTypeConstructor
- lazy val NullTpe = definitions.NullClass.toTypeConstructor
// exceptions and other throwables
lazy val ClassCastExceptionClass = requiredClass[ClassCastException]
@@ -393,7 +393,7 @@ trait Definitions extends api.StandardDefinitions {
def delayedInitMethod = getMemberMethod(DelayedInitClass, nme.delayedInit)
lazy val TypeConstraintClass = requiredClass[scala.annotation.TypeConstraint]
- lazy val SingletonClass = enterNewClass(ScalaPackageClass, tpnme.Singleton, anyparam, ABSTRACT | TRAIT | FINAL)
+ lazy val SingletonClass = enterNewClass(ScalaPackageClass, tpnme.Singleton, AnyTpe :: Nil, ABSTRACT | TRAIT | FINAL)
lazy val SerializableClass = requiredClass[scala.Serializable]
lazy val JavaSerializableClass = requiredClass[java.io.Serializable] modifyInfo fixupAsAnyTrait
lazy val ComparableClass = requiredClass[java.lang.Comparable[_]] modifyInfo fixupAsAnyTrait
@@ -403,7 +403,7 @@ trait Definitions extends api.StandardDefinitions {
lazy val RemoteInterfaceClass = requiredClass[java.rmi.Remote]
lazy val RemoteExceptionClass = requiredClass[java.rmi.RemoteException]
- lazy val ByNameParamClass = specialPolyClass(tpnme.BYNAME_PARAM_CLASS_NAME, COVARIANT)(_ => AnyClass.tpe)
+ lazy val ByNameParamClass = specialPolyClass(tpnme.BYNAME_PARAM_CLASS_NAME, COVARIANT)(_ => AnyTpe)
lazy val JavaRepeatedParamClass = specialPolyClass(tpnme.JAVA_REPEATED_PARAM_CLASS_NAME, COVARIANT)(tparam => arrayType(tparam.tpe))
lazy val RepeatedParamClass = specialPolyClass(tpnme.REPEATED_PARAM_CLASS_NAME, COVARIANT)(tparam => seqType(tparam.tpe))
@@ -447,7 +447,7 @@ trait Definitions extends api.StandardDefinitions {
}
def isReferenceArray(tp: Type) = tp match {
- case TypeRef(_, ArrayClass, arg :: Nil) => arg <:< AnyRefClass.tpe
+ case TypeRef(_, ArrayClass, arg :: Nil) => arg <:< AnyRefTpe
case _ => false
}
def isArrayOfSymbol(tp: Type, elem: Symbol) = tp match {
@@ -597,7 +597,7 @@ trait Definitions extends api.StandardDefinitions {
case BooleanClass => nme.wrapBooleanArray
case UnitClass => nme.wrapUnitArray
case _ =>
- if ((elemtp <:< AnyRefClass.tpe) && !isPhantomClass(elemtp.typeSymbol)) nme.wrapRefArray
+ if ((elemtp <:< AnyRefTpe) && !isPhantomClass(elemtp.typeSymbol)) nme.wrapRefArray
else nme.genericWrapArray
}
@@ -733,12 +733,12 @@ trait Definitions extends api.StandardDefinitions {
existentialAbstraction(clazz.unsafeTypeParams, clazz.tpe_*)
// members of class scala.Any
- lazy val Any_== = enterNewMethod(AnyClass, nme.EQ, anyparam, booltype, FINAL)
- lazy val Any_!= = enterNewMethod(AnyClass, nme.NE, anyparam, booltype, FINAL)
- lazy val Any_equals = enterNewMethod(AnyClass, nme.equals_, anyparam, booltype)
- lazy val Any_hashCode = enterNewMethod(AnyClass, nme.hashCode_, Nil, inttype)
- lazy val Any_toString = enterNewMethod(AnyClass, nme.toString_, Nil, stringtype)
- lazy val Any_## = enterNewMethod(AnyClass, nme.HASHHASH, Nil, inttype, FINAL)
+ lazy val Any_== = enterNewMethod(AnyClass, nme.EQ, AnyTpe :: Nil, BooleanTpe, FINAL)
+ lazy val Any_!= = enterNewMethod(AnyClass, nme.NE, AnyTpe :: Nil, BooleanTpe, FINAL)
+ lazy val Any_equals = enterNewMethod(AnyClass, nme.equals_, AnyTpe :: Nil, BooleanTpe)
+ lazy val Any_hashCode = enterNewMethod(AnyClass, nme.hashCode_, Nil, IntTpe)
+ lazy val Any_toString = enterNewMethod(AnyClass, nme.toString_, Nil, StringTpe)
+ lazy val Any_## = enterNewMethod(AnyClass, nme.HASHHASH, Nil, IntTpe, FINAL)
// Any_getClass requires special handling. The return type is determined on
// a per-call-site basis as if the function being called were actually:
@@ -750,7 +750,7 @@ trait Definitions extends api.StandardDefinitions {
// participation. At the "Any" level, the return type is Class[_] as it is in
// java.lang.Object. Java also special cases the return type.
lazy val Any_getClass = enterNewMethod(AnyClass, nme.getClass_, Nil, getMemberMethod(ObjectClass, nme.getClass_).tpe.resultType, DEFERRED)
- lazy val Any_isInstanceOf = newT1NullaryMethod(AnyClass, nme.isInstanceOf_, FINAL)(_ => booltype)
+ lazy val Any_isInstanceOf = newT1NullaryMethod(AnyClass, nme.isInstanceOf_, FINAL)(_ => BooleanTpe)
lazy val Any_asInstanceOf = newT1NullaryMethod(AnyClass, nme.asInstanceOf_, FINAL)(_.typeConstructor)
// A type function from T => Class[U], used to determine the return
@@ -774,7 +774,7 @@ trait Definitions extends api.StandardDefinitions {
else {
val eparams = typeParamsToExistentials(ClassClass, ClassClass.typeParams)
val upperBound = (
- if (isPhantomClass(sym)) AnyClass.tpe
+ if (isPhantomClass(sym)) AnyTpe
else if (sym.isLocalClass) erasure.intersectionDominator(tp.parents)
else tp.widen
)
@@ -834,17 +834,17 @@ trait Definitions extends api.StandardDefinitions {
}
// members of class java.lang.{ Object, String }
- lazy val Object_## = enterNewMethod(ObjectClass, nme.HASHHASH, Nil, inttype, FINAL)
- lazy val Object_== = enterNewMethod(ObjectClass, nme.EQ, anyrefparam, booltype, FINAL)
- lazy val Object_!= = enterNewMethod(ObjectClass, nme.NE, anyrefparam, booltype, FINAL)
- lazy val Object_eq = enterNewMethod(ObjectClass, nme.eq, anyrefparam, booltype, FINAL)
- lazy val Object_ne = enterNewMethod(ObjectClass, nme.ne, anyrefparam, booltype, FINAL)
- lazy val Object_isInstanceOf = newT1NoParamsMethod(ObjectClass, nme.isInstanceOf_Ob, FINAL | SYNTHETIC | ARTIFACT)(_ => booltype)
+ lazy val Object_## = enterNewMethod(ObjectClass, nme.HASHHASH, Nil, IntTpe, FINAL)
+ lazy val Object_== = enterNewMethod(ObjectClass, nme.EQ, AnyRefTpe :: Nil, BooleanTpe, FINAL)
+ lazy val Object_!= = enterNewMethod(ObjectClass, nme.NE, AnyRefTpe :: Nil, BooleanTpe, FINAL)
+ lazy val Object_eq = enterNewMethod(ObjectClass, nme.eq, AnyRefTpe :: Nil, BooleanTpe, FINAL)
+ lazy val Object_ne = enterNewMethod(ObjectClass, nme.ne, AnyRefTpe :: Nil, BooleanTpe, FINAL)
+ lazy val Object_isInstanceOf = newT1NoParamsMethod(ObjectClass, nme.isInstanceOf_Ob, FINAL | SYNTHETIC | ARTIFACT)(_ => BooleanTpe)
lazy val Object_asInstanceOf = newT1NoParamsMethod(ObjectClass, nme.asInstanceOf_Ob, FINAL | SYNTHETIC | ARTIFACT)(_.typeConstructor)
lazy val Object_synchronized = newPolyMethod(1, ObjectClass, nme.synchronized_, FINAL)(tps =>
(Some(List(tps.head.typeConstructor)), tps.head.typeConstructor)
)
- lazy val String_+ = enterNewMethod(StringClass, nme.raw.PLUS, anyparam, stringtype, FINAL)
+ lazy val String_+ = enterNewMethod(StringClass, nme.raw.PLUS, AnyTpe :: Nil, StringTpe, FINAL)
def Object_getClass = getMemberMethod(ObjectClass, nme.getClass_)
def Object_clone = getMemberMethod(ObjectClass, nme.clone_)
@@ -1044,7 +1044,7 @@ trait Definitions extends api.StandardDefinitions {
private def specialPolyClass(name: TypeName, flags: Long)(parentFn: Symbol => Type): ClassSymbol = {
val clazz = enterNewClass(ScalaPackageClass, name, Nil)
val tparam = clazz.newSyntheticTypeParam("T0", flags)
- val parents = List(AnyRefClass.tpe, parentFn(tparam))
+ val parents = List(AnyRefTpe, parentFn(tparam))
clazz setInfo GenPolyType(List(tparam), ClassInfoType(parents, newScope, clazz))
}
diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala
index af20b8b756..f3cea1fd00 100644
--- a/src/reflect/scala/reflect/internal/Symbols.scala
+++ b/src/reflect/scala/reflect/internal/Symbols.scala
@@ -237,7 +237,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
/** Static constructor with info set. */
def newStaticConstructor(pos: Position): MethodSymbol =
- newConstructor(pos, STATIC) setInfo UnitClass.tpe
+ newConstructor(pos, STATIC) setInfo UnitTpe
/** Instance constructor with info set. */
def newClassConstructor(pos: Position): MethodSymbol =
@@ -269,7 +269,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
val newName = nme.moduleVarName(accessor.name.toTermName)
val newFlags = MODULEVAR | ( if (this.isClass) PrivateLocal | SYNTHETIC else 0 )
val newInfo = accessor.tpe.finalResultType
- val mval = newVariable(newName, accessor.pos.focus, newFlags) addAnnotation VolatileAttr
+ val mval = newVariable(newName, accessor.pos.focus, newFlags.toLong) addAnnotation VolatileAttr
if (this.isClass)
mval setInfoAndEnter newInfo
@@ -627,6 +627,8 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
if (!isCompilerUniverse && needsInitialize(isFlagRelated = true, mask = mask)) initialize
(flags & mask) != 0
}
+ def hasFlag(mask: Int): Boolean = hasFlag(mask.toLong)
+
/** Does symbol have ALL the flags in `mask` set? */
final def hasAllFlags(mask: Long): Boolean = {
if (!isCompilerUniverse && needsInitialize(isFlagRelated = true, mask = mask)) initialize
@@ -892,16 +894,23 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
/** Is this a term symbol only defined in a refinement (so that it needs
* to be accessed by reflection)?
*/
- def isOnlyRefinementMember: Boolean = (
- isTerm && // type members are not affected
- owner.isRefinementClass && // owner must be a refinement class
- (owner.info decl name) == this && // symbol must be explicitly declared in the refinement (not synthesized from glb)
- !isOverridingSymbol && // symbol must not override a symbol in a base class
- !isConstant // symbol must not be a constant. Question: Can we exclude @inline methods as well?
+ def isOnlyRefinementMember = (
+ isTerm // Type members are unaffected
+ && owner.isRefinementClass // owner must be a refinement class
+ && isPossibleInRefinement // any overridden symbols must also have refinement class owners
+ && !isConstant // Must not be a constant. Question: Can we exclude @inline methods as well?
+ && isDeclaredByOwner // Must be explicitly declared in the refinement (not synthesized from glb)
)
+ // "(owner.info decl name) == this" is inadequate, because "name" might
+ // be overloaded in owner - and this might be an overloaded symbol.
+ // TODO - make this cheaper and see where else we should be doing something similar.
+ private def isDeclaredByOwner = (owner.info decl name).alternatives exists (alternatives contains _)
final def isStructuralRefinementMember = owner.isStructuralRefinement && isPossibleInRefinement && isPublic
- final def isPossibleInRefinement = !isConstructor && !isOverridingSymbol
+ final def isPossibleInRefinement = (
+ !isConstructor
+ && allOverriddenSymbols.forall(_.owner.isRefinementClass) // this includes allOverriddenSymbols.isEmpty
+ )
/** A a member of class `base` is incomplete if
* (1) it is declared deferred or
@@ -1622,7 +1631,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
def makeSerializable() {
info match {
case ci @ ClassInfoType(_, _, _) =>
- setInfo(ci.copy(parents = ci.parents :+ SerializableClass.tpe))
+ setInfo(ci.copy(parents = ci.parents :+ SerializableTpe))
case i =>
abort("Only ClassInfoTypes can be made serializable: "+ i)
}
@@ -2868,18 +2877,19 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
tpeCache
}
override def typeConstructor: Type = {
- maybeUpdateTyconCache()
+ if (tyconCacheNeedsUpdate)
+ setTyconCache(newTypeRef(Nil))
tyconCache
}
override def tpeHK: Type = typeConstructor
- private def maybeUpdateTyconCache() {
- if ((tyconCache eq null) || tyconRunId != currentRunId) {
- tyconCache = newTypeRef(Nil)
- tyconRunId = currentRunId
- }
- assert(tyconCache ne null)
+ private def tyconCacheNeedsUpdate = (tyconCache eq null) || tyconRunId != currentRunId
+ private def setTyconCache(tycon: Type) {
+ tyconCache = tycon
+ tyconRunId = currentRunId
+ assert(tyconCache ne null, this)
}
+
private def maybeUpdateTypeCache() {
if (tpePeriod != currentPeriod) {
if (isValid(tpePeriod))
@@ -2896,10 +2906,15 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
tpePeriod = currentPeriod
tpeCache = NoType // cycle marker
+ val noTypeParams = phase.erasedTypes && this != ArrayClass || unsafeTypeParams.isEmpty
tpeCache = newTypeRef(
- if (phase.erasedTypes && this != ArrayClass || unsafeTypeParams.isEmpty) Nil
+ if (noTypeParams) Nil
else unsafeTypeParams map (_.typeConstructor)
)
+ // Avoid carrying around different types in tyconCache and tpeCache
+ // for monomorphic types.
+ if (noTypeParams && tyconCacheNeedsUpdate)
+ setTyconCache(tpeCache)
}
override def info_=(tp: Type) {
@@ -2954,7 +2969,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
// a type symbol bound by an existential type, for instance the T in
// List[T] forSome { type T }
override def isExistentialSkolem = this hasFlag EXISTENTIAL
- override def isGADTSkolem = this hasAllFlags GADT_SKOLEM_FLAGS
+ override def isGADTSkolem = this hasAllFlags GADT_SKOLEM_FLAGS.toLong
override def isTypeSkolem = this hasFlag PARAM
override def isAbstractType = this hasFlag DEFERRED
@@ -3430,7 +3445,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
@tailrec private[scala] final
def allSymbolsHaveOwner(syms: List[Symbol], owner: Symbol): Boolean = syms match {
case sym :: rest => sym.owner == owner && allSymbolsHaveOwner(rest, owner)
- case _ => true
+ case _ => true
}
diff --git a/src/reflect/scala/reflect/internal/TreeGen.scala b/src/reflect/scala/reflect/internal/TreeGen.scala
index 44c66b2bbf..6abf344adb 100644
--- a/src/reflect/scala/reflect/internal/TreeGen.scala
+++ b/src/reflect/scala/reflect/internal/TreeGen.scala
@@ -227,7 +227,7 @@ abstract class TreeGen extends macros.TreeBuilder {
/** Cast `tree` to `pt`, unless tpe is a subtype of pt, or pt is Unit. */
def maybeMkAsInstanceOf(tree: Tree, pt: Type, tpe: Type, beforeRefChecks: Boolean = false): Tree =
- if ((pt == UnitClass.tpe) || (tpe <:< pt)) tree
+ if ((pt == UnitTpe) || (tpe <:< pt)) tree
else atPos(tree.pos)(mkAsInstanceOf(tree, pt, any = true, wrapInApply = !beforeRefChecks))
/** Apparently we smuggle a Type around as a Literal(Constant(tp))
@@ -253,7 +253,7 @@ abstract class TreeGen extends macros.TreeBuilder {
* which is appropriate to the given Type.
*/
def mkZero(tp: Type): Tree = tp.typeSymbol match {
- case NothingClass => mkMethodCall(Predef_???, Nil) setType NothingClass.tpe
+ case NothingClass => mkMethodCall(Predef_???, Nil) setType NothingTpe
case _ => Literal(mkConstantZero(tp)) setType tp
}
diff --git a/src/reflect/scala/reflect/internal/Trees.scala b/src/reflect/scala/reflect/internal/Trees.scala
index de0b4e8247..833adb99c7 100644
--- a/src/reflect/scala/reflect/internal/Trees.scala
+++ b/src/reflect/scala/reflect/internal/Trees.scala
@@ -944,6 +944,7 @@ trait Trees extends api.Trees { self: SymbolTable =>
if (flags1 == flags) this
else Modifiers(flags1, privateWithin, annotations) setPositions positions
}
+ def | (flag: Int): Modifiers = this | flag.toLong
def | (flag: Long): Modifiers = {
val flags1 = flags | flag
if (flags1 == flags) this
diff --git a/src/reflect/scala/reflect/internal/Types.scala b/src/reflect/scala/reflect/internal/Types.scala
index 6582459afe..00a929003e 100644
--- a/src/reflect/scala/reflect/internal/Types.scala
+++ b/src/reflect/scala/reflect/internal/Types.scala
@@ -395,7 +395,7 @@ trait Types
/** For a class with nonEmpty parents, the first parent.
* Otherwise some specific fixed top type.
*/
- def firstParent = if (parents.nonEmpty) parents.head else ObjectClass.tpe
+ def firstParent = if (parents.nonEmpty) parents.head else ObjectTpe
/** For a typeref or single-type, the prefix of the normalized type (@see normalize).
* NoType for all other types. */
@@ -961,7 +961,7 @@ trait Types
var sym: Symbol = NoSymbol
var e: ScopeEntry = decls.lookupEntry(name)
while (e ne null) {
- if (!e.sym.hasFlag(excludedFlags)) {
+ if (!e.sym.hasFlag(excludedFlags.toLong)) {
if (sym == NoSymbol) sym = e.sym
else {
if (alts.isEmpty) alts = sym :: Nil
@@ -1462,9 +1462,9 @@ trait Types
final class UniqueTypeBounds(lo: Type, hi: Type) extends TypeBounds(lo, hi)
object TypeBounds extends TypeBoundsExtractor {
- def empty: TypeBounds = apply(NothingClass.tpe, AnyClass.tpe)
- def upper(hi: Type): TypeBounds = apply(NothingClass.tpe, hi)
- def lower(lo: Type): TypeBounds = apply(lo, AnyClass.tpe)
+ def empty: TypeBounds = apply(NothingTpe, AnyTpe)
+ def upper(hi: Type): TypeBounds = apply(NothingTpe, hi)
+ def lower(lo: Type): TypeBounds = apply(lo, AnyTpe)
def apply(lo: Type, hi: Type): TypeBounds = {
unique(new UniqueTypeBounds(lo, hi)).asInstanceOf[TypeBounds]
}
@@ -2472,7 +2472,7 @@ trait Types
if (!isValidForBaseClasses(period)) {
tpe.parentsCache = tpe.thisInfo.parents map tpe.transform
} else if (tpe.parentsCache == null) { // seems this can happen if things are corrupted enough, see #2641
- tpe.parentsCache = List(AnyClass.tpe)
+ tpe.parentsCache = List(AnyTpe)
}
}
}
@@ -3443,7 +3443,7 @@ trait Types
/** the canonical creator for a refined type with a given scope */
def refinedType(parents: List[Type], owner: Symbol, decls: Scope, pos: Position): Type = {
if (phase.erasedTypes)
- if (parents.isEmpty) ObjectClass.tpe else parents.head
+ if (parents.isEmpty) ObjectTpe else parents.head
else {
val clazz = owner.newRefinementClass(pos)
val result = RefinedType(parents, decls, clazz)
@@ -4345,7 +4345,7 @@ trait Types
} else {
val args = argss map (_.head)
if (args.tail forall (_ =:= args.head)) Some(typeRef(pre, sym, List(args.head)))
- else if (args exists (arg => isPrimitiveValueClass(arg.typeSymbol))) Some(ObjectClass.tpe)
+ else if (args exists (arg => isPrimitiveValueClass(arg.typeSymbol))) Some(ObjectTpe)
else Some(typeRef(pre, sym, List(lub(args))))
}
}
@@ -4484,18 +4484,18 @@ trait Types
}
def isUnboundedGeneric(tp: Type) = tp match {
- case t @ TypeRef(_, sym, _) => sym.isAbstractType && !(t <:< AnyRefClass.tpe)
+ case t @ TypeRef(_, sym, _) => sym.isAbstractType && !(t <:< AnyRefTpe)
case _ => false
}
def isBoundedGeneric(tp: Type) = tp match {
- case TypeRef(_, sym, _) if sym.isAbstractType => (tp <:< AnyRefClass.tpe)
+ case TypeRef(_, sym, _) if sym.isAbstractType => (tp <:< AnyRefTpe)
case TypeRef(_, sym, _) => !isPrimitiveValueClass(sym)
case _ => false
}
// Add serializable to a list of parents, unless one of them already is
def addSerializable(ps: Type*): List[Type] = (
if (ps exists typeIsSubTypeOfSerializable) ps.toList
- else (ps :+ SerializableClass.tpe).toList
+ else (ps :+ SerializableTpe).toList
)
/** Members of the given class, other than those inherited
@@ -4508,7 +4508,7 @@ trait Types
def importableMembers(pre: Type): Scope = pre.members filter isImportable
def objToAny(tp: Type): Type =
- if (!phase.erasedTypes && tp.typeSymbol == ObjectClass) AnyClass.tpe
+ if (!phase.erasedTypes && tp.typeSymbol == ObjectClass) AnyTpe
else tp
val shorthands = Set(
@@ -4532,7 +4532,7 @@ trait Types
private[scala] val typeHasAnnotations = (tp: Type) => tp.annotations.nonEmpty
private[scala] val boundsContainType = (bounds: TypeBounds, tp: Type) => bounds containsType tp
private[scala] val typeListIsEmpty = (ts: List[Type]) => ts.isEmpty
- private[scala] val typeIsSubTypeOfSerializable = (tp: Type) => tp <:< SerializableClass.tpe
+ private[scala] val typeIsSubTypeOfSerializable = (tp: Type) => tp <:< SerializableTpe
private[scala] val typeIsNothing = (tp: Type) => tp.typeSymbolDirect eq NothingClass
private[scala] val typeIsAny = (tp: Type) => tp.typeSymbolDirect eq AnyClass
private[scala] val typeIsHigherKinded = (tp: Type) => tp.isHigherKinded
diff --git a/src/reflect/scala/reflect/internal/pickling/ByteCodecs.scala b/src/reflect/scala/reflect/internal/pickling/ByteCodecs.scala
index 18d7e05c4c..eb266e8125 100644
--- a/src/reflect/scala/reflect/internal/pickling/ByteCodecs.scala
+++ b/src/reflect/scala/reflect/internal/pickling/ByteCodecs.scala
@@ -128,7 +128,7 @@ object ByteCodecs {
var j = 0
val dstlen = (srclen * 7 + 7) / 8
while (i + 7 < srclen) {
- var out: Int = src(i)
+ var out: Int = src(i).toInt
var in: Byte = src(i + 1)
src(j) = (out | (in & 0x01) << 7).toByte
out = in >>> 1
@@ -153,7 +153,7 @@ object ByteCodecs {
j += 7
}
if (i < srclen) {
- var out: Int = src(i)
+ var out: Int = src(i).toInt
if (i + 1 < srclen) {
var in: Byte = src(i + 1)
src(j) = (out | (in & 0x01) << 7).toByte; j += 1
diff --git a/src/reflect/scala/reflect/internal/pickling/PickleBuffer.scala b/src/reflect/scala/reflect/internal/pickling/PickleBuffer.scala
index c953b5df22..a814256f8e 100644
--- a/src/reflect/scala/reflect/internal/pickling/PickleBuffer.scala
+++ b/src/reflect/scala/reflect/internal/pickling/PickleBuffer.scala
@@ -94,7 +94,7 @@ class PickleBuffer(data: Array[Byte], from: Int, to: Int) {
/** Read a byte */
def readByte(): Int = {
- val x = bytes(readIndex); readIndex += 1; x
+ val x = bytes(readIndex).toInt; readIndex += 1; x
}
/** Read a natural number in big endian format, base 128.
@@ -105,7 +105,7 @@ class PickleBuffer(data: Array[Byte], from: Int, to: Int) {
var b = 0L
var x = 0L
do {
- b = readByte()
+ b = readByte().toLong
x = (x << 7) + (b & 0x7f)
} while ((b & 0x80) != 0L)
x
diff --git a/src/reflect/scala/reflect/internal/tpe/GlbLubs.scala b/src/reflect/scala/reflect/internal/tpe/GlbLubs.scala
index 2da9960c81..0a7a2a127c 100644
--- a/src/reflect/scala/reflect/internal/tpe/GlbLubs.scala
+++ b/src/reflect/scala/reflect/internal/tpe/GlbLubs.scala
@@ -236,7 +236,7 @@ private[internal] trait GlbLubs {
*/
def weakLub(tps: List[Type]): Type = (
if (tps.isEmpty)
- NothingClass.tpe
+ NothingTpe
else if (tps forall isNumericValueType)
numericLub(tps)
else if (tps exists typeHasAnnotations)
@@ -249,7 +249,7 @@ private[internal] trait GlbLubs {
ts reduceLeft ((t1, t2) =>
if (isNumericSubType(t1, t2)) t2
else if (isNumericSubType(t2, t1)) t1
- else IntClass.tpe)
+ else IntTpe)
private val lubResults = new mutable.HashMap[(Int, List[Type]), Type]
private val glbResults = new mutable.HashMap[(Int, List[Type]), Type]
@@ -272,7 +272,7 @@ private[internal] trait GlbLubs {
}
def lub(ts: List[Type]): Type = ts match {
- case Nil => NothingClass.tpe
+ case Nil => NothingTpe
case t :: Nil => t
case _ =>
if (Statistics.canEnable) Statistics.incCounter(lubCount)
@@ -301,7 +301,7 @@ private[internal] trait GlbLubs {
/** The least upper bound wrt <:< of a list of types */
protected[internal] def lub(ts: List[Type], depth: Int): Type = {
def lub0(ts0: List[Type]): Type = elimSub(ts0, depth) match {
- case List() => NothingClass.tpe
+ case List() => NothingTpe
case List(t) => t
case ts @ PolyType(tparams, _) :: _ =>
val tparams1 = map2(tparams, matchingBounds(ts, tparams).transpose)((tparam, bounds) =>
@@ -320,8 +320,8 @@ private[internal] trait GlbLubs {
case Some(lubType) =>
lubType
case None =>
- lubResults((depth, ts)) = AnyClass.tpe
- val res = if (depth < 0) AnyClass.tpe else lub1(ts)
+ lubResults((depth, ts)) = AnyTpe
+ val res = if (depth < 0) AnyTpe else lub1(ts)
lubResults((depth, ts)) = res
res
}
@@ -437,7 +437,7 @@ private[internal] trait GlbLubs {
/** The greatest lower bound of a list of types (as determined by `<:<`). */
def glb(ts: List[Type]): Type = elimSuper(ts) match {
- case List() => AnyClass.tpe
+ case List() => AnyTpe
case List(t) => t
case ts0 =>
if (Statistics.canEnable) Statistics.incCounter(lubCount)
@@ -452,7 +452,7 @@ private[internal] trait GlbLubs {
}
protected[internal] def glb(ts: List[Type], depth: Int): Type = elimSuper(ts) match {
- case List() => AnyClass.tpe
+ case List() => AnyTpe
case List(t) => t
case ts0 => glbNorm(ts0, depth)
}
@@ -461,7 +461,7 @@ private[internal] trait GlbLubs {
* with regard to `elimSuper`. */
protected def glbNorm(ts: List[Type], depth: Int): Type = {
def glb0(ts0: List[Type]): Type = ts0 match {
- case List() => AnyClass.tpe
+ case List() => AnyTpe
case List(t) => t
case ts @ PolyType(tparams, _) :: _ =>
val tparams1 = map2(tparams, matchingBounds(ts, tparams).transpose)((tparam, bounds) =>
@@ -478,8 +478,8 @@ private[internal] trait GlbLubs {
case Some(glbType) =>
glbType
case _ =>
- glbResults((depth, ts)) = NothingClass.tpe
- val res = if (depth < 0) NothingClass.tpe else glb1(ts)
+ glbResults((depth, ts)) = NothingTpe
+ val res = if (depth < 0) NothingTpe else glb1(ts)
glbResults((depth, ts)) = res
res
}
@@ -556,8 +556,8 @@ private[internal] trait GlbLubs {
existentialAbstraction(tparams, glbType)
} catch {
case GlbFailure =>
- if (ts forall (t => NullClass.tpe <:< t)) NullClass.tpe
- else NothingClass.tpe
+ if (ts forall (t => NullTpe <:< t)) NullTpe
+ else NothingTpe
}
}
// if (settings.debug.value) { println(indent + "glb of " + ts + " at depth "+depth); indent = indent + " " } //DEBUG
diff --git a/src/reflect/scala/reflect/internal/tpe/TypeConstraints.scala b/src/reflect/scala/reflect/internal/tpe/TypeConstraints.scala
index 39e427f588..123c296f95 100644
--- a/src/reflect/scala/reflect/internal/tpe/TypeConstraints.scala
+++ b/src/reflect/scala/reflect/internal/tpe/TypeConstraints.scala
@@ -88,8 +88,8 @@ private[internal] trait TypeConstraints {
/** @PP: Unable to see why these apparently constant types should need vals
* in every TypeConstraint, I lifted them out.
*/
- private lazy val numericLoBound = IntClass.tpe
- private lazy val numericHiBound = intersectionType(List(ByteClass.tpe, CharClass.tpe), ScalaPackageClass)
+ private lazy val numericLoBound = IntTpe
+ private lazy val numericHiBound = intersectionType(List(ByteTpe, CharTpe), ScalaPackageClass)
/** A class expressing upper and lower bounds constraints of type variables,
* as well as their instantiations.
diff --git a/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala b/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala
index 7665e7c0f4..c35825dcee 100644
--- a/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala
+++ b/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala
@@ -30,10 +30,10 @@ private[internal] trait TypeMaps {
def apply(tp: Type): Type = {
tp match {
case TypeRef(_, SingletonClass, _) =>
- AnyClass.tpe
+ AnyTpe
case tp1 @ RefinedType(parents, decls) =>
parents filter (_.typeSymbol != SingletonClass) match {
- case Nil => AnyClass.tpe
+ case Nil => AnyTpe
case p :: Nil if decls.isEmpty => mapOver(p)
case ps => mapOver(copyRefinedType(tp1, ps, decls))
}
@@ -327,7 +327,7 @@ private[internal] trait TypeMaps {
private var expanded = immutable.Set[Symbol]()
def apply(tp: Type): Type = tp match {
case TypeRef(pre, sym, List()) if isRawIfWithoutArgs(sym) =>
- if (expanded contains sym) AnyRefClass.tpe
+ if (expanded contains sym) AnyRefTpe
else try {
expanded += sym
val eparams = mapOver(typeParamsToExistentials(sym))
diff --git a/src/reflect/scala/reflect/internal/transform/Erasure.scala b/src/reflect/scala/reflect/internal/transform/Erasure.scala
index 24da8d20cc..a9a1285de3 100644
--- a/src/reflect/scala/reflect/internal/transform/Erasure.scala
+++ b/src/reflect/scala/reflect/internal/transform/Erasure.scala
@@ -56,7 +56,7 @@ trait Erasure {
}
protected def unboundedGenericArrayLevel(tp: Type): Int = tp match {
- case GenericArray(level, core) if !(core <:< AnyRefClass.tpe) => level
+ case GenericArray(level, core) if !(core <:< AnyRefTpe) => level
case _ => 0
}
@@ -106,9 +106,6 @@ trait Erasure {
}
abstract class ErasureMap extends TypeMap {
- private lazy val ObjectArray = arrayType(ObjectClass.tpe)
- private lazy val ErasedObject = erasedTypeRef(ObjectClass)
-
def mergeParents(parents: List[Type]): Type
def eraseNormalClassRef(pre: Type, clazz: Symbol): Type =
@@ -123,11 +120,11 @@ trait Erasure {
apply(st.supertype)
case tref @ TypeRef(pre, sym, args) =>
if (sym == ArrayClass)
- if (unboundedGenericArrayLevel(tp) == 1) ObjectClass.tpe
- else if (args.head.typeSymbol.isBottomClass) ObjectArray
+ if (unboundedGenericArrayLevel(tp) == 1) ObjectTpe
+ else if (args.head.typeSymbol.isBottomClass) arrayType(ObjectTpe)
else typeRef(apply(pre), sym, args map applyInArray)
- else if (sym == AnyClass || sym == AnyValClass || sym == SingletonClass) ErasedObject
- else if (sym == UnitClass) erasedTypeRef(BoxedUnitClass)
+ else if (sym == AnyClass || sym == AnyValClass || sym == SingletonClass) ObjectTpe
+ else if (sym == UnitClass) BoxedUnitTpe
else if (sym.isRefinementClass) apply(mergeParents(tp.parents))
else if (sym.isDerivedValueClass) eraseDerivedValueClassRef(tref)
else if (sym.isClass) eraseNormalClassRef(pre, sym)
@@ -139,7 +136,7 @@ trait Erasure {
case mt @ MethodType(params, restpe) =>
MethodType(
cloneSymbolsAndModify(params, ErasureMap.this),
- if (restpe.typeSymbol == UnitClass) erasedTypeRef(UnitClass)
+ if (restpe.typeSymbol == UnitClass) UnitTpe
// this replaces each typeref that refers to an argument
// by the type `p.tpe` of the actual argument p (p in params)
else apply(mt.resultType(mt.paramTypes)))
@@ -150,7 +147,7 @@ trait Erasure {
case ClassInfoType(parents, decls, clazz) =>
ClassInfoType(
if (clazz == ObjectClass || isPrimitiveValueClass(clazz)) Nil
- else if (clazz == ArrayClass) List(ErasedObject)
+ else if (clazz == ArrayClass) ObjectTpe :: Nil
else removeLaterObjects(parents map this),
decls, clazz)
case _ =>
@@ -253,7 +250,7 @@ trait Erasure {
* An intersection such as `Object with Trait` erases to Object.
*/
def mergeParents(parents: List[Type]): Type =
- if (parents.isEmpty) ObjectClass.tpe
+ if (parents.isEmpty) ObjectTpe
else parents.head
}
@@ -301,7 +298,7 @@ trait Erasure {
* - Otherwise, the dominator is the first element of the span.
*/
def intersectionDominator(parents: List[Type]): Type = {
- if (parents.isEmpty) ObjectClass.tpe
+ if (parents.isEmpty) ObjectTpe
else {
val psyms = parents map (_.typeSymbol)
if (psyms contains ArrayClass) {
@@ -323,10 +320,6 @@ trait Erasure {
}
}
- /** Type reference after erasure */
- def erasedTypeRef(sym: Symbol): Type =
- typeRef(erasure(sym)(sym.owner.tpe), sym, Nil)
-
/** The symbol's erased info. This is the type's erasure, except for the following symbols:
*
* - For $asInstanceOf : [T]T
@@ -354,8 +347,7 @@ trait Erasure {
else if (sym.name == nme.update)
(tp: @unchecked) match {
case MethodType(List(index, tvar), restpe) =>
- MethodType(List(index.cloneSymbol.setInfo(specialErasure(sym)(index.tpe)), tvar),
- erasedTypeRef(UnitClass))
+ MethodType(List(index.cloneSymbol.setInfo(specialErasure(sym)(index.tpe)), tvar), UnitTpe)
}
else specialErasure(sym)(tp)
} else if (
diff --git a/src/reflect/scala/reflect/internal/transform/UnCurry.scala b/src/reflect/scala/reflect/internal/transform/UnCurry.scala
index c525e794a9..abea8bed9f 100644
--- a/src/reflect/scala/reflect/internal/transform/UnCurry.scala
+++ b/src/reflect/scala/reflect/internal/transform/UnCurry.scala
@@ -46,7 +46,7 @@ trait UnCurry {
apply(seqType(arg))
case TypeRef(pre, JavaRepeatedParamClass, arg :: Nil) =>
apply(arrayType(
- if (isUnboundedGeneric(arg)) ObjectClass.tpe else arg))
+ if (isUnboundedGeneric(arg)) ObjectTpe else arg))
case _ =>
expandAlias(mapOver(tp))
}
diff --git a/src/compiler/scala/tools/nsc/util/AbstractFileClassLoader.scala b/src/reflect/scala/reflect/internal/util/AbstractFileClassLoader.scala
index b204c39e9c..10a8b4c812 100644
--- a/src/compiler/scala/tools/nsc/util/AbstractFileClassLoader.scala
+++ b/src/reflect/scala/reflect/internal/util/AbstractFileClassLoader.scala
@@ -2,10 +2,10 @@
* Copyright 2005-2013 LAMP/EPFL
*/
-package scala.tools.nsc
-package util
+package scala
+package reflect.internal.util
-import scala.tools.nsc.io.AbstractFile
+import scala.reflect.io.AbstractFile
import java.security.cert.Certificate
import java.security.{ ProtectionDomain, CodeSource }
import java.net.{ URL, URLConnection, URLStreamHandler }
diff --git a/src/compiler/scala/tools/nsc/util/ScalaClassLoader.scala b/src/reflect/scala/reflect/internal/util/ScalaClassLoader.scala
index 3899ef24c7..a7fd787dfc 100644
--- a/src/compiler/scala/tools/nsc/util/ScalaClassLoader.scala
+++ b/src/reflect/scala/reflect/internal/util/ScalaClassLoader.scala
@@ -3,8 +3,8 @@
* @author Paul Phillips
*/
-package scala.tools.nsc
-package util
+package scala
+package reflect.internal.util
import java.lang.{ ClassLoader => JClassLoader }
import java.lang.reflect.{ Constructor, Modifier, Method }
@@ -49,7 +49,7 @@ trait ScalaClassLoader extends JClassLoader {
/** The actual bytes for a class file, or an empty array if it can't be found. */
def classBytes(className: String): Array[Byte] = classAsStream(className) match {
case null => Array()
- case stream => io.Streamable.bytes(stream)
+ case stream => scala.reflect.io.Streamable.bytes(stream)
}
/** An InputStream representing the given class name, or null if not found. */
diff --git a/src/reflect/scala/reflect/internal/util/Statistics.scala b/src/reflect/scala/reflect/internal/util/Statistics.scala
index 9c19159657..b583137059 100644
--- a/src/reflect/scala/reflect/internal/util/Statistics.scala
+++ b/src/reflect/scala/reflect/internal/util/Statistics.scala
@@ -103,8 +103,8 @@ quant)
for ((_, q) <- qs if q.underlying == q;
r <- q :: q.children.toList if r.prefix.nonEmpty) yield r
- private def showPercent(x: Double, base: Double) =
- if (base == 0) "" else f" (${x / base * 100}%2.1f%%)"
+ private def showPercent(x: Long, base: Long) =
+ if (base == 0) "" else f" (${x.toDouble / base.toDouble * 100}%2.1f%%)"
/** The base trait for quantities.
* Quantities with non-empty prefix are printed in the statistics info.
@@ -156,7 +156,7 @@ quant)
value = value0 + underlying.value - uvalue0
}
override def toString =
- value + showPercent(value, underlying.value)
+ value + showPercent(value.toLong, underlying.value.toLong)
}
class Timer(val prefix: String, val phases: Seq[String]) extends Quantity {
diff --git a/src/reflect/scala/reflect/runtime/JavaMirrors.scala b/src/reflect/scala/reflect/runtime/JavaMirrors.scala
index ca9cc85ab2..adee155db0 100644
--- a/src/reflect/scala/reflect/runtime/JavaMirrors.scala
+++ b/src/reflect/scala/reflect/runtime/JavaMirrors.scala
@@ -701,7 +701,7 @@ private[reflect] trait JavaMirrors extends internal.SymbolTable with api.JavaUni
val parents = try {
parentsLevel += 1
val jsuperclazz = jclazz.getGenericSuperclass
- val superclazz = if (jsuperclazz == null) AnyClass.tpe else typeToScala(jsuperclazz)
+ val superclazz = if (jsuperclazz == null) AnyTpe else typeToScala(jsuperclazz)
superclazz :: (jclazz.getGenericInterfaces.toList map typeToScala)
} finally {
parentsLevel -= 1
diff --git a/src/reflect/scala/reflect/runtime/ReflectionUtils.scala b/src/reflect/scala/reflect/runtime/ReflectionUtils.scala
index 53495e6ac8..2db9706007 100644
--- a/src/reflect/scala/reflect/runtime/ReflectionUtils.scala
+++ b/src/reflect/scala/reflect/runtime/ReflectionUtils.scala
@@ -8,6 +8,7 @@ package reflect.runtime
import java.lang.{Class => jClass}
import java.lang.reflect.{ Method, InvocationTargetException, UndeclaredThrowableException }
+import scala.reflect.internal.util.AbstractFileClassLoader
/** A few java-reflection oriented utility functions useful during reflection bootstrapping.
*/
@@ -34,7 +35,7 @@ private[scala] object ReflectionUtils {
def isAbstractFileClassLoader(clazz: Class[_]): Boolean = {
if (clazz == null) return false
- if (clazz.getName == "scala.tools.nsc.interpreter.AbstractFileClassLoader") return true
+ if (clazz == classOf[AbstractFileClassLoader]) return true
isAbstractFileClassLoader(clazz.getSuperclass)
}
def inferClasspath(cl: ClassLoader): String = cl match {
diff --git a/src/repl/scala/tools/nsc/interpreter/ILoop.scala b/src/repl/scala/tools/nsc/interpreter/ILoop.scala
index f4e06f6bfc..9f841f2c44 100644
--- a/src/repl/scala/tools/nsc/interpreter/ILoop.scala
+++ b/src/repl/scala/tools/nsc/interpreter/ILoop.scala
@@ -255,16 +255,8 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
}
}
- private def findToolsJar() = {
- val jdkPath = Directory(jdkHome)
- val jar = jdkPath / "lib" / "tools.jar" toFile
+ private def findToolsJar() = PathResolver.SupplementalLocations.platformTools
- if (jar isFile)
- Some(jar)
- else if (jdkPath.isDirectory)
- jdkPath.deepFiles find (_.name == "tools.jar")
- else None
- }
private def addToolsJarToLoader() = {
val cl = findToolsJar() match {
case Some(tools) => ScalaClassLoader.fromURLs(Seq(tools.toURL), intp.classLoader)
diff --git a/src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala b/src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala
index 19fa562234..8b8b668c9f 100644
--- a/src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala
+++ b/src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala
@@ -15,7 +15,7 @@ import scala.reflect.internal.util.StringOps.longestCommonPrefix
class JLineCompletion(val intp: IMain) extends Completion with CompletionOutput {
val global: intp.global.type = intp.global
import global._
- import definitions.{ PredefModule, AnyClass, AnyRefClass, ScalaPackage, JavaLangPackage }
+ import definitions._
import rootMirror.{ RootClass, getModuleIfDefined }
type ExecResult = Any
import intp.{ debugging }
@@ -39,7 +39,7 @@ class JLineCompletion(val intp: IMain) extends Completion with CompletionOutput
// for some reason any's members don't show up in subclasses, which
// we need so 5.<tab> offers asInstanceOf etc.
- private def anyMembers = AnyClass.tpe.nonPrivateMembers
+ private def anyMembers = AnyTpe.nonPrivateMembers
def anyRefMethodsToShow = Set("isInstanceOf", "asInstanceOf", "toString")
def tos(sym: Symbol): String = sym.decodedName
@@ -152,7 +152,7 @@ class JLineCompletion(val intp: IMain) extends Completion with CompletionOutput
}
// not for completion but for excluding
- object anyref extends TypeMemberCompletion(AnyRefClass.tpe) { }
+ object anyref extends TypeMemberCompletion(AnyRefTpe) { }
// the unqualified vals/defs/etc visible in the repl
object ids extends CompletionAware {
diff --git a/src/scaladoc/scala/tools/nsc/doc/html/SyntaxHigh.scala b/src/scaladoc/scala/tools/nsc/doc/html/SyntaxHigh.scala
index fe0fc64033..910148532d 100644
--- a/src/scaladoc/scala/tools/nsc/doc/html/SyntaxHigh.scala
+++ b/src/scaladoc/scala/tools/nsc/doc/html/SyntaxHigh.scala
@@ -260,8 +260,8 @@ private[html] object SyntaxHigh {
parse(buf(i).toChar.toString, i+1)
case _ =>
if (i == 0 || (i >= 1 && !Character.isJavaIdentifierPart(buf(i-1).toChar))) {
- if (Character.isDigit(buf(i)) ||
- (buf(i) == '.' && i + 1 < buf.length && Character.isDigit(buf(i+1)))) {
+ if (Character.isDigit(buf(i).toInt) ||
+ (buf(i) == '.' && i + 1 < buf.length && Character.isDigit(buf(i+1).toInt))) {
val s = numlit(i)
parse("<span class=\"num\">"+s+"</span>", i+s.length)
} else {
diff --git a/src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotRunner.scala b/src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotRunner.scala
index 2fa1bf62f3..4bed106f43 100644
--- a/src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotRunner.scala
+++ b/src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotRunner.scala
@@ -98,7 +98,7 @@ class DotProcess(settings: doc.Settings) {
assert(!inputString.isSet)
assert(!outputString.isSet)
inputString.put(input)
- var result = outputString.take(settings.docDiagramsDotTimeout.value * 1000)
+ var result = outputString.take(settings.docDiagramsDotTimeout.value * 1000L)
if (error) result = null
result
diff --git a/src/scaladoc/scala/tools/nsc/doc/model/ModelFactoryImplicitSupport.scala b/src/scaladoc/scala/tools/nsc/doc/model/ModelFactoryImplicitSupport.scala
index d7b324f1d5..f984b4579f 100644
--- a/src/scaladoc/scala/tools/nsc/doc/model/ModelFactoryImplicitSupport.scala
+++ b/src/scaladoc/scala/tools/nsc/doc/model/ModelFactoryImplicitSupport.scala
@@ -285,7 +285,7 @@ trait ModelFactoryImplicitSupport {
(tparams zip constrs) flatMap {
case (tparam, constr) => {
uniteConstraints(constr) match {
- case (loBounds, upBounds) => (loBounds filter (_ != NothingClass.tpe), upBounds filter (_ != AnyClass.tpe)) match {
+ case (loBounds, upBounds) => (loBounds filter (_ != NothingTpe), upBounds filter (_ != AnyTpe)) match {
case (Nil, Nil) =>
Nil
case (List(lo), List(up)) if (lo == up) =>
@@ -532,7 +532,7 @@ trait ModelFactoryImplicitSupport {
object wildcardToNothing extends TypeMap {
def apply(tp: Type): Type = mapOver(tp) match {
case WildcardType =>
- NothingClass.tpe
+ NothingTpe
case other =>
other
}
diff --git a/src/scalap/scala/tools/scalap/Classfile.scala b/src/scalap/scala/tools/scalap/Classfile.scala
index 8082b6befe..f62df285f9 100644
--- a/src/scalap/scala/tools/scalap/Classfile.scala
+++ b/src/scalap/scala/tools/scalap/Classfile.scala
@@ -32,7 +32,7 @@ class Classfile(in: ByteArrayReader) {
var attribs: List[Attribute] = Nil
var i = 0
while (i < n) {
- attribs = Attribute(in.nextChar, in.nextBytes(in.nextInt)) :: attribs
+ attribs = Attribute(in.nextChar.toInt, in.nextBytes(in.nextInt)) :: attribs
i = i + 1
}
attribs
@@ -43,7 +43,7 @@ class Classfile(in: ByteArrayReader) {
var members: List[Member] = Nil
var i = 0
while (i < n) {
- members = Member(field, in.nextChar, in.nextChar, in.nextChar, readAttribs) :: members
+ members = Member(field, in.nextChar.toInt, in.nextChar.toInt, in.nextChar.toInt, readAttribs) :: members
i = i + 1
}
members
@@ -54,7 +54,7 @@ class Classfile(in: ByteArrayReader) {
var intfs: List[Int] = Nil
var i = 0
while (i < n) {
- intfs = in.nextChar :: intfs
+ intfs = in.nextChar.toInt :: intfs
i = i + 1
}
intfs
@@ -81,7 +81,7 @@ class Classfile(in: ByteArrayReader) {
case object Empty extends PoolEntry(0) { }
val entries = {
- val pool = new Array[PoolEntry](in.nextChar)
+ val pool = new Array[PoolEntry](in.nextChar.toInt)
var i = 1
while (i < pool.length) {
val tag = in.nextByte
@@ -92,7 +92,7 @@ class Classfile(in: ByteArrayReader) {
pool(i) = Empty
}
else pool(i) = tag match {
- case CONSTANT_UTF8 => UTF8(in.nextUTF8(in.nextChar))
+ case CONSTANT_UTF8 => UTF8(in.nextUTF8(in.nextChar.toInt))
case CONSTANT_UNICODE => in.skip(in.nextChar) ; Empty
case CONSTANT_CLASS => ClassRef(in.nextChar)
case CONSTANT_STRING => StringConst(in.nextChar)
diff --git a/src/scalap/scala/tools/scalap/CodeWriter.scala b/src/scalap/scala/tools/scalap/CodeWriter.scala
index fe594c14cf..168050096d 100644
--- a/src/scalap/scala/tools/scalap/CodeWriter.scala
+++ b/src/scalap/scala/tools/scalap/CodeWriter.scala
@@ -98,9 +98,9 @@ class CodeWriter(writer: Writer) {
def print(value: Boolean): CodeWriter = print(String.valueOf(value))
- def print(value: Byte): CodeWriter = print(String.valueOf(value))
+ def print(value: Byte): CodeWriter = print(String.valueOf(value.toInt))
- def print(value: Short): CodeWriter = print(String.valueOf(value))
+ def print(value: Short): CodeWriter = print(String.valueOf(value.toInt))
def print(value: Char): CodeWriter = print(String.valueOf(value))
diff --git a/src/swing/scala/swing/Component.scala b/src/swing/scala/swing/Component.scala
index b7dd856d09..3a47784562 100644
--- a/src/swing/scala/swing/Component.scala
+++ b/src/swing/scala/swing/Component.scala
@@ -83,9 +83,9 @@ abstract class Component extends UIElement {
* Used by certain layout managers, e.g., BoxLayout or OverlayLayout to
* align components relative to each other.
*/
- def xLayoutAlignment: Double = peer.getAlignmentX
+ def xLayoutAlignment: Double = peer.getAlignmentX.toDouble
def xLayoutAlignment_=(x: Double) = peer.setAlignmentX(x.toFloat)
- def yLayoutAlignment: Double = peer.getAlignmentY
+ def yLayoutAlignment: Double = peer.getAlignmentY.toDouble
def yLayoutAlignment_=(y: Double) = peer.setAlignmentY(y.toFloat)
def border: Border = peer.getBorder
diff --git a/test/files/continuations-run/basics.scala b/test/files/continuations-run/basics.scala
index b63710bc64..ed1782d77a 100755
--- a/test/files/continuations-run/basics.scala
+++ b/test/files/continuations-run/basics.scala
@@ -13,7 +13,7 @@ object Test {
2 * shift((k:Int => Int) => k(k(7)))
}
- def main(args: Array[String]) = {
+ def main(args: Array[String]) {
println(reset(m0()))
println(reset(m1()))
diff --git a/test/files/continuations-run/function1.scala b/test/files/continuations-run/function1.scala
index fbd413ed9d..ec7ebb66a5 100644
--- a/test/files/continuations-run/function1.scala
+++ b/test/files/continuations-run/function1.scala
@@ -5,7 +5,7 @@ import scala.util.continuations._
object Test {
- def main(args: Array[String]): Any = {
+ def main(args: Array[String]): Unit = {
val f = () => shift { k: (Int=>Int) => k(7) }
val g: () => Int @cps[Int] = f
@@ -13,4 +13,4 @@ object Test {
println(reset(g()))
}
-} \ No newline at end of file
+}
diff --git a/test/files/continuations-run/function4.scala b/test/files/continuations-run/function4.scala
index 2ccd0b4ff2..232b1ec3a6 100644
--- a/test/files/continuations-run/function4.scala
+++ b/test/files/continuations-run/function4.scala
@@ -5,11 +5,11 @@ import scala.util.continuations._
object Test {
- def main(args: Array[String]): Any = {
+ def main(args: Array[String]): Unit = {
val g: () => Int @cps[Int] = () => shift { k: (Int=>Int) => k(7) }
println(reset(g()))
}
-} \ No newline at end of file
+}
diff --git a/test/files/continuations-run/function5.scala b/test/files/continuations-run/function5.scala
index fe528e14e7..17ae08c98e 100644
--- a/test/files/continuations-run/function5.scala
+++ b/test/files/continuations-run/function5.scala
@@ -5,11 +5,11 @@ import scala.util.continuations._
object Test {
- def main(args: Array[String]): Any = {
+ def main(args: Array[String]): Unit = {
val g: () => Int @cps[Int] = () => 7
println(reset(g()))
}
-} \ No newline at end of file
+}
diff --git a/test/files/continuations-run/function6.scala b/test/files/continuations-run/function6.scala
index 54a6ffcc93..6b4c5adc41 100644
--- a/test/files/continuations-run/function6.scala
+++ b/test/files/continuations-run/function6.scala
@@ -5,7 +5,7 @@ import scala.util.continuations._
object Test {
- def main(args: Array[String]): Any = {
+ def main(args: Array[String]): Unit = {
val g: PartialFunction[Int, Int @cps[Int]] = { case x => 7 }
@@ -13,4 +13,4 @@ object Test {
}
-} \ No newline at end of file
+}
diff --git a/test/files/continuations-run/ifelse0.scala b/test/files/continuations-run/ifelse0.scala
index 2facab4b98..2c40f64959 100644
--- a/test/files/continuations-run/ifelse0.scala
+++ b/test/files/continuations-run/ifelse0.scala
@@ -10,9 +10,9 @@ object Test {
else
shift { k: (Int=>Int) => k(x) }
- def main(args: Array[String]): Any = {
+ def main(args: Array[String]): Unit = {
println(reset(1 + test(7)))
println(reset(1 + test(8)))
}
-} \ No newline at end of file
+}
diff --git a/test/files/continuations-run/ifelse1.scala b/test/files/continuations-run/ifelse1.scala
index c624b84b75..6f52a8c1e3 100644
--- a/test/files/continuations-run/ifelse1.scala
+++ b/test/files/continuations-run/ifelse1.scala
@@ -15,11 +15,11 @@ object Test {
else
shift { k: (Int=>Int) => k(k(k(x))) }
- def main(args: Array[String]): Any = {
+ def main(args: Array[String]): Unit = {
println(reset(1 + test1(7)))
println(reset(1 + test1(8)))
println(reset(1 + test2(7)))
println(reset(1 + test2(8)))
}
-} \ No newline at end of file
+}
diff --git a/test/files/continuations-run/ifelse2.scala b/test/files/continuations-run/ifelse2.scala
index 506acc4d00..f7f8328703 100644
--- a/test/files/continuations-run/ifelse2.scala
+++ b/test/files/continuations-run/ifelse2.scala
@@ -8,9 +8,9 @@ object Test {
def test(x:Int) = if (x <= 7)
shift { k: (Unit=>Unit) => println("abort") }
- def main(args: Array[String]): Any = {
+ def main(args: Array[String]): Unit = {
println(reset{ test(7); println("alive") })
println(reset{ test(8); println("alive") })
}
-} \ No newline at end of file
+}
diff --git a/test/files/continuations-run/ifelse3.scala b/test/files/continuations-run/ifelse3.scala
index 54566a421c..7b85770be9 100644
--- a/test/files/continuations-run/ifelse3.scala
+++ b/test/files/continuations-run/ifelse3.scala
@@ -13,9 +13,9 @@ object Test {
x + 1
- def main(args: Array[String]): Any = {
+ def main(args: Array[String]): Unit = {
println(reset(test(7)))
println(reset(test(8)))
}
-} \ No newline at end of file
+}
diff --git a/test/files/continuations-run/ifelse4.scala b/test/files/continuations-run/ifelse4.scala
index 8360375283..a0dbcafc57 100644
--- a/test/files/continuations-run/ifelse4.scala
+++ b/test/files/continuations-run/ifelse4.scala
@@ -22,10 +22,10 @@ object Test {
if (sh(x1)==45) x1 else sh(x1)
}
- def main(args: Array[String]): Any = {
+ def main(args: Array[String]): Unit = {
println(reset(1 + testA(7)))
println(reset(1 + testB(9)))
println(reset(1 + testC(9)))
println(reset(1 + testD(7)))
}
-} \ No newline at end of file
+}
diff --git a/test/files/continuations-run/infer1.scala b/test/files/continuations-run/infer1.scala
index 10822508e7..1196bd40a8 100644
--- a/test/files/continuations-run/infer1.scala
+++ b/test/files/continuations-run/infer1.scala
@@ -17,7 +17,7 @@ object Test {
def util() = shift { k: (String => String) => "7" }
- def main(args: Array[String]): Any = {
+ def main(args: Array[String]): Unit = {
test { shift { k: (Int => String) => 9 } }
test { shift { k: (Int => String) => 9 }; 2 }
// test { shift { k: (Int => String) => 9 }; util() } <-- doesn't work
@@ -30,4 +30,4 @@ object Test {
}
-} \ No newline at end of file
+}
diff --git a/test/files/continuations-run/match0.scala b/test/files/continuations-run/match0.scala
index b65d343c07..63b73bf21e 100644
--- a/test/files/continuations-run/match0.scala
+++ b/test/files/continuations-run/match0.scala
@@ -10,9 +10,9 @@ object Test {
case 8 => shift { k: (Int=>Int) => k(x) }
}
- def main(args: Array[String]): Any = {
+ def main(args: Array[String]): Unit = {
println(reset(1 + test(7)))
println(reset(1 + test(8)))
}
-} \ No newline at end of file
+}
diff --git a/test/files/continuations-run/match1.scala b/test/files/continuations-run/match1.scala
index 20671f26ba..62d639ee72 100644
--- a/test/files/continuations-run/match1.scala
+++ b/test/files/continuations-run/match1.scala
@@ -10,9 +10,9 @@ object Test {
case _ => x
}
- def main(args: Array[String]): Any = {
+ def main(args: Array[String]): Unit = {
println(reset(1 + test(7)))
println(reset(1 + test(8)))
}
-} \ No newline at end of file
+}
diff --git a/test/files/continuations-run/patvirt.scala b/test/files/continuations-run/patvirt.scala
index 5b4d312f20..7d769d46fe 100644
--- a/test/files/continuations-run/patvirt.scala
+++ b/test/files/continuations-run/patvirt.scala
@@ -25,7 +25,7 @@ object Test {
o7.get
}
- def main(args: Array[String]): Any = {
+ def main(args: Array[String]): Unit = {
println(reset(1 + test(7)))
println(reset(1 + test(8)))
}
diff --git a/test/files/continuations-run/t1820.scala b/test/files/continuations-run/t1820.scala
index 893ddab6d1..7de6ccabef 100644
--- a/test/files/continuations-run/t1820.scala
+++ b/test/files/continuations-run/t1820.scala
@@ -10,5 +10,5 @@ object Test {
if (b) shifted
}
}
- def main(args: Array[String]) = test1(true)
-} \ No newline at end of file
+ def main(args: Array[String]): Unit = test1(true)
+}
diff --git a/test/files/continuations-run/t1821.scala b/test/files/continuations-run/t1821.scala
index 0d5fb553be..55bf7b6f12 100644
--- a/test/files/continuations-run/t1821.scala
+++ b/test/files/continuations-run/t1821.scala
@@ -11,10 +11,10 @@ object Test {
def test3[A](x: A): A @suspendable = x match { case x => x }
def test4[A](x: List[A]): A @suspendable = x match { case List(x) => x }
- def main(args: Array[String]) = {
+ def main(args: Array[String]) {
println(reset(test1()))
println(reset(test2(List(()))))
println(reset(test3()))
println(reset(test4(List(()))))
}
-} \ No newline at end of file
+}
diff --git a/test/files/continuations-run/t3199b.scala b/test/files/continuations-run/t3199b.scala
index 2122c963ac..fe1ecafe72 100644
--- a/test/files/continuations-run/t3199b.scala
+++ b/test/files/continuations-run/t3199b.scala
@@ -4,8 +4,8 @@ object Test {
java.util.Arrays.asList(Array(1,2,3):_*)
}
- def main(args: Array[String]) = {
+ def main(args: Array[String]) {
println(test())
}
-} \ No newline at end of file
+}
diff --git a/test/files/continuations-run/t3223.scala b/test/files/continuations-run/t3223.scala
index efed1ff581..fda61f41ea 100644
--- a/test/files/continuations-run/t3223.scala
+++ b/test/files/continuations-run/t3223.scala
@@ -6,7 +6,7 @@ object Test {
throw new Exception
shiftUnit0[Int,Int](7)
} catch {
- case ex =>
+ case ex: Throwable =>
val g = (a:Int)=>a
9
}
@@ -16,4 +16,4 @@ object Test {
println(reset(foo(0)))
}
-} \ No newline at end of file
+}
diff --git a/test/files/continuations-run/t3225.scala b/test/files/continuations-run/t3225.scala
index 5b6259c43f..bc6d635c88 100644
--- a/test/files/continuations-run/t3225.scala
+++ b/test/files/continuations-run/t3225.scala
@@ -48,7 +48,7 @@ object Test {
// TODO: check whether this also applies to a::shift { k => ... }
- def main(args: Array[String]) = {
+ def main(args: Array[String]) {
testMono()
testPoly()
}
diff --git a/test/files/continuations-run/t5314.check b/test/files/continuations-run/t5314.check
index 4b35d8e6d0..61f5b25dc7 100644
--- a/test/files/continuations-run/t5314.check
+++ b/test/files/continuations-run/t5314.check
@@ -1,3 +1,9 @@
+t5314.scala:34: warning: expression 7 is cps-transformed unexpectedly
+ def bar3(x:Int): Int @cps[Int] = { foo2(x); if (x == 7) return 7 else return foo2(x) }
+ ^
+t5314.scala:35: warning: expression 7 is cps-transformed unexpectedly
+ def bar4(x:Int): Int @cps[Int] = { foo2(x); if (x == 7) return 7 else foo2(x) }
+ ^
7
7
7
diff --git a/test/files/continuations-run/t5472.check b/test/files/continuations-run/t5472.check
index d42e80c18e..3192c746eb 100644
--- a/test/files/continuations-run/t5472.check
+++ b/test/files/continuations-run/t5472.check
@@ -1 +1,15 @@
+t5472.scala:12: warning: expression case4(){
+ if (x1.ne(null))
+ matchEnd3(true)
+ else
+ case5()
+} is cps-transformed unexpectedly
+ (location, accessors) <- new ContinuationizedParallelIterable(map)
+ ^
+t5472.scala:12: warning: expression matchEnd3(x: Int){
+ x
+} is cps-transformed unexpectedly
+ (location, accessors) <- new ContinuationizedParallelIterable(map)
+ ^
+warning: there were 1 deprecation warning(s); re-run with -deprecation for details
List(23, 23)
diff --git a/test/files/continuations-run/t5472.scala b/test/files/continuations-run/t5472.scala
index 3e3c76b32a..060d267544 100644
--- a/test/files/continuations-run/t5472.scala
+++ b/test/files/continuations-run/t5472.scala
@@ -2,6 +2,7 @@ import scala.annotation._
import scala.util.continuations._
import java.util.concurrent.atomic._
+@deprecated("Suppress warnings", since="2.11")
object Test {
def main(args: Array[String]) {
val map = Map("foo" -> 1, "bar" -> 2)
@@ -15,7 +16,6 @@ object Test {
println(mapped.toList)
}
}
-}
final class ContinuationizedParallelIterable[+A](protected val underline: Iterable[A]) {
def toList = underline.toList.sortBy(_.toString)
@@ -76,7 +76,7 @@ final class ContinuationizedParallelIterable[+A](protected val underline: Iterab
new AtomicInteger(underline.size) with ((ContinuationizedParallelIterable[B] => Unit) => Unit) {
override final def apply(continue: ContinuationizedParallelIterable[B] => Unit) {
val results = new Array[B](super.get)
- for ((element, i) <- underline.view zipWithIndex) {
+ for ((element, i) <- underline.view.zipWithIndex) {
reset {
val result = f(element)
results(i) = result
@@ -88,3 +88,4 @@ final class ContinuationizedParallelIterable[+A](protected val underline: Iterab
}
})
}
+}
diff --git a/test/files/continuations-run/t5506.scala b/test/files/continuations-run/t5506.scala
index 2b5c1118f7..4b3703c725 100644
--- a/test/files/continuations-run/t5506.scala
+++ b/test/files/continuations-run/t5506.scala
@@ -42,7 +42,7 @@ z
}
-def main(args: Array[String]) = {
+def main(args: Array[String]) {
reset {
println(fp10)
println(fp11)
diff --git a/test/files/continuations-run/t5538.check b/test/files/continuations-run/t5538.check
index 457721d5e0..d9d873663d 100644
--- a/test/files/continuations-run/t5538.check
+++ b/test/files/continuations-run/t5538.check
@@ -1 +1,2 @@
+warning: there were 1 feature warning(s); re-run with -feature for details
Future(Future(Future(Future(Future(List(1, 2, 3, 4, 5))))))
diff --git a/test/files/continuations-run/t5538.scala b/test/files/continuations-run/t5538.scala
index 42f8163caf..6713cecf2f 100644
--- a/test/files/continuations-run/t5538.scala
+++ b/test/files/continuations-run/t5538.scala
@@ -1,6 +1,8 @@
import scala.util.continuations._
import scala.collection.generic.CanBuildFrom
+import scala.language.{ implicitConversions }
+
object Test {
class ExecutionContext
@@ -43,8 +45,8 @@ object Test {
}
- def main(args: Array[String]) = {
+ def main(args: Array[String]) {
val p = new PromiseStream[Int]
println(Future.flow(p << (Future(1), Future(2), Future(3), Future(4), Future(5))))
}
-} \ No newline at end of file
+}
diff --git a/test/files/continuations-run/trycatch0.scala b/test/files/continuations-run/trycatch0.scala
index ec39863f3f..feb7f7182b 100644
--- a/test/files/continuations-run/trycatch0.scala
+++ b/test/files/continuations-run/trycatch0.scala
@@ -7,14 +7,14 @@ object Test {
def foo = try {
shift((k: Int=>Int) => k(7))
} catch {
- case ex =>
+ case ex: Throwable =>
9
}
def bar = try {
7
} catch {
- case ex =>
+ case ex: Throwable =>
shiftUnit0[Int,Int](9)
}
@@ -22,4 +22,4 @@ object Test {
println(reset { foo + 3 })
println(reset { bar + 3 })
}
-} \ No newline at end of file
+}
diff --git a/test/files/continuations-run/trycatch1.check b/test/files/continuations-run/trycatch1.check
index a028d2b1e1..061ecdcd54 100644
--- a/test/files/continuations-run/trycatch1.check
+++ b/test/files/continuations-run/trycatch1.check
@@ -1,4 +1,10 @@
+trycatch1.scala:34: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 7
+ ^
+trycatch1.scala:18: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ shift((k: Int=>Int) => k(7))
+ ^
+12
12
12
12
-12 \ No newline at end of file
diff --git a/test/files/continuations-run/trycatch1.scala b/test/files/continuations-run/trycatch1.scala
index 10dfd30bb2..b00a87d059 100644
--- a/test/files/continuations-run/trycatch1.scala
+++ b/test/files/continuations-run/trycatch1.scala
@@ -10,7 +10,7 @@ object Test {
fatal
shift((k: Int=>Int) => k(7))
} catch {
- case ex =>
+ case ex: Throwable =>
9
}
@@ -18,7 +18,7 @@ object Test {
shift((k: Int=>Int) => k(7))
fatal
} catch {
- case ex =>
+ case ex: Throwable =>
9
}
@@ -26,7 +26,7 @@ object Test {
fatal
7
} catch {
- case ex =>
+ case ex: Throwable =>
shiftUnit0[Int,Int](9) // regular shift causes no-symbol doesn't have owner
}
@@ -34,7 +34,7 @@ object Test {
7
fatal
} catch {
- case ex =>
+ case ex: Throwable =>
shiftUnit0[Int,Int](9) // regular shift causes no-symbol doesn't have owner
}
@@ -45,4 +45,4 @@ object Test {
println(reset { bar2 + 3 })
}
-} \ No newline at end of file
+}
diff --git a/test/files/continuations-run/while0.scala b/test/files/continuations-run/while0.scala
index 46005a4a77..542408fb24 100644
--- a/test/files/continuations-run/while0.scala
+++ b/test/files/continuations-run/while0.scala
@@ -15,8 +15,8 @@ object Test {
println(x)
}
- def main(args: Array[String]): Any = {
+ def main(args: Array[String]): Unit = {
reset(test())
}
-} \ No newline at end of file
+}
diff --git a/test/files/continuations-run/while1.scala b/test/files/continuations-run/while1.scala
index fd41ab36ee..351d52c27a 100644
--- a/test/files/continuations-run/while1.scala
+++ b/test/files/continuations-run/while1.scala
@@ -15,8 +15,8 @@ object Test {
println(x)
}
- def main(args: Array[String]): Any = {
+ def main(args: Array[String]): Unit = {
reset(test())
}
-} \ No newline at end of file
+}
diff --git a/test/files/continuations-run/while2.scala b/test/files/continuations-run/while2.scala
index 63f9cb99fe..f4991dea61 100644
--- a/test/files/continuations-run/while2.scala
+++ b/test/files/continuations-run/while2.scala
@@ -16,8 +16,8 @@ object Test {
println(x)
}
- def main(args: Array[String]): Any = {
+ def main(args: Array[String]): Unit = {
reset(test())
}
-} \ No newline at end of file
+}
diff --git a/test/files/filters b/test/files/filters
new file mode 100644
index 0000000000..9a9b439784
--- /dev/null
+++ b/test/files/filters
@@ -0,0 +1,3 @@
+#
+#Java HotSpot(TM) 64-Bit Server VM warning: Failed to reserve shared memory (errno = 28).
+Java HotSpot\(TM\) .* warning:
diff --git a/test/files/jvm/actor-exceptions.scala b/test/files/jvm/actor-exceptions.scala
index 3ee4db9ed2..bdd983a0e8 100644
--- a/test/files/jvm/actor-exceptions.scala
+++ b/test/files/jvm/actor-exceptions.scala
@@ -1,4 +1,7 @@
+
+@deprecated("Suppress warnings", since="2.11")
+object Test {
import scala.actors.{Actor, Exit}
import Actor._
@@ -58,7 +61,6 @@ object Slave extends Actor {
case object A
-object Test {
def main(args: Array[String]) {
Master.start()
}
diff --git a/test/files/jvm/actor-executor.scala b/test/files/jvm/actor-executor.scala
index b1f9caebdd..0fc28b4d85 100644
--- a/test/files/jvm/actor-executor.scala
+++ b/test/files/jvm/actor-executor.scala
@@ -1,3 +1,7 @@
+
+
+@deprecated("Suppress warnings", since="2.11")
+object Test {
import java.util.concurrent.Executors
import scala.actors.{Actor, SchedulerAdapter}
import Actor._
@@ -50,7 +54,6 @@ object Two extends AdaptedActor {
}
}
-object Test {
val executor =
Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors())
diff --git a/test/files/jvm/actor-executor2.scala b/test/files/jvm/actor-executor2.scala
index f8fcaef69f..5badf2ae7e 100644
--- a/test/files/jvm/actor-executor2.scala
+++ b/test/files/jvm/actor-executor2.scala
@@ -1,3 +1,8 @@
+
+
+
+@deprecated("Suppress warnings", since="2.11")
+object Test {
import scala.actors.{Actor, SchedulerAdapter, Exit}
import Actor._
import java.util.concurrent.{Executors, RejectedExecutionException}
@@ -48,7 +53,6 @@ trait AdaptedActor extends Actor {
Test.scheduler
}
-object Test {
val NUM_MSG = 100000
val executor =
diff --git a/test/files/jvm/actor-executor3.scala b/test/files/jvm/actor-executor3.scala
index 4fde2c6c5f..f8b57d84b3 100644
--- a/test/files/jvm/actor-executor3.scala
+++ b/test/files/jvm/actor-executor3.scala
@@ -1,3 +1,8 @@
+
+
+
+@deprecated("Suppress warnings", since="2.11")
+object Test {
import scala.actors.Actor
import scala.actors.scheduler.ExecutorScheduler
import java.util.concurrent.Executors
@@ -48,7 +53,6 @@ trait AdaptedActor extends Actor {
Test.scheduler
}
-object Test {
val NUM_MSG = 100000
val executor =
diff --git a/test/files/jvm/actor-getstate.scala b/test/files/jvm/actor-getstate.scala
index a6e15a8721..425efbe5e6 100644
--- a/test/files/jvm/actor-getstate.scala
+++ b/test/files/jvm/actor-getstate.scala
@@ -1,7 +1,9 @@
-import scala.actors.{Reactor, Actor, TIMEOUT}
-import Actor._
+
+@deprecated("Suppress warnings", since="2.11")
object Test {
+ import scala.actors.{Reactor, Actor, TIMEOUT}
+ import Actor._
def assert(cond: => Boolean, hint: String) {
if (!cond)
diff --git a/test/files/jvm/actor-link-getstate.scala b/test/files/jvm/actor-link-getstate.scala
index c24daf2eff..d8b8ada1e6 100644
--- a/test/files/jvm/actor-link-getstate.scala
+++ b/test/files/jvm/actor-link-getstate.scala
@@ -1,5 +1,9 @@
-import scala.actors.{Actor, Exit}
-import scala.actors.Actor._
+
+
+@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
@@ -39,7 +43,6 @@ object Master extends Actor {
}
}
-object Test {
def main(args: Array[String]) {
actor {
diff --git a/test/files/jvm/actor-looping.scala b/test/files/jvm/actor-looping.scala
index 475d4754ce..7bc6f1e5c5 100644
--- a/test/files/jvm/actor-looping.scala
+++ b/test/files/jvm/actor-looping.scala
@@ -1,7 +1,8 @@
-import scala.actors.Actor._
+@deprecated("Suppress warnings", since="2.11")
object Test {
+ import scala.actors.Actor._
case object A
def main(args: Array[String]) {
diff --git a/test/files/jvm/actor-normal-exit.scala b/test/files/jvm/actor-normal-exit.scala
index 20863d5bb0..90495866e2 100644
--- a/test/files/jvm/actor-normal-exit.scala
+++ b/test/files/jvm/actor-normal-exit.scala
@@ -1,7 +1,9 @@
-import scala.actors.{Actor, Exit}
+
+@deprecated("Suppress warnings", since="2.11")
object Test {
+ import scala.actors.{Actor, Exit}
object Master extends Actor {
trapExit = true
def act() {
diff --git a/test/files/jvm/actor-receivewithin.scala b/test/files/jvm/actor-receivewithin.scala
index a5c87c2722..5982462502 100644
--- a/test/files/jvm/actor-receivewithin.scala
+++ b/test/files/jvm/actor-receivewithin.scala
@@ -1,3 +1,7 @@
+
+
+@deprecated("Suppress warnings", since="2.11")
+object Test {
import scala.actors.{Actor, TIMEOUT}
object A extends Actor {
@@ -62,7 +66,6 @@ object B extends Actor {
}
}
-object Test {
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
index 21e624bd0a..42e0be4a8c 100644
--- a/test/files/jvm/actor-sync-send-timeout.scala
+++ b/test/files/jvm/actor-sync-send-timeout.scala
@@ -1,8 +1,9 @@
+@deprecated("Suppress warnings", since="2.11")
+object Test {
import scala.actors.Actor
/* This test is a regression test for SI-4759.
*/
-object Test {
val Runs = 5
def main(args: Array[String]) = {
@@ -14,7 +15,6 @@ object Test {
}
//println("done sending to A1")
}
-}
object A2 extends Actor {
this.start()
@@ -45,3 +45,4 @@ object A1 extends Actor {
}
}
}
+}
diff --git a/test/files/jvm/actor-termination.scala b/test/files/jvm/actor-termination.scala
index d8e44a2797..4a6bf92d48 100644
--- a/test/files/jvm/actor-termination.scala
+++ b/test/files/jvm/actor-termination.scala
@@ -1,8 +1,9 @@
-import scala.actors.Actor
/* 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 {
diff --git a/test/files/jvm/actor-uncaught-exception.scala b/test/files/jvm/actor-uncaught-exception.scala
index 5ae66de640..5285b7519f 100644
--- a/test/files/jvm/actor-uncaught-exception.scala
+++ b/test/files/jvm/actor-uncaught-exception.scala
@@ -1,10 +1,11 @@
+@deprecated("Suppress warnings", since="2.11")
+object Test {
import scala.actors.{Actor, Exit}
class MyException(msg: String) extends Exception(msg) {
override def fillInStackTrace() = this
}
-object Test {
case object StartError extends Actor {
def act() {
diff --git a/test/files/jvm/actor-uncaught-exception2.check b/test/files/jvm/actor-uncaught-exception2.check
index 870a5d32f9..a54f374aed 100644
--- a/test/files/jvm/actor-uncaught-exception2.check
+++ b/test/files/jvm/actor-uncaught-exception2.check
@@ -1,2 +1,2 @@
-UncaughtException(StartError,None,None,MyException: I don't want to run!)
-UncaughtException(MessageError,Some('ping),Some(Supervisor),MyException: No message for me!)
+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
index 0364cbeb03..f56217c187 100644
--- a/test/files/jvm/actor-uncaught-exception2.scala
+++ b/test/files/jvm/actor-uncaught-exception2.scala
@@ -1,11 +1,11 @@
+@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
}
-object Test {
-
case object StartError extends Actor {
def act() {
try {
diff --git a/test/files/jvm/annotations.scala b/test/files/jvm/annotations.scala
index 77a45fae89..c42eceef4c 100644
--- a/test/files/jvm/annotations.scala
+++ b/test/files/jvm/annotations.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ higherKinds, reflectiveCalls }
+
object Test1 {
class Foo {
@remote
diff --git a/test/files/jvm/daemon-actor-termination.scala b/test/files/jvm/daemon-actor-termination.scala
index 6ddfc3139d..40acd8583e 100644
--- a/test/files/jvm/daemon-actor-termination.scala
+++ b/test/files/jvm/daemon-actor-termination.scala
@@ -1,8 +1,10 @@
-import scala.actors.{Actor, DaemonActor}
/* 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 {
diff --git a/test/files/jvm/deprecation.check b/test/files/jvm/deprecation.check
new file mode 100644
index 0000000000..e263e4909d
--- /dev/null
+++ b/test/files/jvm/deprecation.check
@@ -0,0 +1,3 @@
+warning: there were 5 deprecation warning(s); re-run with -deprecation for details
+Note: deprecation/Use_2.java uses or overrides a deprecated API.
+Note: Recompile with -Xlint:deprecation for details.
diff --git a/test/files/jvm/duration-tck.scala b/test/files/jvm/duration-tck.scala
index b2573448c7..3bc8a2c100 100644
--- a/test/files/jvm/duration-tck.scala
+++ b/test/files/jvm/duration-tck.scala
@@ -6,6 +6,8 @@ import scala.concurrent.duration._
import scala.reflect._
import scala.tools.partest.TestUtil.intercept
+import scala.language.{ postfixOps }
+
object Test extends App {
implicit class Assert(val left: Any) extends AnyVal {
diff --git a/test/files/jvm/future-alarm.scala b/test/files/jvm/future-alarm.scala
index 8ee902b5ea..3e71fa681c 100644
--- a/test/files/jvm/future-alarm.scala
+++ b/test/files/jvm/future-alarm.scala
@@ -1,6 +1,8 @@
-import scala.actors.Futures
+
+@deprecated("Suppress warnings", since="2.11")
object Test {
+ import scala.actors.Futures
def main(args: Array[String]) {
try {
for (i <- 1 to 100000) {
diff --git a/test/files/jvm/future-awaitall-zero.scala b/test/files/jvm/future-awaitall-zero.scala
index cd6ba172cc..56f4bab16f 100644
--- a/test/files/jvm/future-awaitall-zero.scala
+++ b/test/files/jvm/future-awaitall-zero.scala
@@ -1,7 +1,9 @@
-import scala.actors.Futures._
-import scala.actors.Actor._
+
+@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) {
diff --git a/test/files/jvm/future-spec/main.scala b/test/files/jvm/future-spec/main.scala
index 90048ccda0..e000431dda 100644
--- a/test/files/jvm/future-spec/main.scala
+++ b/test/files/jvm/future-spec/main.scala
@@ -17,6 +17,12 @@ object Test {
}
+trait Features {
+ implicit def implicitously = scala.language.implicitConversions
+ implicit def reflectively = scala.language.reflectiveCalls
+ implicit def postulously = scala.language.postfixOps
+}
+
trait Output {
val buffer = new StringBuilder
@@ -27,7 +33,7 @@ trait Output {
}
-trait MinimalScalaTest extends Output {
+trait MinimalScalaTest extends Output with Features {
val throwables = mutable.ArrayBuffer[Throwable]()
@@ -70,7 +76,7 @@ trait MinimalScalaTest extends Output {
throw new Exception("Exception of type %s was not thrown".format(manifest[T]))
} catch {
case t: Throwable =>
- if (manifest[T].erasure != t.getClass) throw t
+ if (manifest[T].runtimeClass != t.getClass) throw t
else t.asInstanceOf[T]
}
}
diff --git a/test/files/jvm/future-termination.scala b/test/files/jvm/future-termination.scala
index f51642cb7a..668b3f74ba 100644
--- a/test/files/jvm/future-termination.scala
+++ b/test/files/jvm/future-termination.scala
@@ -1,8 +1,10 @@
-import scala.actors.Futures
/* 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 {
diff --git a/test/files/jvm/reactor-exceptionOnSend.scala b/test/files/jvm/reactor-exceptionOnSend.scala
index 3d9a042131..6d79fc9d13 100644
--- a/test/files/jvm/reactor-exceptionOnSend.scala
+++ b/test/files/jvm/reactor-exceptionOnSend.scala
@@ -1,3 +1,7 @@
+
+
+@deprecated("Suppress warnings", since="2.11")
+object Test {
import scala.actors.Reactor
import scala.actors.Actor._
@@ -48,7 +52,6 @@ object B extends Reactor[Any] {
}
}
-object Test {
def main(args: Array[String]) {
B.start()
}
diff --git a/test/files/jvm/reactor-producer-consumer.scala b/test/files/jvm/reactor-producer-consumer.scala
index 8a6b17c3ad..ec34febe01 100644
--- a/test/files/jvm/reactor-producer-consumer.scala
+++ b/test/files/jvm/reactor-producer-consumer.scala
@@ -1,6 +1,8 @@
-import scala.actors.Reactor
+
+@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)
diff --git a/test/files/jvm/reactor.scala b/test/files/jvm/reactor.scala
index dbc9a6bdda..91ded27f07 100644
--- a/test/files/jvm/reactor.scala
+++ b/test/files/jvm/reactor.scala
@@ -1,3 +1,11 @@
+/**
+ * Ping pong example for Reactor.
+ *
+ * @author Philipp Haller
+ */
+
+@deprecated("Suppress warnings", since="2.11")
+object Test {
import scala.actors.Reactor
@@ -5,19 +13,12 @@ case class Ping(from: Reactor[Any])
case object Pong
case object Stop
-/**
- * Ping pong example for Reactor.
- *
- * @author Philipp Haller
- */
-object Test {
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() {
@@ -68,3 +69,4 @@ class PongActor extends Reactor[Any] {
}
}
}
+}
diff --git a/test/files/jvm/replyablereactor.scala b/test/files/jvm/replyablereactor.scala
index e1fabc98da..4c4e13d9ab 100644
--- a/test/files/jvm/replyablereactor.scala
+++ b/test/files/jvm/replyablereactor.scala
@@ -1,3 +1,7 @@
+
+
+@deprecated("Suppress warnings", since="2.11")
+object Test {
import scala.actors.ReplyReactor
class MyActor extends ReplyReactor {
@@ -18,7 +22,6 @@ class MyActor extends ReplyReactor {
}
}
-object Test {
def main(args: Array[String]) {
val a = new MyActor
a.start()
diff --git a/test/files/jvm/replyablereactor2.scala b/test/files/jvm/replyablereactor2.scala
index da9e0e269e..21f33cce56 100644
--- a/test/files/jvm/replyablereactor2.scala
+++ b/test/files/jvm/replyablereactor2.scala
@@ -1,3 +1,7 @@
+
+
+@deprecated("Suppress warnings", since="2.11")
+object Test {
import scala.actors._
import scala.actors.Actor._
@@ -19,7 +23,6 @@ class MyActor extends ReplyReactor {
}
}
-object Test {
def main(args: Array[String]) {
val a = new MyActor
a.start()
diff --git a/test/files/jvm/replyablereactor3.scala b/test/files/jvm/replyablereactor3.scala
index 2c26b8a176..5810ed053f 100644
--- a/test/files/jvm/replyablereactor3.scala
+++ b/test/files/jvm/replyablereactor3.scala
@@ -1,3 +1,7 @@
+
+
+@deprecated("Suppress warnings", since="2.11")
+object Test {
import scala.actors._
import scala.actors.Actor._
@@ -19,7 +23,6 @@ class MyActor extends ReplyReactor {
}
}
-object Test {
def main(args: Array[String]) {
val a = new MyActor
a.start()
diff --git a/test/files/jvm/replyablereactor4.scala b/test/files/jvm/replyablereactor4.scala
index 8776cf63f0..95d63684dd 100644
--- a/test/files/jvm/replyablereactor4.scala
+++ b/test/files/jvm/replyablereactor4.scala
@@ -1,3 +1,7 @@
+
+
+@deprecated("Suppress warnings", since="2.11")
+object Test {
import scala.actors._
import scala.actors.Actor._
@@ -19,7 +23,6 @@ class MyActor extends ReplyReactor {
}
}
-object Test {
def main(args: Array[String]) {
val a = new MyActor
a.start()
diff --git a/test/files/jvm/replyreactor-react-sender.scala b/test/files/jvm/replyreactor-react-sender.scala
index c9884295f6..fdcea09035 100644
--- a/test/files/jvm/replyreactor-react-sender.scala
+++ b/test/files/jvm/replyreactor-react-sender.scala
@@ -1,7 +1,9 @@
-import scala.actors.ReplyReactor
-import scala.actors.Actor._
+
+@deprecated("Suppress warnings", since="2.11")
object Test {
+ import scala.actors.ReplyReactor
+ import scala.actors.Actor._
val NUM = 2000
diff --git a/test/files/jvm/replyreactor.scala b/test/files/jvm/replyreactor.scala
index 0cecf29ec7..7512fb0eb2 100644
--- a/test/files/jvm/replyreactor.scala
+++ b/test/files/jvm/replyreactor.scala
@@ -1,6 +1,8 @@
-import scala.actors.ReplyReactor
+
+@deprecated("Suppress warnings", since="2.11")
object Test {
+ import scala.actors.ReplyReactor
def main(args: Array[String]) {
val a = new ReplyReactor {
def act() {
diff --git a/test/files/jvm/scala-concurrent-tck.check b/test/files/jvm/scala-concurrent-tck.check
new file mode 100644
index 0000000000..18fc456acb
--- /dev/null
+++ b/test/files/jvm/scala-concurrent-tck.check
@@ -0,0 +1,3 @@
+scala-concurrent-tck.scala:429: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ f
+ ^
diff --git a/test/files/jvm/scala-concurrent-tck.scala b/test/files/jvm/scala-concurrent-tck.scala
index b2b4183564..438ee310e6 100644
--- a/test/files/jvm/scala-concurrent-tck.scala
+++ b/test/files/jvm/scala-concurrent-tck.scala
@@ -728,7 +728,7 @@ trait Blocking extends TestBase {
Await.result(f, Duration(500, "ms"))
assert(false)
} catch {
- case t =>
+ case t: Throwable =>
assert(t == cause)
done()
}
diff --git a/test/files/jvm/scheduler-adapter.scala b/test/files/jvm/scheduler-adapter.scala
index d6a8a446a0..1c9cfe7019 100644
--- a/test/files/jvm/scheduler-adapter.scala
+++ b/test/files/jvm/scheduler-adapter.scala
@@ -1,3 +1,7 @@
+
+
+@deprecated("Suppress warnings", since="2.11")
+object Test {
import scala.actors.{Actor, SchedulerAdapter}
trait AdaptedActor extends Actor {
@@ -36,7 +40,6 @@ object Two extends AdaptedActor {
}
}
-object Test {
val adapted =
new SchedulerAdapter {
def execute(block: => Unit) {
diff --git a/test/files/jvm/serialization.scala b/test/files/jvm/serialization.scala
index f2c47aad77..a64b7115fa 100644
--- a/test/files/jvm/serialization.scala
+++ b/test/files/jvm/serialization.scala
@@ -281,6 +281,7 @@ object Test2_immutable {
//############################################################################
// Test classes in package "scala.collection.mutable"
+@deprecated("Suppress warnings", since="2.11")
object Test3_mutable {
import scala.reflect.ClassManifest
import scala.collection.mutable.{
@@ -593,6 +594,7 @@ object Test8 {
//############################################################################
// Test code
+@deprecated("Suppress warnings", since="2.11")
object Test {
def main(args: Array[String]) {
Test1_scala
@@ -678,7 +680,7 @@ object Test10_util {
import scala.util.Random
def rep[A](n: Int)(f: => A) { if (n > 0) { f; rep(n-1)(f) } }
- try {
+ {
val random = new Random(345)
val random2: Random = read(write(random))
rep(5) { assert(random.nextInt == random2.nextInt) }
diff --git a/test/files/jvm/stringbuilder.scala b/test/files/jvm/stringbuilder.scala
index 54951d657b..1fbf61aeab 100644
--- a/test/files/jvm/stringbuilder.scala
+++ b/test/files/jvm/stringbuilder.scala
@@ -2,6 +2,7 @@
*
* @author Stephane Micheloud
*/
+import scala.language.{ postfixOps }
object Test {
def main(args: Array[String]) {
Test1.run() //ctor, reverse
diff --git a/test/files/jvm/t1449.scala b/test/files/jvm/t1449.scala
index 3822cf7dd5..7917d6f6d5 100644
--- a/test/files/jvm/t1449.scala
+++ b/test/files/jvm/t1449.scala
@@ -1,7 +1,10 @@
-import scala.actors.Actor._
-import scala.actors.Future
-import scala.actors.Futures._
+
+
+@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 {
diff --git a/test/files/jvm/t1948.scala b/test/files/jvm/t1948.scala
index 084c956398..95777b8037 100644
--- a/test/files/jvm/t1948.scala
+++ b/test/files/jvm/t1948.scala
@@ -1,7 +1,9 @@
-import scala.actors._
-import scala.actors.Actor._
+
+@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 {
diff --git a/test/files/jvm/t2163/t2163.scala b/test/files/jvm/t2163/t2163.scala
index f73b520cbe..fdf19c4e25 100644
--- a/test/files/jvm/t2163/t2163.scala
+++ b/test/files/jvm/t2163/t2163.scala
@@ -1,5 +1,10 @@
+
+import scala.language.{ higherKinds }
+
class T2163Scala[CC[X]](x: CC[Int]) {
def bar[DD[X]](meh: DD[Int]): CC[Int] = x
}
-object Test extends App {}
+object Test extends App {
+ new t2163().test()
+}
diff --git a/test/files/jvm/t2359.scala b/test/files/jvm/t2359.scala
index 69c69d7b3b..76b78d44f7 100644
--- a/test/files/jvm/t2359.scala
+++ b/test/files/jvm/t2359.scala
@@ -1,6 +1,8 @@
-import scala.actors.Futures._
+
+@deprecated("Suppress warnings", since="2.11")
object Test {
+ import scala.actors.Futures._
def main(args: Array[String]) {
val x = future {
try {
diff --git a/test/files/jvm/t2530.scala b/test/files/jvm/t2530.scala
index c2925a92d1..b41661e623 100644
--- a/test/files/jvm/t2530.scala
+++ b/test/files/jvm/t2530.scala
@@ -1,6 +1,8 @@
-import scala.actors.{Future, Futures}
+
+@deprecated("Suppress warnings", since="2.11")
object Test {
+ import scala.actors.{Future, Futures}
def main(args:Array[String]) : Unit = {
//scala.actors.Debug.level = 3
@@ -29,7 +31,6 @@ object Test {
}
println("Test done with no deadlock. Try again, it will not occur...")
}
-}
case class Matrix(numRows: Int, numCols: Int, values: Array[Double]) {
@@ -94,3 +95,4 @@ case class Matrix(numRows: Int, numCols: Int, values: Array[Double]) {
}
}
+}
diff --git a/test/files/jvm/t3102.scala b/test/files/jvm/t3102.scala
index fbcf2e60e6..d0e0704859 100644
--- a/test/files/jvm/t3102.scala
+++ b/test/files/jvm/t3102.scala
@@ -1,7 +1,10 @@
-import scala.actors.{Actor, TIMEOUT}
-import Actor._
+
+@deprecated("Suppress warnings", since="2.11")
object Test {
+ import scala.actors.{Actor, TIMEOUT}
+ import Actor._
+
def main(args: Array[String]) {
val a = actor {
try {
diff --git a/test/files/jvm/t3356.scala b/test/files/jvm/t3356.scala
index a9e83fe503..53bfd737cd 100644
--- a/test/files/jvm/t3356.scala
+++ b/test/files/jvm/t3356.scala
@@ -1,3 +1,7 @@
+
+
+@deprecated("Suppress warnings", since="2.11")
+object Test {
import scala.actors.{Actor, Exit, !, UncaughtException}
import Actor._
@@ -10,7 +14,6 @@ case class ImageInfo(text: String) {
case class ImageData(text: String)
case class Download(info: ImageInfo)
-object Test {
def scanForImageInfo(url: String): List[ImageInfo] =
List(ImageInfo("A"), ImageInfo("B"))
diff --git a/test/files/jvm/t3365.scala b/test/files/jvm/t3365.scala
index b94e804e63..8321428093 100644
--- a/test/files/jvm/t3365.scala
+++ b/test/files/jvm/t3365.scala
@@ -1,3 +1,7 @@
+
+
+@deprecated("Suppress warnings", since="2.11")
+object Test {
import scala.actors.{ReplyReactor, Channel, Actor, Future}
case class ChannelMsg(chan: Channel[Any])
@@ -27,7 +31,6 @@ class MyActor extends Actor {
}
}
-object Test {
def main(args: Array[String]) {
val a = new MyActor
a.start()
diff --git a/test/files/jvm/t3407.scala b/test/files/jvm/t3407.scala
index 6c2ce85c71..757fa3a438 100644
--- a/test/files/jvm/t3407.scala
+++ b/test/files/jvm/t3407.scala
@@ -1,6 +1,8 @@
-import scala.actors._, scala.actors.Actor._
+
+@deprecated("Suppress warnings", since="2.11")
object Test {
+ import scala.actors._, scala.actors.Actor._
def main(args: Array[String]) {
for (i <- 1 to 10) {
diff --git a/test/files/jvm/t3412-channel.scala b/test/files/jvm/t3412-channel.scala
index fcc439b488..af319d2303 100644
--- a/test/files/jvm/t3412-channel.scala
+++ b/test/files/jvm/t3412-channel.scala
@@ -1,6 +1,8 @@
-import scala.actors._, scala.actors.Actor._, scala.actors.Futures._
+
+@deprecated("Suppress warnings", since="2.11")
object Test {
+ import scala.actors._, scala.actors.Actor._, scala.actors.Futures._
def main(args: Array[String]) {
diff --git a/test/files/jvm/t3412.scala b/test/files/jvm/t3412.scala
index ced15ab5dc..fde6c04cb7 100644
--- a/test/files/jvm/t3412.scala
+++ b/test/files/jvm/t3412.scala
@@ -1,6 +1,8 @@
-import scala.actors._, scala.actors.Actor._, scala.actors.Futures._
+
+@deprecated("Suppress warnings", since="2.11")
object Test {
+ import scala.actors._, scala.actors.Actor._, scala.actors.Futures._
def main(args: Array[String]) {
diff --git a/test/files/jvm/t3470.scala b/test/files/jvm/t3470.scala
index 5e4242cdd7..bcb1d4f8de 100644
--- a/test/files/jvm/t3470.scala
+++ b/test/files/jvm/t3470.scala
@@ -1,6 +1,8 @@
-import scala.actors._
+
+@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
diff --git a/test/files/jvm/t3838.scala b/test/files/jvm/t3838.scala
index ba8f15fc31..a1a71d1049 100644
--- a/test/files/jvm/t3838.scala
+++ b/test/files/jvm/t3838.scala
@@ -1,6 +1,8 @@
-import scala.actors.Actor._
+
+@deprecated("Suppress warnings", since="2.11")
object Test {
+ import scala.actors.Actor._
def main(args: Array[String]) {
actor {
try {
diff --git a/test/files/jvm/t560bis.scala b/test/files/jvm/t560bis.scala
index b04303c8a0..21eb8dde28 100644
--- a/test/files/jvm/t560bis.scala
+++ b/test/files/jvm/t560bis.scala
@@ -6,7 +6,7 @@ import scala.xml._;
case _ => Console.println("bah")
}
def foo(args: List[String]) =
- Elem(null,"bla",Null, TopScope, (args map {x => Text(x)}):_*) match {
+ Elem(null,"bla",Null, TopScope, minimizeEmpty = true, (args map {x => Text(x)}):_*) match {
case Elem(_,_,_,_,Text("1"),_*) =>
Console.println("cool!")
case _ =>
diff --git a/test/files/jvm/t6941/Analyzed_1.flags b/test/files/jvm/t6941/Analyzed_1.flags
new file mode 100644
index 0000000000..ad51758c39
--- /dev/null
+++ b/test/files/jvm/t6941/Analyzed_1.flags
@@ -0,0 +1 @@
+-nowarn
diff --git a/test/files/jvm/t7006.check b/test/files/jvm/t7006.check
new file mode 100644
index 0000000000..7c99eba30c
--- /dev/null
+++ b/test/files/jvm/t7006.check
@@ -0,0 +1,28 @@
+[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 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/t7146.scala b/test/files/jvm/t7146.scala
index 2bd03d6d02..aaa3dc7ca4 100644
--- a/test/files/jvm/t7146.scala
+++ b/test/files/jvm/t7146.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ reflectiveCalls }
import java.util.concurrent.Executor
import scala.concurrent._
import scala.util.control.NoStackTrace
diff --git a/test/files/jvm/try-type-tests.scala b/test/files/jvm/try-type-tests.scala
index 17811f64c5..e5e53ee737 100644
--- a/test/files/jvm/try-type-tests.scala
+++ b/test/files/jvm/try-type-tests.scala
@@ -49,6 +49,7 @@ trait TryStandard {
n match {
case Success(v) => assert(false)
case Failure(e: NoSuchElementException) => assert(true)
+ case _ => assert(false)
}
}
@@ -141,4 +142,4 @@ object Test
extends App
with TryStandard {
System.exit(0)
-} \ No newline at end of file
+}
diff --git a/test/files/jvm/unreachable/Foo_1.scala b/test/files/jvm/unreachable/Foo_1.scala
index d17421c516..c223718097 100644
--- a/test/files/jvm/unreachable/Foo_1.scala
+++ b/test/files/jvm/unreachable/Foo_1.scala
@@ -1,3 +1,5 @@
+import scala.sys.error
+
class Foo_1 {
def unreachableNormalExit: Int = {
return 42
@@ -107,4 +109,4 @@ class Foo_1 {
}
2
}
-} \ No newline at end of file
+}
diff --git a/test/files/jvm/xml01.scala b/test/files/jvm/xml01.scala
index 75777a5b94..2b456f5ff5 100644
--- a/test/files/jvm/xml01.scala
+++ b/test/files/jvm/xml01.scala
@@ -4,6 +4,8 @@ import org.xml.sax.InputSource
import scala.xml._
object Test extends App {
+ def Elem(prefix: String, label: String, attributes: MetaData, scope: NamespaceBinding, child: Node*): Elem =
+ scala.xml.Elem.apply(prefix, label, attributes, scope, minimizeEmpty = true, child: _*)
val e: scala.xml.MetaData = Null //Node.NoAttributes
val sc: scala.xml.NamespaceBinding = TopScope
diff --git a/test/files/jvm/xml03syntax.check b/test/files/jvm/xml03syntax.check
index edcdbdd2ba..599cbad686 100755
--- a/test/files/jvm/xml03syntax.check
+++ b/test/files/jvm/xml03syntax.check
@@ -24,3 +24,4 @@ true
node=<elem key="<b>hello</b>"/>, key=Some(<b>hello</b>)
node=<elem/>, key=None
+<a>Å </a>
diff --git a/test/files/jvm/xml03syntax.scala b/test/files/jvm/xml03syntax.scala
index 2c93f7c176..41663681c7 100644
--- a/test/files/jvm/xml03syntax.scala
+++ b/test/files/jvm/xml03syntax.scala
@@ -91,7 +91,7 @@ object Test {
}
val parsed = parser.element(TopScope) // parse the source as element
// alternatively, we could call document()
- parsed
+ println(parsed)
}
}
diff --git a/test/files/neg/raw-types-stubs.check b/test/files/neg/raw-types-stubs.check
new file mode 100644
index 0000000000..f1b26a23b7
--- /dev/null
+++ b/test/files/neg/raw-types-stubs.check
@@ -0,0 +1,11 @@
+S_3.scala:1: error: class Sub needs to be abstract, since:
+it has 2 unimplemented members.
+/** As seen from class Sub, the missing signatures are as follows.
+ * For convenience, these are usable as stub implementations.
+ */
+ def raw(x$1: M_1[_ <: String]): Unit = ???
+ def raw(x$1: Any): Unit = ???
+
+class Sub extends Raw_2 { }
+ ^
+one error found
diff --git a/test/files/neg/raw-types-stubs/M_1.java b/test/files/neg/raw-types-stubs/M_1.java
new file mode 100644
index 0000000000..6ea0d2e593
--- /dev/null
+++ b/test/files/neg/raw-types-stubs/M_1.java
@@ -0,0 +1,3 @@
+public class M_1<K extends String> { }
+
+
diff --git a/test/files/neg/raw-types-stubs/Raw_2.java b/test/files/neg/raw-types-stubs/Raw_2.java
new file mode 100644
index 0000000000..eff7df790e
--- /dev/null
+++ b/test/files/neg/raw-types-stubs/Raw_2.java
@@ -0,0 +1,4 @@
+public abstract class Raw_2 {
+ public abstract void raw(Object list);
+ public abstract void raw(M_1 list);
+}
diff --git a/test/files/neg/raw-types-stubs/S_3.scala b/test/files/neg/raw-types-stubs/S_3.scala
new file mode 100644
index 0000000000..618eedc888
--- /dev/null
+++ b/test/files/neg/raw-types-stubs/S_3.scala
@@ -0,0 +1 @@
+class Sub extends Raw_2 { }
diff --git a/test/files/neg/t4584.check b/test/files/neg/t4584.check
index 419f5704b1..97d07afa0e 100644
--- a/test/files/neg/t4584.check
+++ b/test/files/neg/t4584.check
@@ -1,7 +1,7 @@
t4584.scala:1: error: error in unicode escape
-class A { val /u2
+class A { val \u2
^
-t4584.scala:1: error: illegal character '/uffff'
-class A { val /u2
+t4584.scala:1: error: illegal character '\uffff'
+class A { val \u2
^
two errors found
diff --git a/test/files/neg/unicode-unterminated-quote.check b/test/files/neg/unicode-unterminated-quote.check
index 5085505fb4..166488710b 100644
--- a/test/files/neg/unicode-unterminated-quote.check
+++ b/test/files/neg/unicode-unterminated-quote.check
@@ -1,7 +1,7 @@
unicode-unterminated-quote.scala:2: error: unclosed string literal
- val x = /u0022
+ val x = \u0022
^
unicode-unterminated-quote.scala:2: error: '}' expected but eof found.
- val x = /u0022
+ val x = \u0022
^
two errors found
diff --git a/test/files/pos/t3688-redux.scala b/test/files/pos/t3688-redux.scala
deleted file mode 100644
index e601cf240c..0000000000
--- a/test/files/pos/t3688-redux.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-import collection.JavaConverters._
-import java.{ util => ju }
-import scala.collection.{ mutable, immutable }
-
-object Test {
- def m[P <% AsJava[ju.List[Int]]](l: P) = 1
- m(List(1))
-} \ No newline at end of file
diff --git a/test/files/presentation/doc/doc.scala b/test/files/presentation/doc/doc.scala
index a64a423cc5..c884b6425b 100755
--- a/test/files/presentation/doc/doc.scala
+++ b/test/files/presentation/doc/doc.scala
@@ -1,9 +1,9 @@
+import scala.reflect.internal.util.{ BatchSourceFile, SourceFile }
import scala.tools.nsc.doc
import scala.tools.nsc.doc.base._
import scala.tools.nsc.doc.base.comment._
import scala.tools.nsc.interactive._
import scala.tools.nsc.interactive.tests._
-import scala.tools.nsc.util._
object Test extends InteractiveTest {
val tags = Seq(
@@ -100,12 +100,11 @@ object Test extends InteractiveTest {
println("Couldn't parse")
case Some(_) =>
val sym = compiler.ask { () =>
- val toplevel = definitions.EmptyPackage.info.decl(newTypeName(name))
+ val toplevel = compiler.rootMirror.EmptyPackage.info.decl(TypeName(name))
if (toplevel eq NoSymbol) {
- val clazz = definitions.EmptyPackage.info.decl(newTypeName(className))
-
- val term = clazz.info.decl(newTermName(name))
- if (term eq NoSymbol) clazz.info.decl(newTypeName(name)) else
+ val clazz = compiler.rootMirror.EmptyPackage.info.decl(TypeName(className))
+ val term = clazz.info.decl(TermName(name))
+ if (term eq NoSymbol) clazz.info.decl(TypeName(name)) else
if (term.isAccessor) term.accessed else term
} else toplevel
}
@@ -133,7 +132,7 @@ object Test extends InteractiveTest {
case c: Comment => existsText(c.body, text)
}
val (derived, base) = compiler.ask { () =>
- val derived = definitions.RootPackage.info.decl(newTermName("p")).info.decl(newTypeName("Derived"))
+ val derived = compiler.rootMirror.RootPackage.info.decl(newTermName("p")).info.decl(newTypeName("Derived"))
(derived, derived.ancestors(0))
}
val cmt1 = getComment(derived, derivedSource, (base, baseSource)::(derived, derivedSource)::Nil)
diff --git a/test/files/presentation/memory-leaks/MemoryLeaksTest.scala b/test/files/presentation/memory-leaks/MemoryLeaksTest.scala
index 950569c880..1ddeb6ac4a 100644
--- a/test/files/presentation/memory-leaks/MemoryLeaksTest.scala
+++ b/test/files/presentation/memory-leaks/MemoryLeaksTest.scala
@@ -2,8 +2,8 @@ import java.io.PrintWriter
import java.io.FileOutputStream
import java.util.Calendar
+import scala.reflect.internal.util.BatchSourceFile
import scala.tools.nsc.interactive.tests._
-import scala.tools.nsc.util._
import scala.tools.nsc.io._
import scala.tools.nsc.doc
diff --git a/test/files/run/Course-2002-01.check b/test/files/run/Course-2002-01.check
index 17b30bf3c2..16b491d6e2 100644
--- a/test/files/run/Course-2002-01.check
+++ b/test/files/run/Course-2002-01.check
@@ -1,3 +1,6 @@
+Course-2002-01.scala:41: warning: method loop in object M0 does nothing other than call itself recursively
+ def loop: Int = loop;
+ ^
232
667
11
diff --git a/test/files/run/Meter.check b/test/files/run/Meter.check
index b7e2eac125..c79c51a294 100644
--- a/test/files/run/Meter.check
+++ b/test/files/run/Meter.check
@@ -1,3 +1,6 @@
+Meter.scala:72: warning: a.Meter and Int are unrelated: they will never compare equal
+ println("x == 1: "+(x == 1))
+ ^
2.0
4.0m
false
diff --git a/test/files/run/MeterCaseClass.check b/test/files/run/MeterCaseClass.check
index 2528753657..2782704f9f 100644
--- a/test/files/run/MeterCaseClass.check
+++ b/test/files/run/MeterCaseClass.check
@@ -1,3 +1,6 @@
+MeterCaseClass.scala:69: warning: comparing values of types a.Meter and Int using `==' will always yield false
+ println("x == 1: "+(x == 1))
+ ^
2.0
Meter(4.0)
false
diff --git a/test/files/run/Predef.readLine.scala b/test/files/run/Predef.readLine.scala
index 9f07936638..54809f8071 100644
--- a/test/files/run/Predef.readLine.scala
+++ b/test/files/run/Predef.readLine.scala
@@ -1,4 +1,5 @@
import java.io.StringReader
+import scala.io.ReadStdin.readLine
object Test extends App {
Console.withIn(new StringReader("")) {
@@ -7,4 +8,4 @@ object Test extends App {
readLine("%s prompt\n", "fancy")
readLine("%s %s prompt\n", "immensely", "fancy")
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/SymbolsTest.scala b/test/files/run/SymbolsTest.scala
index 53caa5e62f..d5948ea168 100644
--- a/test/files/run/SymbolsTest.scala
+++ b/test/files/run/SymbolsTest.scala
@@ -1,6 +1,5 @@
-
-
+import scala.language.reflectiveCalls
class Slazz {
val s1 = 'myFirstSymbol
diff --git a/test/files/run/abstypetags_serialize.scala b/test/files/run/abstypetags_serialize.scala
index 93fb5dcd06..6ec97105fe 100644
--- a/test/files/run/abstypetags_serialize.scala
+++ b/test/files/run/abstypetags_serialize.scala
@@ -1,3 +1,4 @@
+import scala.language.higherKinds
import java.io._
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{universe => ru}
@@ -30,4 +31,4 @@ object Test extends App {
}
qwe
-} \ No newline at end of file
+}
diff --git a/test/files/run/array-existential-bound.scala b/test/files/run/array-existential-bound.scala
index bc442d39f7..b397c98111 100644
--- a/test/files/run/array-existential-bound.scala
+++ b/test/files/run/array-existential-bound.scala
@@ -10,8 +10,8 @@ object Test extends Fooz[Array[Int]] {
def main(args: Array[String]): Unit = {
println(f1.f0(Array[String]("a", "b")))
- println(f2.f0(1 to 1000 toArray))
+ println(f2.f0((1 to 1000).toArray))
println(f3.f0((1 to 1000).toArray[Any]))
- println(f4.f0('a' to 'z' toArray))
+ println(f4.f0(('a' to 'z').toArray))
}
}
diff --git a/test/files/run/arrays.check b/test/files/run/arrays.check
index b1f7fae1d1..c9a3a87268 100644
--- a/test/files/run/arrays.check
+++ b/test/files/run/arrays.check
@@ -1 +1,7 @@
+arrays.scala:248: warning: comparing values of types Unit and Unit using `==' will always yield true
+ check(xs(0) == u0, xs(0), u0);
+ ^
+arrays.scala:249: warning: comparing values of types Unit and Unit using `==' will always yield true
+ check(xs(1) == u1, xs(1), u1);
+ ^
checks: 2302
diff --git a/test/files/run/bitsets.scala b/test/files/run/bitsets.scala
index 3bfb8c7ac3..5d49220749 100644
--- a/test/files/run/bitsets.scala
+++ b/test/files/run/bitsets.scala
@@ -4,6 +4,8 @@
//############################################################################
+import scala.language.postfixOps
+
object TestMutable {
import scala.collection.mutable.BitSet
diff --git a/test/files/run/bridges.scala b/test/files/run/bridges.scala
index fda86eabc6..eb036bd781 100644
--- a/test/files/run/bridges.scala
+++ b/test/files/run/bridges.scala
@@ -3588,7 +3588,7 @@ object Test {
errors = errors + 1;
}
} catch {
- case exception => {
+ case exception: Throwable => {
Console.print(name + " raised exception " + exception);
Console.println;
errors = errors + 1;
diff --git a/test/files/run/bugs.scala b/test/files/run/bugs.scala
index ca598603bb..9d2be42fb7 100644
--- a/test/files/run/bugs.scala
+++ b/test/files/run/bugs.scala
@@ -444,7 +444,7 @@ object Test {
try {
test;
} catch {
- case exception =>
+ case exception: Throwable =>
Console.print("Exception in thread \"" + Thread.currentThread + "\" " + exception);
Console.println;
errors += 1
diff --git a/test/files/run/classmanifests_new_alias.scala b/test/files/run/classmanifests_new_alias.scala
index 12bd93bab6..777bd5dd6d 100644
--- a/test/files/run/classmanifests_new_alias.scala
+++ b/test/files/run/classmanifests_new_alias.scala
@@ -1,5 +1,7 @@
+
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
type CM[T] = ClassManifest[T]
println(implicitly[CM[Int]])
println(implicitly[CM[Int]] eq Manifest.Int)
-} \ No newline at end of file
+}
diff --git a/test/files/run/classmanifests_new_core.scala b/test/files/run/classmanifests_new_core.scala
index 63dbfab25c..0a9c58e8e1 100644
--- a/test/files/run/classmanifests_new_core.scala
+++ b/test/files/run/classmanifests_new_core.scala
@@ -1,4 +1,5 @@
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
println(classManifest[Int])
println(classManifest[Int] eq Manifest.Int)
-} \ No newline at end of file
+}
diff --git a/test/files/run/collections.scala b/test/files/run/collections.scala
index 69c40fae80..1e4e8791ac 100644
--- a/test/files/run/collections.scala
+++ b/test/files/run/collections.scala
@@ -1,5 +1,6 @@
-import collection._
+import scala.collection._
import scala.compat.Platform.currentTime
+import scala.language.postfixOps
object Test extends App {
diff --git a/test/files/run/colltest1.scala b/test/files/run/colltest1.scala
index 54adeb7cda..9d77fc413a 100644
--- a/test/files/run/colltest1.scala
+++ b/test/files/run/colltest1.scala
@@ -1,4 +1,8 @@
-import collection._
+/*
+ * filter: inliner warning\(s\); re-run with -Yinline-warnings for details
+ */
+import scala.collection._
+import scala.language.postfixOps
object Test extends App {
diff --git a/test/files/run/comparable-comparator.scala b/test/files/run/comparable-comparator.scala
index ac943c63bb..1707fb6e61 100644
--- a/test/files/run/comparable-comparator.scala
+++ b/test/files/run/comparable-comparator.scala
@@ -15,7 +15,8 @@ object Test {
def compare(p1: C2, p2: C2) = p2.s compareTo p1.s
}
- val strs = "zip foo bar baz aggle bing bong" split ' ' toList
+ val words = "zip foo bar baz aggle bing bong" split ' '
+ val strs = words.toList
val c1s = strs map (x => new C1(x))
val c2s = strs map (x => new C2(x))
diff --git a/test/files/run/compiler-asSeenFrom.scala b/test/files/run/compiler-asSeenFrom.scala
index 0d4b504d3c..bd3db0bf66 100644
--- a/test/files/run/compiler-asSeenFrom.scala
+++ b/test/files/run/compiler-asSeenFrom.scala
@@ -1,6 +1,10 @@
+/*
+ * filter: inliner warning\(s\); re-run with -Yinline-warnings for details
+ */
import scala.tools.nsc._
import scala.tools.partest.CompilerTest
import scala.collection.{ mutable, immutable, generic }
+import scala.language.postfixOps
/** It's too messy but it's better than not having it.
*/
@@ -117,6 +121,5 @@ package ll {
println(sigs.mkString(x + " { // after " + ph + "\n ", "\n ", "\n}\n"))
}
}
- true
}
}
diff --git a/test/files/run/concurrent-stream.scala b/test/files/run/concurrent-stream.scala
index 42c695964e..9d5ba0428e 100644
--- a/test/files/run/concurrent-stream.scala
+++ b/test/files/run/concurrent-stream.scala
@@ -1,32 +1,33 @@
// 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
+ 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
}
- next
-}
-def testCons(cons: (Int, => Stream[Int]) => Stream[Int]): Unit = {
- import scala.actors.Actor._
+ 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] => list }
- val eval1 = receive { case list: List[Int] => list }
- println("Evaluation 0: " + eval0)
- println("Evaluation 1: " + eval1)
-}
+ 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.")
diff --git a/test/files/run/contrib674.check b/test/files/run/contrib674.check
new file mode 100644
index 0000000000..78325c1810
--- /dev/null
+++ b/test/files/run/contrib674.check
@@ -0,0 +1,3 @@
+contrib674.scala:15: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 1
+ ^
diff --git a/test/files/run/contrib674.scala b/test/files/run/contrib674.scala
index f6b46d13c6..45c9871fc4 100644
--- a/test/files/run/contrib674.scala
+++ b/test/files/run/contrib674.scala
@@ -5,11 +5,11 @@ object Test extends App {
try {
1
} catch {
- case e =>
+ case e: Throwable =>
} finally {
try {
} catch {
- case e =>
+ case e: Throwable =>
}
}
1
diff --git a/test/files/run/ctries-new/main.scala b/test/files/run/ctries-new/main.scala
index d7fe087e4d..34f3ec2ccf 100644
--- a/test/files/run/ctries-new/main.scala
+++ b/test/files/run/ctries-new/main.scala
@@ -21,6 +21,9 @@ object Test {
trait Spec {
+ implicit def implicitously = scala.language.implicitConversions
+ implicit def reflectively = scala.language.reflectiveCalls
+
implicit def str2ops(s: String) = new {
def in[U](body: =>U) {
// just execute body
@@ -37,11 +40,11 @@ trait Spec {
var produced = false
try body
catch {
- case e => if (e.getClass == implicitly[ClassTag[T]].runtimeClass) produced = true
+ case e: Throwable => if (e.getClass == implicitly[ClassTag[T]].runtimeClass) produced = true
} finally {
assert(produced, "Did not produce exception of type: " + implicitly[ClassTag[T]])
}
}
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/ctries-old/concmap.scala b/test/files/run/ctries-old/concmap.scala
index 3ec0256afb..fccd4bed3e 100644
--- a/test/files/run/ctries-old/concmap.scala
+++ b/test/files/run/ctries-old/concmap.scala
@@ -2,6 +2,7 @@
import collection.concurrent.TrieMap
+import Test.Spec
object ConcurrentMapSpec extends Spec {
diff --git a/test/files/run/ctries-old/iterator.scala b/test/files/run/ctries-old/iterator.scala
index b953a40e00..585bdc0e48 100644
--- a/test/files/run/ctries-old/iterator.scala
+++ b/test/files/run/ctries-old/iterator.scala
@@ -5,6 +5,7 @@
import collection._
import collection.concurrent.TrieMap
+import Test.Spec
object IteratorSpec extends Spec {
diff --git a/test/files/run/ctries-old/lnode.scala b/test/files/run/ctries-old/lnode.scala
index 92a31088e5..3ff5414ac0 100644
--- a/test/files/run/ctries-old/lnode.scala
+++ b/test/files/run/ctries-old/lnode.scala
@@ -3,6 +3,7 @@
import collection.concurrent.TrieMap
+import Test.Spec
object LNodeSpec extends Spec {
diff --git a/test/files/run/ctries-old/main.scala b/test/files/run/ctries-old/main.scala
index 78ba7f0db1..f714bcdcdc 100644
--- a/test/files/run/ctries-old/main.scala
+++ b/test/files/run/ctries-old/main.scala
@@ -5,6 +5,7 @@
+@deprecated("Suppress warnings", since="2.11")
object Test {
def main(args: Array[String]) {
@@ -14,11 +15,13 @@ object Test {
SnapshotSpec.test()
}
-}
trait Spec {
+ implicit def implicitously = scala.language.implicitConversions
+ implicit def reflectively = scala.language.reflectiveCalls
+
implicit def str2ops(s: String) = new {
def in[U](body: =>U) {
// just execute body
@@ -35,7 +38,7 @@ trait Spec {
var produced = false
try body
catch {
- case e => if (e.getClass == implicitly[ClassManifest[T]].erasure) produced = true
+ case e: Throwable => if (e.getClass == implicitly[ClassManifest[T]].erasure) produced = true
} finally {
assert(produced, "Did not produce exception of type: " + implicitly[ClassManifest[T]])
}
@@ -43,3 +46,4 @@ trait Spec {
}
}
+}
diff --git a/test/files/run/ctries-old/snapshot.scala b/test/files/run/ctries-old/snapshot.scala
index 5fe77d445b..768b588f81 100644
--- a/test/files/run/ctries-old/snapshot.scala
+++ b/test/files/run/ctries-old/snapshot.scala
@@ -5,6 +5,7 @@
import collection._
import collection.concurrent.TrieMap
+import Test.Spec
object SnapshotSpec extends Spec {
diff --git a/test/files/run/delay-bad.check b/test/files/run/delay-bad.check
index 9d9c828a03..2ae88267c5 100644
--- a/test/files/run/delay-bad.check
+++ b/test/files/run/delay-bad.check
@@ -1,3 +1,9 @@
+delay-bad.scala:53: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ f(new C { 5 })
+ ^
+delay-bad.scala:73: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ f(new { val x = 5 } with E() { 5 })
+ ^
// new C { }
diff --git a/test/files/run/delay-good.check b/test/files/run/delay-good.check
index 8eb04c7cff..b4f6b04af7 100644
--- a/test/files/run/delay-good.check
+++ b/test/files/run/delay-good.check
@@ -1,3 +1,9 @@
+delay-good.scala:53: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ f(new C { 5 })
+ ^
+delay-good.scala:73: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ f(new { val x = 5 } with E() { 5 })
+ ^
// new C { }
diff --git a/test/files/run/distinct.scala b/test/files/run/distinct.scala
index 09e5a0734a..37bbe7805a 100644
--- a/test/files/run/distinct.scala
+++ b/test/files/run/distinct.scala
@@ -3,7 +3,7 @@
*/
object Test {
val alphabet = 'a' to 'z' mkString ""
- val alphaList = 'a' to 'z' toList
+ val alphaList = ('a' to 'z').toList
def shuffled = util.Random.shuffle(alphaList)
def main(args: Array[String]): Unit = {
diff --git a/test/files/run/enrich-gentraversable.scala b/test/files/run/enrich-gentraversable.scala
index 52eded55fd..0f79a47030 100644
--- a/test/files/run/enrich-gentraversable.scala
+++ b/test/files/run/enrich-gentraversable.scala
@@ -1,3 +1,6 @@
+import scala.language.implicitConversions
+import scala.language.postfixOps
+
object Test extends App {
import scala.collection.{GenTraversableOnce,GenTraversableLike}
import scala.collection.generic._
diff --git a/test/files/run/eta-expand-star2.check b/test/files/run/eta-expand-star2.check
index ce01362503..cbf4781255 100644
--- a/test/files/run/eta-expand-star2.check
+++ b/test/files/run/eta-expand-star2.check
@@ -1 +1,2 @@
+warning: there were 1 deprecation warning(s); re-run with -deprecation for details
hello
diff --git a/test/files/run/exceptions-2.check b/test/files/run/exceptions-2.check
index 9a3044cd4f..4f8244800a 100644
--- a/test/files/run/exceptions-2.check
+++ b/test/files/run/exceptions-2.check
@@ -1,3 +1,6 @@
+exceptions-2.scala:267: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ try { 1 } catch { case e: java.io.IOException => () }
+ ^
nested1:
Innermost finally
Outermost finally
diff --git a/test/files/run/exceptions-2.scala b/test/files/run/exceptions-2.scala
index f5bbcca210..8d755c3809 100644
--- a/test/files/run/exceptions-2.scala
+++ b/test/files/run/exceptions-2.scala
@@ -42,7 +42,7 @@ object NoExcep {
def method4 = try {
Console.println("..");
} catch {
- case _ => sys.error("..");
+ case _: Throwable => sys.error("..");
}
}
@@ -136,7 +136,7 @@ object Test {
try {
sys.error("a");
} catch {
- case _ => Console.println("Silently ignore exception in finally");
+ case _: Throwable => Console.println("Silently ignore exception in finally");
}
}
}
@@ -146,7 +146,7 @@ object Test {
} finally {
val fin = "Abc";
Console.println(fin);
- };
+ }
def tryAndValInFinally: Unit =
try {
@@ -154,8 +154,8 @@ object Test {
val fin = "Abc";
try {
Console.println(fin);
- } catch { case _ => () }
- };
+ } catch { case _: Throwable => () }
+ }
def returnInBody: Unit = try {
try {
@@ -249,7 +249,7 @@ object Test {
def execute(f: => Unit) = try {
f;
} catch {
- case _ => ();
+ case _: Throwable => ()
}
diff --git a/test/files/run/exceptions-nest.scala b/test/files/run/exceptions-nest.scala
index 841e6b1c67..432d600d13 100644
--- a/test/files/run/exceptions-nest.scala
+++ b/test/files/run/exceptions-nest.scala
@@ -5,9 +5,9 @@ object Test extends App {
println(test3)
println(test4)
println(test5)
- try { println(test6) } catch { case _ => println("OK") }
+ try { println(test6) } catch { case _: Throwable => println("OK") }
println(test7)
- try { println(test8) } catch { case _ => println("OK") }
+ try { println(test8) } catch { case _: Throwable => println("OK") }
println(test9)
println(test10)
println(test11)
@@ -19,7 +19,7 @@ object Test extends App {
x = 2
} catch {
case _: NullPointerException => x = 3
- case _ => x = 4
+ case _: Throwable => x = 4
}
x
}
@@ -31,12 +31,12 @@ object Test extends App {
try {
x = 21
} catch {
- case _ => x = 22
+ case _: Throwable => x = 22
}
x = 23
} catch {
case _: NullPointerException => x = 3
- case _ => x = 4
+ case _: Throwable => x = 4
}
x
}
@@ -44,10 +44,10 @@ object Test extends App {
def test3 = {
var x = 1
try {
- try{x = 2} catch { case _ => x = 4 }
+ try{x = 2} catch { case _: Throwable => x = 4 }
} catch {
case _: NullPointerException => x = 3
- case _ => x = 4
+ case _: Throwable => x = 4
}
x
}
@@ -58,7 +58,7 @@ object Test extends App {
x = 2
} catch {
case _: NullPointerException => x = 3
- case _ => x = 4
+ case _: Throwable => x = 4
}
try {
x = 5
@@ -73,8 +73,8 @@ object Test extends App {
try {
x = 2
} catch {
- case _: NullPointerException => try { x = 3 } catch { case f => throw f }
- case _ => x = 4; try { x = 41 } catch { case _: Exception => x = 42 }; x = 43
+ case _: NullPointerException => try { x = 3 } catch { case f: Throwable => throw f }
+ case _: Throwable => x = 4; try { x = 41 } catch { case _: Exception => x = 42 }; x = 43
}
x
}
@@ -87,7 +87,7 @@ object Test extends App {
} catch {
case e: NullPointerException =>
throw e
- case _ =>
+ case _: Throwable =>
x = 3
return 1000
} finally {
@@ -105,7 +105,7 @@ object Test extends App {
try {
x = 4
} catch {
- case _ => x = 5
+ case _: Throwable => x = 5
}
}
x
@@ -116,7 +116,7 @@ object Test extends App {
try {
throw new NullPointerException
} catch {
- case e => throw e
+ case e: Throwable => throw e
}
x
}
@@ -124,7 +124,7 @@ object Test extends App {
def test9 = {
try { "" match {
case s: String => 10
- }} catch { case _ => 20 }
+ }} catch { case _: Throwable => 20 }
}
var x10 = 1
@@ -135,7 +135,7 @@ object Test extends App {
def test11 {
try { () }
- catch { case e => () }
+ catch { case e: Throwable => () }
}
class E1 extends Exception
diff --git a/test/files/run/exceptions.scala b/test/files/run/exceptions.scala
index 90f681e3c5..f0fe76946b 100644
--- a/test/files/run/exceptions.scala
+++ b/test/files/run/exceptions.scala
@@ -32,7 +32,7 @@ object exceptions {
val value = try {
map.lookup(key)
} catch {
- case e => e.getMessage()
+ case e: Throwable => e.getMessage()
}
check("lookup(" + key + ")", value, "KO");
}
diff --git a/test/files/run/existentials-in-compiler.scala b/test/files/run/existentials-in-compiler.scala
index 14c25849cb..f5a0aa98d0 100644
--- a/test/files/run/existentials-in-compiler.scala
+++ b/test/files/run/existentials-in-compiler.scala
@@ -1,3 +1,6 @@
+/*
+ * filter: inliner warning\(s\); re-run with -Yinline-warnings for details
+ */
import scala.tools.nsc._
import scala.tools.partest.CompilerTest
import scala.collection.{ mutable, immutable, generic }
@@ -71,14 +74,13 @@ package extest {
}
"""
- def check(source: String, unit: global.CompilationUnit) = {
- getRequiredPackage("extest").moduleClass.info.decls.toList.filter(_.isType).map(_.initialize).sortBy(_.name.toString) foreach { clazz =>
+ override def check(source: String, unit: global.CompilationUnit) {
+ getPackage("extest").moduleClass.info.decls.toList.filter(_.isType).map(_.initialize).sortBy(_.name.toString) foreach { clazz =>
exitingTyper {
clazz.info
println(clazz.defString)
println(" " + classExistentialType(clazz) + "\n")
}
}
- true
}
}
diff --git a/test/files/run/existentials.scala b/test/files/run/existentials.scala
index 3977d47417..65acfd2ac0 100644
--- a/test/files/run/existentials.scala
+++ b/test/files/run/existentials.scala
@@ -1,3 +1,6 @@
+import scala.language.existentials
+import scala.language.reflectiveCalls
+
class Foo {
class Line {
case class Cell[T](var x: T)
diff --git a/test/files/run/existentials3-new.scala b/test/files/run/existentials3-new.scala
index 110c8eff7a..6112a7b856 100644
--- a/test/files/run/existentials3-new.scala
+++ b/test/files/run/existentials3-new.scala
@@ -1,3 +1,4 @@
+import scala.language.existentials
import scala.reflect.runtime.universe._
object Test {
@@ -77,4 +78,4 @@ object Misc {
}
def g1 = o1.f1 _
def g2 = o1.f2 _
-} \ No newline at end of file
+}
diff --git a/test/files/run/existentials3-old.scala b/test/files/run/existentials3-old.scala
index 944160ff12..c021c0e71e 100644
--- a/test/files/run/existentials3-old.scala
+++ b/test/files/run/existentials3-old.scala
@@ -1,3 +1,5 @@
+import scala.language.existentials
+
object Test {
trait ToS { final override def toString = getClass.getName }
diff --git a/test/files/run/finally.scala b/test/files/run/finally.scala
index 635123cc4d..01180fd217 100644
--- a/test/files/run/finally.scala
+++ b/test/files/run/finally.scala
@@ -7,7 +7,7 @@ object Test extends App {
try {
bar
} catch {
- case e => println(e)
+ case e: Throwable => println(e)
}
}
@@ -17,7 +17,7 @@ object Test extends App {
println("hi")
}
catch {
- case e => println("SHOULD NOT GET HERE")
+ case e: Throwable => println("SHOULD NOT GET HERE")
}
finally {
println("In Finally")
@@ -30,7 +30,7 @@ object Test extends App {
try {
throw new Exception
} catch {
- case e =>
+ case e: Throwable =>
println(e);
return
} finally println("in finally")
@@ -41,7 +41,7 @@ object Test extends App {
try {
throw new Exception
} catch {
- case e =>
+ case e: Throwable =>
println(e);
throw e
} finally println("in finally")
@@ -52,7 +52,7 @@ object Test extends App {
try {
return
} catch {
- case e =>
+ case e: Throwable =>
println(e);
throw e
} finally println("in finally")
@@ -63,7 +63,7 @@ object Test extends App {
try {
throw new Exception
} catch {
- case e =>
+ case e: Throwable =>
println(e);
} finally println("in finally")
}
@@ -89,7 +89,7 @@ object Test extends App {
throw new Exception
}
} catch {
- case e => println(e)
+ case e: Throwable => println(e)
}
}
@@ -99,7 +99,7 @@ object Test extends App {
try {
return 10
} finally {
- try { () } catch { case _ => () }
+ try { () } catch { case _: Throwable => () }
println("in finally 1")
}
} finally {
@@ -111,7 +111,7 @@ object Test extends App {
try {
m
} catch {
- case e => println("COUGHT: " + e)
+ case e: Throwable => println("COUGHT: " + e)
}
println("-" * 40)
}
diff --git a/test/files/run/genericValueClass.scala b/test/files/run/genericValueClass.scala
index 768e1f86a5..9398390a80 100644
--- a/test/files/run/genericValueClass.scala
+++ b/test/files/run/genericValueClass.scala
@@ -1,4 +1,6 @@
+import scala.language.implicitConversions
+
object Test extends App {
class ArrowAssocClass[A](val __leftOfArrow: A) extends AnyVal {
@inline def -> [B](y: B): Tuple2[A, B] = Tuple2(__leftOfArrow, y)
diff --git a/test/files/run/getClassTest-old.scala b/test/files/run/getClassTest-old.scala
index 951cc8d931..789dd4d162 100644
--- a/test/files/run/getClassTest-old.scala
+++ b/test/files/run/getClassTest-old.scala
@@ -50,6 +50,7 @@ class MoreAnyRefs {
def f4 = (new A { def bippy() = 5 }).getClass()
}
+@deprecated("Suppress warnings", since="2.11")
object Test {
def returnTypes[T: Manifest] = (
manifest[T].erasure.getMethods.toList
diff --git a/test/files/run/global-showdef.scala b/test/files/run/global-showdef.scala
index 71ba7b8bb3..2a00ee51bd 100644
--- a/test/files/run/global-showdef.scala
+++ b/test/files/run/global-showdef.scala
@@ -1,6 +1,7 @@
import scala.tools.nsc._
-import io.{ AbstractFile }
-import util.{ SourceFile, BatchSourceFile, stringFromStream }
+import scala.reflect.io.AbstractFile
+import scala.tools.nsc.util.stringFromStream
+import scala.reflect.internal.util.{ SourceFile, BatchSourceFile }
import scala.tools.nsc.reporters.ConsoleReporter
object Test {
@@ -53,7 +54,7 @@ object Bippy {
val run = new compiler.Run()
run.compileSources(List(src))
}
- output split "\\n" toList
+ (output split "\\n").toList
}
def showClass(name: String) = lines("-Yshow:typer", "-Xshow-class", name)
def showObject(name: String) = lines("-Yshow:typer", "-Xshow-object", name)
diff --git a/test/files/run/impconvtimes.scala b/test/files/run/impconvtimes.scala
index 8c5ab61779..477a16a890 100644
--- a/test/files/run/impconvtimes.scala
+++ b/test/files/run/impconvtimes.scala
@@ -1,3 +1,5 @@
+import scala.language.implicitConversions
+
object Test {
abstract class Unit
object NoUnit extends Unit
diff --git a/test/files/run/implicits.scala b/test/files/run/implicits.scala
index a30f60f6d0..5681a9d484 100644
--- a/test/files/run/implicits.scala
+++ b/test/files/run/implicits.scala
@@ -1,3 +1,5 @@
+import scala.language.implicitConversions
+
object A {
object B {
implicit def int2string(x: Int) = "["+x.toString+"]"
diff --git a/test/files/run/indexedSeq.scala b/test/files/run/indexedSeq.scala
index 9744f47f63..29a8be701d 100644
--- a/test/files/run/indexedSeq.scala
+++ b/test/files/run/indexedSeq.scala
@@ -1,10 +1,11 @@
object Test {
- import scala.collection.{ mutable, immutable, generic }
+ import scala.collection.immutable
def checkIdentity[A](xs: immutable.IndexedSeq[A]) = assert(xs.toIndexedSeq eq xs)
def main(args: Array[String]): Unit = {
- checkIdentity(immutable.Vector(1 to 10: _*))
- checkIdentity(1 to 10 toIndexedSeq)
+ def r = 1 to 10
+ checkIdentity(immutable.Vector(r: _*))
+ checkIdentity(r.toIndexedSeq)
}
}
diff --git a/test/files/run/inner-obj-auto.scala b/test/files/run/inner-obj-auto.scala
index aa2e29326f..35ca56ba3e 100644
--- a/test/files/run/inner-obj-auto.scala
+++ b/test/files/run/inner-obj-auto.scala
@@ -25,7 +25,7 @@ class Class2_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -54,7 +54,7 @@ object Object3_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -83,7 +83,7 @@ trait Trait4_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -112,7 +112,7 @@ class Class6_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -141,7 +141,7 @@ object Object7_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -170,7 +170,7 @@ trait Trait8_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -199,7 +199,7 @@ class Class10_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -228,7 +228,7 @@ object Object11_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -257,7 +257,7 @@ trait Trait12_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -286,7 +286,7 @@ class Class14_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -315,7 +315,7 @@ object Object15_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -344,7 +344,7 @@ trait Trait16_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -373,7 +373,7 @@ class Class18_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -402,7 +402,7 @@ object Object19_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -431,7 +431,7 @@ trait Trait20_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -460,7 +460,7 @@ class Class22_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -489,7 +489,7 @@ object Object23_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -518,7 +518,7 @@ trait Trait24_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -548,7 +548,7 @@ class Class26_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -579,7 +579,7 @@ object Object27_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -610,7 +610,7 @@ trait Trait28_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -641,7 +641,7 @@ class Class30_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -672,7 +672,7 @@ object Object31_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -703,7 +703,7 @@ trait Trait32_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -733,7 +733,7 @@ class Class34_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -762,7 +762,7 @@ object Object35_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -791,7 +791,7 @@ trait Trait36_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -820,7 +820,7 @@ class Class38_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -849,7 +849,7 @@ object Object39_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -878,7 +878,7 @@ trait Trait40_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -907,7 +907,7 @@ class Class42_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -936,7 +936,7 @@ object Object43_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -965,7 +965,7 @@ trait Trait44_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -994,7 +994,7 @@ class Class46_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -1023,7 +1023,7 @@ object Object47_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -1052,7 +1052,7 @@ trait Trait48_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -1081,7 +1081,7 @@ class Class50_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -1110,7 +1110,7 @@ object Object51_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -1139,7 +1139,7 @@ trait Trait52_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -1172,7 +1172,7 @@ class Class54_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1205,7 +1205,7 @@ object Object55_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1238,7 +1238,7 @@ trait Trait56_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1271,7 +1271,7 @@ class Class58_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1304,7 +1304,7 @@ object Object59_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1337,7 +1337,7 @@ trait Trait60_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1370,7 +1370,7 @@ class Class62_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1403,7 +1403,7 @@ object Object63_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1436,7 +1436,7 @@ trait Trait64_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1469,7 +1469,7 @@ class Class66_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1502,7 +1502,7 @@ object Object67_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1535,7 +1535,7 @@ trait Trait68_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1568,7 +1568,7 @@ class Class70_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1601,7 +1601,7 @@ object Object71_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1634,7 +1634,7 @@ trait Trait72_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1667,7 +1667,7 @@ class Class74_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1700,7 +1700,7 @@ object Object75_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1733,7 +1733,7 @@ trait Trait76_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1767,7 +1767,7 @@ class Class78_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1802,7 +1802,7 @@ object Object79_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1837,7 +1837,7 @@ trait Trait80_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1872,7 +1872,7 @@ class Class82_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1907,7 +1907,7 @@ object Object83_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1942,7 +1942,7 @@ trait Trait84_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1976,7 +1976,7 @@ class Class90_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -2009,7 +2009,7 @@ trait Trait92_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
diff --git a/test/files/run/interop_classtags_are_classmanifests.scala b/test/files/run/interop_classtags_are_classmanifests.scala
index 91b9d89c6e..62d85c3ce3 100644
--- a/test/files/run/interop_classtags_are_classmanifests.scala
+++ b/test/files/run/interop_classtags_are_classmanifests.scala
@@ -1,5 +1,6 @@
-import scala.reflect.{ClassTag, classTag}
+import scala.reflect.ClassTag
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
def classTagIsClassManifest[T: ClassTag] = {
println(classManifest[T])
@@ -8,4 +9,4 @@ object Test extends App {
classTagIsClassManifest[Int]
classTagIsClassManifest[String]
classTagIsClassManifest[Array[Int]]
-} \ No newline at end of file
+}
diff --git a/test/files/run/interop_manifests_are_classtags.scala b/test/files/run/interop_manifests_are_classtags.scala
index 03479e527a..705038ece7 100644
--- a/test/files/run/interop_manifests_are_classtags.scala
+++ b/test/files/run/interop_manifests_are_classtags.scala
@@ -1,5 +1,6 @@
import scala.reflect.{ClassTag, classTag}
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
def classManifestIsClassTag[T: ClassManifest] = {
println(classTag[T])
@@ -20,4 +21,4 @@ object Test extends App {
manifestIsClassTag[Int]
manifestIsClassTag[String]
manifestIsClassTag[Array[Int]]
-} \ No newline at end of file
+}
diff --git a/test/files/run/interpolationArgs.scala b/test/files/run/interpolationArgs.scala
index eb13767907..ffb254b63f 100644
--- a/test/files/run/interpolationArgs.scala
+++ b/test/files/run/interpolationArgs.scala
@@ -1,5 +1,5 @@
object Test extends App {
- try { scala.StringContext("p1", "p2", "p3").s("e1") } catch { case ex => println(ex) }
- try { scala.StringContext("p1").s("e1") } catch { case ex => println(ex) }
+ try { scala.StringContext("p1", "p2", "p3").s("e1") } catch { case ex: Throwable => println(ex) }
+ try { scala.StringContext("p1").s("e1") } catch { case ex: Throwable => println(ex) }
}
diff --git a/test/files/run/interpolationMultiline2.scala b/test/files/run/interpolationMultiline2.scala
index f6a682c3ce..2de4c4b22e 100644
--- a/test/files/run/interpolationMultiline2.scala
+++ b/test/files/run/interpolationMultiline2.scala
@@ -2,14 +2,15 @@ object Test extends App {
def test1(n: Int) = {
val old = "old"
- try { println(s"""Bob is ${s"$n"} years ${s"$old"}!""") } catch { case ex => println(ex) }
- try { println(s"""Bob is ${f"$n"} years ${s"$old"}!""") } catch { case ex => println(ex) }
- try { println(f"""Bob is ${s"$n"} years ${s"$old"}!""") } catch { case ex => println(ex) }
- try { println(f"""Bob is ${f"$n"} years ${s"$old"}!""") } catch { case ex => println(ex) }
- try { println(f"""Bob is ${f"$n%2d"} years ${s"$old"}!""") } catch { case ex => println(ex) }
- try { println(f"""Bob is ${s"$n%2d"} years ${s"$old"}!""") } catch { case ex => println(ex) }
- try { println(s"""Bob is ${f"$n%2d"} years ${s"$old"}!""") } catch { case ex => println(ex) }
- try { println(s"""Bob is ${s"$n%2d"} years ${s"$old"}!""") } catch { case ex => println(ex) }
+ val catcher: PartialFunction[Throwable, Unit] = { case e => println(e) }
+ try { println(s"""Bob is ${s"$n"} years ${s"$old"}!""") } catch catcher
+ try { println(s"""Bob is ${f"$n"} years ${s"$old"}!""") } catch catcher
+ try { println(f"""Bob is ${s"$n"} years ${s"$old"}!""") } catch catcher
+ try { println(f"""Bob is ${f"$n"} years ${s"$old"}!""") } catch catcher
+ try { println(f"""Bob is ${f"$n%2d"} years ${s"$old"}!""") } catch catcher
+ try { println(f"""Bob is ${s"$n%2d"} years ${s"$old"}!""") } catch catcher
+ try { println(s"""Bob is ${f"$n%2d"} years ${s"$old"}!""") } catch catcher
+ try { println(s"""Bob is ${s"$n%2d"} years ${s"$old"}!""") } catch catcher
}
test1(1)
diff --git a/test/files/run/io-position.scala b/test/files/run/io-position.scala
index 1093704fa4..b227846fb4 100644
--- a/test/files/run/io-position.scala
+++ b/test/files/run/io-position.scala
@@ -1,7 +1,5 @@
object Test {
- Console.setErr(Console.out)
-
- def main(args: Array[String]): Unit = {
+ def main(args: Array[String]): Unit = Console.withErr(Console.out) {
try {
xml.parsing.ConstructingParser.fromSource(io.Source.fromString("<foo>"), false).document()
} catch {
diff --git a/test/files/run/is-valid-num.scala b/test/files/run/is-valid-num.scala
index 402eff99d6..19a3b9c7c0 100644
--- a/test/files/run/is-valid-num.scala
+++ b/test/files/run/is-valid-num.scala
@@ -1,3 +1,6 @@
+/*
+ * filter: inliner warning\(s\); re-run with -Yinline-warnings for details
+ */
object Test {
def x = BigInt("10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
def y = BigDecimal("" + (Short.MaxValue + 1) + ".0")
diff --git a/test/files/run/issue192.scala b/test/files/run/issue192.scala
index d8db8b5816..3c3b44a8fb 100644
--- a/test/files/run/issue192.scala
+++ b/test/files/run/issue192.scala
@@ -1,3 +1,5 @@
+import scala.language.reflectiveCalls
+
object Test extends App {
def f1(p: Any{def unary_+ : Int}) = +p
diff --git a/test/files/run/iterator-from.scala b/test/files/run/iterator-from.scala
index 8dc6ae4e51..fb33f6b5ed 100644
--- a/test/files/run/iterator-from.scala
+++ b/test/files/run/iterator-from.scala
@@ -1,4 +1,6 @@
-// This file tests iteratorFrom, keysIteratorFrom, and valueIteratorFrom on various sorted sets and maps
+/* This file tests iteratorFrom, keysIteratorFrom, and valueIteratorFrom on various sorted sets and maps
+ * filter: inliner warning\(s\); re-run with -Yinline-warnings for details
+ */
import scala.util.{Random => R}
import scala.collection._
diff --git a/test/files/run/iterator-iterate-lazy.scala b/test/files/run/iterator-iterate-lazy.scala
index 73886f192b..92b170062e 100644
--- a/test/files/run/iterator-iterate-lazy.scala
+++ b/test/files/run/iterator-iterate-lazy.scala
@@ -1,5 +1,5 @@
object Test {
def main(args: Array[String]): Unit = {
- Iterator.iterate(1 to 5 toList)(_.tail).takeWhile(_.nonEmpty).map(_.head).toList
+ Iterator.iterate((1 to 5).toList)(_.tail).takeWhile(_.nonEmpty).map(_.head).toList
}
}
diff --git a/test/files/run/iterators.scala b/test/files/run/iterators.scala
index b85291cd72..e2d0f93a05 100644
--- a/test/files/run/iterators.scala
+++ b/test/files/run/iterators.scala
@@ -4,6 +4,8 @@
//############################################################################
+import scala.language.postfixOps
+
object Test {
def check_from: Int = {
diff --git a/test/files/run/json.scala b/test/files/run/json.scala
index a81f12564c..36e86ac5bb 100644
--- a/test/files/run/json.scala
+++ b/test/files/run/json.scala
@@ -1,13 +1,17 @@
+/*
+ * filter: inliner warning\(s\); re-run with -Yinline-warnings for details
+ */
import scala.util.parsing.json._
import scala.collection.immutable.TreeMap
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
/* This method converts parsed JSON back into real JSON notation with objects in
* sorted-key order. Not required by the spec, but it allows us to do a stable
* toString comparison. */
def jsonToString(in : Any) : String = in match {
case l : List[_] => "[" + l.map(jsonToString).mkString(", ") + "]"
- case m : Map[String,_] => "{" + m.iterator.toList
+ case m : Map[String @unchecked,_] => "{" + m.iterator.toList
.sortWith({ (x,y) => x._1 < y._1 })
.map({ case (k,v) => "\"" + k + "\": " + jsonToString(v) })
.mkString(", ") + "}"
@@ -20,7 +24,7 @@ object Test extends App {
*/
def sortJSON(in : Any) : Any = in match {
case l : List[_] => l.map(sortJSON)
- case m : Map[String,_] => TreeMap(m.mapValues(sortJSON).iterator.toSeq : _*)
+ case m : Map[String @unchecked,_] => TreeMap(m.mapValues(sortJSON).iterator.toSeq : _*)
// For the object versions, sort their contents, ugly casts and all...
case JSONObject(data) => JSONObject(sortJSON(data).asInstanceOf[Map[String,Any]])
case JSONArray(data) => JSONArray(sortJSON(data).asInstanceOf[List[Any]])
diff --git a/test/files/run/lazy-exprs.check b/test/files/run/lazy-exprs.check
index e77d204251..2efb8ceb4a 100644
--- a/test/files/run/lazy-exprs.check
+++ b/test/files/run/lazy-exprs.check
@@ -1,3 +1,11 @@
+lazy-exprs.scala:38: warning: match may not be exhaustive.
+It would fail on the following input: Some((x: String forSome x not in Z1))
+ t match {
+ ^
+lazy-exprs.scala:62: warning: match may not be exhaustive.
+It would fail on the following input: Some((x: String forSome x not in LazyField))
+ t match {
+ ^
forced <z1>
lazy val in scrutinee: ok
forced <z1>
diff --git a/test/files/run/lazy-locals.check b/test/files/run/lazy-locals.check
index d1cc754f2c..9e88a55d18 100644
--- a/test/files/run/lazy-locals.check
+++ b/test/files/run/lazy-locals.check
@@ -1,3 +1,9 @@
+lazy-locals.scala:153: warning: a pure expression does nothing in statement position; you may be omitting necessary 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/lists-run.scala b/test/files/run/lists-run.scala
index ccfe5bc260..5ff3ee353e 100644
--- a/test/files/run/lists-run.scala
+++ b/test/files/run/lists-run.scala
@@ -2,6 +2,8 @@
*
* @author Stephane Micheloud
*/
+import scala.language.postfixOps
+
object Test {
def main(args: Array[String]) {
Test_multiset.run() // multiset operations: union, intersect, diff
@@ -153,7 +155,7 @@ object Test3 {
List.range(1, 10, 0)
} catch {
case e: IllegalArgumentException => ()
- case _ => throw new Error("List.range(1, 10, 0)")
+ case _: Throwable => throw new Error("List.range(1, 10, 0)")
}
assert(List.range(10, 0, -2) == List(10, 8, 6, 4, 2))
}
diff --git a/test/files/run/literals.check b/test/files/run/literals.check
index f53c879dea..6be5137994 100644
--- a/test/files/run/literals.check
+++ b/test/files/run/literals.check
@@ -1,3 +1,4 @@
+warning: there were 13 deprecation warning(s); re-run with -deprecation for details
test '\u0024' == '$' was successful
test '\u005f' == '_' was successful
test 65.asInstanceOf[Char] == 'A' was successful
@@ -43,7 +44,6 @@ test 0x8000000000000000L == -9223372036854775808L was successful
test 0xffffffffffffffffL == -1L was successful
test 1e1f == 10.0f was successful
-test 2.f == 2.0f was successful
test .3f == 0.3f was successful
test 0f == 0.0f was successful
test 3.14f == 3.14f was successful
@@ -53,8 +53,6 @@ test 1.asInstanceOf[Float] == 1.0 was successful
test 1l.asInstanceOf[Float] == 1.0 was successful
test 1e1 == 10.0 was successful
-test 2. == 2.0 was successful
-test 2.d == 2.0 was successful
test .3 == 0.3 was successful
test 0.0 == 0.0 was successful
test 0d == 0.0 was successful
diff --git a/test/files/run/literals.scala b/test/files/run/literals.scala
index 32bc29fda8..7676125339 100644
--- a/test/files/run/literals.scala
+++ b/test/files/run/literals.scala
@@ -105,7 +105,7 @@ object Test {
// float
check_success("1e1f == 10.0f", 1e1f, 10.0f)
- check_success("2.f == 2.0f", 2.f, 2.0f)
+ //check_success("2.f == 2.0f", 2.f, 2.0f)
check_success(".3f == 0.3f", .3f, 0.3f)
check_success("0f == 0.0f", 0f, 0.0f)
check_success("3.14f == 3.14f", 3.14f, 3.14f)
@@ -118,8 +118,8 @@ object Test {
// double
check_success("1e1 == 10.0", 1e1, 10.0)
- check_success("2. == 2.0", 2., 2.0)
- check_success("2.d == 2.0", 2.d, 2.0)
+ //check_success("2. == 2.0", 2., 2.0)
+ //check_success("2.d == 2.0", 2.d, 2.0)
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)
diff --git a/test/files/run/macro-declared-in-anonymous/Macros_Test_2.scala b/test/files/run/macro-declared-in-anonymous/Macros_Test_2.scala
index 8bd8c172c9..88cd29ae4f 100644
--- a/test/files/run/macro-declared-in-anonymous/Macros_Test_2.scala
+++ b/test/files/run/macro-declared-in-anonymous/Macros_Test_2.scala
@@ -1,4 +1,6 @@
+import scala.language.reflectiveCalls
+
object Test extends App {
val macros = new { def foo = macro Impls.foo }
macros.foo
-} \ No newline at end of file
+}
diff --git a/test/files/run/macro-declared-in-refinement/Macros_Test_2.scala b/test/files/run/macro-declared-in-refinement/Macros_Test_2.scala
index f746c2da57..ff9a66d58a 100644
--- a/test/files/run/macro-declared-in-refinement/Macros_Test_2.scala
+++ b/test/files/run/macro-declared-in-refinement/Macros_Test_2.scala
@@ -1,6 +1,9 @@
+
+import scala.language.reflectiveCalls
+
class Base
object Test extends App {
val macros = new Base { def foo = macro Impls.foo }
macros.foo
-} \ No newline at end of file
+}
diff --git a/test/files/run/macro-duplicate.check b/test/files/run/macro-duplicate.check
index e69de29bb2..58781b719a 100644
--- a/test/files/run/macro-duplicate.check
+++ b/test/files/run/macro-duplicate.check
@@ -0,0 +1,3 @@
+Test_2.scala:5: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ Macros.foo
+ ^
diff --git a/test/files/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala b/test/files/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala
index 81ebd63c5f..22047eeb36 100644
--- a/test/files/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala
+++ b/test/files/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala
@@ -1,4 +1,5 @@
object Macros {
+ import scala.language.implicitConversions
implicit def foo(x: String): Option[Int] = macro Impls.foo
}
@@ -7,4 +8,4 @@ object Test extends App {
println("2": Option[Int])
val s: Int = "2" getOrElse 0
println(s)
-} \ No newline at end of file
+}
diff --git a/test/files/run/macro-expand-implicit-macro-is-view.flags b/test/files/run/macro-expand-implicit-macro-is-view.flags
deleted file mode 100644
index cd66464f2f..0000000000
--- a/test/files/run/macro-expand-implicit-macro-is-view.flags
+++ /dev/null
@@ -1 +0,0 @@
--language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala b/test/files/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala
index 0ff1fb80ca..0d99f32d7e 100644
--- a/test/files/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala
+++ b/test/files/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala
@@ -1,4 +1,7 @@
+
object Macros {
+ import scala.language.experimental.macros
+ import scala.language.implicitConversions
implicit def foo(x: String): Option[Int] = macro Impls.foo
}
@@ -6,4 +9,4 @@ object Test extends App {
import Macros._
def bar[T <% Option[Int]](x: T) = println(x)
println("2")
-} \ No newline at end of file
+}
diff --git a/test/files/run/manifests-new.scala b/test/files/run/manifests-new.scala
index f1596dee81..8b42e3ca73 100644
--- a/test/files/run/manifests-new.scala
+++ b/test/files/run/manifests-new.scala
@@ -1,3 +1,6 @@
+
+
+import scala.language.{ higherKinds, postfixOps }
import scala.reflect.runtime.universe._
object Test
@@ -146,4 +149,4 @@ object Test
}
def main(args: Array[String]): Unit = runAllTests
-} \ No newline at end of file
+}
diff --git a/test/files/run/manifests-old.scala b/test/files/run/manifests-old.scala
index 621689a254..d8b1e751d4 100644
--- a/test/files/run/manifests-old.scala
+++ b/test/files/run/manifests-old.scala
@@ -1,3 +1,6 @@
+import scala.language.{ higherKinds, postfixOps }
+
+@deprecated("Suppress warnings", since="2.11")
object Test
{
object Variances extends Enumeration {
@@ -144,4 +147,4 @@ object Test
}
def main(args: Array[String]): Unit = runAllTests
-} \ No newline at end of file
+}
diff --git a/test/files/run/mapConserve.scala b/test/files/run/mapConserve.scala
index 013095b1de..330fb34ca1 100644
--- a/test/files/run/mapConserve.scala
+++ b/test/files/run/mapConserve.scala
@@ -1,3 +1,6 @@
+/*
+ * filter: inliner warning\(s\); re-run with -Yinline-warnings for details
+ */
import scala.annotation.tailrec
import scala.collection.mutable.ListBuffer
@@ -50,4 +53,4 @@ object Test {
checkStackOverflow();
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/misc.check b/test/files/run/misc.check
index 9fa7b72d50..56116f8104 100644
--- a/test/files/run/misc.check
+++ b/test/files/run/misc.check
@@ -1,3 +1,27 @@
+misc.scala:46: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 42;
+ ^
+misc.scala:47: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 42l;
+ ^
+misc.scala:48: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 23.5f;
+ ^
+misc.scala:49: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 23.5;
+ ^
+misc.scala:50: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ "Hello";
+ ^
+misc.scala:51: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 32 + 45;
+ ^
+misc.scala:62: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ x;
+ ^
+misc.scala:74: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 1 < 2;
+ ^
### Hello
### 17
### Bye
diff --git a/test/files/run/names-defaults.check b/test/files/run/names-defaults.check
index f253de71d6..0037822f3b 100644
--- a/test/files/run/names-defaults.check
+++ b/test/files/run/names-defaults.check
@@ -1,3 +1,7 @@
+names-defaults.scala:269: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ spawn(b = { val ttt = 1; ttt }, a = 0)
+ ^
+warning: there were 4 deprecation warning(s); re-run with -deprecation for details
1: @
get: $
get: 2
diff --git a/test/files/run/names-defaults.scala b/test/files/run/names-defaults.scala
index 220414f02a..05cd4a540c 100644
--- a/test/files/run/names-defaults.scala
+++ b/test/files/run/names-defaults.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ higherKinds, existentials }
+
object Test extends App {
def get[T](x: T) = { println("get: "+ x); x }
diff --git a/test/files/run/no-pickle-skolems/Test_2.scala b/test/files/run/no-pickle-skolems/Test_2.scala
index 90bb4c4f88..8fd6016aea 100644
--- a/test/files/run/no-pickle-skolems/Test_2.scala
+++ b/test/files/run/no-pickle-skolems/Test_2.scala
@@ -1,3 +1,5 @@
+
+import scala.language.reflectiveCalls
import scala.reflect.runtime.universe._
object Test {
diff --git a/test/files/run/option-fold.scala b/test/files/run/option-fold.scala
index d554ba4f9b..7e21403c2e 100644
--- a/test/files/run/option-fold.scala
+++ b/test/files/run/option-fold.scala
@@ -7,13 +7,14 @@ object Test {
def g(x: Option[A]) = x.fold(-1) {
case B => 0
case C(x) => x
+ case _ => ???
}
def main(args: Array[String]): Unit = {
- println(f(None))
- println(f(Some(5)))
- println(g(None))
- println(g(Some(B)))
- println(g(Some(C(1))))
+ println(f(None)) //List()
+ println(f(Some(5))) //List(5)
+ println(g(None)) //-1
+ println(g(Some(B))) //0
+ println(g(Some(C(1)))) //1
}
}
diff --git a/test/files/run/patmat-exprs.scala b/test/files/run/patmat-exprs.scala
index dfc78e2ca5..56e4e01598 100644
--- a/test/files/run/patmat-exprs.scala
+++ b/test/files/run/patmat-exprs.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ implicitConversions }
import runtime.ScalaRunTime
object Test {
@@ -576,4 +578,4 @@ trait Pattern {
implicit def long2Constant[T](l: Long)(implicit num: NumericOps[T]): Leaf[T] =
const(num.fromDouble(l.toDouble))
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/patmat_unapp_abstype-new.check b/test/files/run/patmat_unapp_abstype-new.check
index 42c54631d2..c5511e9516 100644
--- a/test/files/run/patmat_unapp_abstype-new.check
+++ b/test/files/run/patmat_unapp_abstype-new.check
@@ -1,3 +1,9 @@
+patmat_unapp_abstype-new.scala:21: warning: abstract type pattern TypesUser.this.TypeRef is unchecked since it is eliminated by erasure
+ case TypeRef(x) => println("TypeRef")
+ ^
+patmat_unapp_abstype-new.scala:53: warning: abstract type pattern Intermed.this.Foo is unchecked since it is eliminated by erasure
+ case Foo(x) => println("Foo")
+ ^
TypeRef
MethodType
Bar
diff --git a/test/files/run/patmatnew.check b/test/files/run/patmatnew.check
index e69de29bb2..56b8ac2f4f 100644
--- a/test/files/run/patmatnew.check
+++ b/test/files/run/patmatnew.check
@@ -0,0 +1,15 @@
+patmatnew.scala:351: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ case 1 => "OK"
+ ^
+patmatnew.scala:352: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ case 2 => assert(false); "KO"
+ ^
+patmatnew.scala:353: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 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.
+ case e => {
+ ^
+patmatnew.scala:489: warning: unreachable code
+ case _ if false =>
+ ^
diff --git a/test/files/run/patmatnew.scala b/test/files/run/patmatnew.scala
index a6f8199457..fb49e0c924 100644
--- a/test/files/run/patmatnew.scala
+++ b/test/files/run/patmatnew.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ postfixOps }
+
object Test {
def main(args: Array[String]) {
diff --git a/test/files/run/pc-conversions.scala b/test/files/run/pc-conversions.scala
index 60ee59c3c4..b1ef3d963e 100644
--- a/test/files/run/pc-conversions.scala
+++ b/test/files/run/pc-conversions.scala
@@ -1,4 +1,6 @@
-
+/*
+ * filter: inliner warning\(s\); re-run with -Yinline-warnings for details
+ */
import collection._
diff --git a/test/files/run/pf-catch.scala b/test/files/run/pf-catch.scala
index ba0781fe89..dfe43dc750 100644
--- a/test/files/run/pf-catch.scala
+++ b/test/files/run/pf-catch.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ postfixOps }
object Test {
def shortName(x: AnyRef) = x.getClass.getName split '.' last
type Handler[+T] = PartialFunction[Throwable, T]
@@ -27,7 +29,7 @@ object Test {
def main(args: Array[String]): Unit = {
try f1
- catch { case x => println(shortName(x) + " slipped by.") }
+ catch { case x: Throwable => println(shortName(x) + " slipped by.") }
f2
}
diff --git a/test/files/run/preinits.check b/test/files/run/preinits.check
index 5584ab261e..e97a14b77f 100644
--- a/test/files/run/preinits.check
+++ b/test/files/run/preinits.check
@@ -1,3 +1,9 @@
+preinits.scala:2: warning: Implementation restriction: early definitions in traits are not initialized before the super class is initialized.
+trait B extends { override val x = 1 } with A { println("B") }
+ ^
+preinits.scala:3: warning: Implementation restriction: early definitions in traits are not initialized before the super class is initialized.
+trait C extends { override val x = 2 } with A
+ ^
A
B
2
diff --git a/test/files/run/primitive-sigs-2-new.scala b/test/files/run/primitive-sigs-2-new.scala
index cf6de9c81b..1f39667b18 100644
--- a/test/files/run/primitive-sigs-2-new.scala
+++ b/test/files/run/primitive-sigs-2-new.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ postfixOps }
import scala.reflect.{ClassTag, classTag}
import java.{ lang => jl }
@@ -29,4 +31,4 @@ object Test {
println(new C f)
c3m.sorted foreach println
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/primitive-sigs-2-old.scala b/test/files/run/primitive-sigs-2-old.scala
index b7152f7e3d..0a4be93f22 100644
--- a/test/files/run/primitive-sigs-2-old.scala
+++ b/test/files/run/primitive-sigs-2-old.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ postfixOps }
import java.{ lang => jl }
trait T[A] {
diff --git a/test/files/run/private-inline.check b/test/files/run/private-inline.check
index 209e3ef4b6..eee7f2973b 100644
--- a/test/files/run/private-inline.check
+++ b/test/files/run/private-inline.check
@@ -1 +1,7 @@
+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: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))
+ ^
20
diff --git a/test/files/run/private-inline.flags b/test/files/run/private-inline.flags
index eb4d19bcb9..00d3643fd4 100644
--- a/test/files/run/private-inline.flags
+++ b/test/files/run/private-inline.flags
@@ -1 +1 @@
--optimise \ No newline at end of file
+-optimise -Yinline-warnings
diff --git a/test/files/run/private-inline.scala b/test/files/run/private-inline.scala
index a62007779c..72cabaeff0 100644
--- a/test/files/run/private-inline.scala
+++ b/test/files/run/private-inline.scala
@@ -43,7 +43,7 @@ object Test {
val foundClass = (
try Class.forName(clazz)
- catch { case _ => null }
+ catch { case _: Throwable => null }
)
assert(foundClass == null, foundClass)
diff --git a/test/files/run/programmatic-main.scala b/test/files/run/programmatic-main.scala
index 7bc5c5dfcf..08335ca6f6 100644
--- a/test/files/run/programmatic-main.scala
+++ b/test/files/run/programmatic-main.scala
@@ -1,3 +1,5 @@
+
+import scala.language.postfixOps
import scala.tools.nsc._
import io.Path
diff --git a/test/files/run/records.scala b/test/files/run/records.scala
index 96b0b4cb0f..bae0d943ff 100644
--- a/test/files/run/records.scala
+++ b/test/files/run/records.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ reflectiveCalls }
+
trait C {
def f: Int
}
diff --git a/test/files/run/reflection-allmirrors-tostring.scala b/test/files/run/reflection-allmirrors-tostring.scala
index 0ca387a6b1..41bab5ac0e 100644
--- a/test/files/run/reflection-allmirrors-tostring.scala
+++ b/test/files/run/reflection-allmirrors-tostring.scala
@@ -1,3 +1,5 @@
+
+import scala.language.higherKinds
import scala.reflect.runtime.universe._
class C {
@@ -40,4 +42,4 @@ object Test extends App {
val cc = typeOf[C].member(TypeName("C")).asClass
println(cm.reflectClass(c).reflectConstructor(c.typeSignature.member(nme.CONSTRUCTOR).asMethod))
println(im.reflectClass(cc).reflectConstructor(cc.typeSignature.member(nme.CONSTRUCTOR).asMethod))
-} \ No newline at end of file
+}
diff --git a/test/files/run/reflection-implicit.scala b/test/files/run/reflection-implicit.scala
index 0bcb0bc3a0..f2b3ba960c 100644
--- a/test/files/run/reflection-implicit.scala
+++ b/test/files/run/reflection-implicit.scala
@@ -1,3 +1,5 @@
+
+import scala.language.implicitConversions
import scala.reflect.runtime.universe._
class C {
@@ -12,4 +14,4 @@ object Test extends App {
val param = decls.find(_.name.toString == "d").get.asMethod.paramss.last.head
param.typeSignature
println(param.isImplicit)
-} \ No newline at end of file
+}
diff --git a/test/files/run/reflection-magicsymbols-vanilla.scala b/test/files/run/reflection-magicsymbols-vanilla.scala
index 26b70460eb..2bde3d8874 100644
--- a/test/files/run/reflection-magicsymbols-vanilla.scala
+++ b/test/files/run/reflection-magicsymbols-vanilla.scala
@@ -1,3 +1,5 @@
+import scala.language.postfixOps
+
class A {
def foo1(x: Int*) = ???
def foo2(x: => Int) = ???
diff --git a/test/files/run/reify-each-node-type.scala b/test/files/run/reify-each-node-type.scala
index a827da766d..425061f955 100644
--- a/test/files/run/reify-each-node-type.scala
+++ b/test/files/run/reify-each-node-type.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ existentials, postfixOps }
import scala.reflect.runtime.universe._
object r {
diff --git a/test/files/run/reify_ann1b.check b/test/files/run/reify_ann1b.check
index bc046a7455..a046dafeab 100644
--- a/test/files/run/reify_ann1b.check
+++ b/test/files/run/reify_ann1b.check
@@ -1,3 +1,8 @@
+reify_ann1b.scala:6: warning: Implementation restriction: subclassing Classfile does not
+make your annotation visible at runtime. If that is what
+you want, you must write the annotation class in Java.
+class ann(bar: String) extends annotation.ClassfileAnnotation
+ ^
{
@new ann(bar = "1a") @new ann(bar = "1b") class C[@new ann(bar = "2a") @new ann(bar = "2b") T] extends AnyRef {
@new ann(bar = "3a") @new ann(bar = "3b") <paramaccessor> private[this] val x: T @ann(bar = "4a") @ann(bar = "4b") = _;
diff --git a/test/files/run/reify_classfileann_a.check b/test/files/run/reify_classfileann_a.check
index 0c919020a8..51f255b232 100644
--- a/test/files/run/reify_classfileann_a.check
+++ b/test/files/run/reify_classfileann_a.check
@@ -1,3 +1,8 @@
+reify_classfileann_a.scala:6: warning: Implementation restriction: subclassing Classfile does not
+make your annotation visible at runtime. If that is what
+you want, you must write the annotation class in Java.
+class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends annotation.ClassfileAnnotation
+ ^
{
@new ann(bar = "1", quux = Array("2", "3"), baz = new ann(bar = "4")) class C extends AnyRef {
def <init>() = {
diff --git a/test/files/run/reify_classfileann_b.check b/test/files/run/reify_classfileann_b.check
index c204fa8dc0..05f2e5bfc6 100644
--- a/test/files/run/reify_classfileann_b.check
+++ b/test/files/run/reify_classfileann_b.check
@@ -1,3 +1,8 @@
+reify_classfileann_b.scala:6: warning: Implementation restriction: subclassing Classfile does not
+make your annotation visible at runtime. If that is what
+you want, you must write the annotation class in Java.
+class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends annotation.ClassfileAnnotation
+ ^
{
class C extends AnyRef {
def <init>() = {
diff --git a/test/files/run/reify_extendbuiltins.scala b/test/files/run/reify_extendbuiltins.scala
index a2d546579d..46d5b7e55e 100644
--- a/test/files/run/reify_extendbuiltins.scala
+++ b/test/files/run/reify_extendbuiltins.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ implicitConversions, postfixOps }
import scala.reflect.runtime.universe._
import scala.tools.reflect.Eval
@@ -12,4 +14,4 @@ object Test extends App {
println("10! = " + (10!))
}.eval
-} \ No newline at end of file
+}
diff --git a/test/files/run/reify_implicits-new.scala b/test/files/run/reify_implicits-new.scala
index 42a1deef26..1d90d907ea 100644
--- a/test/files/run/reify_implicits-new.scala
+++ b/test/files/run/reify_implicits-new.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ implicitConversions, reflectiveCalls }
import scala.reflect.{ClassTag, classTag}
import scala.reflect.runtime.universe._
import scala.tools.reflect.Eval
@@ -13,4 +15,4 @@ object Test extends App {
val x = Array(2, 3, 1, 4)
println("x = "+ x.sort((x: Int, y: Int) => x < y).toList)
}.eval
-} \ No newline at end of file
+}
diff --git a/test/files/run/reify_implicits-old.scala b/test/files/run/reify_implicits-old.scala
index 8ff256d2d4..a4e90488e5 100644
--- a/test/files/run/reify_implicits-old.scala
+++ b/test/files/run/reify_implicits-old.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ implicitConversions, reflectiveCalls }
import scala.reflect.runtime.universe._
import scala.tools.reflect.Eval
@@ -12,4 +14,4 @@ object Test extends App {
val x = Array(2, 3, 1, 4)
println("x = "+ x.sort((x: Int, y: Int) => x < y).toList)
}.eval
-} \ No newline at end of file
+}
diff --git a/test/files/run/reify_lazyevaluation.scala b/test/files/run/reify_lazyevaluation.scala
index 5b310d95f7..3f2530ddee 100644
--- a/test/files/run/reify_lazyevaluation.scala
+++ b/test/files/run/reify_lazyevaluation.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ implicitConversions }
import scala.reflect.runtime.universe._
import scala.tools.reflect.Eval
diff --git a/test/files/run/reify_lazyunit.check b/test/files/run/reify_lazyunit.check
index 1b46c909be..579ecfe8aa 100644
--- a/test/files/run/reify_lazyunit.check
+++ b/test/files/run/reify_lazyunit.check
@@ -1,3 +1,6 @@
+reify_lazyunit.scala:6: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ lazy val x = { 0; println("12")}
+ ^
12
one
two
diff --git a/test/files/run/reify_printf.check b/test/files/run/reify_printf.check
index e69de29bb2..3b18e512db 100644
--- a/test/files/run/reify_printf.check
+++ b/test/files/run/reify_printf.check
@@ -0,0 +1 @@
+hello world
diff --git a/test/files/run/reify_printf.scala b/test/files/run/reify_printf.scala
index 9932a58dfa..c4ade79837 100644
--- a/test/files/run/reify_printf.scala
+++ b/test/files/run/reify_printf.scala
@@ -9,13 +9,13 @@ import scala.reflect.internal.Types
import scala.util.matching.Regex
object Test extends App {
- val output = new ByteArrayOutputStream()
- Console.setOut(new PrintStream(output))
+ //val output = new ByteArrayOutputStream()
+ //Console.setOut(new PrintStream(output))
val toolbox = cm.mkToolBox()
val tree = tree_printf(reify("hello %s").tree, reify("world").tree)
val evaluated = toolbox.eval(tree)
- assert(output.toString() == "hello world", output.toString() +" == hello world")
+ //assert(output.toString() == "hello world", output.toString() +" == hello world")
/*
// upd. Oh, good old times, our very-very first experiments with macros :)
@@ -68,4 +68,4 @@ object Test extends App {
): Tree
Block((evals ++ prints).toList, Literal(Constant(())))
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/repl-backticks.scala b/test/files/run/repl-backticks.scala
index 5eaa1ec4c1..ec2691d9c5 100644
--- a/test/files/run/repl-backticks.scala
+++ b/test/files/run/repl-backticks.scala
@@ -8,7 +8,7 @@ object Test {
`yield`
</code>.text
- def main(args: Array[String]) = {
+ def main(args: Array[String]) {
val settings = new Settings()
settings.classpath.value = System.getProperty("java.class.path")
val repl = new interpreter.IMain(settings)
diff --git a/test/files/run/repl-power.check b/test/files/run/repl-power.check
index 9d63ecde94..1abb8e9d14 100644
--- a/test/files/run/repl-power.check
+++ b/test/files/run/repl-power.check
@@ -14,6 +14,7 @@ scala> global.emptyValDef // "it is imported twice in the same scope by ..."
res0: $r.global.emptyValDef.type = private val _ = _
scala> val tp = ArrayClass[scala.util.Random] // magic with tags
+warning: there were 1 feature warning(s); re-run with -feature for details
tp: $r.global.Type = Array[scala.util.Random]
scala> tp.memberType(Array_apply) // evidence
diff --git a/test/files/run/resetattrs-this.scala b/test/files/run/resetattrs-this.scala
index 12afa3d712..2a55437273 100644
--- a/test/files/run/resetattrs-this.scala
+++ b/test/files/run/resetattrs-this.scala
@@ -4,8 +4,8 @@ import scala.tools.reflect.ToolBox
object Test extends App {
val tb = cm.mkToolBox()
- val tree = Select(This(cm.staticPackage("scala").moduleClass), newTermName("Predef"))
+ val tree = Select(This(cm.staticPackage("scala").moduleClass), TermName("Predef"))
val ttree = tb.typeCheck(tree)
val rttree = tb.resetAllAttrs(ttree)
println(tb.eval(rttree) == Predef)
-} \ No newline at end of file
+}
diff --git a/test/files/run/richs.scala b/test/files/run/richs.scala
index 5ee573673d..4b5345757c 100644
--- a/test/files/run/richs.scala
+++ b/test/files/run/richs.scala
@@ -11,8 +11,8 @@ trait RichTest {
val cn = this.getClass().getName()
cn.substring(0, cn.length-1)
}
- def length[A](it: Iterator[A]) = it.toList length
- def length[A](it: Iterable[A]) = it.toList length
+ def length[A](it: Iterator[A]) = it.toList.length
+ def length[A](it: Iterable[A]) = it.toList.length
def run: Unit
}
object RichCharTest1 extends RichTest {
diff --git a/test/files/run/runtime.check b/test/files/run/runtime.check
index 990a087da0..d613c9bd42 100644
--- a/test/files/run/runtime.check
+++ b/test/files/run/runtime.check
@@ -1,3 +1,9 @@
+runtime.scala:141: warning: comparing values of types Null and Null using `eq' will always yield true
+ check(true , null eq null, null ne null);
+ ^
+runtime.scala:141: warning: comparing values of types Null and Null using `ne' will always yield false
+ check(true , null eq null, null ne null);
+ ^
<<< Test0
[false,true]
[0,1,2]
diff --git a/test/files/run/runtime.scala b/test/files/run/runtime.scala
index a2ac204e8a..89348b294d 100644
--- a/test/files/run/runtime.scala
+++ b/test/files/run/runtime.scala
@@ -171,7 +171,7 @@ object Test {
try {
test;
} catch {
- case exception => {
+ case exception: Throwable => {
//val name: String = Thread.currentThread().getName();
Console.print("Exception in thread \"" + name + "\" " + exception);
Console.println;
diff --git a/test/files/run/sequenceComparisons.scala b/test/files/run/sequenceComparisons.scala
index 5d7958bc7e..f8ef17d77d 100644
--- a/test/files/run/sequenceComparisons.scala
+++ b/test/files/run/sequenceComparisons.scala
@@ -82,7 +82,7 @@ object Test {
val sameElementsInputs = (
List(List(1,2,3,4,5)),
- List(Nil, List(1), List(1,2), List(2,3,4), List(2,3,4,5), List(2,3,4,5,1), List(1,2,3,5,4), seq reverse)
+ List(Nil, List(1), List(1,2), List(2,3,4), List(2,3,4,5), List(2,3,4,5,1), List(1,2,3,5,4), seq.reverse)
)
}
diff --git a/test/files/run/settings-parse.scala b/test/files/run/settings-parse.scala
index 2b04f55b24..2754feb972 100644
--- a/test/files/run/settings-parse.scala
+++ b/test/files/run/settings-parse.scala
@@ -1,3 +1,5 @@
+
+import scala.language.postfixOps
import scala.tools.nsc._
object Test {
diff --git a/test/files/run/si5045.scala b/test/files/run/si5045.scala
index e198b101f3..b0c3a4ddc4 100644
--- a/test/files/run/si5045.scala
+++ b/test/files/run/si5045.scala
@@ -1,3 +1,6 @@
+
+import scala.language.postfixOps
+
object Test extends App {
import scala.util.matching.{ Regex, UnanchoredRegex }
diff --git a/test/files/run/slices.scala b/test/files/run/slices.scala
index e31ea4046f..107b8e658a 100644
--- a/test/files/run/slices.scala
+++ b/test/files/run/slices.scala
@@ -1,3 +1,6 @@
+
+import scala.language.postfixOps
+
object Test extends App {
// lists
diff --git a/test/files/run/spec-nlreturn.scala b/test/files/run/spec-nlreturn.scala
index ec5e7229d3..a84160ecca 100644
--- a/test/files/run/spec-nlreturn.scala
+++ b/test/files/run/spec-nlreturn.scala
@@ -1,7 +1,8 @@
+
object Test {
def f(): Int = {
try {
- val g = 1 to 10 map { i => return 16 ; i } sum;
+ val g = (1 to 10 map { i => return 16 ; i }).sum
g
}
catch { case x: runtime.NonLocalReturnControl[_] =>
diff --git a/test/files/run/stream_flatmap_odds.scala b/test/files/run/stream_flatmap_odds.scala
index 6fb202ca68..1935253595 100644
--- a/test/files/run/stream_flatmap_odds.scala
+++ b/test/files/run/stream_flatmap_odds.scala
@@ -1,4 +1,4 @@
object Test extends App {
lazy val odds: Stream[Int] = Stream(1) append ( odds flatMap {x => Stream(x + 2)} )
- println(odds take 42 force)
+ Console println (odds take 42).force
}
diff --git a/test/files/run/stringbuilder-drop.scala b/test/files/run/stringbuilder-drop.scala
index a9e5a71762..422fb2bc7c 100644
--- a/test/files/run/stringbuilder-drop.scala
+++ b/test/files/run/stringbuilder-drop.scala
@@ -1,7 +1,7 @@
object Test {
def main(args: Array[String]): Unit = {
- val s = (new StringBuilder ++= "hello world") dropRight 1 toString;
- assert(s == "hello worl")
+ val s = (new StringBuilder ++= "hello world") dropRight 1
+ assert("" + s == "hello worl")
}
}
diff --git a/test/files/run/stringbuilder.scala b/test/files/run/stringbuilder.scala
index ef85fc02a6..a88ea38b92 100644
--- a/test/files/run/stringbuilder.scala
+++ b/test/files/run/stringbuilder.scala
@@ -1,3 +1,6 @@
+
+import scala.language.reflectiveCalls
+
object Test extends App {
val str = "ABCDEFGHIJKLMABCDEFGHIJKLM"
val surrogateStr = "an old Turkic letter: \uD803\uDC22"
@@ -33,8 +36,8 @@ object Test extends App {
sameAnswers(_.lastIndexOf("KLM", 22))
// testing that the "reverse" implementation avoids reversing surrogate pairs
- val jsb = new JavaStringBuilder(surrogateStr) reverse
- val ssb = new ScalaStringBuilder(surrogateStr) reverseContents ;
+ val jsb = new JavaStringBuilder(surrogateStr).reverse
+ val ssb = new ScalaStringBuilder(surrogateStr).reverseContents
assert(jsb.toString == ssb.toString)
}
diff --git a/test/files/run/stringinterpolation_macro-run.scala b/test/files/run/stringinterpolation_macro-run.scala
index 9c59c334f8..1138cd0860 100644
--- a/test/files/run/stringinterpolation_macro-run.scala
+++ b/test/files/run/stringinterpolation_macro-run.scala
@@ -1,3 +1,6 @@
+/*
+ * filter: inliner warning\(s\); re-run with -Yinline-warnings for details
+ */
object Test extends App {
// 'b' / 'B' (category: general)
diff --git a/test/files/run/structural.scala b/test/files/run/structural.scala
index 3a703d2cf1..2788717ec2 100644
--- a/test/files/run/structural.scala
+++ b/test/files/run/structural.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ reflectiveCalls }
+
object test1 {
val o1 = new Object { override def toString = "ohone" }
@@ -164,7 +167,7 @@ object test3 {
}
catch {
case e: Exc => println("caught")
- case e => println(e)
+ case e: Throwable => println(e)
}
m(Rec)
diff --git a/test/files/run/synchronized.check b/test/files/run/synchronized.check
index dd9f4ef424..6e99739633 100644
--- a/test/files/run/synchronized.check
+++ b/test/files/run/synchronized.check
@@ -1,3 +1,4 @@
+warning: there were 14 inliner warning(s); re-run with -Yinline-warnings for details
.|. c1.f1: OK
.|. c1.fi: OK
.|... c1.fv: OK
diff --git a/test/files/run/synchronized.flags b/test/files/run/synchronized.flags
index 1182725e86..49d036a887 100644
--- a/test/files/run/synchronized.flags
+++ b/test/files/run/synchronized.flags
@@ -1 +1 @@
--optimize \ No newline at end of file
+-optimize
diff --git a/test/files/run/t0325.scala b/test/files/run/t0325.scala
index 92331ab05f..048303206c 100644
--- a/test/files/run/t0325.scala
+++ b/test/files/run/t0325.scala
@@ -24,7 +24,7 @@ object Test {
else
println(ret)
} catch {
- case e@_ => println(which + " failed with " + e.getClass)
+ case e: Throwable => println(which + " failed with " + e.getClass)
}
}
diff --git a/test/files/run/t0421-old.scala b/test/files/run/t0421-old.scala
index 8d51013924..9b88b4789b 100644
--- a/test/files/run/t0421-old.scala
+++ b/test/files/run/t0421-old.scala
@@ -1,4 +1,6 @@
// ticket #421
+
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
def transpose[A: ClassManifest](xss: Array[Array[A]]) = {
diff --git a/test/files/run/t0432.scala b/test/files/run/t0432.scala
index 8ba9015d81..b860a0874f 100644
--- a/test/files/run/t0432.scala
+++ b/test/files/run/t0432.scala
@@ -1,3 +1,6 @@
+
+import scala.language.reflectiveCalls
+
object Test {
type valueType = { def value: this.type }
diff --git a/test/files/run/t0528.scala b/test/files/run/t0528.scala
index a76f602ed3..68a9975173 100644
--- a/test/files/run/t0528.scala
+++ b/test/files/run/t0528.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ existentials }
trait Sequ[A] {
def toArray: Array[T forSome {type T <: A}]
}
diff --git a/test/files/run/t0677-old.scala b/test/files/run/t0677-old.scala
index 6c8a3a7e99..c0f1abae53 100644
--- a/test/files/run/t0677-old.scala
+++ b/test/files/run/t0677-old.scala
@@ -1,3 +1,6 @@
+
+
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
class X[T: ClassManifest] {
val a = Array.ofDim[T](3, 4)
diff --git a/test/files/run/t1005.scala b/test/files/run/t1005.scala
index 60129bcc51..575ec43565 100644
--- a/test/files/run/t1005.scala
+++ b/test/files/run/t1005.scala
@@ -1,19 +1,20 @@
+import scala.language.postfixOps
object Test
{
class Foo[T](x : Array[AnyRef]) { def bar = x.asInstanceOf[Array[T]] }
class Bar[T](x : Array[T]) { def bar = x.asInstanceOf[Array[AnyRef]] }
object FromMono{
- def main(args : Array[String]) = (new Foo[AnyRef](Array[AnyRef]("Halp!"))).bar
+ def mainer(args : Array[String]) = (new Foo[AnyRef](Array[AnyRef]("Halp!"))).bar
}
object FromPoly{
- def main(args : Array[String]) = (new Bar[AnyRef](Array[AnyRef]("Halp!"))).bar
+ def mainer(args : Array[String]) = (new Bar[AnyRef](Array[AnyRef]("Halp!"))).bar
}
def main(args: Array[String]): Unit = {
- println(FromMono main null mkString)
- println(FromPoly main null mkString)
+ println(FromMono mainer null mkString)
+ println(FromPoly mainer null mkString)
}
}
diff --git a/test/files/run/t1110.scala b/test/files/run/t1110.scala
index 824643868c..81917789c8 100644
--- a/test/files/run/t1110.scala
+++ b/test/files/run/t1110.scala
@@ -1,8 +1,12 @@
+
+
+import scala.language.{ reflectiveCalls }
+
class Stuff {
def zoop(p: Any{def &(q: Int): Int}) = p & 7
def floop = new { def & = "Hello" }
- assert((floop &) == "Hello")
+ assert((floop.&) == "Hello")
assert(zoop(10) == 2)
}
diff --git a/test/files/run/t1141.scala b/test/files/run/t1141.scala
index ee4f2e7fd2..b907b4798f 100644
--- a/test/files/run/t1141.scala
+++ b/test/files/run/t1141.scala
@@ -1,3 +1,7 @@
+
+
+import scala.language.reflectiveCalls
+
object Test extends App {
val foo = new {
def apply(args : String*) = args foreach println
diff --git a/test/files/run/t1195-new.scala b/test/files/run/t1195-new.scala
index 0f62b140c9..4f068c7d42 100644
--- a/test/files/run/t1195-new.scala
+++ b/test/files/run/t1195-new.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ existentials }
import scala.reflect.runtime.universe._
object Test {
@@ -25,4 +27,4 @@ class A1[T] {
class B1[U] {
def f = { case class D(x: Int) extends A1[String] ; new D(5) }
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/t1195-old.scala b/test/files/run/t1195-old.scala
index b46a3b70f5..f80734c228 100644
--- a/test/files/run/t1195-old.scala
+++ b/test/files/run/t1195-old.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ existentials }
+
object Test {
def f() = { case class Bar(x: Int); Bar }
def g() = { case class Bar(x: Int); Bar(5) }
diff --git a/test/files/run/t1368.check b/test/files/run/t1368.check
new file mode 100644
index 0000000000..581e8a4039
--- /dev/null
+++ b/test/files/run/t1368.check
@@ -0,0 +1,3 @@
+t1368.scala:7: warning: Reference to uninitialized value blurp
+ def go3 = (new AnyRef with Happy with Sad { override val status = blurp ; val blurp = "happysad" }).status
+ ^
diff --git a/test/files/run/t1427.check b/test/files/run/t1427.check
new file mode 100644
index 0000000000..11a3d2f4a9
--- /dev/null
+++ b/test/files/run/t1427.check
@@ -0,0 +1,3 @@
+t1427.scala:6: warning: abstract type X in type pattern Bob[_[_] <: Any] is unchecked since it is eliminated by erasure
+ case x: (Bob[X] forSome { type X[_] }) => true
+ ^
diff --git a/test/files/run/t1427.scala b/test/files/run/t1427.scala
index 21bd71ffef..eeb2603c26 100644
--- a/test/files/run/t1427.scala
+++ b/test/files/run/t1427.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ higherKinds }
+
class Bob[K[_]] {
def foo(other: Any) = other match {
case x: (Bob[X] forSome { type X[_] }) => true
diff --git a/test/files/run/t1500.scala b/test/files/run/t1500.scala
index 6d2e7ee05f..75a6e31cdf 100644
--- a/test/files/run/t1500.scala
+++ b/test/files/run/t1500.scala
@@ -16,7 +16,7 @@ object Test {
</code>.text
- def main(args: Array[String]) = {
+ def main(args: Array[String]) {
val settings = new Settings()
settings.classpath.value = System.getProperty("java.class.path")
diff --git a/test/files/run/t1501.scala b/test/files/run/t1501.scala
index a2f7bb3a65..71ad0aeb5c 100644
--- a/test/files/run/t1501.scala
+++ b/test/files/run/t1501.scala
@@ -27,7 +27,7 @@ object Test {
</code>.text
- def main(args: Array[String]) = {
+ def main(args: Array[String]) {
val settings = new Settings()
settings.classpath.value = System.getProperty("java.class.path")
val tool = new interpreter.IMain(settings)
diff --git a/test/files/run/t153.scala b/test/files/run/t153.scala
index 82492fdbe6..3fdb423865 100644
--- a/test/files/run/t153.scala
+++ b/test/files/run/t153.scala
@@ -1,5 +1,5 @@
object Test extends App {
def powers(x: Int) = if ((x&(x-1))==0) Some(x) else None
val res = (Stream.range(1, 500000) flatMap powers).reverse
- println(res take 42 force)
+ println((res take 42).force)
}
diff --git a/test/files/run/t1766.scala b/test/files/run/t1766.scala
index 2afd883755..7d12451092 100644
--- a/test/files/run/t1766.scala
+++ b/test/files/run/t1766.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ reflectiveCalls }
+
object Test extends App {
class C(s: String) {
diff --git a/test/files/run/t2106.check b/test/files/run/t2106.check
new file mode 100644
index 0000000000..b14e9d1c41
--- /dev/null
+++ b/test/files/run/t2106.check
@@ -0,0 +1,3 @@
+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
+ ^
diff --git a/test/files/run/t2106.flags b/test/files/run/t2106.flags
index eb4d19bcb9..00d3643fd4 100644
--- a/test/files/run/t2106.flags
+++ b/test/files/run/t2106.flags
@@ -1 +1 @@
--optimise \ No newline at end of file
+-optimise -Yinline-warnings
diff --git a/test/files/run/t2106.scala b/test/files/run/t2106.scala
index e8124dabab..55b89da805 100644
--- a/test/files/run/t2106.scala
+++ b/test/files/run/t2106.scala
@@ -4,5 +4,5 @@ class A extends Cloneable {
object Test {
val x = new A
- def main(args: Array[String]) = x.foo
+ def main(args: Array[String]): Unit = x.foo
}
diff --git a/test/files/run/t2308a.scala b/test/files/run/t2308a.scala
index abb568064a..200dee1ef6 100644
--- a/test/files/run/t2308a.scala
+++ b/test/files/run/t2308a.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ higherKinds }
object Test {
trait T[M[_]]
diff --git a/test/files/run/t2318.scala b/test/files/run/t2318.scala
index 47d083eb9d..d7fd9fdd41 100644
--- a/test/files/run/t2318.scala
+++ b/test/files/run/t2318.scala
@@ -1,5 +1,7 @@
import java.security._
+import scala.language.{ reflectiveCalls }
+
object Test {
trait Bar { def bar: Unit }
diff --git a/test/files/run/t2333.scala b/test/files/run/t2333.scala
index da43386572..7dc7a92df2 100644
--- a/test/files/run/t2333.scala
+++ b/test/files/run/t2333.scala
@@ -1,7 +1,7 @@
class A {
def whatever() {
lazy val a = 1
- lazy val b = try { 2 } catch { case _ => 0 }
+ lazy val b = try { 2 } catch { case _: Throwable => 0 }
a
b
@@ -13,4 +13,4 @@ object Test {
val a = new A
a.whatever
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/t2417.scala b/test/files/run/t2417.scala
index 2d0bc2d405..18b6c326b5 100644
--- a/test/files/run/t2417.scala
+++ b/test/files/run/t2417.scala
@@ -8,7 +8,7 @@ object Test {
try {
block
} catch {
- case x => failure = x
+ case x: Throwable => failure = x
}
}
})
diff --git a/test/files/run/t2514.scala b/test/files/run/t2514.scala
index 21c4afb472..cf5fa0ea02 100644
--- a/test/files/run/t2514.scala
+++ b/test/files/run/t2514.scala
@@ -1,3 +1,7 @@
+
+
+import scala.language.{ implicitConversions, postfixOps, reflectiveCalls }
+
object Test
{
implicit def x[A](a: A) = new { def xx = a }
@@ -12,4 +16,4 @@ object Test
assert(r5 == 24)
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/t2594_tcpoly.scala b/test/files/run/t2594_tcpoly.scala
index e759ca8b0f..a9d26693f9 100644
--- a/test/files/run/t2594_tcpoly.scala
+++ b/test/files/run/t2594_tcpoly.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ higherKinds }
+
trait Monad[M[_]] {
def foo[A](a: M[A]): M[A]
}
@@ -15,4 +18,4 @@ object Test {
}
def main(as: Array[String]) { BarMonad[Int] foo (new Bar[Int, Int]) }
-} \ No newline at end of file
+}
diff --git a/test/files/run/t2636.scala b/test/files/run/t2636.scala
index 3271f79ffc..6ae2248a26 100644
--- a/test/files/run/t2636.scala
+++ b/test/files/run/t2636.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ reflectiveCalls }
+
object Test
{
type Foo = { def update(x: Int, value: String): Unit }
@@ -32,4 +35,4 @@ object Test
assert(arrApply(arr, 1) == "o")
assert(arrApply(new { def apply(x: Int) = "tom" }, -100) == "tom")
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/t3038d.scala b/test/files/run/t3038d.scala
index 9550165235..56cfcdb174 100644
--- a/test/files/run/t3038d.scala
+++ b/test/files/run/t3038d.scala
@@ -21,7 +21,7 @@ class Bar extends Foo with Serializable {
def size = a
@transient var second: Any = null
- def checkMember { first }
+ def checkMember { if (first == null) print("") }
private def writeObject(out: java.io.ObjectOutputStream) {
serializeTo(out)
diff --git a/test/files/run/t3050.scala b/test/files/run/t3050.scala
index ca9d91e191..65b2674b69 100644
--- a/test/files/run/t3050.scala
+++ b/test/files/run/t3050.scala
@@ -2,7 +2,7 @@ object Test {
def main(args: Array[String]): Unit = {
val x =
try { ("": Any) match { case List(_*) => true } }
- catch { case _ => false }
+ catch { case _: Throwable => false }
assert(!x)
}
diff --git a/test/files/run/t3175.scala b/test/files/run/t3175.scala
index aff2e67d0d..5c6daead38 100644
--- a/test/files/run/t3175.scala
+++ b/test/files/run/t3175.scala
@@ -1,6 +1,9 @@
/** A bit down the road this test will examine
* the bytecode.
*/
+
+import scala.language.reflectiveCalls
+
object Test {
def len(x:{ def length: Int }) = x.length
def f1(x:{ def apply(x: Int): Long }) = x(0)
diff --git a/test/files/run/t3232.scala b/test/files/run/t3232.scala
index feff7e7089..4c6cb1e35c 100644
--- a/test/files/run/t3232.scala
+++ b/test/files/run/t3232.scala
@@ -15,7 +15,7 @@ object Test {
// exception required
List(e1, e2) foreach { f =>
try { f() ; assert(false) }
- catch { case _ => () }
+ catch { case _: Throwable => () }
}
}
}
diff --git a/test/files/run/t3242.scala b/test/files/run/t3242.scala
index f8defaa5cd..0a449d51f9 100644
--- a/test/files/run/t3242.scala
+++ b/test/files/run/t3242.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ higherKinds }
+
object Test {
def benchmarkA(num: Int) {
diff --git a/test/files/run/t3361.scala b/test/files/run/t3361.scala
index 7fbc6777f2..f739d17b86 100644
--- a/test/files/run/t3361.scala
+++ b/test/files/run/t3361.scala
@@ -57,7 +57,7 @@ object Test extends App {
DoubleLinkedList().insert(ten)
} catch {
case _: IllegalArgumentException => require(true)
- case _ => require(false)
+ case _: Throwable => require(false)
}
val zero = DoubleLinkedList(0)
zero.insert(ten)
@@ -87,7 +87,7 @@ object Test extends App {
DoubleLinkedList().append(ten)
} catch {
case _: IllegalArgumentException => require(true)
- case _ => require(false)
+ case _: Throwable => require(false)
}
val zero = DoubleLinkedList(0)
zero.append(ten)
diff --git a/test/files/run/t3425.check b/test/files/run/t3425.check
new file mode 100644
index 0000000000..5be779bd74
--- /dev/null
+++ b/test/files/run/t3425.check
@@ -0,0 +1,4 @@
+123
+456
+789
+789
diff --git a/test/files/run/t3425.scala b/test/files/run/t3425.scala
new file mode 100644
index 0000000000..c61d1071a5
--- /dev/null
+++ b/test/files/run/t3425.scala
@@ -0,0 +1,41 @@
+import scala.language.reflectiveCalls
+object Other {
+ abstract class Foo {
+ type R1 <: { def x: Any }
+ type R2 <: R1 { def x: Int }
+
+ def f(x: R2) = x.x
+ }
+
+ abstract class Bar {
+ trait R0 { def x: Any }
+ type R1 <: R0 { def x: AnyVal }
+ type R2 <: R1 { def x: Int }
+
+ def f(x: R2) = x.x
+ }
+}
+object Test {
+ trait A
+ trait B
+ def x(a: (A { val y: Int }) with B { val y: Int }) = a.y
+
+ class C extends A with B {
+ val y = 456
+ }
+
+ class Bippy { def x: Int = 789 }
+
+ def main(args: Array[String]): Unit = {
+ println(x(new A with B { val y = 123 }))
+ println(x(new C))
+
+ { val foo = new Other.Foo { type R1 = Bippy ; type R2 = Bippy }
+ println(foo.f(new Bippy))
+ }
+ { val bar = new Other.Bar { type R1 = Bippy with R0 ; type R2 = R1 }
+ println(bar.f(new Bippy with bar.R0))
+ }
+ }
+}
+
diff --git a/test/files/run/t3425b.check b/test/files/run/t3425b.check
new file mode 100644
index 0000000000..5d34c43de3
--- /dev/null
+++ b/test/files/run/t3425b.check
@@ -0,0 +1,152 @@
+==== Direct Calls ====
+
+Any{val y: P} with C{val y: P}
+Any{val y: P} with C{val y: Q}
+Any{val y: P} with C{val y: R forSome { type R <: P with Q }}
+Any{val y: Q} with C{val y: P}
+Any{val y: Q} with C{val y: Q}
+Any{val y: Q} with C{val y: R forSome { type R <: P with Q }}
+Any{val y: R forSome { type R <: P with Q }} with C{val y: P}
+Any{val y: R forSome { type R <: P with Q }} with C{val y: Q}
+Any{val y: R forSome { type R <: P with Q }} with C{val y: R forSome { type R <: P with Q }}
+A{val y: P} with C{val y: P}
+A{val y: P} with C{val y: Q}
+A{val y: P} with C{val y: R forSome { type R <: P with Q }}
+A{val y: Q} with C{val y: P}
+A{val y: Q} with C{val y: Q}
+A{val y: Q} with C{val y: R forSome { type R <: P with Q }}
+A{val y: R forSome { type R <: P with Q }} with C{val y: P}
+A{val y: R forSome { type R <: P with Q }} with C{val y: Q}
+A{val y: R forSome { type R <: P with Q }} with C{val y: R forSome { type R <: P with Q }}
+B{val y: P} with C{val y: P}
+B{val y: P} with C{val y: Q}
+B{val y: P} with C{val y: R forSome { type R <: P with Q }}
+B{val y: Q} with C{val y: P}
+B{val y: Q} with C{val y: Q}
+B{val y: Q} with C{val y: R forSome { type R <: P with Q }}
+B{val y: R forSome { type R <: P with Q }} with C{val y: P}
+B{val y: R forSome { type R <: P with Q }} with C{val y: Q}
+B{val y: R forSome { type R <: P with Q }} with C{val y: R forSome { type R <: P with Q }}
+C{val y: P} with C{val y: P}
+C{val y: P} with C{val y: Q}
+C{val y: P} with C{val y: R forSome { type R <: P with Q }}
+C{val y: Q} with C{val y: P}
+C{val y: Q} with C{val y: Q}
+C{val y: Q} with C{val y: R forSome { type R <: P with Q }}
+C{val y: R forSome { type R <: P with Q }} with C{val y: P}
+C{val y: R forSome { type R <: P with Q }} with C{val y: Q}
+C{val y: R forSome { type R <: P with Q }} with C{val y: R forSome { type R <: P with Q }}
+
+
+==== Reflective Calls ====
+
+Any{val y: P} with Any{val y: P}
+Any{val y: P} with Any{val y: Q}
+Any{val y: P} with Any{val y: R forSome { type R <: P with Q }}
+Any{val y: P} with A{val y: P}
+Any{val y: P} with A{val y: Q}
+Any{val y: P} with A{val y: R forSome { type R <: P with Q }}
+Any{val y: P} with B{val y: P}
+Any{val y: P} with B{val y: Q}
+Any{val y: P} with B{val y: R forSome { type R <: P with Q }}
+Any{val y: Q} with Any{val y: P}
+Any{val y: Q} with Any{val y: Q}
+Any{val y: Q} with Any{val y: R forSome { type R <: P with Q }}
+Any{val y: Q} with A{val y: P}
+Any{val y: Q} with A{val y: Q}
+Any{val y: Q} with A{val y: R forSome { type R <: P with Q }}
+Any{val y: Q} with B{val y: P}
+Any{val y: Q} with B{val y: Q}
+Any{val y: Q} with B{val y: R forSome { type R <: P with Q }}
+Any{val y: R forSome { type R <: P with Q }} with Any{val y: P}
+Any{val y: R forSome { type R <: P with Q }} with Any{val y: Q}
+Any{val y: R forSome { type R <: P with Q }} with Any{val y: R forSome { type R <: P with Q }}
+Any{val y: R forSome { type R <: P with Q }} with A{val y: P}
+Any{val y: R forSome { type R <: P with Q }} with A{val y: Q}
+Any{val y: R forSome { type R <: P with Q }} with A{val y: R forSome { type R <: P with Q }}
+Any{val y: R forSome { type R <: P with Q }} with B{val y: P}
+Any{val y: R forSome { type R <: P with Q }} with B{val y: Q}
+Any{val y: R forSome { type R <: P with Q }} with B{val y: R forSome { type R <: P with Q }}
+A{val y: P} with Any{val y: P}
+A{val y: P} with Any{val y: Q}
+A{val y: P} with Any{val y: R forSome { type R <: P with Q }}
+A{val y: P} with A{val y: P}
+A{val y: P} with A{val y: Q}
+A{val y: P} with A{val y: R forSome { type R <: P with Q }}
+A{val y: P} with B{val y: P}
+A{val y: P} with B{val y: Q}
+A{val y: P} with B{val y: R forSome { type R <: P with Q }}
+A{val y: Q} with Any{val y: P}
+A{val y: Q} with Any{val y: Q}
+A{val y: Q} with Any{val y: R forSome { type R <: P with Q }}
+A{val y: Q} with A{val y: P}
+A{val y: Q} with A{val y: Q}
+A{val y: Q} with A{val y: R forSome { type R <: P with Q }}
+A{val y: Q} with B{val y: P}
+A{val y: Q} with B{val y: Q}
+A{val y: Q} with B{val y: R forSome { type R <: P with Q }}
+A{val y: R forSome { type R <: P with Q }} with Any{val y: P}
+A{val y: R forSome { type R <: P with Q }} with Any{val y: Q}
+A{val y: R forSome { type R <: P with Q }} with Any{val y: R forSome { type R <: P with Q }}
+A{val y: R forSome { type R <: P with Q }} with A{val y: P}
+A{val y: R forSome { type R <: P with Q }} with A{val y: Q}
+A{val y: R forSome { type R <: P with Q }} with A{val y: R forSome { type R <: P with Q }}
+A{val y: R forSome { type R <: P with Q }} with B{val y: P}
+A{val y: R forSome { type R <: P with Q }} with B{val y: Q}
+A{val y: R forSome { type R <: P with Q }} with B{val y: R forSome { type R <: P with Q }}
+B{val y: P} with Any{val y: P}
+B{val y: P} with Any{val y: Q}
+B{val y: P} with Any{val y: R forSome { type R <: P with Q }}
+B{val y: P} with A{val y: P}
+B{val y: P} with A{val y: Q}
+B{val y: P} with A{val y: R forSome { type R <: P with Q }}
+B{val y: P} with B{val y: P}
+B{val y: P} with B{val y: Q}
+B{val y: P} with B{val y: R forSome { type R <: P with Q }}
+B{val y: Q} with Any{val y: P}
+B{val y: Q} with Any{val y: Q}
+B{val y: Q} with Any{val y: R forSome { type R <: P with Q }}
+B{val y: Q} with A{val y: P}
+B{val y: Q} with A{val y: Q}
+B{val y: Q} with A{val y: R forSome { type R <: P with Q }}
+B{val y: Q} with B{val y: P}
+B{val y: Q} with B{val y: Q}
+B{val y: Q} with B{val y: R forSome { type R <: P with Q }}
+B{val y: R forSome { type R <: P with Q }} with Any{val y: P}
+B{val y: R forSome { type R <: P with Q }} with Any{val y: Q}
+B{val y: R forSome { type R <: P with Q }} with Any{val y: R forSome { type R <: P with Q }}
+B{val y: R forSome { type R <: P with Q }} with A{val y: P}
+B{val y: R forSome { type R <: P with Q }} with A{val y: Q}
+B{val y: R forSome { type R <: P with Q }} with A{val y: R forSome { type R <: P with Q }}
+B{val y: R forSome { type R <: P with Q }} with B{val y: P}
+B{val y: R forSome { type R <: P with Q }} with B{val y: Q}
+B{val y: R forSome { type R <: P with Q }} with B{val y: R forSome { type R <: P with Q }}
+C{val y: P} with Any{val y: P}
+C{val y: P} with Any{val y: Q}
+C{val y: P} with Any{val y: R forSome { type R <: P with Q }}
+C{val y: P} with A{val y: P}
+C{val y: P} with A{val y: Q}
+C{val y: P} with A{val y: R forSome { type R <: P with Q }}
+C{val y: P} with B{val y: P}
+C{val y: P} with B{val y: Q}
+C{val y: P} with B{val y: R forSome { type R <: P with Q }}
+C{val y: Q} with Any{val y: P}
+C{val y: Q} with Any{val y: Q}
+C{val y: Q} with Any{val y: R forSome { type R <: P with Q }}
+C{val y: Q} with A{val y: P}
+C{val y: Q} with A{val y: Q}
+C{val y: Q} with A{val y: R forSome { type R <: P with Q }}
+C{val y: Q} with B{val y: P}
+C{val y: Q} with B{val y: Q}
+C{val y: Q} with B{val y: R forSome { type R <: P with Q }}
+C{val y: R forSome { type R <: P with Q }} with Any{val y: P}
+C{val y: R forSome { type R <: P with Q }} with Any{val y: Q}
+C{val y: R forSome { type R <: P with Q }} with Any{val y: R forSome { type R <: P with Q }}
+C{val y: R forSome { type R <: P with Q }} with A{val y: P}
+C{val y: R forSome { type R <: P with Q }} with A{val y: Q}
+C{val y: R forSome { type R <: P with Q }} with A{val y: R forSome { type R <: P with Q }}
+C{val y: R forSome { type R <: P with Q }} with B{val y: P}
+C{val y: R forSome { type R <: P with Q }} with B{val y: Q}
+C{val y: R forSome { type R <: P with Q }} with B{val y: R forSome { type R <: P with Q }}
+
+
diff --git a/test/files/run/t3425b/Base_1.scala b/test/files/run/t3425b/Base_1.scala
new file mode 100644
index 0000000000..02e108b320
--- /dev/null
+++ b/test/files/run/t3425b/Base_1.scala
@@ -0,0 +1,89 @@
+trait P { def reflected: Boolean }
+trait Q { def reflected: Boolean }
+class PQ(val reflected: Boolean) extends P with Q { }
+
+trait A
+trait B
+trait C { val y: P }
+class ABC extends A with B with C {
+ private def reflected = (
+ Thread.currentThread.getStackTrace
+ takeWhile (_.getMethodName != "main")
+ exists (_.toString contains "java.lang.reflect.")
+ )
+ lazy val y: PQ = new PQ(reflected)
+}
+
+/*** The source used to generate the second file
+ Not otherwise used in the test except that compiling
+ it helps make sure it still compiles.
+
+****/
+
+object Gen {
+ case class Tp(outer: String, elem: String) {
+ override def toString = s"$outer { val y: $elem }"
+ }
+ case class Pair(tp1: Tp, tp2: Tp) {
+ def expr = s"((new ABC): $tp)"
+ def tp = s"($tp1) with ($tp2)"
+ }
+ val traits = Vector("Any", "A", "B", "C") map ("%6s" format _)
+ val types = Vector("P", "Q", "R forSome { type R <: P with Q }")
+ val allTypes = for (c <- traits ; tp <- types) yield Tp(c, tp)
+ val pairs = allTypes flatMap (t1 => allTypes map (t2 => Pair(t1, t2)))
+ val indices = pairs.indices
+
+ def aliases(idx: Int) = {
+ val p = pairs(idx)
+ import p._
+ List(
+ s"type R1_$idx = $tp",
+ s"type R2_$idx = R1_$idx { val y: (${tp1.elem}) with (${tp2.elem}) }"
+ )
+ }
+
+ def mkMethodContent(pre: String)(f: Int => String) =
+ indices map (i => s"def $pre$i${f(i)}") mkString "\n "
+
+ def content = List(
+ indices flatMap aliases mkString "\n ",
+ mkMethodContent("f")(i => s" = { val x = ${pairs(i).expr} ; x.y.reflected -> whatis(x).toString }"),
+ mkMethodContent("g")(i => s"""(x: R1_$i) = x.y"""),
+ mkMethodContent("h")(i => s"""(x: R2_$i) = x.y""")
+ ) mkString "\n "
+
+ def fCalls = indices map ("f" + _) mkString ("\n ", ",\n ", "\n ")
+
+ def main(args: Array[String]): Unit = {
+ // One cannot attain proper appreciation for the inadequacies of
+ // string interpolation without becoming one with the newline.
+ val nl = "\\n"
+
+ println(s"""
+ |import scala.reflect.runtime.universe._
+ |import scala.language._
+ |
+ |object Test {
+ | def whatis[T: TypeTag](x: T) = typeOf[T]
+ | def sshow(label: String, xs: Traversable[Any]) {
+ | println("==== " + label + " ====$nl")
+ | xs.toList.map("" + _).sorted foreach println
+ | println("$nl")
+ | }
+ |
+ | $content
+ | lazy val fcalls = List($fCalls)
+ |
+ | def main(args: Array[String]) {
+ | sshow("Direct Calls", fcalls collect { case (false, n) => n })
+ | sshow("Reflective Calls", fcalls collect { case (true, n) => n })
+ | // For a good time try printing this - have to fix bugs in
+ | // reflection before that's going to be a good idea
+ | // println(typeOf[Test.type].typeSymbol.asClass.typeSignature)
+ | }
+ |}
+ """.stripMargin.trim
+ )
+ }
+}
diff --git a/test/files/run/t3425b/Generated_2.scala b/test/files/run/t3425b/Generated_2.scala
new file mode 100644
index 0000000000..f1699636f6
--- /dev/null
+++ b/test/files/run/t3425b/Generated_2.scala
@@ -0,0 +1,886 @@
+import scala.reflect.runtime.universe._
+import scala.language._
+
+object Test {
+ def whatis[T: TypeTag](x: T) = typeOf[T]
+ def sshow(label: String, xs: Traversable[Any]) {
+ println("==== " + label + " ====\n")
+ xs.toList.map("" + _).sorted foreach println
+ println("\n")
+ }
+
+ type R1_0 = ( Any { val y: P }) with ( Any { val y: P })
+ type R2_0 = R1_0 { val y: (P) with (P) }
+ type R1_1 = ( Any { val y: P }) with ( Any { val y: Q })
+ type R2_1 = R1_1 { val y: (P) with (Q) }
+ type R1_2 = ( Any { val y: P }) with ( Any { val y: R forSome { type R <: P with Q } })
+ type R2_2 = R1_2 { val y: (P) with (R forSome { type R <: P with Q }) }
+ type R1_3 = ( Any { val y: P }) with ( A { val y: P })
+ type R2_3 = R1_3 { val y: (P) with (P) }
+ type R1_4 = ( Any { val y: P }) with ( A { val y: Q })
+ type R2_4 = R1_4 { val y: (P) with (Q) }
+ type R1_5 = ( Any { val y: P }) with ( A { val y: R forSome { type R <: P with Q } })
+ type R2_5 = R1_5 { val y: (P) with (R forSome { type R <: P with Q }) }
+ type R1_6 = ( Any { val y: P }) with ( B { val y: P })
+ type R2_6 = R1_6 { val y: (P) with (P) }
+ type R1_7 = ( Any { val y: P }) with ( B { val y: Q })
+ type R2_7 = R1_7 { val y: (P) with (Q) }
+ type R1_8 = ( Any { val y: P }) with ( B { val y: R forSome { type R <: P with Q } })
+ type R2_8 = R1_8 { val y: (P) with (R forSome { type R <: P with Q }) }
+ type R1_9 = ( Any { val y: P }) with ( C { val y: P })
+ type R2_9 = R1_9 { val y: (P) with (P) }
+ type R1_10 = ( Any { val y: P }) with ( C { val y: Q })
+ type R2_10 = R1_10 { val y: (P) with (Q) }
+ type R1_11 = ( Any { val y: P }) with ( C { val y: R forSome { type R <: P with Q } })
+ type R2_11 = R1_11 { val y: (P) with (R forSome { type R <: P with Q }) }
+ type R1_12 = ( Any { val y: Q }) with ( Any { val y: P })
+ type R2_12 = R1_12 { val y: (Q) with (P) }
+ type R1_13 = ( Any { val y: Q }) with ( Any { val y: Q })
+ type R2_13 = R1_13 { val y: (Q) with (Q) }
+ type R1_14 = ( Any { val y: Q }) with ( Any { val y: R forSome { type R <: P with Q } })
+ type R2_14 = R1_14 { val y: (Q) with (R forSome { type R <: P with Q }) }
+ type R1_15 = ( Any { val y: Q }) with ( A { val y: P })
+ type R2_15 = R1_15 { val y: (Q) with (P) }
+ type R1_16 = ( Any { val y: Q }) with ( A { val y: Q })
+ type R2_16 = R1_16 { val y: (Q) with (Q) }
+ type R1_17 = ( Any { val y: Q }) with ( A { val y: R forSome { type R <: P with Q } })
+ type R2_17 = R1_17 { val y: (Q) with (R forSome { type R <: P with Q }) }
+ type R1_18 = ( Any { val y: Q }) with ( B { val y: P })
+ type R2_18 = R1_18 { val y: (Q) with (P) }
+ type R1_19 = ( Any { val y: Q }) with ( B { val y: Q })
+ type R2_19 = R1_19 { val y: (Q) with (Q) }
+ type R1_20 = ( Any { val y: Q }) with ( B { val y: R forSome { type R <: P with Q } })
+ type R2_20 = R1_20 { val y: (Q) with (R forSome { type R <: P with Q }) }
+ type R1_21 = ( Any { val y: Q }) with ( C { val y: P })
+ type R2_21 = R1_21 { val y: (Q) with (P) }
+ type R1_22 = ( Any { val y: Q }) with ( C { val y: Q })
+ type R2_22 = R1_22 { val y: (Q) with (Q) }
+ type R1_23 = ( Any { val y: Q }) with ( C { val y: R forSome { type R <: P with Q } })
+ type R2_23 = R1_23 { val y: (Q) with (R forSome { type R <: P with Q }) }
+ type R1_24 = ( Any { val y: R forSome { type R <: P with Q } }) with ( Any { val y: P })
+ type R2_24 = R1_24 { val y: (R forSome { type R <: P with Q }) with (P) }
+ type R1_25 = ( Any { val y: R forSome { type R <: P with Q } }) with ( Any { val y: Q })
+ type R2_25 = R1_25 { val y: (R forSome { type R <: P with Q }) with (Q) }
+ type R1_26 = ( Any { val y: R forSome { type R <: P with Q } }) with ( Any { val y: R forSome { type R <: P with Q } })
+ type R2_26 = R1_26 { val y: (R forSome { type R <: P with Q }) with (R forSome { type R <: P with Q }) }
+ type R1_27 = ( Any { val y: R forSome { type R <: P with Q } }) with ( A { val y: P })
+ type R2_27 = R1_27 { val y: (R forSome { type R <: P with Q }) with (P) }
+ type R1_28 = ( Any { val y: R forSome { type R <: P with Q } }) with ( A { val y: Q })
+ type R2_28 = R1_28 { val y: (R forSome { type R <: P with Q }) with (Q) }
+ type R1_29 = ( Any { val y: R forSome { type R <: P with Q } }) with ( A { val y: R forSome { type R <: P with Q } })
+ type R2_29 = R1_29 { val y: (R forSome { type R <: P with Q }) with (R forSome { type R <: P with Q }) }
+ type R1_30 = ( Any { val y: R forSome { type R <: P with Q } }) with ( B { val y: P })
+ type R2_30 = R1_30 { val y: (R forSome { type R <: P with Q }) with (P) }
+ type R1_31 = ( Any { val y: R forSome { type R <: P with Q } }) with ( B { val y: Q })
+ type R2_31 = R1_31 { val y: (R forSome { type R <: P with Q }) with (Q) }
+ type R1_32 = ( Any { val y: R forSome { type R <: P with Q } }) with ( B { val y: R forSome { type R <: P with Q } })
+ type R2_32 = R1_32 { val y: (R forSome { type R <: P with Q }) with (R forSome { type R <: P with Q }) }
+ type R1_33 = ( Any { val y: R forSome { type R <: P with Q } }) with ( C { val y: P })
+ type R2_33 = R1_33 { val y: (R forSome { type R <: P with Q }) with (P) }
+ type R1_34 = ( Any { val y: R forSome { type R <: P with Q } }) with ( C { val y: Q })
+ type R2_34 = R1_34 { val y: (R forSome { type R <: P with Q }) with (Q) }
+ type R1_35 = ( Any { val y: R forSome { type R <: P with Q } }) with ( C { val y: R forSome { type R <: P with Q } })
+ type R2_35 = R1_35 { val y: (R forSome { type R <: P with Q }) with (R forSome { type R <: P with Q }) }
+ type R1_36 = ( A { val y: P }) with ( Any { val y: P })
+ type R2_36 = R1_36 { val y: (P) with (P) }
+ type R1_37 = ( A { val y: P }) with ( Any { val y: Q })
+ type R2_37 = R1_37 { val y: (P) with (Q) }
+ type R1_38 = ( A { val y: P }) with ( Any { val y: R forSome { type R <: P with Q } })
+ type R2_38 = R1_38 { val y: (P) with (R forSome { type R <: P with Q }) }
+ type R1_39 = ( A { val y: P }) with ( A { val y: P })
+ type R2_39 = R1_39 { val y: (P) with (P) }
+ type R1_40 = ( A { val y: P }) with ( A { val y: Q })
+ type R2_40 = R1_40 { val y: (P) with (Q) }
+ type R1_41 = ( A { val y: P }) with ( A { val y: R forSome { type R <: P with Q } })
+ type R2_41 = R1_41 { val y: (P) with (R forSome { type R <: P with Q }) }
+ type R1_42 = ( A { val y: P }) with ( B { val y: P })
+ type R2_42 = R1_42 { val y: (P) with (P) }
+ type R1_43 = ( A { val y: P }) with ( B { val y: Q })
+ type R2_43 = R1_43 { val y: (P) with (Q) }
+ type R1_44 = ( A { val y: P }) with ( B { val y: R forSome { type R <: P with Q } })
+ type R2_44 = R1_44 { val y: (P) with (R forSome { type R <: P with Q }) }
+ type R1_45 = ( A { val y: P }) with ( C { val y: P })
+ type R2_45 = R1_45 { val y: (P) with (P) }
+ type R1_46 = ( A { val y: P }) with ( C { val y: Q })
+ type R2_46 = R1_46 { val y: (P) with (Q) }
+ type R1_47 = ( A { val y: P }) with ( C { val y: R forSome { type R <: P with Q } })
+ type R2_47 = R1_47 { val y: (P) with (R forSome { type R <: P with Q }) }
+ type R1_48 = ( A { val y: Q }) with ( Any { val y: P })
+ type R2_48 = R1_48 { val y: (Q) with (P) }
+ type R1_49 = ( A { val y: Q }) with ( Any { val y: Q })
+ type R2_49 = R1_49 { val y: (Q) with (Q) }
+ type R1_50 = ( A { val y: Q }) with ( Any { val y: R forSome { type R <: P with Q } })
+ type R2_50 = R1_50 { val y: (Q) with (R forSome { type R <: P with Q }) }
+ type R1_51 = ( A { val y: Q }) with ( A { val y: P })
+ type R2_51 = R1_51 { val y: (Q) with (P) }
+ type R1_52 = ( A { val y: Q }) with ( A { val y: Q })
+ type R2_52 = R1_52 { val y: (Q) with (Q) }
+ type R1_53 = ( A { val y: Q }) with ( A { val y: R forSome { type R <: P with Q } })
+ type R2_53 = R1_53 { val y: (Q) with (R forSome { type R <: P with Q }) }
+ type R1_54 = ( A { val y: Q }) with ( B { val y: P })
+ type R2_54 = R1_54 { val y: (Q) with (P) }
+ type R1_55 = ( A { val y: Q }) with ( B { val y: Q })
+ type R2_55 = R1_55 { val y: (Q) with (Q) }
+ type R1_56 = ( A { val y: Q }) with ( B { val y: R forSome { type R <: P with Q } })
+ type R2_56 = R1_56 { val y: (Q) with (R forSome { type R <: P with Q }) }
+ type R1_57 = ( A { val y: Q }) with ( C { val y: P })
+ type R2_57 = R1_57 { val y: (Q) with (P) }
+ type R1_58 = ( A { val y: Q }) with ( C { val y: Q })
+ type R2_58 = R1_58 { val y: (Q) with (Q) }
+ type R1_59 = ( A { val y: Q }) with ( C { val y: R forSome { type R <: P with Q } })
+ type R2_59 = R1_59 { val y: (Q) with (R forSome { type R <: P with Q }) }
+ type R1_60 = ( A { val y: R forSome { type R <: P with Q } }) with ( Any { val y: P })
+ type R2_60 = R1_60 { val y: (R forSome { type R <: P with Q }) with (P) }
+ type R1_61 = ( A { val y: R forSome { type R <: P with Q } }) with ( Any { val y: Q })
+ type R2_61 = R1_61 { val y: (R forSome { type R <: P with Q }) with (Q) }
+ type R1_62 = ( A { val y: R forSome { type R <: P with Q } }) with ( Any { val y: R forSome { type R <: P with Q } })
+ type R2_62 = R1_62 { val y: (R forSome { type R <: P with Q }) with (R forSome { type R <: P with Q }) }
+ type R1_63 = ( A { val y: R forSome { type R <: P with Q } }) with ( A { val y: P })
+ type R2_63 = R1_63 { val y: (R forSome { type R <: P with Q }) with (P) }
+ type R1_64 = ( A { val y: R forSome { type R <: P with Q } }) with ( A { val y: Q })
+ type R2_64 = R1_64 { val y: (R forSome { type R <: P with Q }) with (Q) }
+ type R1_65 = ( A { val y: R forSome { type R <: P with Q } }) with ( A { val y: R forSome { type R <: P with Q } })
+ type R2_65 = R1_65 { val y: (R forSome { type R <: P with Q }) with (R forSome { type R <: P with Q }) }
+ type R1_66 = ( A { val y: R forSome { type R <: P with Q } }) with ( B { val y: P })
+ type R2_66 = R1_66 { val y: (R forSome { type R <: P with Q }) with (P) }
+ type R1_67 = ( A { val y: R forSome { type R <: P with Q } }) with ( B { val y: Q })
+ type R2_67 = R1_67 { val y: (R forSome { type R <: P with Q }) with (Q) }
+ type R1_68 = ( A { val y: R forSome { type R <: P with Q } }) with ( B { val y: R forSome { type R <: P with Q } })
+ type R2_68 = R1_68 { val y: (R forSome { type R <: P with Q }) with (R forSome { type R <: P with Q }) }
+ type R1_69 = ( A { val y: R forSome { type R <: P with Q } }) with ( C { val y: P })
+ type R2_69 = R1_69 { val y: (R forSome { type R <: P with Q }) with (P) }
+ type R1_70 = ( A { val y: R forSome { type R <: P with Q } }) with ( C { val y: Q })
+ type R2_70 = R1_70 { val y: (R forSome { type R <: P with Q }) with (Q) }
+ type R1_71 = ( A { val y: R forSome { type R <: P with Q } }) with ( C { val y: R forSome { type R <: P with Q } })
+ type R2_71 = R1_71 { val y: (R forSome { type R <: P with Q }) with (R forSome { type R <: P with Q }) }
+ type R1_72 = ( B { val y: P }) with ( Any { val y: P })
+ type R2_72 = R1_72 { val y: (P) with (P) }
+ type R1_73 = ( B { val y: P }) with ( Any { val y: Q })
+ type R2_73 = R1_73 { val y: (P) with (Q) }
+ type R1_74 = ( B { val y: P }) with ( Any { val y: R forSome { type R <: P with Q } })
+ type R2_74 = R1_74 { val y: (P) with (R forSome { type R <: P with Q }) }
+ type R1_75 = ( B { val y: P }) with ( A { val y: P })
+ type R2_75 = R1_75 { val y: (P) with (P) }
+ type R1_76 = ( B { val y: P }) with ( A { val y: Q })
+ type R2_76 = R1_76 { val y: (P) with (Q) }
+ type R1_77 = ( B { val y: P }) with ( A { val y: R forSome { type R <: P with Q } })
+ type R2_77 = R1_77 { val y: (P) with (R forSome { type R <: P with Q }) }
+ type R1_78 = ( B { val y: P }) with ( B { val y: P })
+ type R2_78 = R1_78 { val y: (P) with (P) }
+ type R1_79 = ( B { val y: P }) with ( B { val y: Q })
+ type R2_79 = R1_79 { val y: (P) with (Q) }
+ type R1_80 = ( B { val y: P }) with ( B { val y: R forSome { type R <: P with Q } })
+ type R2_80 = R1_80 { val y: (P) with (R forSome { type R <: P with Q }) }
+ type R1_81 = ( B { val y: P }) with ( C { val y: P })
+ type R2_81 = R1_81 { val y: (P) with (P) }
+ type R1_82 = ( B { val y: P }) with ( C { val y: Q })
+ type R2_82 = R1_82 { val y: (P) with (Q) }
+ type R1_83 = ( B { val y: P }) with ( C { val y: R forSome { type R <: P with Q } })
+ type R2_83 = R1_83 { val y: (P) with (R forSome { type R <: P with Q }) }
+ type R1_84 = ( B { val y: Q }) with ( Any { val y: P })
+ type R2_84 = R1_84 { val y: (Q) with (P) }
+ type R1_85 = ( B { val y: Q }) with ( Any { val y: Q })
+ type R2_85 = R1_85 { val y: (Q) with (Q) }
+ type R1_86 = ( B { val y: Q }) with ( Any { val y: R forSome { type R <: P with Q } })
+ type R2_86 = R1_86 { val y: (Q) with (R forSome { type R <: P with Q }) }
+ type R1_87 = ( B { val y: Q }) with ( A { val y: P })
+ type R2_87 = R1_87 { val y: (Q) with (P) }
+ type R1_88 = ( B { val y: Q }) with ( A { val y: Q })
+ type R2_88 = R1_88 { val y: (Q) with (Q) }
+ type R1_89 = ( B { val y: Q }) with ( A { val y: R forSome { type R <: P with Q } })
+ type R2_89 = R1_89 { val y: (Q) with (R forSome { type R <: P with Q }) }
+ type R1_90 = ( B { val y: Q }) with ( B { val y: P })
+ type R2_90 = R1_90 { val y: (Q) with (P) }
+ type R1_91 = ( B { val y: Q }) with ( B { val y: Q })
+ type R2_91 = R1_91 { val y: (Q) with (Q) }
+ type R1_92 = ( B { val y: Q }) with ( B { val y: R forSome { type R <: P with Q } })
+ type R2_92 = R1_92 { val y: (Q) with (R forSome { type R <: P with Q }) }
+ type R1_93 = ( B { val y: Q }) with ( C { val y: P })
+ type R2_93 = R1_93 { val y: (Q) with (P) }
+ type R1_94 = ( B { val y: Q }) with ( C { val y: Q })
+ type R2_94 = R1_94 { val y: (Q) with (Q) }
+ type R1_95 = ( B { val y: Q }) with ( C { val y: R forSome { type R <: P with Q } })
+ type R2_95 = R1_95 { val y: (Q) with (R forSome { type R <: P with Q }) }
+ type R1_96 = ( B { val y: R forSome { type R <: P with Q } }) with ( Any { val y: P })
+ type R2_96 = R1_96 { val y: (R forSome { type R <: P with Q }) with (P) }
+ type R1_97 = ( B { val y: R forSome { type R <: P with Q } }) with ( Any { val y: Q })
+ type R2_97 = R1_97 { val y: (R forSome { type R <: P with Q }) with (Q) }
+ type R1_98 = ( B { val y: R forSome { type R <: P with Q } }) with ( Any { val y: R forSome { type R <: P with Q } })
+ type R2_98 = R1_98 { val y: (R forSome { type R <: P with Q }) with (R forSome { type R <: P with Q }) }
+ type R1_99 = ( B { val y: R forSome { type R <: P with Q } }) with ( A { val y: P })
+ type R2_99 = R1_99 { val y: (R forSome { type R <: P with Q }) with (P) }
+ type R1_100 = ( B { val y: R forSome { type R <: P with Q } }) with ( A { val y: Q })
+ type R2_100 = R1_100 { val y: (R forSome { type R <: P with Q }) with (Q) }
+ type R1_101 = ( B { val y: R forSome { type R <: P with Q } }) with ( A { val y: R forSome { type R <: P with Q } })
+ type R2_101 = R1_101 { val y: (R forSome { type R <: P with Q }) with (R forSome { type R <: P with Q }) }
+ type R1_102 = ( B { val y: R forSome { type R <: P with Q } }) with ( B { val y: P })
+ type R2_102 = R1_102 { val y: (R forSome { type R <: P with Q }) with (P) }
+ type R1_103 = ( B { val y: R forSome { type R <: P with Q } }) with ( B { val y: Q })
+ type R2_103 = R1_103 { val y: (R forSome { type R <: P with Q }) with (Q) }
+ type R1_104 = ( B { val y: R forSome { type R <: P with Q } }) with ( B { val y: R forSome { type R <: P with Q } })
+ type R2_104 = R1_104 { val y: (R forSome { type R <: P with Q }) with (R forSome { type R <: P with Q }) }
+ type R1_105 = ( B { val y: R forSome { type R <: P with Q } }) with ( C { val y: P })
+ type R2_105 = R1_105 { val y: (R forSome { type R <: P with Q }) with (P) }
+ type R1_106 = ( B { val y: R forSome { type R <: P with Q } }) with ( C { val y: Q })
+ type R2_106 = R1_106 { val y: (R forSome { type R <: P with Q }) with (Q) }
+ type R1_107 = ( B { val y: R forSome { type R <: P with Q } }) with ( C { val y: R forSome { type R <: P with Q } })
+ type R2_107 = R1_107 { val y: (R forSome { type R <: P with Q }) with (R forSome { type R <: P with Q }) }
+ type R1_108 = ( C { val y: P }) with ( Any { val y: P })
+ type R2_108 = R1_108 { val y: (P) with (P) }
+ type R1_109 = ( C { val y: P }) with ( Any { val y: Q })
+ type R2_109 = R1_109 { val y: (P) with (Q) }
+ type R1_110 = ( C { val y: P }) with ( Any { val y: R forSome { type R <: P with Q } })
+ type R2_110 = R1_110 { val y: (P) with (R forSome { type R <: P with Q }) }
+ type R1_111 = ( C { val y: P }) with ( A { val y: P })
+ type R2_111 = R1_111 { val y: (P) with (P) }
+ type R1_112 = ( C { val y: P }) with ( A { val y: Q })
+ type R2_112 = R1_112 { val y: (P) with (Q) }
+ type R1_113 = ( C { val y: P }) with ( A { val y: R forSome { type R <: P with Q } })
+ type R2_113 = R1_113 { val y: (P) with (R forSome { type R <: P with Q }) }
+ type R1_114 = ( C { val y: P }) with ( B { val y: P })
+ type R2_114 = R1_114 { val y: (P) with (P) }
+ type R1_115 = ( C { val y: P }) with ( B { val y: Q })
+ type R2_115 = R1_115 { val y: (P) with (Q) }
+ type R1_116 = ( C { val y: P }) with ( B { val y: R forSome { type R <: P with Q } })
+ type R2_116 = R1_116 { val y: (P) with (R forSome { type R <: P with Q }) }
+ type R1_117 = ( C { val y: P }) with ( C { val y: P })
+ type R2_117 = R1_117 { val y: (P) with (P) }
+ type R1_118 = ( C { val y: P }) with ( C { val y: Q })
+ type R2_118 = R1_118 { val y: (P) with (Q) }
+ type R1_119 = ( C { val y: P }) with ( C { val y: R forSome { type R <: P with Q } })
+ type R2_119 = R1_119 { val y: (P) with (R forSome { type R <: P with Q }) }
+ type R1_120 = ( C { val y: Q }) with ( Any { val y: P })
+ type R2_120 = R1_120 { val y: (Q) with (P) }
+ type R1_121 = ( C { val y: Q }) with ( Any { val y: Q })
+ type R2_121 = R1_121 { val y: (Q) with (Q) }
+ type R1_122 = ( C { val y: Q }) with ( Any { val y: R forSome { type R <: P with Q } })
+ type R2_122 = R1_122 { val y: (Q) with (R forSome { type R <: P with Q }) }
+ type R1_123 = ( C { val y: Q }) with ( A { val y: P })
+ type R2_123 = R1_123 { val y: (Q) with (P) }
+ type R1_124 = ( C { val y: Q }) with ( A { val y: Q })
+ type R2_124 = R1_124 { val y: (Q) with (Q) }
+ type R1_125 = ( C { val y: Q }) with ( A { val y: R forSome { type R <: P with Q } })
+ type R2_125 = R1_125 { val y: (Q) with (R forSome { type R <: P with Q }) }
+ type R1_126 = ( C { val y: Q }) with ( B { val y: P })
+ type R2_126 = R1_126 { val y: (Q) with (P) }
+ type R1_127 = ( C { val y: Q }) with ( B { val y: Q })
+ type R2_127 = R1_127 { val y: (Q) with (Q) }
+ type R1_128 = ( C { val y: Q }) with ( B { val y: R forSome { type R <: P with Q } })
+ type R2_128 = R1_128 { val y: (Q) with (R forSome { type R <: P with Q }) }
+ type R1_129 = ( C { val y: Q }) with ( C { val y: P })
+ type R2_129 = R1_129 { val y: (Q) with (P) }
+ type R1_130 = ( C { val y: Q }) with ( C { val y: Q })
+ type R2_130 = R1_130 { val y: (Q) with (Q) }
+ type R1_131 = ( C { val y: Q }) with ( C { val y: R forSome { type R <: P with Q } })
+ type R2_131 = R1_131 { val y: (Q) with (R forSome { type R <: P with Q }) }
+ type R1_132 = ( C { val y: R forSome { type R <: P with Q } }) with ( Any { val y: P })
+ type R2_132 = R1_132 { val y: (R forSome { type R <: P with Q }) with (P) }
+ type R1_133 = ( C { val y: R forSome { type R <: P with Q } }) with ( Any { val y: Q })
+ type R2_133 = R1_133 { val y: (R forSome { type R <: P with Q }) with (Q) }
+ type R1_134 = ( C { val y: R forSome { type R <: P with Q } }) with ( Any { val y: R forSome { type R <: P with Q } })
+ type R2_134 = R1_134 { val y: (R forSome { type R <: P with Q }) with (R forSome { type R <: P with Q }) }
+ type R1_135 = ( C { val y: R forSome { type R <: P with Q } }) with ( A { val y: P })
+ type R2_135 = R1_135 { val y: (R forSome { type R <: P with Q }) with (P) }
+ type R1_136 = ( C { val y: R forSome { type R <: P with Q } }) with ( A { val y: Q })
+ type R2_136 = R1_136 { val y: (R forSome { type R <: P with Q }) with (Q) }
+ type R1_137 = ( C { val y: R forSome { type R <: P with Q } }) with ( A { val y: R forSome { type R <: P with Q } })
+ type R2_137 = R1_137 { val y: (R forSome { type R <: P with Q }) with (R forSome { type R <: P with Q }) }
+ type R1_138 = ( C { val y: R forSome { type R <: P with Q } }) with ( B { val y: P })
+ type R2_138 = R1_138 { val y: (R forSome { type R <: P with Q }) with (P) }
+ type R1_139 = ( C { val y: R forSome { type R <: P with Q } }) with ( B { val y: Q })
+ type R2_139 = R1_139 { val y: (R forSome { type R <: P with Q }) with (Q) }
+ type R1_140 = ( C { val y: R forSome { type R <: P with Q } }) with ( B { val y: R forSome { type R <: P with Q } })
+ type R2_140 = R1_140 { val y: (R forSome { type R <: P with Q }) with (R forSome { type R <: P with Q }) }
+ type R1_141 = ( C { val y: R forSome { type R <: P with Q } }) with ( C { val y: P })
+ type R2_141 = R1_141 { val y: (R forSome { type R <: P with Q }) with (P) }
+ type R1_142 = ( C { val y: R forSome { type R <: P with Q } }) with ( C { val y: Q })
+ type R2_142 = R1_142 { val y: (R forSome { type R <: P with Q }) with (Q) }
+ type R1_143 = ( C { val y: R forSome { type R <: P with Q } }) with ( C { val y: R forSome { type R <: P with Q } })
+ type R2_143 = R1_143 { val y: (R forSome { type R <: P with Q }) with (R forSome { type R <: P with Q }) }
+ def f0 = { val x = ((new ABC): ( Any { val y: P }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f1 = { val x = ((new ABC): ( Any { val y: P }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f2 = { val x = ((new ABC): ( Any { val y: P }) with ( Any { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f3 = { val x = ((new ABC): ( Any { val y: P }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f4 = { val x = ((new ABC): ( Any { val y: P }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f5 = { val x = ((new ABC): ( Any { val y: P }) with ( A { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f6 = { val x = ((new ABC): ( Any { val y: P }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f7 = { val x = ((new ABC): ( Any { val y: P }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f8 = { val x = ((new ABC): ( Any { val y: P }) with ( B { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f9 = { val x = ((new ABC): ( Any { val y: P }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f10 = { val x = ((new ABC): ( Any { val y: P }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f11 = { val x = ((new ABC): ( Any { val y: P }) with ( C { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f12 = { val x = ((new ABC): ( Any { val y: Q }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f13 = { val x = ((new ABC): ( Any { val y: Q }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f14 = { val x = ((new ABC): ( Any { val y: Q }) with ( Any { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f15 = { val x = ((new ABC): ( Any { val y: Q }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f16 = { val x = ((new ABC): ( Any { val y: Q }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f17 = { val x = ((new ABC): ( Any { val y: Q }) with ( A { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f18 = { val x = ((new ABC): ( Any { val y: Q }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f19 = { val x = ((new ABC): ( Any { val y: Q }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f20 = { val x = ((new ABC): ( Any { val y: Q }) with ( B { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f21 = { val x = ((new ABC): ( Any { val y: Q }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f22 = { val x = ((new ABC): ( Any { val y: Q }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f23 = { val x = ((new ABC): ( Any { val y: Q }) with ( C { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f24 = { val x = ((new ABC): ( Any { val y: R forSome { type R <: P with Q } }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f25 = { val x = ((new ABC): ( Any { val y: R forSome { type R <: P with Q } }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f26 = { val x = ((new ABC): ( Any { val y: R forSome { type R <: P with Q } }) with ( Any { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f27 = { val x = ((new ABC): ( Any { val y: R forSome { type R <: P with Q } }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f28 = { val x = ((new ABC): ( Any { val y: R forSome { type R <: P with Q } }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f29 = { val x = ((new ABC): ( Any { val y: R forSome { type R <: P with Q } }) with ( A { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f30 = { val x = ((new ABC): ( Any { val y: R forSome { type R <: P with Q } }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f31 = { val x = ((new ABC): ( Any { val y: R forSome { type R <: P with Q } }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f32 = { val x = ((new ABC): ( Any { val y: R forSome { type R <: P with Q } }) with ( B { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f33 = { val x = ((new ABC): ( Any { val y: R forSome { type R <: P with Q } }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f34 = { val x = ((new ABC): ( Any { val y: R forSome { type R <: P with Q } }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f35 = { val x = ((new ABC): ( Any { val y: R forSome { type R <: P with Q } }) with ( C { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f36 = { val x = ((new ABC): ( A { val y: P }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f37 = { val x = ((new ABC): ( A { val y: P }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f38 = { val x = ((new ABC): ( A { val y: P }) with ( Any { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f39 = { val x = ((new ABC): ( A { val y: P }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f40 = { val x = ((new ABC): ( A { val y: P }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f41 = { val x = ((new ABC): ( A { val y: P }) with ( A { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f42 = { val x = ((new ABC): ( A { val y: P }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f43 = { val x = ((new ABC): ( A { val y: P }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f44 = { val x = ((new ABC): ( A { val y: P }) with ( B { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f45 = { val x = ((new ABC): ( A { val y: P }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f46 = { val x = ((new ABC): ( A { val y: P }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f47 = { val x = ((new ABC): ( A { val y: P }) with ( C { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f48 = { val x = ((new ABC): ( A { val y: Q }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f49 = { val x = ((new ABC): ( A { val y: Q }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f50 = { val x = ((new ABC): ( A { val y: Q }) with ( Any { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f51 = { val x = ((new ABC): ( A { val y: Q }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f52 = { val x = ((new ABC): ( A { val y: Q }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f53 = { val x = ((new ABC): ( A { val y: Q }) with ( A { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f54 = { val x = ((new ABC): ( A { val y: Q }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f55 = { val x = ((new ABC): ( A { val y: Q }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f56 = { val x = ((new ABC): ( A { val y: Q }) with ( B { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f57 = { val x = ((new ABC): ( A { val y: Q }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f58 = { val x = ((new ABC): ( A { val y: Q }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f59 = { val x = ((new ABC): ( A { val y: Q }) with ( C { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f60 = { val x = ((new ABC): ( A { val y: R forSome { type R <: P with Q } }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f61 = { val x = ((new ABC): ( A { val y: R forSome { type R <: P with Q } }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f62 = { val x = ((new ABC): ( A { val y: R forSome { type R <: P with Q } }) with ( Any { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f63 = { val x = ((new ABC): ( A { val y: R forSome { type R <: P with Q } }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f64 = { val x = ((new ABC): ( A { val y: R forSome { type R <: P with Q } }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f65 = { val x = ((new ABC): ( A { val y: R forSome { type R <: P with Q } }) with ( A { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f66 = { val x = ((new ABC): ( A { val y: R forSome { type R <: P with Q } }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f67 = { val x = ((new ABC): ( A { val y: R forSome { type R <: P with Q } }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f68 = { val x = ((new ABC): ( A { val y: R forSome { type R <: P with Q } }) with ( B { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f69 = { val x = ((new ABC): ( A { val y: R forSome { type R <: P with Q } }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f70 = { val x = ((new ABC): ( A { val y: R forSome { type R <: P with Q } }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f71 = { val x = ((new ABC): ( A { val y: R forSome { type R <: P with Q } }) with ( C { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f72 = { val x = ((new ABC): ( B { val y: P }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f73 = { val x = ((new ABC): ( B { val y: P }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f74 = { val x = ((new ABC): ( B { val y: P }) with ( Any { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f75 = { val x = ((new ABC): ( B { val y: P }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f76 = { val x = ((new ABC): ( B { val y: P }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f77 = { val x = ((new ABC): ( B { val y: P }) with ( A { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f78 = { val x = ((new ABC): ( B { val y: P }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f79 = { val x = ((new ABC): ( B { val y: P }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f80 = { val x = ((new ABC): ( B { val y: P }) with ( B { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f81 = { val x = ((new ABC): ( B { val y: P }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f82 = { val x = ((new ABC): ( B { val y: P }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f83 = { val x = ((new ABC): ( B { val y: P }) with ( C { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f84 = { val x = ((new ABC): ( B { val y: Q }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f85 = { val x = ((new ABC): ( B { val y: Q }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f86 = { val x = ((new ABC): ( B { val y: Q }) with ( Any { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f87 = { val x = ((new ABC): ( B { val y: Q }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f88 = { val x = ((new ABC): ( B { val y: Q }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f89 = { val x = ((new ABC): ( B { val y: Q }) with ( A { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f90 = { val x = ((new ABC): ( B { val y: Q }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f91 = { val x = ((new ABC): ( B { val y: Q }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f92 = { val x = ((new ABC): ( B { val y: Q }) with ( B { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f93 = { val x = ((new ABC): ( B { val y: Q }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f94 = { val x = ((new ABC): ( B { val y: Q }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f95 = { val x = ((new ABC): ( B { val y: Q }) with ( C { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f96 = { val x = ((new ABC): ( B { val y: R forSome { type R <: P with Q } }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f97 = { val x = ((new ABC): ( B { val y: R forSome { type R <: P with Q } }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f98 = { val x = ((new ABC): ( B { val y: R forSome { type R <: P with Q } }) with ( Any { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f99 = { val x = ((new ABC): ( B { val y: R forSome { type R <: P with Q } }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f100 = { val x = ((new ABC): ( B { val y: R forSome { type R <: P with Q } }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f101 = { val x = ((new ABC): ( B { val y: R forSome { type R <: P with Q } }) with ( A { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f102 = { val x = ((new ABC): ( B { val y: R forSome { type R <: P with Q } }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f103 = { val x = ((new ABC): ( B { val y: R forSome { type R <: P with Q } }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f104 = { val x = ((new ABC): ( B { val y: R forSome { type R <: P with Q } }) with ( B { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f105 = { val x = ((new ABC): ( B { val y: R forSome { type R <: P with Q } }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f106 = { val x = ((new ABC): ( B { val y: R forSome { type R <: P with Q } }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f107 = { val x = ((new ABC): ( B { val y: R forSome { type R <: P with Q } }) with ( C { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f108 = { val x = ((new ABC): ( C { val y: P }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f109 = { val x = ((new ABC): ( C { val y: P }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f110 = { val x = ((new ABC): ( C { val y: P }) with ( Any { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f111 = { val x = ((new ABC): ( C { val y: P }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f112 = { val x = ((new ABC): ( C { val y: P }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f113 = { val x = ((new ABC): ( C { val y: P }) with ( A { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f114 = { val x = ((new ABC): ( C { val y: P }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f115 = { val x = ((new ABC): ( C { val y: P }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f116 = { val x = ((new ABC): ( C { val y: P }) with ( B { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f117 = { val x = ((new ABC): ( C { val y: P }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f118 = { val x = ((new ABC): ( C { val y: P }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f119 = { val x = ((new ABC): ( C { val y: P }) with ( C { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f120 = { val x = ((new ABC): ( C { val y: Q }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f121 = { val x = ((new ABC): ( C { val y: Q }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f122 = { val x = ((new ABC): ( C { val y: Q }) with ( Any { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f123 = { val x = ((new ABC): ( C { val y: Q }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f124 = { val x = ((new ABC): ( C { val y: Q }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f125 = { val x = ((new ABC): ( C { val y: Q }) with ( A { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f126 = { val x = ((new ABC): ( C { val y: Q }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f127 = { val x = ((new ABC): ( C { val y: Q }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f128 = { val x = ((new ABC): ( C { val y: Q }) with ( B { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f129 = { val x = ((new ABC): ( C { val y: Q }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f130 = { val x = ((new ABC): ( C { val y: Q }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f131 = { val x = ((new ABC): ( C { val y: Q }) with ( C { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f132 = { val x = ((new ABC): ( C { val y: R forSome { type R <: P with Q } }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f133 = { val x = ((new ABC): ( C { val y: R forSome { type R <: P with Q } }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f134 = { val x = ((new ABC): ( C { val y: R forSome { type R <: P with Q } }) with ( Any { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f135 = { val x = ((new ABC): ( C { val y: R forSome { type R <: P with Q } }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f136 = { val x = ((new ABC): ( C { val y: R forSome { type R <: P with Q } }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f137 = { val x = ((new ABC): ( C { val y: R forSome { type R <: P with Q } }) with ( A { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f138 = { val x = ((new ABC): ( C { val y: R forSome { type R <: P with Q } }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f139 = { val x = ((new ABC): ( C { val y: R forSome { type R <: P with Q } }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f140 = { val x = ((new ABC): ( C { val y: R forSome { type R <: P with Q } }) with ( B { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def f141 = { val x = ((new ABC): ( C { val y: R forSome { type R <: P with Q } }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString }
+ def f142 = { val x = ((new ABC): ( C { val y: R forSome { type R <: P with Q } }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString }
+ def f143 = { val x = ((new ABC): ( C { val y: R forSome { type R <: P with Q } }) with ( C { val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString }
+ def g0(x: R1_0) = x.y
+ def g1(x: R1_1) = x.y
+ def g2(x: R1_2) = x.y
+ def g3(x: R1_3) = x.y
+ def g4(x: R1_4) = x.y
+ def g5(x: R1_5) = x.y
+ def g6(x: R1_6) = x.y
+ def g7(x: R1_7) = x.y
+ def g8(x: R1_8) = x.y
+ def g9(x: R1_9) = x.y
+ def g10(x: R1_10) = x.y
+ def g11(x: R1_11) = x.y
+ def g12(x: R1_12) = x.y
+ def g13(x: R1_13) = x.y
+ def g14(x: R1_14) = x.y
+ def g15(x: R1_15) = x.y
+ def g16(x: R1_16) = x.y
+ def g17(x: R1_17) = x.y
+ def g18(x: R1_18) = x.y
+ def g19(x: R1_19) = x.y
+ def g20(x: R1_20) = x.y
+ def g21(x: R1_21) = x.y
+ def g22(x: R1_22) = x.y
+ def g23(x: R1_23) = x.y
+ def g24(x: R1_24) = x.y
+ def g25(x: R1_25) = x.y
+ def g26(x: R1_26) = x.y
+ def g27(x: R1_27) = x.y
+ def g28(x: R1_28) = x.y
+ def g29(x: R1_29) = x.y
+ def g30(x: R1_30) = x.y
+ def g31(x: R1_31) = x.y
+ def g32(x: R1_32) = x.y
+ def g33(x: R1_33) = x.y
+ def g34(x: R1_34) = x.y
+ def g35(x: R1_35) = x.y
+ def g36(x: R1_36) = x.y
+ def g37(x: R1_37) = x.y
+ def g38(x: R1_38) = x.y
+ def g39(x: R1_39) = x.y
+ def g40(x: R1_40) = x.y
+ def g41(x: R1_41) = x.y
+ def g42(x: R1_42) = x.y
+ def g43(x: R1_43) = x.y
+ def g44(x: R1_44) = x.y
+ def g45(x: R1_45) = x.y
+ def g46(x: R1_46) = x.y
+ def g47(x: R1_47) = x.y
+ def g48(x: R1_48) = x.y
+ def g49(x: R1_49) = x.y
+ def g50(x: R1_50) = x.y
+ def g51(x: R1_51) = x.y
+ def g52(x: R1_52) = x.y
+ def g53(x: R1_53) = x.y
+ def g54(x: R1_54) = x.y
+ def g55(x: R1_55) = x.y
+ def g56(x: R1_56) = x.y
+ def g57(x: R1_57) = x.y
+ def g58(x: R1_58) = x.y
+ def g59(x: R1_59) = x.y
+ def g60(x: R1_60) = x.y
+ def g61(x: R1_61) = x.y
+ def g62(x: R1_62) = x.y
+ def g63(x: R1_63) = x.y
+ def g64(x: R1_64) = x.y
+ def g65(x: R1_65) = x.y
+ def g66(x: R1_66) = x.y
+ def g67(x: R1_67) = x.y
+ def g68(x: R1_68) = x.y
+ def g69(x: R1_69) = x.y
+ def g70(x: R1_70) = x.y
+ def g71(x: R1_71) = x.y
+ def g72(x: R1_72) = x.y
+ def g73(x: R1_73) = x.y
+ def g74(x: R1_74) = x.y
+ def g75(x: R1_75) = x.y
+ def g76(x: R1_76) = x.y
+ def g77(x: R1_77) = x.y
+ def g78(x: R1_78) = x.y
+ def g79(x: R1_79) = x.y
+ def g80(x: R1_80) = x.y
+ def g81(x: R1_81) = x.y
+ def g82(x: R1_82) = x.y
+ def g83(x: R1_83) = x.y
+ def g84(x: R1_84) = x.y
+ def g85(x: R1_85) = x.y
+ def g86(x: R1_86) = x.y
+ def g87(x: R1_87) = x.y
+ def g88(x: R1_88) = x.y
+ def g89(x: R1_89) = x.y
+ def g90(x: R1_90) = x.y
+ def g91(x: R1_91) = x.y
+ def g92(x: R1_92) = x.y
+ def g93(x: R1_93) = x.y
+ def g94(x: R1_94) = x.y
+ def g95(x: R1_95) = x.y
+ def g96(x: R1_96) = x.y
+ def g97(x: R1_97) = x.y
+ def g98(x: R1_98) = x.y
+ def g99(x: R1_99) = x.y
+ def g100(x: R1_100) = x.y
+ def g101(x: R1_101) = x.y
+ def g102(x: R1_102) = x.y
+ def g103(x: R1_103) = x.y
+ def g104(x: R1_104) = x.y
+ def g105(x: R1_105) = x.y
+ def g106(x: R1_106) = x.y
+ def g107(x: R1_107) = x.y
+ def g108(x: R1_108) = x.y
+ def g109(x: R1_109) = x.y
+ def g110(x: R1_110) = x.y
+ def g111(x: R1_111) = x.y
+ def g112(x: R1_112) = x.y
+ def g113(x: R1_113) = x.y
+ def g114(x: R1_114) = x.y
+ def g115(x: R1_115) = x.y
+ def g116(x: R1_116) = x.y
+ def g117(x: R1_117) = x.y
+ def g118(x: R1_118) = x.y
+ def g119(x: R1_119) = x.y
+ def g120(x: R1_120) = x.y
+ def g121(x: R1_121) = x.y
+ def g122(x: R1_122) = x.y
+ def g123(x: R1_123) = x.y
+ def g124(x: R1_124) = x.y
+ def g125(x: R1_125) = x.y
+ def g126(x: R1_126) = x.y
+ def g127(x: R1_127) = x.y
+ def g128(x: R1_128) = x.y
+ def g129(x: R1_129) = x.y
+ def g130(x: R1_130) = x.y
+ def g131(x: R1_131) = x.y
+ def g132(x: R1_132) = x.y
+ def g133(x: R1_133) = x.y
+ def g134(x: R1_134) = x.y
+ def g135(x: R1_135) = x.y
+ def g136(x: R1_136) = x.y
+ def g137(x: R1_137) = x.y
+ def g138(x: R1_138) = x.y
+ def g139(x: R1_139) = x.y
+ def g140(x: R1_140) = x.y
+ def g141(x: R1_141) = x.y
+ def g142(x: R1_142) = x.y
+ def g143(x: R1_143) = x.y
+ def h0(x: R2_0) = x.y
+ def h1(x: R2_1) = x.y
+ def h2(x: R2_2) = x.y
+ def h3(x: R2_3) = x.y
+ def h4(x: R2_4) = x.y
+ def h5(x: R2_5) = x.y
+ def h6(x: R2_6) = x.y
+ def h7(x: R2_7) = x.y
+ def h8(x: R2_8) = x.y
+ def h9(x: R2_9) = x.y
+ def h10(x: R2_10) = x.y
+ def h11(x: R2_11) = x.y
+ def h12(x: R2_12) = x.y
+ def h13(x: R2_13) = x.y
+ def h14(x: R2_14) = x.y
+ def h15(x: R2_15) = x.y
+ def h16(x: R2_16) = x.y
+ def h17(x: R2_17) = x.y
+ def h18(x: R2_18) = x.y
+ def h19(x: R2_19) = x.y
+ def h20(x: R2_20) = x.y
+ def h21(x: R2_21) = x.y
+ def h22(x: R2_22) = x.y
+ def h23(x: R2_23) = x.y
+ def h24(x: R2_24) = x.y
+ def h25(x: R2_25) = x.y
+ def h26(x: R2_26) = x.y
+ def h27(x: R2_27) = x.y
+ def h28(x: R2_28) = x.y
+ def h29(x: R2_29) = x.y
+ def h30(x: R2_30) = x.y
+ def h31(x: R2_31) = x.y
+ def h32(x: R2_32) = x.y
+ def h33(x: R2_33) = x.y
+ def h34(x: R2_34) = x.y
+ def h35(x: R2_35) = x.y
+ def h36(x: R2_36) = x.y
+ def h37(x: R2_37) = x.y
+ def h38(x: R2_38) = x.y
+ def h39(x: R2_39) = x.y
+ def h40(x: R2_40) = x.y
+ def h41(x: R2_41) = x.y
+ def h42(x: R2_42) = x.y
+ def h43(x: R2_43) = x.y
+ def h44(x: R2_44) = x.y
+ def h45(x: R2_45) = x.y
+ def h46(x: R2_46) = x.y
+ def h47(x: R2_47) = x.y
+ def h48(x: R2_48) = x.y
+ def h49(x: R2_49) = x.y
+ def h50(x: R2_50) = x.y
+ def h51(x: R2_51) = x.y
+ def h52(x: R2_52) = x.y
+ def h53(x: R2_53) = x.y
+ def h54(x: R2_54) = x.y
+ def h55(x: R2_55) = x.y
+ def h56(x: R2_56) = x.y
+ def h57(x: R2_57) = x.y
+ def h58(x: R2_58) = x.y
+ def h59(x: R2_59) = x.y
+ def h60(x: R2_60) = x.y
+ def h61(x: R2_61) = x.y
+ def h62(x: R2_62) = x.y
+ def h63(x: R2_63) = x.y
+ def h64(x: R2_64) = x.y
+ def h65(x: R2_65) = x.y
+ def h66(x: R2_66) = x.y
+ def h67(x: R2_67) = x.y
+ def h68(x: R2_68) = x.y
+ def h69(x: R2_69) = x.y
+ def h70(x: R2_70) = x.y
+ def h71(x: R2_71) = x.y
+ def h72(x: R2_72) = x.y
+ def h73(x: R2_73) = x.y
+ def h74(x: R2_74) = x.y
+ def h75(x: R2_75) = x.y
+ def h76(x: R2_76) = x.y
+ def h77(x: R2_77) = x.y
+ def h78(x: R2_78) = x.y
+ def h79(x: R2_79) = x.y
+ def h80(x: R2_80) = x.y
+ def h81(x: R2_81) = x.y
+ def h82(x: R2_82) = x.y
+ def h83(x: R2_83) = x.y
+ def h84(x: R2_84) = x.y
+ def h85(x: R2_85) = x.y
+ def h86(x: R2_86) = x.y
+ def h87(x: R2_87) = x.y
+ def h88(x: R2_88) = x.y
+ def h89(x: R2_89) = x.y
+ def h90(x: R2_90) = x.y
+ def h91(x: R2_91) = x.y
+ def h92(x: R2_92) = x.y
+ def h93(x: R2_93) = x.y
+ def h94(x: R2_94) = x.y
+ def h95(x: R2_95) = x.y
+ def h96(x: R2_96) = x.y
+ def h97(x: R2_97) = x.y
+ def h98(x: R2_98) = x.y
+ def h99(x: R2_99) = x.y
+ def h100(x: R2_100) = x.y
+ def h101(x: R2_101) = x.y
+ def h102(x: R2_102) = x.y
+ def h103(x: R2_103) = x.y
+ def h104(x: R2_104) = x.y
+ def h105(x: R2_105) = x.y
+ def h106(x: R2_106) = x.y
+ def h107(x: R2_107) = x.y
+ def h108(x: R2_108) = x.y
+ def h109(x: R2_109) = x.y
+ def h110(x: R2_110) = x.y
+ def h111(x: R2_111) = x.y
+ def h112(x: R2_112) = x.y
+ def h113(x: R2_113) = x.y
+ def h114(x: R2_114) = x.y
+ def h115(x: R2_115) = x.y
+ def h116(x: R2_116) = x.y
+ def h117(x: R2_117) = x.y
+ def h118(x: R2_118) = x.y
+ def h119(x: R2_119) = x.y
+ def h120(x: R2_120) = x.y
+ def h121(x: R2_121) = x.y
+ def h122(x: R2_122) = x.y
+ def h123(x: R2_123) = x.y
+ def h124(x: R2_124) = x.y
+ def h125(x: R2_125) = x.y
+ def h126(x: R2_126) = x.y
+ def h127(x: R2_127) = x.y
+ def h128(x: R2_128) = x.y
+ def h129(x: R2_129) = x.y
+ def h130(x: R2_130) = x.y
+ def h131(x: R2_131) = x.y
+ def h132(x: R2_132) = x.y
+ def h133(x: R2_133) = x.y
+ def h134(x: R2_134) = x.y
+ def h135(x: R2_135) = x.y
+ def h136(x: R2_136) = x.y
+ def h137(x: R2_137) = x.y
+ def h138(x: R2_138) = x.y
+ def h139(x: R2_139) = x.y
+ def h140(x: R2_140) = x.y
+ def h141(x: R2_141) = x.y
+ def h142(x: R2_142) = x.y
+ def h143(x: R2_143) = x.y
+ lazy val fcalls = List(
+ f0,
+ f1,
+ f2,
+ f3,
+ f4,
+ f5,
+ f6,
+ f7,
+ f8,
+ f9,
+ f10,
+ f11,
+ f12,
+ f13,
+ f14,
+ f15,
+ f16,
+ f17,
+ f18,
+ f19,
+ f20,
+ f21,
+ f22,
+ f23,
+ f24,
+ f25,
+ f26,
+ f27,
+ f28,
+ f29,
+ f30,
+ f31,
+ f32,
+ f33,
+ f34,
+ f35,
+ f36,
+ f37,
+ f38,
+ f39,
+ f40,
+ f41,
+ f42,
+ f43,
+ f44,
+ f45,
+ f46,
+ f47,
+ f48,
+ f49,
+ f50,
+ f51,
+ f52,
+ f53,
+ f54,
+ f55,
+ f56,
+ f57,
+ f58,
+ f59,
+ f60,
+ f61,
+ f62,
+ f63,
+ f64,
+ f65,
+ f66,
+ f67,
+ f68,
+ f69,
+ f70,
+ f71,
+ f72,
+ f73,
+ f74,
+ f75,
+ f76,
+ f77,
+ f78,
+ f79,
+ f80,
+ f81,
+ f82,
+ f83,
+ f84,
+ f85,
+ f86,
+ f87,
+ f88,
+ f89,
+ f90,
+ f91,
+ f92,
+ f93,
+ f94,
+ f95,
+ f96,
+ f97,
+ f98,
+ f99,
+ f100,
+ f101,
+ f102,
+ f103,
+ f104,
+ f105,
+ f106,
+ f107,
+ f108,
+ f109,
+ f110,
+ f111,
+ f112,
+ f113,
+ f114,
+ f115,
+ f116,
+ f117,
+ f118,
+ f119,
+ f120,
+ f121,
+ f122,
+ f123,
+ f124,
+ f125,
+ f126,
+ f127,
+ f128,
+ f129,
+ f130,
+ f131,
+ f132,
+ f133,
+ f134,
+ f135,
+ f136,
+ f137,
+ f138,
+ f139,
+ f140,
+ f141,
+ f142,
+ f143
+ )
+
+ def main(args: Array[String]) {
+ sshow("Direct Calls", fcalls collect { case (false, n) => n })
+ sshow("Reflective Calls", fcalls collect { case (true, n) => n })
+ // For a good time try printing this - have to fix bugs in
+ // reflection before that's going to be a good idea
+ // println(typeOf[Test.type].typeSymbol.asClass.typeSignature)
+ }
+}
diff --git a/test/files/run/t3488.check b/test/files/run/t3488.check
index 0d66ea1aee..314dfc7838 100644
--- a/test/files/run/t3488.check
+++ b/test/files/run/t3488.check
@@ -1,2 +1,8 @@
+t3488.scala:4: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 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
+ println(foo { val List(_*)=List(0); 1 } (1))
+ ^
0
1
diff --git a/test/files/run/t3507-new.scala b/test/files/run/t3507-new.scala
index f045755b8f..bd16849e8a 100644
--- a/test/files/run/t3507-new.scala
+++ b/test/files/run/t3507-new.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ existentials }
import scala.reflect.runtime.universe._
class A {
@@ -14,4 +16,4 @@ object Test extends App {
def mani[T: TypeTag](x: T) = println(typeOf[T])
mani/*[object _1.b.c]*/(c) // kaboom in manifestOfType / TreeGen.mkAttributedQualifier
// --> _1 is not in scope here
-} \ No newline at end of file
+}
diff --git a/test/files/run/t3529.scala b/test/files/run/t3529.scala
index bb82424bf6..a5977d0a6c 100644
--- a/test/files/run/t3529.scala
+++ b/test/files/run/t3529.scala
@@ -1,3 +1,4 @@
+import scala.language.postfixOps
object Test {
def main(args: Array[String]): Unit = {
assert(1 to 10 drop 10 isEmpty)
diff --git a/test/files/run/t3651.scala b/test/files/run/t3651.scala
index 49ae173249..3a6dda0de3 100644
--- a/test/files/run/t3651.scala
+++ b/test/files/run/t3651.scala
@@ -5,6 +5,6 @@ class LongKlass( override val a: Long ) extends Klass[Long](a)
object Test {
def main(args: Array[String]) {
val lk = new LongKlass(10)
- lk.a
+ val a = lk.a
}
}
diff --git a/test/files/run/t3705.scala b/test/files/run/t3705.scala
index fcc020f28c..3ebf6fc95d 100644
--- a/test/files/run/t3705.scala
+++ b/test/files/run/t3705.scala
@@ -2,16 +2,16 @@
import scala.xml._
object Test {
+ // guard caused verifyerror in oldpatmat
def updateNodes(ns: Seq[Node]): Seq[Node] =
for(subnode <- ns) yield subnode match {
case <d>{_}</d> if true => <d>abc</d>
case Elem(prefix, label, attribs, scope, children @ _*) =>
- Elem(prefix, label, attribs, scope, updateNodes(children) : _*)
+ Elem(prefix, label, attribs, scope, minimizeEmpty = true, updateNodes(children) : _*)
case other => other
}
def main(args: Array[String]): Unit = {
updateNodes(<b />)
-
}
}
diff --git a/test/files/run/t3758-old.scala b/test/files/run/t3758-old.scala
index f00254afee..d5e4a6cc1c 100644
--- a/test/files/run/t3758-old.scala
+++ b/test/files/run/t3758-old.scala
@@ -1,3 +1,5 @@
+
+@deprecated("Suppress warnings", since="2.11")
object Test {
def main(args: Array[String]): Unit = {
assert(classManifest[Array[String]].typeArguments contains classManifest[String])
@@ -7,4 +9,4 @@ object Test {
assert(manifest[Array[Int]].typeArguments contains manifest[Int])
assert(manifest[Array[Float]].typeArguments contains manifest[Float])
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/t3855.scala b/test/files/run/t3855.scala
index e55714201f..d8029e16f0 100644
--- a/test/files/run/t3855.scala
+++ b/test/files/run/t3855.scala
@@ -3,11 +3,11 @@ object Test {
def closure[A](f: () => A) = f()
def f1(s: String) = {
- var n = try { s.toInt } catch { case _ => 1 }
+ var n = try { s.toInt } catch { case _: Throwable => 1 }
byval(n)
}
def f2(s: String) = {
- var n = try { s.toInt } catch { case _ => 1 }
+ var n = try { s.toInt } catch { case _: Throwable => 1 }
closure(() => n)
}
diff --git a/test/files/run/t3888.check b/test/files/run/t3888.check
new file mode 100644
index 0000000000..844ca54682
--- /dev/null
+++ b/test/files/run/t3888.check
@@ -0,0 +1 @@
+warning: there were 1 deprecation warning(s); re-run with -deprecation for details
diff --git a/test/files/run/t3888.scala b/test/files/run/t3888.scala
index e0f1453b1d..1914072599 100644
--- a/test/files/run/t3888.scala
+++ b/test/files/run/t3888.scala
@@ -1,3 +1,6 @@
+
+// in a match, which notion of equals prevails?
+// extending Tuple doesn't seem to be at issue here.
object Test {
val T1 = new P
@@ -23,4 +26,4 @@ object Test {
class P extends Pair(1, 1) {
override def equals(x: Any) = true
-} \ No newline at end of file
+}
diff --git a/test/files/run/t3935.scala b/test/files/run/t3935.scala
index c66b1b0599..fa1bbf8d3f 100644
--- a/test/files/run/t3935.scala
+++ b/test/files/run/t3935.scala
@@ -9,7 +9,7 @@ object Test {
try {
assert(q.front != null)
} catch {
- case _ =>
+ case _: Throwable =>
}
}
}
diff --git a/test/files/run/t3964.scala b/test/files/run/t3964.scala
index 80ba361a20..68ff9a44c4 100644
--- a/test/files/run/t3964.scala
+++ b/test/files/run/t3964.scala
@@ -1,3 +1,6 @@
+
+import scala.language.implicitConversions
+
object Test {
class Base
object Bob extends Base
diff --git a/test/files/run/t4047.check b/test/files/run/t4047.check
index 2a942a70e0..3c41e6e244 100644
--- a/test/files/run/t4047.check
+++ b/test/files/run/t4047.check
@@ -1,3 +1,15 @@
+t4047.scala:23: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ a.foo
+ ^
+t4047.scala:24: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ a.foo
+ ^
+t4047.scala:26: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ b.foo
+ ^
+t4047.scala:27: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ b.foo
+ ^
Unit: called A.foo
Unit: called B.foo
Unit: called C.foo
diff --git a/test/files/run/t4072.scala b/test/files/run/t4072.scala
index 872072a4ce..bff2e0c7d2 100644
--- a/test/files/run/t4072.scala
+++ b/test/files/run/t4072.scala
@@ -1,5 +1,7 @@
import scala.tools.nsc._
+import scala.language.{ reflectiveCalls }
+
object Test {
class DryRun {
val compiler = new Global(new Settings()) {
diff --git a/test/files/run/t4080.scala b/test/files/run/t4080.scala
index 92740ed776..1d1418847d 100644
--- a/test/files/run/t4080.scala
+++ b/test/files/run/t4080.scala
@@ -1,4 +1,5 @@
import scala.collection.mutable.LinkedList
+import java.util.NoSuchElementException
object Test {
def main(args: Array[String]) {
@@ -6,7 +7,7 @@ object Test {
ll.insert(LinkedList(0))
println(ll)
val ll2 = LinkedList[Int]()
- try println(ll2.head)
- catch { case _ => () }
+ try println("Empty head? " + ll2.head)
+ catch { case _: NoSuchElementException => () }
}
}
diff --git a/test/files/run/t4148.scala b/test/files/run/t4148.scala
index 0739403594..6de0c8fe7a 100644
--- a/test/files/run/t4148.scala
+++ b/test/files/run/t4148.scala
@@ -1,7 +1,7 @@
object Test {
- val x1 = try { "aaa".asInstanceOf[Int] } catch { case _ => "cce1" }
- val x2 = try { (5: Any).asInstanceOf[Int] } catch { case _ => "cce2" }
- val x3 = try { (new java.lang.Short(100.toShort).asInstanceOf[Int]) } catch { case _ => "cce3" }
+ val x1 = try { "aaa".asInstanceOf[Int] } catch { case _: Throwable => "cce1" }
+ val x2 = try { (5: Any).asInstanceOf[Int] } catch { case _: Throwable => "cce2" }
+ val x3 = try { (new java.lang.Short(100.toShort).asInstanceOf[Int]) } catch { case _: Throwable => "cce3" }
def main(args: Array[String]): Unit = {
List(x1, x2, x3) foreach println
diff --git a/test/files/run/t4171.scala b/test/files/run/t4171.scala
index fba2fb5ed6..7f6dfd48ce 100644
--- a/test/files/run/t4171.scala
+++ b/test/files/run/t4171.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ reflectiveCalls }
+
object Test {
val c = { class C; new C { def foo = 1 } }
val a = { class B { def bar = 5 }; class C extends B; new C }
diff --git a/test/files/run/t4398.scala b/test/files/run/t4398.scala
index 1d57eb688d..87dc870afc 100644
--- a/test/files/run/t4398.scala
+++ b/test/files/run/t4398.scala
@@ -1,5 +1,7 @@
+import scala.language.{ postfixOps }
+
object Test {
def main(args: Array[String]) {
val x = 1 to 10 toSet
diff --git a/test/files/run/t4560.scala b/test/files/run/t4560.scala
index 9979199067..ee657e47eb 100644
--- a/test/files/run/t4560.scala
+++ b/test/files/run/t4560.scala
@@ -7,6 +7,9 @@
// TEST 1
// self-type is other trait
+
+import scala.language.{ reflectiveCalls }
+
trait Aa
trait Ab
diff --git a/test/files/run/t4660.scala b/test/files/run/t4660.scala
index e57bb4bf25..9aac10ddfd 100644
--- a/test/files/run/t4660.scala
+++ b/test/files/run/t4660.scala
@@ -3,7 +3,7 @@ object Test {
val traversable = 1 to 20 map (_.toString)
def normalize(m: Map[Char, Traversable[String]]) = m.map { case (k,v) => (k, v.toList) }
- val groupedFromView = (traversable view).groupBy(_(0))
+ val groupedFromView = traversable.view.groupBy(_(0))
val groupedFromStrict = traversable.groupBy(_(0))
assert(normalize(groupedFromView) == normalize(groupedFromStrict))
diff --git a/test/files/run/t4680.check b/test/files/run/t4680.check
index b5cfc651f2..b2e5209dc5 100644
--- a/test/files/run/t4680.check
+++ b/test/files/run/t4680.check
@@ -1,3 +1,9 @@
+t4680.scala:51: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ new C { 5 }
+ ^
+t4680.scala:69: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ new { val x = 5 } with E() { 5 }
+ ^
// new C { }
diff --git a/test/files/run/t4729/S_2.scala b/test/files/run/t4729/S_2.scala
index a80afb0257..f823433ded 100644
--- a/test/files/run/t4729/S_2.scala
+++ b/test/files/run/t4729/S_2.scala
@@ -1,3 +1,4 @@
+import scala.language.reflectiveCalls
// Scala class:
class ScalaVarArgs extends J_1 {
// -- no problem on overriding it using ordinary class
diff --git a/test/files/run/t4766.scala b/test/files/run/t4766.scala
index c2a864ddb2..d67431f50e 100644
--- a/test/files/run/t4766.scala
+++ b/test/files/run/t4766.scala
@@ -1,3 +1,7 @@
+
+import scala.language.postfixOps
+import scala.language.reflectiveCalls
+
object Test extends App {
val x = new {
def > = 1
diff --git a/test/files/run/t4777.scala b/test/files/run/t4777.scala
index 4a811d3b9a..6c7b856e39 100644
--- a/test/files/run/t4777.scala
+++ b/test/files/run/t4777.scala
@@ -3,6 +3,6 @@ class DefaultsTest(x: Int = 25) extends A(28)
object DefaultsTest extends DefaultsTest(12)
object Test extends App {
- println(new DefaultsTest() a)
- println(DefaultsTest a)
+ println(new DefaultsTest().a)
+ println(DefaultsTest.a)
}
diff --git a/test/files/run/t4794.scala b/test/files/run/t4794.scala
index afe89fa429..720906f507 100644
--- a/test/files/run/t4794.scala
+++ b/test/files/run/t4794.scala
@@ -7,6 +7,7 @@ class Arr[@specialized A](val arr: Array[A]) {
object Test {
def main(args: Array[String]): Unit = {
- println(classOf[Arr[_]].getMethods filter (_.getName contains "quux") size) // expect 10, not 1
+ def quuxae = classOf[Arr[_]].getMethods filter (_.getName contains "quux")
+ println(quuxae.size) // expect 10, not 1
}
}
diff --git a/test/files/run/t4929.scala b/test/files/run/t4929.scala
index 3208cd1b09..1b0e8672d5 100644
--- a/test/files/run/t4929.scala
+++ b/test/files/run/t4929.scala
@@ -2,6 +2,7 @@ import scala.util.parsing.json._
import java.util.concurrent._
import collection.JavaConversions._
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
val LIMIT = 2000
diff --git a/test/files/run/t498.scala b/test/files/run/t498.scala
index b4ede951f0..5c10e6630f 100644
--- a/test/files/run/t498.scala
+++ b/test/files/run/t498.scala
@@ -1,3 +1,6 @@
+
+import scala.language.postfixOps
+
object Test extends App {
// the function passed to flatMap produces lots of empty streams, but this should not overflow the stack
val res = Stream.from(1).flatMap(i => if (i < 3000) Stream.empty else List(1))
diff --git a/test/files/run/t5053.scala b/test/files/run/t5053.scala
index e46dad5ac6..233edf6780 100644
--- a/test/files/run/t5053.scala
+++ b/test/files/run/t5053.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ existentials }
+
object Test extends App {
{
val (left, right) = Seq((1, "a"), (1, "a"), (1, "a"), (3, "c")).view.unzip
diff --git a/test/files/run/t5080.scala b/test/files/run/t5080.scala
index ce72d13a54..acb6167f46 100644
--- a/test/files/run/t5080.scala
+++ b/test/files/run/t5080.scala
@@ -1,3 +1,7 @@
+
+import scala.language.implicitConversions
+import scala.language.reflectiveCalls
+
object Test extends App {
abstract class Value {
diff --git a/test/files/run/t5224.check b/test/files/run/t5224.check
index e15c1c90eb..b11480acdf 100644
--- a/test/files/run/t5224.check
+++ b/test/files/run/t5224.check
@@ -1,3 +1,8 @@
+t5224.scala:3: warning: Implementation restriction: subclassing Classfile does not
+make your annotation visible at runtime. If that is what
+you want, you must write the annotation class in Java.
+class Foo(bar: String) extends annotation.ClassfileAnnotation
+ ^
{
@new Foo(bar = "qwe") class C extends AnyRef {
def <init>() = {
diff --git a/test/files/run/t5277_1.scala b/test/files/run/t5277_1.scala
index a2d546579d..65232967c2 100644
--- a/test/files/run/t5277_1.scala
+++ b/test/files/run/t5277_1.scala
@@ -1,6 +1,7 @@
import scala.reflect.runtime.universe._
import scala.tools.reflect.Eval
+import scala.language.{ implicitConversions, postfixOps }
object Test extends App {
reify {
def fact(n: Int): BigInt =
@@ -12,4 +13,4 @@ object Test extends App {
println("10! = " + (10!))
}.eval
-} \ No newline at end of file
+}
diff --git a/test/files/run/t5284b.check b/test/files/run/t5284b.check
index 98d9bcb75a..71426ad0b7 100644
--- a/test/files/run/t5284b.check
+++ b/test/files/run/t5284b.check
@@ -1 +1,4 @@
+t5284b.scala:27: warning: type S is unused or used in non-specializable positions.
+ def bar[@specialized(Int) W <: T, @specialized(Int) S](w: W) = id(w)
+ ^
17
diff --git a/test/files/run/t5284c.check b/test/files/run/t5284c.check
index 00750edc07..cf578ad102 100644
--- a/test/files/run/t5284c.check
+++ b/test/files/run/t5284c.check
@@ -1 +1,4 @@
+t5284c.scala:29: warning: type W is unused or used in non-specializable positions.
+ def bar[@specialized(Int) W <: T](ws: List[W]) = len(ws)
+ ^
3
diff --git a/test/files/run/t5353.scala b/test/files/run/t5353.scala
deleted file mode 100644
index 5208fe527f..0000000000
--- a/test/files/run/t5353.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-object Test extends App {
- def f(x: Boolean) = if (x) Array("abc") else Array()
- try {
- println(f(true).length)
- println(f(false).length)
- } catch {
- case ex: Throwable => println(ex.getMessage)
- }
-}
diff --git a/test/files/run/t5356.scala b/test/files/run/t5356.scala
index ec17e036ad..dabb9ef855 100644
--- a/test/files/run/t5356.scala
+++ b/test/files/run/t5356.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ reflectiveCalls }
object Test {
def f(x: Any { def toInt: Int }) = println(x.toInt + " " + x.getClass.getName)
diff --git a/test/files/run/t5375.scala b/test/files/run/t5375.scala
index e4b329deae..fa5932ff89 100644
--- a/test/files/run/t5375.scala
+++ b/test/files/run/t5375.scala
@@ -8,7 +8,7 @@ import collection.parallel.CompositeThrowable
object Test {
def main(args: Array[String]) {
- val foos = (1 to 1000) toSeq;
+ val foos = (1 to 1000).toSeq
try {
foos.par.map(i => if (i % 37 == 0) sys.error("i div 37") else i)
} catch {
diff --git a/test/files/run/t5380.check b/test/files/run/t5380.check
new file mode 100644
index 0000000000..731a798301
--- /dev/null
+++ b/test/files/run/t5380.check
@@ -0,0 +1,9 @@
+t5380.scala:3: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 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
+ val f = () => return try { 1 } catch { case _: Throwable => 0 }
+ ^
+t5380.scala:3: warning: enclosing method main has result type Unit: return value discarded
+ val f = () => return try { 1 } catch { case _: Throwable => 0 }
+ ^
diff --git a/test/files/run/t5380.scala b/test/files/run/t5380.scala
index 6083161a9b..66d12a0ca6 100644
--- a/test/files/run/t5380.scala
+++ b/test/files/run/t5380.scala
@@ -1,6 +1,6 @@
object Test {
def main(args: Array[String]) {
- val f = () => return try { 1 } catch { case _ => 0 }
+ val f = () => return try { 1 } catch { case _: Throwable => 0 }
f()
}
}
diff --git a/test/files/run/t5428.scala b/test/files/run/t5428.scala
index 106bb7fc31..fb58cbbe24 100644
--- a/test/files/run/t5428.scala
+++ b/test/files/run/t5428.scala
@@ -23,7 +23,7 @@ object Test {
println(a)
- a pop
+ a.pop
}
}
diff --git a/test/files/run/t5568.flags b/test/files/run/t5568.flags
new file mode 100644
index 0000000000..ad51758c39
--- /dev/null
+++ b/test/files/run/t5568.flags
@@ -0,0 +1 @@
+-nowarn
diff --git a/test/files/run/t5629b.scala b/test/files/run/t5629b.scala
index 6c908081b9..adb9ca5498 100644
--- a/test/files/run/t5629b.scala
+++ b/test/files/run/t5629b.scala
@@ -33,7 +33,7 @@ object Test extends App {
val pf = newPF(1)
println("=== pf(1):")
- try { pf(1) } catch { case x => println(x) }
+ try { pf(1) } catch { case x: Throwable => println(x) }
println("=== pf(42):")
pf(42)
println("=== done")
diff --git a/test/files/run/t5699.scala b/test/files/run/t5699.scala
index 5cef67e3b1..ec3b1d26b4 100755
--- a/test/files/run/t5699.scala
+++ b/test/files/run/t5699.scala
@@ -1,5 +1,5 @@
import scala.tools.partest.DirectTest
-import scala.tools.nsc.util.BatchSourceFile
+import scala.reflect.internal.util.BatchSourceFile
object Test extends DirectTest {
// Java code
diff --git a/test/files/run/t576.scala b/test/files/run/t576.scala
index 756a241572..5c8c9a90cb 100644
--- a/test/files/run/t576.scala
+++ b/test/files/run/t576.scala
@@ -1,3 +1,5 @@
+import scala.language.reflectiveCalls
+
class A {
override def equals(other: Any) = other match {
case _: this.type => true
diff --git a/test/files/run/t5881.scala b/test/files/run/t5881.scala
index 01bee29181..04b24b713d 100644
--- a/test/files/run/t5881.scala
+++ b/test/files/run/t5881.scala
@@ -1,6 +1,7 @@
+import scala.language.existentials
import scala.reflect.ClassTag
object Test extends App {
println(implicitly[ClassTag[List[T forSome {type T <: List[T]}]]])
println(implicitly[ClassTag[List[Any]]])
-} \ No newline at end of file
+}
diff --git a/test/files/run/t5912.scala b/test/files/run/t5912.scala
index 7710d04396..9418e946d0 100644
--- a/test/files/run/t5912.scala
+++ b/test/files/run/t5912.scala
@@ -1,6 +1,7 @@
+import scala.language.existentials
object Test extends App{
import scala.reflect.runtime.{currentMirror=>cm}
import scala.tools.reflect._
import scala.reflect.runtime.universe._
val tree = cm.mkToolBox().typeCheck( Literal(Constant("test")) )
-} \ No newline at end of file
+}
diff --git a/test/files/run/t5942.scala b/test/files/run/t5942.scala
index 44a8be93f6..c90d29e1ca 100644
--- a/test/files/run/t5942.scala
+++ b/test/files/run/t5942.scala
@@ -5,6 +5,6 @@ import scala.tools.reflect._
object Test extends App {
val tb = cm.mkToolBox()
tb.parse("def x = {}")
- try { tb.parse("def x = {") } catch { case _ => }
+ try { tb.parse("def x = {") } catch { case _: Throwable => }
tb.parse("def x = {}")
}
diff --git a/test/files/run/t6011c.check b/test/files/run/t6011c.check
new file mode 100644
index 0000000000..088e6fdaae
--- /dev/null
+++ b/test/files/run/t6011c.check
@@ -0,0 +1,3 @@
+t6011c.scala:11: warning: unreachable code
+ case 1 => 3 // crash
+ ^
diff --git a/test/files/run/t603.scala b/test/files/run/t603.scala
index b8825c933b..54fb8e6974 100644
--- a/test/files/run/t603.scala
+++ b/test/files/run/t603.scala
@@ -1,4 +1,6 @@
object forceDelay {
+ import scala.language.implicitConversions
+
class Susp[+A](lazyValue: => A) extends Function0[A] {
private var func: () => Any = () => lazyValue
private var value: Any = null
diff --git a/test/files/run/t6102.check b/test/files/run/t6102.check
index b6fc4c620b..97e455647b 100644
--- a/test/files/run/t6102.check
+++ b/test/files/run/t6102.check
@@ -1 +1,29 @@
-hello \ No newline at end of file
+[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 icode on t6102.scala]
+[running phase inliner on t6102.scala]
+[running phase inlinehandlers on t6102.scala]
+[running phase closelim on t6102.scala]
+[running phase constopt on t6102.scala]
+[running phase dce on t6102.scala]
+[running phase jvm on icode]
+hello
diff --git a/test/files/run/t6113.scala b/test/files/run/t6113.scala
index 321cae86a3..b77a56029a 100644
--- a/test/files/run/t6113.scala
+++ b/test/files/run/t6113.scala
@@ -1,6 +1,8 @@
+import scala.language.higherKinds
+
trait Foo[C[_]]
object Test extends App {
import scala.reflect.runtime.universe._
println(typeOf[Foo[({type l[X] = (Int, X)})#l]])
-} \ No newline at end of file
+}
diff --git a/test/files/run/t6146b.check b/test/files/run/t6146b.check
index 49ff70697e..2333b9d986 100644
--- a/test/files/run/t6146b.check
+++ b/test/files/run/t6146b.check
@@ -1,3 +1,7 @@
+t6146b.scala:15: warning: match may not be exhaustive.
+It would fail on the following inputs: S2(), S3()
+ def foo(f: F[Int]) = f match { case X.S1 => }
+ ^
Type in expressions to have them evaluated.
Type :help for more information.
diff --git a/test/files/run/t6246.scala b/test/files/run/t6246.scala
index 28765e1adf..2db87aa6d2 100644
--- a/test/files/run/t6246.scala
+++ b/test/files/run/t6246.scala
@@ -1,5 +1,6 @@
import scala.reflect.{ClassTag, classTag}
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
def testValueClass(tag: ClassTag[_]) {
println(s"runtimeClass = ${tag.runtimeClass}, toString = ${tag.toString}")
@@ -23,4 +24,4 @@ object Test extends App {
testValueClass(ClassTag.Double)
testValueClass(ClassTag.Unit)
testValueClass(ClassTag.Boolean)
-} \ No newline at end of file
+}
diff --git a/test/files/run/t6329_vanilla.scala b/test/files/run/t6329_vanilla.scala
index f2d843896d..ec84f1f938 100644
--- a/test/files/run/t6329_vanilla.scala
+++ b/test/files/run/t6329_vanilla.scala
@@ -1,5 +1,6 @@
import scala.reflect.classTag
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
println(classManifest[scala.List[_]])
println(classTag[scala.List[_]])
diff --git a/test/files/run/t6443.scala b/test/files/run/t6443.scala
index 67fe2cab22..3ab8c345fe 100644
--- a/test/files/run/t6443.scala
+++ b/test/files/run/t6443.scala
@@ -1,3 +1,5 @@
+import scala.language.existentials
+
class Base
class Derived extends Base
diff --git a/test/files/run/t657.scala b/test/files/run/t657.scala
index a9726092e7..e76b0292dd 100644
--- a/test/files/run/t657.scala
+++ b/test/files/run/t657.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ implicitConversions }
abstract class BaseList {
type Node <: NodeImpl;
implicit def convertNode(ni : NodeImpl) = ni.asInstanceOf[Node];
diff --git a/test/files/run/t6690.scala b/test/files/run/t6690.scala
index 43ede967a0..15b1817e87 100644
--- a/test/files/run/t6690.scala
+++ b/test/files/run/t6690.scala
@@ -1,5 +1,7 @@
import scala.collection.mutable
+import scala.language.{ reflectiveCalls }
+
object Test extends App {
def last0(ml: mutable.MutableList[Int]) =
ml.asInstanceOf[{def last0: mutable.LinkedList[Int]}].last0
diff --git a/test/files/run/t6731.scala b/test/files/run/t6731.scala
index 89d212e91e..12357b935e 100644
--- a/test/files/run/t6731.scala
+++ b/test/files/run/t6731.scala
@@ -12,7 +12,7 @@ abstract class MonoDynamic extends Dynamic {
def applyDynamic(name: String)(args: Any*): String = show(this + "." + name + mkArgs(args: _*))
def applyDynamicNamed(name: String)(args: (String, Any)*): String = show(this + "." + name + mkArgs(args: _*))
- override def toString = this.getClass.getName split '.' last
+ override def toString = (this.getClass.getName split '.').last
}
object Mono extends MonoDynamic {
diff --git a/test/files/run/t6863.check b/test/files/run/t6863.check
new file mode 100644
index 0000000000..030cb8b265
--- /dev/null
+++ b/test/files/run/t6863.check
@@ -0,0 +1,12 @@
+t6863.scala:38: warning: comparing values of types Unit and Unit using `==' will always yield true
+ assert({ () => x}.apply == ())
+ ^
+t6863.scala:42: warning: comparing values of types Unit and Unit using `==' will always yield true
+ assert({ () => x}.apply == ())
+ ^
+t6863.scala:46: warning: comparing values of types Unit and Unit using `==' will always yield true
+ assert({ () => x}.apply == ())
+ ^
+t6863.scala:59: warning: comparing values of types Unit and Unit using `==' will always yield true
+ assert({ () => x }.apply == ())
+ ^
diff --git a/test/files/run/t6863.scala b/test/files/run/t6863.scala
index d77adb6af4..c4f3c2c885 100644
--- a/test/files/run/t6863.scala
+++ b/test/files/run/t6863.scala
@@ -51,7 +51,7 @@ object Test {
assert({ () => x }.apply == "42")
}
def tryCatch() = {
- var x = try { "42" } catch { case _ => "43" }
+ var x = try { "42" } catch { case _: Throwable => "43" }
assert({ () => x }.apply == "42")
}
def `if`() = {
@@ -85,7 +85,7 @@ object Test {
def nested() = {
var x = {
val y = 42
- if(true) try "42" catch {case _ => "43"}
+ if(true) try "42" catch {case _: Throwable => "43"}
else "44"
}
assert({ () => x }.apply == "42")
diff --git a/test/files/run/t6969.scala b/test/files/run/t6969.scala
index 8cfc28c1e5..c4561b4424 100644
--- a/test/files/run/t6969.scala
+++ b/test/files/run/t6969.scala
@@ -1,3 +1,7 @@
+
+
+import scala.language.{ reflectiveCalls }
+
object Test {
private type Clearable = { def clear(): Unit }
private def choke() = {
diff --git a/test/files/run/t7047.check b/test/files/run/t7047.check
index e69de29bb2..32bd581094 100644
--- a/test/files/run/t7047.check
+++ b/test/files/run/t7047.check
@@ -0,0 +1,3 @@
+Test_2.scala:2: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ Macros.foo
+ ^
diff --git a/test/files/run/t7096.scala b/test/files/run/t7096.scala
index 2a93dcc571..2495102899 100644
--- a/test/files/run/t7096.scala
+++ b/test/files/run/t7096.scala
@@ -1,3 +1,6 @@
+/*
+ * filter: inliner warning\(s\); re-run with -Yinline-warnings for details
+ */
import scala.tools.partest._
import scala.tools.nsc._
diff --git a/test/files/run/t7120b.scala b/test/files/run/t7120b.scala
index 9f6591aa06..0be4eb70a7 100644
--- a/test/files/run/t7120b.scala
+++ b/test/files/run/t7120b.scala
@@ -1,3 +1,6 @@
+
+import scala.language.higherKinds
+
trait Base[A] { type B = A; }
class C extends Base[String] {
class D {
diff --git a/test/files/run/t7171.check b/test/files/run/t7171.check
new file mode 100644
index 0000000000..d826f6cb94
--- /dev/null
+++ b/test/files/run/t7171.check
@@ -0,0 +1,3 @@
+t7171.scala:2: warning: The outer reference in this type test cannot be checked at run time.
+ final case class A()
+ ^
diff --git a/test/files/run/t7171.flags b/test/files/run/t7171.flags
new file mode 100644
index 0000000000..c02e5f2461
--- /dev/null
+++ b/test/files/run/t7171.flags
@@ -0,0 +1 @@
+-unchecked
diff --git a/test/files/run/t7171.scala b/test/files/run/t7171.scala
index 97585b9860..e0a1192228 100644
--- a/test/files/run/t7171.scala
+++ b/test/files/run/t7171.scala
@@ -16,7 +16,7 @@ object Test extends App {
val a1 = new t1.A()
val a2 = new t1.A()
assert(t1.foo(a1))
- // as noted in the unchecked warning (tested in the corresponding neg test),
+ // as noted in the unchecked warning (also tested in the corresponding neg test),
// the outer pointer isn't checked
assert(t1.foo(a2))
}
diff --git a/test/files/run/t7198.check b/test/files/run/t7198.check
new file mode 100644
index 0000000000..6dad496f49
--- /dev/null
+++ b/test/files/run/t7198.check
@@ -0,0 +1,2 @@
+The quick brown fox jumped
+And ran away with the vixen.
diff --git a/test/files/run/t7198.scala b/test/files/run/t7198.scala
new file mode 100644
index 0000000000..26e1d8805a
--- /dev/null
+++ b/test/files/run/t7198.scala
@@ -0,0 +1,9 @@
+/* spew a few lines
+ * filter: Over the moon
+ */
+object Test extends App {
+ Console println "The quick brown fox jumped"
+ Console println "Over the moon"
+ Console println "And ran away with the vixen."
+ Console println "Java HotSpot(TM) 64-Bit Server VM warning: Failed to reserve shared memory (errno = 28)."
+}
diff --git a/test/files/run/t7240/Test_2.scala b/test/files/run/t7240/Test_2.scala
index 2450bdabf9..5cc2cc7f78 100644
--- a/test/files/run/t7240/Test_2.scala
+++ b/test/files/run/t7240/Test_2.scala
@@ -1,3 +1,3 @@
object Test extends App {
- bakery.Bakery.failure
-} \ No newline at end of file
+ val v = bakery.Bakery.failure
+}
diff --git a/test/files/run/t7271.check b/test/files/run/t7271.check
index 6db301c21d..f7a23018ca 100644
--- a/test/files/run/t7271.check
+++ b/test/files/run/t7271.check
@@ -1,12 +1,12 @@
[[syntax trees at end of parser]] // newSource1.scala
-[0:91]package [0:0]<empty> {
- [0:91]class C extends [8:91][91]scala.AnyRef {
+[6]package [6]<empty> {
+ [6]class C extends [8][91]scala.AnyRef {
[8]def <init>() = [8]{
[NoPosition][NoPosition][NoPosition]super.<init>();
[8]()
};
- [16:44]def quote = [28:44]<28:44><28:44>[28]StringContext([30:34]"foo", [40:44]"baz").s([35:39]this);
- [51:85]def tripleQuote = [69:85]<69:85><69:85>[69]StringContext([71:75]"foo", [81:85]"baz").s([76:80]this)
+ [20]def quote = [28][28][28][28]StringContext([30]"foo", [40]"baz").s([35]this);
+ [55]def tripleQuote = [69][69][69][69]StringContext([71]"foo", [81]"baz").s([76]this)
}
}
diff --git a/test/files/run/t7271.scala b/test/files/run/t7271.scala
index 6fccf14d20..cb43331a29 100644
--- a/test/files/run/t7271.scala
+++ b/test/files/run/t7271.scala
@@ -4,6 +4,7 @@ import scala.tools.nsc._
import scala.tools.nsc.util.CommandLineParser
import scala.tools.nsc.{Global, Settings, CompilerCommand}
import scala.tools.nsc.reporters.ConsoleReporter
+import scala.reflect.internal.Positions
object Test extends DirectTest {
@@ -29,6 +30,6 @@ object Test extends DirectTest {
val settings = new Settings()
settings.Xprintpos.value = true
val command = new CompilerCommand((CommandLineParser tokenize extraSettings) ++ args.toList, settings)
- new Global(command.settings, new ConsoleReporter(settings)) with interactive.RangePositions
+ new Global(command.settings, new ConsoleReporter(settings)) with Positions
}
}
diff --git a/test/files/run/t7290.check b/test/files/run/t7290.check
new file mode 100644
index 0000000000..aff48abd4a
--- /dev/null
+++ b/test/files/run/t7290.check
@@ -0,0 +1,6 @@
+t7290.scala:4: warning: Pattern contains duplicate alternatives: 0
+ case 0 | 0 => 0
+ ^
+t7290.scala:5: warning: Pattern contains duplicate alternatives: 2, 3
+ case 2 | 2 | 2 | 3 | 2 | 3 => 0
+ ^
diff --git a/test/files/run/t7291.scala b/test/files/run/t7291.scala
index 30c4261a81..d996c615ce 100644
--- a/test/files/run/t7291.scala
+++ b/test/files/run/t7291.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ higherKinds, implicitConversions }
+
trait Fooable[T]
object Fooable {
implicit def conjure[T]: Fooable[T] = {
diff --git a/test/files/run/t7319.check b/test/files/run/t7319.check
index 966736915e..b5081f2d00 100644
--- a/test/files/run/t7319.check
+++ b/test/files/run/t7319.check
@@ -32,7 +32,14 @@ argument expression's type is not compatible with formal parameter type;
convert(Some[Int](0))
^
+scala> Range(1,2).toArray: Seq[_]
+<console>:11: error: polymorphic expression cannot be instantiated to expected type;
+ found : [B >: Int]Array[B]
+ required: Seq[_]
+ Range(1,2).toArray: Seq[_]
+ ^
+
scala> 0
-res1: Int = 0
+res2: Int = 0
scala>
diff --git a/test/files/run/t7319.scala b/test/files/run/t7319.scala
index 23ffeb977d..65a3ed922d 100644
--- a/test/files/run/t7319.scala
+++ b/test/files/run/t7319.scala
@@ -9,5 +9,6 @@ implicit def ma0[A](a: A): M[A] = null
implicit def ma1[A](a: A): M[A] = null
def convert[F[X <: F[X]]](builder: F[_ <: F[_]]) = 0
convert(Some[Int](0))
+Range(1,2).toArray: Seq[_]
0""" // before the fix, this line, and all that followed, re-issued the implicit ambiguity error.
}
diff --git a/test/files/run/t7436.scala b/test/files/run/t7436.scala
new file mode 100644
index 0000000000..867a931e05
--- /dev/null
+++ b/test/files/run/t7436.scala
@@ -0,0 +1,9 @@
+class A(val p: Int*)
+
+class B(val p1: Int) extends A(p1)
+
+object Test {
+ def main(args: Array[String]) {
+ new B(1).p1 // threw java.lang.ClassCastException: scala.collection.mutable.WrappedArray$ofInt cannot be cast to java.lang.Integer
+ }
+}
diff --git a/test/files/run/t874.scala b/test/files/run/t874.scala
index 41d124f728..7e70fc34eb 100644
--- a/test/files/run/t874.scala
+++ b/test/files/run/t874.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ reflectiveCalls }
object Test {
abstract class Base {
val U: {
diff --git a/test/files/run/tcpoly_monads.scala b/test/files/run/tcpoly_monads.scala
index cffbcc963b..6372851451 100644
--- a/test/files/run/tcpoly_monads.scala
+++ b/test/files/run/tcpoly_monads.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ higherKinds, implicitConversions }
+
trait Monads {
/**
* class Monad m where
diff --git a/test/files/run/tcpoly_overriding.scala b/test/files/run/tcpoly_overriding.scala
index 86ba89f530..32174ad8bf 100644
--- a/test/files/run/tcpoly_overriding.scala
+++ b/test/files/run/tcpoly_overriding.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ higherKinds }
+
abstract class A[t[x]] {
def b: t[Int]
}
diff --git a/test/files/run/tcpoly_parseridioms.check b/test/files/run/tcpoly_parseridioms.check
index 5fff2efb15..ab829e0a0e 100644
--- a/test/files/run/tcpoly_parseridioms.check
+++ b/test/files/run/tcpoly_parseridioms.check
@@ -1 +1,21 @@
+tcpoly_parseridioms.scala:18: warning: match may not be exhaustive.
+It would fail on the following input: ParseResult()
+ case Success(next, x) => b(next) match {
+ ^
+tcpoly_parseridioms.scala:17: warning: match may not be exhaustive.
+It would fail on the following input: ParseResult()
+ def apply(in: Input): ParseResult[Pair[T, U]] = a(in) match {
+ ^
+tcpoly_parseridioms.scala:30: warning: match may not be exhaustive.
+It would fail on the following input: ParseResult()
+ case Failure(_, _) => b(in) match {
+ ^
+tcpoly_parseridioms.scala:28: warning: match may not be exhaustive.
+It would fail on the following input: ParseResult()
+ def apply(in: Input): ParseResult[T] = a(in) match {
+ ^
+tcpoly_parseridioms.scala:39: warning: match may not be exhaustive.
+It would fail on the following input: ParseResult()
+ def apply(in: Input): ParseResult[U] = a(in) match {
+ ^
Success(List(),Plus(1,2))
diff --git a/test/files/run/tcpoly_parseridioms.scala b/test/files/run/tcpoly_parseridioms.scala
index 634240e44d..ec17e062db 100644
--- a/test/files/run/tcpoly_parseridioms.scala
+++ b/test/files/run/tcpoly_parseridioms.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ higherKinds, implicitConversions, postfixOps }
+
trait Parsers {
type Input = List[Char]
diff --git a/test/files/run/toolbox_console_reporter.scala b/test/files/run/toolbox_console_reporter.scala
index d672ccb9cb..ce28086c25 100644
--- a/test/files/run/toolbox_console_reporter.scala
+++ b/test/files/run/toolbox_console_reporter.scala
@@ -4,10 +4,10 @@ import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.{ToolBox, mkConsoleFrontEnd}
object Test extends App {
- val oldErr = Console.err;
- val baos = new java.io.ByteArrayOutputStream();
- Console.setErr(new java.io.PrintStream(baos));
- try {
+ //val oldErr = Console.err;
+ val baos = new java.io.ByteArrayOutputStream()
+ val errs = new java.io.PrintStream(baos)
+ (Console withErr errs) {
val toolbox = cm.mkToolBox(frontEnd = mkConsoleFrontEnd(), options = "-deprecation")
toolbox.eval(reify{
object Utils {
@@ -18,12 +18,11 @@ object Test extends App {
Utils.foo
}.tree)
println("============compiler console=============")
+ errs.flush()
println(baos.toString);
println("=========================================")
println("============compiler messages============")
toolbox.frontEnd.infos.foreach(println(_))
println("=========================================")
- } finally {
- Console.setErr(oldErr);
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/tpeCache-tyconCache.check b/test/files/run/tpeCache-tyconCache.check
new file mode 100644
index 0000000000..a892f5477a
--- /dev/null
+++ b/test/files/run/tpeCache-tyconCache.check
@@ -0,0 +1,19 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala> :power
+** Power User mode enabled - BEEP WHIR GYVE **
+** :phase has been set to 'typer'. **
+** scala.tools.nsc._ has been imported **
+** global._, definitions._ also imported **
+** Try :help, :vals, power.<tab> **
+
+scala>
+
+scala> AnyRefClass.tpe eq AnyRefClass.typeConstructor
+res0: Boolean = true
+
+scala> AnyRefClass.tpe eq AnyRefClass.typeConstructor
+res1: Boolean = true
+
+scala>
diff --git a/test/files/run/tpeCache-tyconCache.scala b/test/files/run/tpeCache-tyconCache.scala
new file mode 100644
index 0000000000..f907167a33
--- /dev/null
+++ b/test/files/run/tpeCache-tyconCache.scala
@@ -0,0 +1,10 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ override def code = """
+:power
+
+AnyRefClass.tpe eq AnyRefClass.typeConstructor
+AnyRefClass.tpe eq AnyRefClass.typeConstructor
+ """.trim
+}
diff --git a/test/files/run/transform.scala b/test/files/run/transform.scala
index 5cc1c49d6f..82f924950d 100644
--- a/test/files/run/transform.scala
+++ b/test/files/run/transform.scala
@@ -1,5 +1,5 @@
object Test {
- val x = 1 to 10 toBuffer
+ val x = (1 to 10).toBuffer
def main(args: Array[String]): Unit = {
x transform (_ * 2)
diff --git a/test/files/run/try-2.check b/test/files/run/try-2.check
index 6c4a024c93..987d3462df 100644
--- a/test/files/run/try-2.check
+++ b/test/files/run/try-2.check
@@ -1,3 +1,6 @@
+try-2.scala:41: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 10;
+ ^
exception happened
Nothin
diff --git a/test/files/run/try-2.scala b/test/files/run/try-2.scala
index da321f2668..b55977ba8b 100644
--- a/test/files/run/try-2.scala
+++ b/test/files/run/try-2.scala
@@ -12,42 +12,42 @@ object Test {
throw new Error();
}
catch {
- case _ => Console.println("exception happened\n");
+ case _: Throwable => Console.println("exception happened\n");
}
def tryUnitAll: Unit =
try {
Console.println("Nothin");
} catch {
- case _ => sys.error("Bad, bad, lama!");
+ case _: Throwable => sys.error("Bad, bad, lama!");
}
def tryAllAll: Unit =
try {
throw new Error();
} catch {
- case _ => sys.error("Bad, bad, lama!");
+ case _: Throwable => sys.error("Bad, bad, lama!");
}
def tryUnitUnit: Unit =
try {
Console.println("Nothin");
} catch {
- case _ => Console.println("Nothin");
+ case _: Throwable => Console.println("Nothin");
}
def tryIntUnit: Unit =
try {
10;
} catch {
- case _ => Console.println("Huh?");
+ case _: Throwable => Console.println("Huh?");
}
def execute(f: => Unit) = try {
f;
} catch {
- case _ => ();
+ case _: Throwable => ();
}
diff --git a/test/files/run/try-catch-unify.scala b/test/files/run/try-catch-unify.scala
index 8cb14d060e..151e549e5f 100644
--- a/test/files/run/try-catch-unify.scala
+++ b/test/files/run/try-catch-unify.scala
@@ -9,7 +9,7 @@ object Test {
try {
catching(classOf[NumberFormatException]) withTry (sys.error("O NOES"))
} catch {
- case t => println(t.getMessage)
+ case t: Throwable => println(t.getMessage)
}
println(nonFatalCatch withTry ("Hi".toDouble))
}
diff --git a/test/files/run/try.check b/test/files/run/try.check
index 3983e26060..f742ccb0df 100644
--- a/test/files/run/try.check
+++ b/test/files/run/try.check
@@ -1,3 +1,6 @@
+try.scala:65: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 1+1;
+ ^
1 + 1 = 2
1 + 1 = 2
1 + 1 = 2
diff --git a/test/files/run/try.scala b/test/files/run/try.scala
index e393c0b4b1..a4fdfd796b 100644
--- a/test/files/run/try.scala
+++ b/test/files/run/try.scala
@@ -45,7 +45,7 @@ object Test extends AnyRef with App {
instance = try {
"" //new String();
} catch {
- case _ =>
+ case _: Throwable =>
val cs = "aaa";
if (cs.length() > 0) {
"" //new String();
@@ -65,13 +65,13 @@ object Test extends AnyRef with App {
1+1;
()
} catch {
- case _ =>
+ case _: Throwable =>
Console.println("2");
sys.error("for good");
}
Console.println("a");
} catch {
- case _ => ();
+ case _: Throwable => ();
}
class A {
@@ -95,7 +95,7 @@ object Test extends AnyRef with App {
try {
null
} catch {
- case _ => null
+ case _: Throwable => null
}
new AnyRef {
diff --git a/test/files/run/tuple-zipped.scala b/test/files/run/tuple-zipped.scala
index b197183844..c8ba41f042 100644
--- a/test/files/run/tuple-zipped.scala
+++ b/test/files/run/tuple-zipped.scala
@@ -1,3 +1,6 @@
+
+import scala.language.postfixOps
+
object Test {
val xs1 = List.range(1, 100)
val xs2 = xs1.view
diff --git a/test/files/run/tuples.scala b/test/files/run/tuples.scala
index 4854e36c96..a4ea9ddbcc 100644
--- a/test/files/run/tuples.scala
+++ b/test/files/run/tuples.scala
@@ -6,6 +6,7 @@ object Test extends App {
Console.println(xyz)
xyz match {
case (1, "abc", true) => Console.println("OK")
+ case _ => ???
}
def func(x: Int, y: String, z: Double) {
Console.println("x = " + x + "; y = " + y + "; z = " + z);
diff --git a/test/files/run/type-currying.scala b/test/files/run/type-currying.scala
index f9764c64f0..5e31fef403 100644
--- a/test/files/run/type-currying.scala
+++ b/test/files/run/type-currying.scala
@@ -1,3 +1,6 @@
+
+
+import scala.language.{ higherKinds, reflectiveCalls }
import scala.collection.{ mutable, immutable, generic }
import generic.CanBuildFrom
diff --git a/test/files/run/unapply.check b/test/files/run/unapply.check
new file mode 100644
index 0000000000..847e3b381e
--- /dev/null
+++ b/test/files/run/unapply.check
@@ -0,0 +1,3 @@
+unapply.scala:57: warning: comparing values of types Null and Null using `==' will always yield true
+ assert(doMatch2(b) == null)
+ ^
diff --git a/test/files/run/unittest_io.scala b/test/files/run/unittest_io.scala
index 2cadb9b1df..2c3dacdf91 100644
--- a/test/files/run/unittest_io.scala
+++ b/test/files/run/unittest_io.scala
@@ -1,3 +1,5 @@
+
+@deprecated("Suppress warnings", since="2.11")
object Test {
def main(args: Array[String]) {
diff --git a/test/files/run/unreachable.scala b/test/files/run/unreachable.scala
index 50a8d88b7c..99ac730746 100644
--- a/test/files/run/unreachable.scala
+++ b/test/files/run/unreachable.scala
@@ -1,3 +1,6 @@
+import scala.util.Random.nextInt
+import scala.sys.error
+
object Test extends App {
def unreachableNormalExit: Int = {
return 42
@@ -6,14 +9,14 @@ object Test extends App {
def unreachableIf: Int = {
return 42
- if (util.Random.nextInt % 2 == 0)
+ if (nextInt % 2 == 0)
0
else
1
}
def unreachableIfBranches: Int = {
- if (util.Random.nextInt % 2 == 0)
+ if (nextInt % 2 == 0)
return 42
else
return 42
@@ -22,14 +25,14 @@ object Test extends App {
}
def unreachableOneLegIf: Int = {
- if (util.Random.nextInt % 2 == 0)
+ if (nextInt % 2 == 0)
return 42
return 42
}
def unreachableLeftBranch: Int = {
- val result = if (util.Random.nextInt % 2 == 0)
+ val result = if (nextInt % 2 == 0)
return 42
else
42
@@ -38,7 +41,7 @@ object Test extends App {
}
def unreachableRightBranch: Int = {
- val result = if (util.Random.nextInt % 2 == 0)
+ val result = if (nextInt % 2 == 0)
42
else
return 42
@@ -89,7 +92,7 @@ object Test extends App {
def unreachableSwitch: Int = {
return 42
- val x = util.Random.nextInt % 2
+ val x = nextInt % 2
x match {
case 0 => return 0
case 1 => return 1
@@ -99,7 +102,7 @@ object Test extends App {
}
def unreachableAfterSwitch: Int = {
- val x = util.Random.nextInt % 2
+ val x = nextInt % 2
x match {
case 0 => return 42
case 1 => return 41 + x
@@ -122,4 +125,4 @@ object Test extends App {
check(unreachableAfterFinally)
check(unreachableSwitch)
check(unreachableAfterSwitch)
-} \ No newline at end of file
+}
diff --git a/test/files/run/valueclasses-classmanifest-basic.scala b/test/files/run/valueclasses-classmanifest-basic.scala
index c2aa08ef86..50addda359 100644
--- a/test/files/run/valueclasses-classmanifest-basic.scala
+++ b/test/files/run/valueclasses-classmanifest-basic.scala
@@ -1,5 +1,6 @@
class Foo(val x: Int) extends AnyVal
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
println(classManifest[Foo])
-} \ No newline at end of file
+}
diff --git a/test/files/run/valueclasses-classmanifest-existential.scala b/test/files/run/valueclasses-classmanifest-existential.scala
index 11999df678..6bcd7cf942 100644
--- a/test/files/run/valueclasses-classmanifest-existential.scala
+++ b/test/files/run/valueclasses-classmanifest-existential.scala
@@ -1,5 +1,6 @@
class Foo[T](val x: T) extends AnyVal
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
println(classManifest[Foo[_]])
-} \ No newline at end of file
+}
diff --git a/test/files/run/valueclasses-classmanifest-generic.scala b/test/files/run/valueclasses-classmanifest-generic.scala
index 280152dc1d..5efcaed959 100644
--- a/test/files/run/valueclasses-classmanifest-generic.scala
+++ b/test/files/run/valueclasses-classmanifest-generic.scala
@@ -1,5 +1,6 @@
class Foo[T](val x: T) extends AnyVal
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
println(classManifest[Foo[String]])
-} \ No newline at end of file
+}
diff --git a/test/files/run/vector1.scala b/test/files/run/vector1.scala
index b37cfe82e8..2e335aded4 100644
--- a/test/files/run/vector1.scala
+++ b/test/files/run/vector1.scala
@@ -102,7 +102,7 @@ object Test {
seqBack()
}
} catch {
- case ex =>
+ case ex: Throwable =>
//println("----------------")
//a.debug
throw ex
diff --git a/test/files/run/view-iterator-stream.scala b/test/files/run/view-iterator-stream.scala
index f91407f92c..c172b5cb99 100644
--- a/test/files/run/view-iterator-stream.scala
+++ b/test/files/run/view-iterator-stream.scala
@@ -1,3 +1,6 @@
+
+import scala.language.postfixOps
+
import scala.collection.{ mutable, immutable, generic }
import collection.TraversableView
diff --git a/test/files/run/virtpatmat_alts.check b/test/files/run/virtpatmat_alts.check
index 7a4ad0a741..f39e292fef 100644
--- a/test/files/run/virtpatmat_alts.check
+++ b/test/files/run/virtpatmat_alts.check
@@ -1 +1,7 @@
+virtpatmat_alts.scala:5: warning: match may not be exhaustive.
+ (true, true) match {
+ ^
+virtpatmat_alts.scala:9: warning: match may not be exhaustive.
+ List(5) match {
+ ^
OK 5
diff --git a/test/files/run/virtpatmat_alts.flags b/test/files/run/virtpatmat_alts.flags
deleted file mode 100644
index 3f5a3100e4..0000000000
--- a/test/files/run/virtpatmat_alts.flags
+++ /dev/null
@@ -1 +0,0 @@
- -Xexperimental
diff --git a/test/files/run/virtpatmat_alts.scala b/test/files/run/virtpatmat_alts.scala
index b7717524e2..d1dfa8a4a1 100644
--- a/test/files/run/virtpatmat_alts.scala
+++ b/test/files/run/virtpatmat_alts.scala
@@ -1,3 +1,6 @@
+/*
+ * filter: It would fail on the following input
+ */
object Test extends App {
(true, true) match {
case (true, true) | (false, false) => 1
@@ -9,4 +12,4 @@ object Test extends App {
case 7 :: Nil => println("FAILED")
case Nil => println("FAILED")
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/virtpatmat_nested_lists.check b/test/files/run/virtpatmat_nested_lists.check
index d8263ee986..ddf68eeedd 100644
--- a/test/files/run/virtpatmat_nested_lists.check
+++ b/test/files/run/virtpatmat_nested_lists.check
@@ -1 +1,4 @@
-2 \ No newline at end of file
+virtpatmat_nested_lists.scala:5: warning: match may not be exhaustive.
+ List(List(1), List(2)) match { case x :: (y :: Nil) :: Nil => println(y) }
+ ^
+2
diff --git a/test/files/run/virtpatmat_nested_lists.flags b/test/files/run/virtpatmat_nested_lists.flags
deleted file mode 100644
index 3f5a3100e4..0000000000
--- a/test/files/run/virtpatmat_nested_lists.flags
+++ /dev/null
@@ -1 +0,0 @@
- -Xexperimental
diff --git a/test/files/run/virtpatmat_nested_lists.scala b/test/files/run/virtpatmat_nested_lists.scala
index fef74cea15..d1aa68ea93 100644
--- a/test/files/run/virtpatmat_nested_lists.scala
+++ b/test/files/run/virtpatmat_nested_lists.scala
@@ -1,3 +1,6 @@
+/*
+ * filter: It would fail on the following input
+ */
object Test extends App {
List(List(1), List(2)) match { case x :: (y :: Nil) :: Nil => println(y) }
}
diff --git a/test/files/run/virtpatmat_opt_sharing.check b/test/files/run/virtpatmat_opt_sharing.check
index d00491fd7e..78ec61f19d 100644
--- a/test/files/run/virtpatmat_opt_sharing.check
+++ b/test/files/run/virtpatmat_opt_sharing.check
@@ -1 +1,4 @@
+virtpatmat_opt_sharing.scala:7: warning: match may not be exhaustive.
+ List(1, 3, 4, 7) match {
+ ^
1
diff --git a/test/files/run/virtpatmat_opt_sharing.flags b/test/files/run/virtpatmat_opt_sharing.flags
deleted file mode 100644
index 3f5a3100e4..0000000000
--- a/test/files/run/virtpatmat_opt_sharing.flags
+++ /dev/null
@@ -1 +0,0 @@
- -Xexperimental
diff --git a/test/files/run/virtpatmat_opt_sharing.scala b/test/files/run/virtpatmat_opt_sharing.scala
index 119e3050ea..d2c42cab48 100644
--- a/test/files/run/virtpatmat_opt_sharing.scala
+++ b/test/files/run/virtpatmat_opt_sharing.scala
@@ -1,3 +1,6 @@
+/*
+ * filter: It would fail on the following input
+ */
object Test extends App {
virtMatch()
def virtMatch() = {
@@ -7,4 +10,4 @@ object Test extends App {
case 1 :: 3 :: 4 :: 7 :: x => println(1)
}
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/virtpatmat_staging.scala b/test/files/run/virtpatmat_staging.scala
index c17b45043b..d444829b02 100644
--- a/test/files/run/virtpatmat_staging.scala
+++ b/test/files/run/virtpatmat_staging.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ higherKinds, implicitConversions }
+
trait Intf {
type Rep[+T]
type M[+T] = Rep[Maybe[T]]
@@ -9,7 +12,7 @@ trait Intf {
def zero: M[Nothing]
def one[T](x: Rep[T]): M[T]
- def guard[T](cond: Rep[Boolean], then: => Rep[T]): M[T]
+ def guard[T](cond: Rep[Boolean], dann: => Rep[T]): M[T]
def isSuccess[T, U](x: Rep[T])(f: Rep[T] => M[U]): Rep[Boolean] // used for isDefinedAt
}
@@ -33,7 +36,7 @@ trait Impl extends Intf {
def runOrElse[T, U](in: Rep[T])(matcher: Rep[T] => M[U]): Rep[U] = ("runOrElse("+ in +", ?" + matcher("?") + ")")
def zero: M[Nothing] = "zero"
def one[T](x: Rep[T]): M[T] = "one("+x.toString+")"
- def guard[T](cond: Rep[Boolean], then: => Rep[T]): M[T] = "guard("+cond+","+then+")"
+ def guard[T](cond: Rep[Boolean], dann: => Rep[T]): M[T] = s"guard($cond,$dann)"
def isSuccess[T, U](x: Rep[T])(f: Rep[T] => M[U]): Rep[Boolean] = ("isSuccess("+x+", ?" + f("?") + ")")
}
diff --git a/test/files/run/virtpatmat_stringinterp.scala b/test/files/run/virtpatmat_stringinterp.scala
index 213712f17a..c6c951e6e5 100644
--- a/test/files/run/virtpatmat_stringinterp.scala
+++ b/test/files/run/virtpatmat_stringinterp.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ implicitConversions }
+
object Test extends App {
case class Node(x: Int)
@@ -10,4 +13,4 @@ object Test extends App {
val x: Node = Node(0)
x match { case xml"""<foo arg=$a/>""" => println(a) }
-} \ No newline at end of file
+}
diff --git a/test/files/run/virtpatmat_try.scala b/test/files/run/virtpatmat_try.scala
index 46e67cb72e..dab2c89227 100644
--- a/test/files/run/virtpatmat_try.scala
+++ b/test/files/run/virtpatmat_try.scala
@@ -8,7 +8,7 @@ object Test extends App {
} catch { // this should emit a "catch-switch"
case y: A => println(y.x)
case (_ : A | _ : B) => println("B")
- case _ => println("other")
+ case _: Throwable => println("other")
}
try {
@@ -17,7 +17,7 @@ object Test extends App {
// case A(x) => println(x)
case y: A => println(y.x)
case x@((_ : A) | (_ : B)) => println(x)
- case _ => println("other")
+ case _: Throwable => println("other")
}
def simpleTry {
@@ -34,7 +34,7 @@ object Test extends App {
}
def wildcardTry {
- try { bla } catch { case _ => bla }
+ try { bla } catch { case _: Throwable => bla }
}
def tryPlusFinally {
@@ -44,4 +44,4 @@ object Test extends App {
def catchAndPassToLambda {
try { bla } catch { case ex: Exception => val f = () => ex }
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/virtpatmat_typed.check b/test/files/run/virtpatmat_typed.check
index cec2740d18..9924d84148 100644
--- a/test/files/run/virtpatmat_typed.check
+++ b/test/files/run/virtpatmat_typed.check
@@ -1 +1,4 @@
+virtpatmat_typed.scala:5: warning: unreachable code
+ case x: String => println("FAILED")
+ ^
OK foo
diff --git a/test/files/run/xml-loop-bug.scala b/test/files/run/xml-loop-bug.scala
index 67637674b2..dc155dbb02 100644
--- a/test/files/run/xml-loop-bug.scala
+++ b/test/files/run/xml-loop-bug.scala
@@ -1,8 +1,14 @@
+import java.io.{ Console => _, _ }
+import scala.io._
+import scala.xml.parsing._
object Test {
def main(args: Array[String]): Unit = {
- val sink = new java.io.PrintStream(new java.io.ByteArrayOutputStream())
- Console setOut sink
- Console setErr sink
- scala.xml.parsing.ConstructingParser.fromSource(scala.io.Source.fromString("<!DOCTYPE xmeml SYSTEM> <xmeml> <sequence> </sequence> </xmeml> "), true).document.docElem
+ val xml = "<!DOCTYPE xmeml SYSTEM> <xmeml> <sequence> </sequence> </xmeml> "
+ val sink = new PrintStream(new ByteArrayOutputStream())
+ (Console withOut sink) {
+ (Console withErr sink) {
+ ConstructingParser.fromSource((Source fromString xml), true).document.docElem
+ }
+ }
}
}
diff --git a/test/files/specialized/spec-matrix-old.scala b/test/files/specialized/spec-matrix-old.scala
index 98735c8c03..83941e80a7 100644
--- a/test/files/specialized/spec-matrix-old.scala
+++ b/test/files/specialized/spec-matrix-old.scala
@@ -1,6 +1,7 @@
/** Test matrix multiplication with specialization.
*/
+@deprecated("Suppress warnings", since="2.11")
class Matrix[@specialized A: ClassManifest](val rows: Int, val cols: Int) {
private val arr: Array[Array[A]] = Array.ofDim[A](rows, cols)
@@ -25,6 +26,7 @@ class Matrix[@specialized A: ClassManifest](val rows: Int, val cols: Int) {
}
}
+@deprecated("Suppress warnings", since="2.11")
object Test {
def main(args: Array[String]) {
val m = randomMatrix(200, 100)
diff --git a/test/files/specialized/spec-super.check b/test/files/specialized/spec-super.check
index 4be83ca9e6..2f4d60018b 100644
--- a/test/files/specialized/spec-super.check
+++ b/test/files/specialized/spec-super.check
@@ -1,3 +1,6 @@
+spec-super.scala:18: warning: class Base must be a trait. Specialized version of class Extended will inherit generic Base[Int]
+class Extended [@specialized(Int) T](t: T) extends Base[T](t) {
+ ^
s
1
-2 \ No newline at end of file
+2
diff --git a/test/files/specialized/spec-t3896.scala b/test/files/specialized/spec-t3896.scala
index 605ed0df9d..3a3be3da2b 100644
--- a/test/files/specialized/spec-t3896.scala
+++ b/test/files/specialized/spec-t3896.scala
@@ -12,7 +12,7 @@ object Test {
def main(args: Array[String]): Unit = {
val e = new AtomicBoolean(false)
val x = e.f( (a : Boolean) => !a ) // ok
- println( e.f( (a : Boolean) => !a ) toString ) // ok
+ println( e.f( (a : Boolean) => !a ).toString ) // ok
println( e.f( (a : Boolean) => !a) ) // compiler crash
println(runtime.BoxesRunTime.integerBoxCount)
diff --git a/test/files/specialized/tb3651.check b/test/files/specialized/tb3651.check
index c227083464..8a3f686ef5 100644
--- a/test/files/specialized/tb3651.check
+++ b/test/files/specialized/tb3651.check
@@ -1 +1,4 @@
-0 \ No newline at end of file
+tb3651.scala:8: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ lk.a
+ ^
+0
diff --git a/test/files/specialized/tc3651.check b/test/files/specialized/tc3651.check
index c227083464..e2dbadf22c 100644
--- a/test/files/specialized/tc3651.check
+++ b/test/files/specialized/tc3651.check
@@ -1 +1,4 @@
-0 \ No newline at end of file
+tc3651.scala:12: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ lk.a
+ ^
+0
diff --git a/test/files/specialized/td3651.check b/test/files/specialized/td3651.check
index 9aea9e0ce5..1a709fd0a7 100644
--- a/test/files/specialized/td3651.check
+++ b/test/files/specialized/td3651.check
@@ -1,2 +1,8 @@
+td3651.scala:12: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ b.a
+ ^
+td3651.scala:16: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ der.a
+ ^
+0
0
-0 \ No newline at end of file