diff options
Diffstat (limited to 'src')
22 files changed, 228 insertions, 91 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index 9e631febee..ffc45b21ea 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -654,9 +654,10 @@ self => def isIdentExcept(except: Name) = isIdent && in.name != except def isIdentOf(name: Name) = isIdent && in.name == name - def isUnaryOp = isIdent && raw.isUnary(in.name) - def isRawStar = isIdent && in.name == raw.STAR - def isRawBar = isIdent && in.name == raw.BAR + def isUnaryOp = isIdent && raw.isUnary(in.name) + def isRawStar = isRawIdent && in.name == raw.STAR + def isRawBar = isRawIdent && in.name == raw.BAR + def isRawIdent = in.token == IDENTIFIER def isIdent = in.token == IDENTIFIER || in.token == BACKQUOTED_IDENT def isMacro = in.token == IDENTIFIER && in.name == nme.MACROkw @@ -1001,19 +1002,30 @@ self => } def infixTypeRest(t: Tree, mode: InfixMode.Value): Tree = { - if (isIdent && in.name != nme.STAR) { - val opOffset = in.offset + // Detect postfix star for repeated args. + // Only RPAREN can follow, but accept COMMA and EQUALS for error's sake. + // Take RBRACE as a paren typo. + def checkRepeatedParam = if (isRawStar) { + lookingAhead (in.token match { + case RPAREN | COMMA | EQUALS | RBRACE => t + case _ => EmptyTree + }) + } else EmptyTree + def asInfix = { + val opOffset = in.offset val leftAssoc = treeInfo.isLeftAssoc(in.name) - if (mode != InfixMode.FirstOp) checkAssoc(opOffset, in.name, leftAssoc = mode == InfixMode.LeftOp) - val op = identForType() - val tycon = atPos(opOffset) { Ident(op) } + if (mode != InfixMode.FirstOp) + checkAssoc(opOffset, in.name, leftAssoc = mode == InfixMode.LeftOp) + val tycon = atPos(opOffset) { Ident(identForType()) } newLineOptWhenFollowing(isTypeIntroToken) def mkOp(t1: Tree) = atPos(t.pos.start, opOffset) { AppliedTypeTree(tycon, List(t, t1)) } if (leftAssoc) infixTypeRest(mkOp(compoundType()), InfixMode.LeftOp) else mkOp(infixType(InfixMode.RightOp)) - } else t + } + if (isIdent) checkRepeatedParam orElse asInfix + else t } /** {{{ diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala index 359e5d6c29..f800dbf9cd 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala @@ -239,6 +239,13 @@ abstract class BCodeHelpers extends BCodeTypes with BytecodeWriters { } /* + * must-single-thread + */ + def serialVUID(csym: Symbol): Option[Long] = csym getAnnotation definitions.SerialVersionUIDAttr collect { + case AnnotationInfo(_, _, (_, LiteralAnnotArg(const)) :: Nil) => const.longValue + } + + /* * Populates the InnerClasses JVM attribute with `refedInnerClasses`. * In addition to inner classes mentioned somewhere in `jclass` (where `jclass` is a class file being emitted) * `refedInnerClasses` should contain those inner classes defined as direct member classes of `jclass` @@ -881,13 +888,6 @@ abstract class BCodeHelpers extends BCodeTypes with BytecodeWriters { val MIN_SWITCH_DENSITY = 0.7 /* - * must-single-thread - */ - def serialVUID(csym: Symbol): Option[Long] = csym getAnnotation definitions.SerialVersionUIDAttr collect { - case AnnotationInfo(_, Literal(const) :: _, _) => const.longValue - } - - /* * Add public static final field serialVersionUID with value `id` * * can-multi-thread diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala index a389816caf..b7f9b30e19 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala @@ -1142,9 +1142,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM { def isParcelableClass = isAndroidParcelableClass(clasz.symbol) - def serialVUID: Option[Long] = clasz.symbol getAnnotation SerialVersionUIDAttr collect { - case AnnotationInfo(_, Literal(const) :: _, _) => const.longValue - } + def serialVUID: Option[Long] = genBCode.serialVUID(clasz.symbol) private def getSuperInterfaces(c: IClass): Array[String] = { diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index b166bf988d..4540017b62 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -132,7 +132,16 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans defaultMethodNames.toList.distinct foreach { name => val methods = clazz.info.findMember(name, 0L, requiredFlags = METHOD, stableOnly = false).alternatives - val haveDefaults = methods filter (sym => mexists(sym.info.paramss)(_.hasDefault) && !nme.isProtectedAccessorName(sym.name)) + def hasDefaultParam(tpe: Type): Boolean = tpe match { + case MethodType(params, restpe) => (params exists (_.hasDefault)) || hasDefaultParam(restpe) + case _ => false + } + val haveDefaults = methods filter ( + if (settings.isScala211) + (sym => mexists(sym.info.paramss)(_.hasDefault) && !nme.isProtectedAccessorName(sym.name)) + else + (sym => hasDefaultParam(sym.info) && !nme.isProtectedAccessorName(sym.name)) + ) if (haveDefaults.lengthCompare(1) > 0) { val owners = haveDefaults map (_.owner) diff --git a/src/intellij/README b/src/intellij/README index ade87749cd..a39691f4f0 100644 --- a/src/intellij/README +++ b/src/intellij/README @@ -1,8 +1,12 @@ Use the latest IntelliJ IDEA release and install the Scala plugin from within the IDE. +Compilation withing IDEA is performed in "-Dlocker.skip=1" mode: the sources are built +directly using the STARR compiler. + The following steps are required to use IntelliJ IDEA on Scala trunk - - compile "locker" using "ant locker.done". This will also download some JARs from - Maven to ./build/deps, which are included in IntelliJ's classpath. + - Run "ant init". This will download some JARs from to ./build/deps, which are + included in IntelliJ's classpath. - Run src/intellij/setup.sh - Open ./src/intellij/scala-lang.ipr in IntelliJ - - File, Project Settings, Project, SDK. Create an SDK entry named "1.6" containing the java 1.6 SDK + - File, Project Settings, Project, SDK. Create an SDK entry named "1.6" containing the + java 1.6 SDK diff --git a/src/intellij/actors.iml.SAMPLE b/src/intellij/actors.iml.SAMPLE index 896c4966ff..b15af8b110 100644 --- a/src/intellij/actors.iml.SAMPLE +++ b/src/intellij/actors.iml.SAMPLE @@ -4,7 +4,8 @@ <facet type="scala" name="Scala"> <configuration> <option name="compilerLibraryLevel" value="Project" /> - <option name="compilerLibraryName" value="compiler-locker" /> + <option name="compilerLibraryName" value="starr" /> + <option name="languageLevel" value="Scala 2.11" /> <option name="maximumHeapSize" value="1536" /> <option name="vmOptions" value="-Xms1536m -Xss1m -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -XX:+UseParallelGC" /> </configuration> diff --git a/src/intellij/compiler.iml.SAMPLE b/src/intellij/compiler.iml.SAMPLE index 9fb9cd55eb..50253000ab 100644 --- a/src/intellij/compiler.iml.SAMPLE +++ b/src/intellij/compiler.iml.SAMPLE @@ -4,7 +4,8 @@ <facet type="scala" name="Scala"> <configuration> <option name="compilerLibraryLevel" value="Project" /> - <option name="compilerLibraryName" value="compiler-locker" /> + <option name="compilerLibraryName" value="starr" /> + <option name="languageLevel" value="Scala 2.11" /> <option name="maximumHeapSize" value="1536" /> <option name="vmOptions" value="-Xms1536m -Xss1m -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -XX:+UseParallelGC" /> </configuration> @@ -19,8 +20,8 @@ <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="library" /> <orderEntry type="module" module-name="reflect" /> - <orderEntry type="module" module-name="asm" exported="" /> - <orderEntry type="library" exported="" name="ant" level="project" /> + <orderEntry type="module" module-name="asm" /> + <orderEntry type="library" name="ant" level="project" /> </component> </module> diff --git a/src/intellij/interactive.iml.SAMPLE b/src/intellij/interactive.iml.SAMPLE index c6c8ebb606..83178021d3 100644 --- a/src/intellij/interactive.iml.SAMPLE +++ b/src/intellij/interactive.iml.SAMPLE @@ -4,7 +4,8 @@ <facet type="scala" name="Scala"> <configuration> <option name="compilerLibraryLevel" value="Project" /> - <option name="compilerLibraryName" value="compiler-locker" /> + <option name="compilerLibraryName" value="starr" /> + <option name="languageLevel" value="Scala 2.11" /> <option name="maximumHeapSize" value="1536" /> <option name="vmOptions" value="-Xms1536m -Xss1m -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -XX:+UseParallelGC" /> </configuration> @@ -23,3 +24,4 @@ <orderEntry type="module" module-name="scaladoc" /> </component> </module> + diff --git a/src/intellij/library.iml.SAMPLE b/src/intellij/library.iml.SAMPLE index cac53dff15..137ce6eb9c 100644 --- a/src/intellij/library.iml.SAMPLE +++ b/src/intellij/library.iml.SAMPLE @@ -4,8 +4,9 @@ <facet type="scala" name="Scala"> <configuration> <option name="compilerLibraryLevel" value="Project" /> - <option name="compilerLibraryName" value="compiler-locker" /> - <option name="compilerOptions" value="-sourcepath $BASE_DIR$/src/library" /> + <option name="compilerLibraryName" value="starr" /> + <option name="compilerOptions" value="-sourcepath $MODULE_DIR$/../library" /> + <option name="languageLevel" value="Scala 2.11" /> <option name="maximumHeapSize" value="1536" /> <option name="vmOptions" value="-Xms1536m -Xss1m -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -XX:+UseParallelGC" /> </configuration> diff --git a/src/intellij/manual.iml.SAMPLE b/src/intellij/manual.iml.SAMPLE index 3295a4a877..8babde73ea 100644 --- a/src/intellij/manual.iml.SAMPLE +++ b/src/intellij/manual.iml.SAMPLE @@ -4,7 +4,8 @@ <facet type="scala" name="Scala"> <configuration> <option name="compilerLibraryLevel" value="Project" /> - <option name="compilerLibraryName" value="compiler-locker" /> + <option name="compilerLibraryName" value="starr" /> + <option name="languageLevel" value="Scala 2.11" /> <option name="maximumHeapSize" value="1536" /> <option name="vmOptions" value="-Xms1536m -Xss1m -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -XX:+UseParallelGC" /> </configuration> @@ -18,8 +19,8 @@ <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="library" /> - <orderEntry type="module" module-name="xml" /> <orderEntry type="library" name="ant" level="project" /> + <orderEntry type="library" name="scaladoc-deps" level="project" /> </component> </module> diff --git a/src/intellij/partest-extras.iml.SAMPLE b/src/intellij/partest-extras.iml.SAMPLE new file mode 100644 index 0000000000..c2ada43493 --- /dev/null +++ b/src/intellij/partest-extras.iml.SAMPLE @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="JAVA_MODULE" version="4"> + <component name="FacetManager"> + <facet type="scala" name="Scala"> + <configuration> + <option name="compilerLibraryLevel" value="Project" /> + <option name="compilerLibraryName" value="starr" /> + <option name="languageLevel" value="Scala 2.11" /> + </configuration> + </facet> + </component> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$/../partest-extras"> + <sourceFolder url="file://$MODULE_DIR$/../partest-extras" isTestSource="false" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module" module-name="asm" /> + <orderEntry type="module" module-name="library" /> + <orderEntry type="module" module-name="reflect" /> + <orderEntry type="module" module-name="compiler" /> + <orderEntry type="module" module-name="repl" /> + <orderEntry type="library" name="partest" level="project" /> + </component> +</module> + diff --git a/src/intellij/partest-javaagent.iml.SAMPLE b/src/intellij/partest-javaagent.iml.SAMPLE new file mode 100644 index 0000000000..e47e0f6349 --- /dev/null +++ b/src/intellij/partest-javaagent.iml.SAMPLE @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$/../partest-javaagent"> + <sourceFolder url="file://$MODULE_DIR$/../partest-javaagent" isTestSource="false" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module" module-name="asm" /> + </component> +</module> + diff --git a/src/intellij/reflect.iml.SAMPLE b/src/intellij/reflect.iml.SAMPLE index 7d10522826..d206304896 100644 --- a/src/intellij/reflect.iml.SAMPLE +++ b/src/intellij/reflect.iml.SAMPLE @@ -4,8 +4,9 @@ <facet type="scala" name="Scala"> <configuration> <option name="compilerLibraryLevel" value="Project" /> - <option name="compilerLibraryName" value="compiler-locker" /> - <option name="compilerOptions" value="-sourcepath $BASE_DIR$/src/reflect" /> + <option name="compilerLibraryName" value="starr" /> + <option name="compilerOptions" value="-sourcepath $MODULE_DIR$/../reflect" /> + <option name="languageLevel" value="Scala 2.11" /> <option name="maximumHeapSize" value="1536" /> <option name="vmOptions" value="-Xms1536m -Xss1m -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -XX:+UseParallelGC" /> </configuration> @@ -19,7 +20,6 @@ <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="library" /> - <orderEntry type="library" name="jline" level="project" /> </component> </module> diff --git a/src/intellij/repl.iml.SAMPLE b/src/intellij/repl.iml.SAMPLE index fc78ffe8c2..83791f4f6e 100644 --- a/src/intellij/repl.iml.SAMPLE +++ b/src/intellij/repl.iml.SAMPLE @@ -4,7 +4,8 @@ <facet type="scala" name="Scala"> <configuration> <option name="compilerLibraryLevel" value="Project" /> - <option name="compilerLibraryName" value="compiler-locker" /> + <option name="compilerLibraryName" value="starr" /> + <option name="languageLevel" value="Scala 2.11" /> <option name="maximumHeapSize" value="1536" /> <option name="vmOptions" value="-Xms1536m -Xss1m -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -XX:+UseParallelGC" /> </configuration> @@ -23,3 +24,4 @@ <orderEntry type="library" name="repl-deps" level="project" /> </component> </module> + diff --git a/src/intellij/scala-lang.ipr.SAMPLE b/src/intellij/scala-lang.ipr.SAMPLE index a0765b3e99..c0614c946c 100644 --- a/src/intellij/scala-lang.ipr.SAMPLE +++ b/src/intellij/scala-lang.ipr.SAMPLE @@ -1,8 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <project version="4"> - <component name="AntConfiguration"> - <defaultAnt bundledAnt="true" /> - </component> <component name="CompilerConfiguration"> <option name="DEFAULT_COMPILER" value="Javac" /> <resourceExtensions> @@ -21,11 +18,13 @@ <entry name="?*.tld" /> <entry name="?*.ftl" /> </wildcardResourcePatterns> - <annotationProcessing enabled="false" useClasspath="true" /> - </component> - <component name="CopyrightManager" default=""> - <module2copyright /> + <annotationProcessing> + <profile default="true" name="Default" enabled="false"> + <processorPath useClasspath="true" /> + </profile> + </annotationProcessing> </component> + <component name="CopyrightManager" default="" /> <component name="DependencyValidationManager"> <option name="SKIP_IMPORT_STATEMENTS" value="false" /> </component> @@ -41,11 +40,16 @@ <profile version="1.0" is_locked="false"> <option name="myName" value="Project Default" /> <option name="myLocal" value="false" /> + <inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false"> + <option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" /> + <option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" /> + </inspection_tool> <inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false"> <option name="processCode" value="true" /> <option name="processLiterals" value="true" /> <option name="processComments" value="true" /> </inspection_tool> + <inspection_tool class="UnitMethodIsParameterless" enabled="false" level="WARNING" enabled_by_default="false" /> </profile> </profiles> <option name="PROJECT_PROFILE" value="Project Default" /> @@ -53,7 +57,7 @@ <version value="1.0" /> </component> <component name="JavacSettings"> - <option name="ADDITIONAL_OPTIONS_STRING" value="-source 1.5 -target 1.5" /> + <option name="ADDITIONAL_OPTIONS_STRING" value="-source 1.6 -target 1.6" /> </component> <component name="JavadocGenerationManager"> <option name="OUTPUT_DIRECTORY" /> @@ -205,12 +209,15 @@ <module fileurl="file://$PROJECT_DIR$/interactive.iml" filepath="$PROJECT_DIR$/interactive.iml" /> <module fileurl="file://$PROJECT_DIR$/library.iml" filepath="$PROJECT_DIR$/library.iml" /> <module fileurl="file://$PROJECT_DIR$/manual.iml" filepath="$PROJECT_DIR$/manual.iml" /> + <module fileurl="file://$PROJECT_DIR$/partest-extras.iml" filepath="$PROJECT_DIR$/partest-extras.iml" /> + <module fileurl="file://$PROJECT_DIR$/partest-javaagent.iml" filepath="$PROJECT_DIR$/partest-javaagent.iml" /> <module fileurl="file://$PROJECT_DIR$/reflect.iml" filepath="$PROJECT_DIR$/reflect.iml" /> <module fileurl="file://$PROJECT_DIR$/repl.iml" filepath="$PROJECT_DIR$/repl.iml" /> <module fileurl="file://$PROJECT_DIR$/scala.iml" filepath="$PROJECT_DIR$/scala.iml" /> <module fileurl="file://$PROJECT_DIR$/scaladoc.iml" filepath="$PROJECT_DIR$/scaladoc.iml" /> <module fileurl="file://$PROJECT_DIR$/scalap.iml" filepath="$PROJECT_DIR$/scalap.iml" /> <module fileurl="file://$PROJECT_DIR$/test.iml" filepath="$PROJECT_DIR$/test.iml" /> + <module fileurl="file://$PROJECT_DIR$/test-junit.iml" filepath="$PROJECT_DIR$/test-junit.iml" /> </modules> </component> <component name="ProjectResources"> @@ -234,45 +241,46 @@ <JAVADOC /> <SOURCES /> </library> - <library name="compiler-locker"> - <CLASSES> - <root url="file://$PROJECT_DIR$/../../build/locker/classes/library" /> - <root url="file://$PROJECT_DIR$/../../build/locker/classes/compiler" /> - <root url="file://$PROJECT_DIR$/../../build/locker/classes/reflect" /> - <root url="file://$PROJECT_DIR$/../../build/asm/classes" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> <library name="junit"> <CLASSES> <root url="file://$PROJECT_DIR$/../../build/deps/junit" /> </CLASSES> <JAVADOC /> - <SOURCES> - <root url="file://$PROJECT_DIR$/../../build/deps/junit" /> - </SOURCES> + <SOURCES /> <jarDirectory url="file://$PROJECT_DIR$/../../build/deps/junit" recursive="false" /> - <jarDirectory url="file://$PROJECT_DIR$/../../build/deps/junit" recursive="false" type="SOURCES" /> </library> - <library name="partest-deps"> + <library name="partest"> <CLASSES> <root url="file://$PROJECT_DIR$/../../build/deps/partest" /> </CLASSES> <JAVADOC /> - <SOURCES> - <root url="file://$PROJECT_DIR$/../../build/deps/junit" /> - </SOURCES> + <SOURCES /> <jarDirectory url="file://$PROJECT_DIR$/../../build/deps/partest" recursive="false" /> - <jarDirectory url="file://$PROJECT_DIR$/../../build/deps/junit" recursive="false" type="SOURCES" /> </library> <library name="repl-deps"> - <CLASSES> + <CLASSES> <root url="file://$PROJECT_DIR$/../../build/deps/repl" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> + </CLASSES> + <JAVADOC /> + <SOURCES /> <jarDirectory url="file://$PROJECT_DIR$/../../build/deps/repl" recursive="false" /> - </library> + </library> + <library name="scaladoc-deps"> + <CLASSES> + <root url="file://$PROJECT_DIR$/../../build/deps/scaladoc" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + <jarDirectory url="file://$PROJECT_DIR$/../../build/deps/scaladoc" recursive="false" /> + </library> + <library name="starr"> + <CLASSES> + <root url="file://$PROJECT_DIR$/../../build/deps/starr" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + <jarDirectory url="file://$PROJECT_DIR$/../../build/deps/starr" recursive="false" /> + </library> </component> </project> + diff --git a/src/intellij/scaladoc.iml.SAMPLE b/src/intellij/scaladoc.iml.SAMPLE index 07bea5bf5d..8f9a0d8344 100644 --- a/src/intellij/scaladoc.iml.SAMPLE +++ b/src/intellij/scaladoc.iml.SAMPLE @@ -4,7 +4,8 @@ <facet type="scala" name="Scala"> <configuration> <option name="compilerLibraryLevel" value="Project" /> - <option name="compilerLibraryName" value="compiler-locker" /> + <option name="compilerLibraryName" value="starr" /> + <option name="languageLevel" value="Scala 2.11" /> <option name="maximumHeapSize" value="1536" /> <option name="vmOptions" value="-Xms1536m -Xss1m -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -XX:+UseParallelGC" /> </configuration> @@ -20,8 +21,8 @@ <orderEntry type="module" module-name="library" /> <orderEntry type="module" module-name="reflect" /> <orderEntry type="module" module-name="compiler" /> - <orderEntry type="module" module-name="xml" /> - <orderEntry type="module" module-name="parser-combinators" /> - <orderEntry type="module" module-name="partest" /> + <orderEntry type="library" name="partest" level="project" /> + <orderEntry type="library" name="scaladoc-deps" level="project" /> </component> </module> + diff --git a/src/intellij/scalap.iml.SAMPLE b/src/intellij/scalap.iml.SAMPLE index 77eea7c38f..27ae451369 100644 --- a/src/intellij/scalap.iml.SAMPLE +++ b/src/intellij/scalap.iml.SAMPLE @@ -4,7 +4,8 @@ <facet type="scala" name="Scala"> <configuration> <option name="compilerLibraryLevel" value="Project" /> - <option name="compilerLibraryName" value="compiler-locker" /> + <option name="compilerLibraryName" value="starr" /> + <option name="languageLevel" value="Scala 2.11" /> <option name="maximumHeapSize" value="1536" /> <option name="vmOptions" value="-Xms1536m -Xss1m -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -XX:+UseParallelGC" /> </configuration> diff --git a/src/intellij/setup.sh b/src/intellij/setup.sh index bd324ba5bd..ec303778ed 100755 --- a/src/intellij/setup.sh +++ b/src/intellij/setup.sh @@ -5,19 +5,10 @@ set -e export SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" -export BASE="$( cd "$( dirname "$0" )"/../.. && pwd )" echo "About to delete .ipr and .iml files and replace with the .SAMPLE files. Press enter to continue or CTRL-C to cancel." read -(rm -f *.ipr *.iml 2>/dev/null) -for f in $(ls "$SCRIPT_DIR"/*.SAMPLE); do - NEW_FILE=`echo $f | perl -pe 's/.SAMPLE//'`; - - cp $f $NEW_FILE - - # IntelliJ doesn't process the "compilerOptions" setting for variable - # replacement. If it did, we would just use "$PROJECT_DIR$". Instead, - # we do this replacement ourselves. - perl -pi -e 's/\$BASE_DIR\$/$ENV{"BASE"}/g' $NEW_FILE - echo "Created $NEW_FILE" +for f in "$SCRIPT_DIR"/*.SAMPLE; do + g=${f%.SAMPLE} + cp $f $g done diff --git a/src/intellij/test-junit.iml.SAMPLE b/src/intellij/test-junit.iml.SAMPLE new file mode 100644 index 0000000000..bb51c30a4f --- /dev/null +++ b/src/intellij/test-junit.iml.SAMPLE @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="JAVA_MODULE" version="4"> + <component name="FacetManager"> + <facet type="scala" name="Scala"> + <configuration> + <option name="compilerLibraryLevel" value="Project" /> + <option name="compilerLibraryName" value="starr" /> + </configuration> + </facet> + </component> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$/../../test/junit"> + <sourceFolder url="file://$MODULE_DIR$/../../test/junit" isTestSource="true" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module" module-name="actors" /> + <orderEntry type="module" module-name="asm" /> + <orderEntry type="module" module-name="compiler" /> + <orderEntry type="module" module-name="library" /> + <orderEntry type="module" module-name="reflect" /> + <orderEntry type="module" module-name="repl" /> + <orderEntry type="module" module-name="partest-extras" /> + <orderEntry type="module" module-name="forkjoin" /> + <orderEntry type="library" name="junit" level="project" /> + <orderEntry type="library" name="scaladoc-deps" level="project" /> + </component> +</module> + diff --git a/src/intellij/test.iml.SAMPLE b/src/intellij/test.iml.SAMPLE index 423be2062c..cb4a8568a1 100644 --- a/src/intellij/test.iml.SAMPLE +++ b/src/intellij/test.iml.SAMPLE @@ -1,21 +1,31 @@ <?xml version="1.0" encoding="UTF-8"?> <module type="JAVA_MODULE" version="4"> + <component name="FacetManager"> + <facet type="scala" name="Scala"> + <configuration> + <option name="compilerLibraryLevel" value="Project" /> + <option name="compilerLibraryName" value="starr" /> + <option name="languageLevel" value="Scala 2.11" /> + </configuration> + </facet> + </component> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> - <content url="file://$MODULE_DIR$/../../test" /> + <content url="file://$MODULE_DIR$/../../test"> + <excludeFolder url="file://$MODULE_DIR$/../../test/junit" /> + </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="library" /> - <orderEntry type="module" module-name="xml" /> - <orderEntry type="module" module-name="parser-combinators" /> <orderEntry type="module" module-name="reflect" /> <orderEntry type="module" module-name="compiler" /> + <orderEntry type="module" module-name="repl" /> <orderEntry type="module" module-name="actors" /> - <orderEntry type="module" module-name="swing" /> - <orderEntry type="module" module-name="partest" /> <orderEntry type="module" module-name="asm" /> <orderEntry type="module" module-name="forkjoin" /> - <orderEntry type="library" name="junit" level="project" /> + <orderEntry type="module" module-name="partest-extras" /> + <orderEntry type="library" name="scaladoc-deps" level="project" /> + <orderEntry type="library" name="partest" level="project" /> </component> </module> diff --git a/src/intellij/update.sh b/src/intellij/update.sh new file mode 100755 index 0000000000..eb6fea782f --- /dev/null +++ b/src/intellij/update.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# +# Updates the .SAMPLE files with the current project files. +# + +set -e +export SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" + +echo "About to create overwrite the .ipr.SAMPLE and .iml.SAMPLE files with the current project files. Press enter to continue or CTRL-C to cancel." +read + +for f in "$SCRIPT_DIR"/*.{iml,ipr}; do + cp $f $f.SAMPLE +done + +for f in "$SCRIPT_DIR"/*.SAMPLE; do + g=${f%.SAMPLE} + if [[ ! -f $g ]]; then + echo "Stale sample file, deleting $f" + rm $f + fi +done diff --git a/src/library/scala/reflect/Manifest.scala b/src/library/scala/reflect/Manifest.scala index 803c980058..2f7643bccf 100644 --- a/src/library/scala/reflect/Manifest.scala +++ b/src/library/scala/reflect/Manifest.scala @@ -64,6 +64,7 @@ trait Manifest[T] extends ClassManifest[T] with Equals { // TODO undeprecated until Scala reflection becomes non-experimental // @deprecated("Use type tags and manually check the corresponding class or type instead", "2.10.0") +@SerialVersionUID(1L) abstract class AnyValManifest[T <: AnyVal](override val toString: String) extends Manifest[T] with Equals { override def <:<(that: ClassManifest[_]): Boolean = (that eq this) || (that eq Manifest.Any) || (that eq Manifest.AnyVal) @@ -72,6 +73,7 @@ abstract class AnyValManifest[T <: AnyVal](override val toString: String) extend case _ => false } override def equals(that: Any): Boolean = this eq that.asInstanceOf[AnyRef] + @transient override val hashCode = System.identityHashCode(this) } @@ -228,6 +230,7 @@ object ManifestFactory { private abstract class PhantomManifest[T](_runtimeClass: Predef.Class[_], override val toString: String) extends ClassTypeManifest[T](None, _runtimeClass, Nil) { override def equals(that: Any): Boolean = this eq that.asInstanceOf[AnyRef] + @transient override val hashCode = System.identityHashCode(this) } |