summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #5541 from retronym/ticket/10067Adriaan Moors2016-12-195-1/+29
|\ | | | | SI-10067 Avoid linkage errors with type patterns, Java inner classes
| * SI-10067 Don't speculatively emit outer tests for inner Java classesJason Zaugg2016-11-182-3/+1
| | | | | | | | | | Followup to the previous commit to remove the unchecked warning when the speculative outer test is dropped in explicitouter.
| * SI-10067 Java defined inner classes don't have outer accessorsJason Zaugg2016-11-185-1/+31
| | | | | | | | | | | | | | | | | | | | If we pretend they do, we can walk into NoSuchMethodErrors when translating type patterns path dependent types. This commit avoids this symptom by changing the explicitouter info transformer. A following commit will change the pattern matcher itself to avoid speculatively adding this outer check that will be always dropped in explicitouter.
* | Merge pull request #5588 from retronym/ticket/10098Jason Zaugg2016-12-151-8/+5
|\ \ | | | | | | S-10098 Fix regression in Unix runner script with JAVA_HOME unset
| * | S-10098 Fix regression in Unix runner script with JAVA_HOME unsetJason Zaugg2016-12-081-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Rework bfa7ade0 to unconditionally set the system property with the contents of the bootclasspath, rather than trying to do this only for JVM 9+. The attempted JVM version detection code assumed JAVA_HOME was set, which isn't always the case.
* | | Merge pull request #5602 from retronym/ticket/SD-290Lukas Rytz2016-12-142-2/+41
|\ \ \ | | | | | | | | Modules w. serializable type alias "companions" are not serializable
| * | | Modules w. serializable type alias "companions" are not serializableJason Zaugg2016-12-142-2/+41
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The behaviour changed in #5550, this commit adapts to the change so that we'll be binary compatible after boostrapping. MiMa alerted us to a change in the parentage of two objects in the forkjoin package object. In Scala 2.12.0/1, they implemented `scala.Serializable`. Recently, this (synthetically added) parent was absent. This appears to be due to a bug fix in `companionSymbolOf`, which no longer treats objects and same-named type aliases to be companions. This commit manually adds the formerly-synthetic parents to these objects, and documents the change in compiler behaviour with a test. Fixes scala/scala-dev#290
* | | Merge pull request #5558 from larsrh/topic/deprecated-y-flagsAdriaan Moors2016-12-1315-75/+5
|\ \ \ | | | | | | | | Remove deprecated -Y flags
| * | | delete dead codeLars Hupel2016-12-011-2/+0
| | | |
| * | | remove deprecated compiler flag "-Yinfer-by-name"Lars Hupel2016-12-016-32/+3
| | | | | | | | | | | | | | | | This was slated for removal in 2.12.
| * | | remove deprecated compiler flag "-Yeta-expand-keeps-star"Lars Hupel2016-12-0111-42/+3
| | | | | | | | | | | | | | | | This was slated for removal in 2.12.
* | | | Merge pull request #5593 from ashawley/spec-jekyll-3Adriaan Moors2016-12-121-1/+1
|\ \ \ \ | | | | | | | | | | Update spec build to Jekyll 3.3
| * | | | Update spec build to Jekyll 3.3Aaron S. Hawley2016-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seth Tisue suggested updating the Jekyll dependency for the Scala spec in scala/scala-lang#559 so that is consistent with the scala-lang.org and docs.scala-lang.org Web sites. Upgrading Jekll from 2.5.3 to 3.3.0 produces slight differences in the HTML output. The differences in the HTML are isolated to the markup for source code highlighting. In the spec, those are Scala code listings and the blocks of extended-BNF. From what I saw looking at all the pages, they render exactly the same, pixel-for-pixel, as before. I hit print preview and also didn't notice any anomalies. I tested in Ruby 2.2.5 using rbenv 0.4.0, gem 2.4.5.1 and Bundler 1.13.6. This is compared to the Travis build that uses Ruby 2.2.0p0 using rvm 1.26.10, gem 2.4.5 and Bundler 1.7.9.
* | | | | Merge pull request #5531 from tabdulradi/SI-10060Lukas Rytz2016-12-122-2/+44
|\ \ \ \ \ | | | | | | | | | | | | SI-10060 Fixes NumricRange.max bug on empty ranges
| * | | | | fixup! SI-10060 Fixes NumericRange.max bug on empty rangesTamer Mohammed Abdul-Radi2016-11-161-2/+14
| | | | | |
| * | | | | SI-10060 Fixes NumericRange.max bug on empty rangesTamer AbdulRadi2016-11-162-2/+32
| | | | | |
* | | | | | Merge pull request #5543 from retronym/ticket/10069Lukas Rytz2016-12-123-2/+49
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-10069 Fix code gen errors with array updates, Nothing
| * | | | | | SI-10069 Fix code gen errors with array updates, NothingJason Zaugg2016-12-023-2/+49
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Crashes in ASM or VerifyErrors used to occur when assigning an expression of type Nothing to an element of a primitive array. This commit adapts the RHS of the assignment to the element type to correct this. `adapt` contains logic to insert an `ATHROW` of the slot of type `Nothing$`, which makes everything line up. The subsequent array stores become dead code and are dropped later on in code gen, so the test case compiles to: public void foo0(double[]); Code: 0: bipush 42 2: istore_2 3: aload_1 4: iconst_0 5: aload_0 6: invokevirtual #30 // Method throwExpected:()Lscala/runtime/Nothing$; 9: athrow I found a similar bug in the emission of primitive unboxing and fixed that too.
* | | | | | Merge pull request #5527 from som-snytt/fix/use-modern-replaceLukas Rytz2016-12-121-9/+3
|\ \ \ \ \ \ | | | | | | | | | | | | | | String.replaceAllLiterally is String.replace
| * | | | | | String.replaceAllLiterally is String.replaceSom Snytt2016-11-131-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The method is not deprecated outright because it avoids the overloaded equivalent.
* | | | | | | Merge pull request #5550 from retronym/ticket/3772Lukas Rytz2016-12-129-25/+102
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-3772 Fix detection of term-owned companions
| * | | | | | | Refactor companion lookup methods after code reviewJason Zaugg2016-11-292-7/+6
| | | | | | | |
| * | | | | | | SI-3772 Fix detection of term-owned companionsJason Zaugg2016-11-299-25/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Companion detection consults the scopes of enclosing Contexts during typechecking to avoid the cycles that would ensue if we had to look at into the info of enclosing class symbols. For example, this used to typecheck: object CC { val outer = 42 } if ("".isEmpty) { case class CC(c: Int) CC.outer } This logic was not suitably hardened to find companions in exactly the same nesting level. After fixing this problem, a similar problem in `Namer::inCurrentScope` could be solved to be more selective about synthesizing a companion object. In particular, if a manually defined companion trails after the case class, don't create an addiotional synthetic comanpanion object.
* | | | | | | | Merge pull request #5569 from paplorinc/rotrLukas Rytz2016-12-122-19/+8
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Changed hashing bit rotation to use Integer.rotateRight
| * | | | | | | | Changed hashing bit rotation to use Integer.rotateRightPap Lőrinc2016-12-072-19/+8
| | | | | | | | |
* | | | | | | | | Merge pull request #5594 from retronym/topic/JEP-193Lukas Rytz2016-12-123-5/+10
|\ \ \ \ \ \ \ \ \ | |_|_|_|_|_|/ / / |/| | | | | | | | Compiler support for JEP-193 VarHandle polymorphic signatures
| * | | | | | | | Compiler support for JEP-193 VarHandle polymorphic signaturesJason Zaugg2016-12-123-5/+10
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VarHandles bring a host of new "polymorphic signature" methods to the Java 9 standard library. This commit updates the way we detect such methods to look at the absense/presense of the `PolymorphicSignature` annotation, so as to include these (and any future additions.) When we see applications of such methods, we disable adaptation of argument and return types. Tested manually with JDK9-ea: ``` Welcome to Scala 2.12.2-20161208-165912-3de1c0c (Java HotSpot(TM) 64-Bit Server VM, Java 9-ea). Type in expressions for evaluation. Or try :help. scala> import java.lang.invoke._, scala.runtime.IntRef import java.lang.invoke._ import scala.runtime.IntRef scala> val varHandle = MethodHandles.lookup().in(classOf[IntRef]).findVarHandle(classOf[IntRef], "elem", classOf[Int]); varHandle: java.lang.invoke.VarHandle = java.lang.invoke.VarHandleInts$FieldInstanceReadWrite@7112ce6 scala> varHandle.getAndSet(ref, 1): Int res5: Int = 0 scala> varHandle.getAndSet(ref, 1): Int res6: Int = 1 ``` Inspecting bytecode shows the absense of box/unboxing: ``` object Test { import java.lang.invoke._, scala.runtime.IntRef val varHandle = MethodHandles.lookup().in(classOf[IntRef]).findVarHandle(classOf[IntRef], "elem", classOf[Int]); def main(args: Array[String]): Unit = { val i : Int = varHandle.getAndSet(IntRef.zero, 1) } } ``` ``` public void main(java.lang.String[]); Code: 0: aload_0 1: invokevirtual #28 // Method varHandle:()Ljava/lang/invoke/VarHandle; 4: invokestatic #34 // Method scala/runtime/IntRef.zero:()Lscala/runtime/IntRef; 7: iconst_1 8: invokevirtual #40 // Method java/lang/invoke/VarHandle.getAndSet:(Lscala/runtime/IntRef;I)I 11: istore_2 12: return ```
* | | | | | | | Merge pull request #5545 from paplorinc/vectorCleanupStefan Zeiger2016-12-082-437/+331
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Minor Vector cleanup
| * | | | | | | | Applied further cleanup to VectorPap Lőrinc2016-12-061-56/+63
| | | | | | | | |
| * | | | | | | | Changed >> to >>> in Vector to unify stylePap Lőrinc2016-12-061-118/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unified, since indices are always positive and unsigned shift was already used in other places
| * | | | | | | | Applied suggestions to Vector cleanupPap Lőrinc2016-12-061-179/+161
| | | | | | | | |
| * | | | | | | | Deleted leftover code-comments from VectorPap Lőrinc2016-12-061-93/+20
| | | | | | | | |
| * | | | | | | | Deleted leftover debug method from VectorPap Lőrinc2016-12-062-38/+16
| | | | | | | | |
| * | | | | | | | Unified masks in VectorPap Lőrinc2016-12-061-31/+31
| | | | | | | | |
| * | | | | | | | Removed redundant casts from VectorPap Lőrinc2016-12-061-29/+29
| | |_|_|_|_|_|/ | |/| | | | | |
* | | | | | | | Merge pull request #5584 from xuwei-k/patch-2Jason Zaugg2016-12-071-0/+1
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | add project/build.properties for benchmark project
| * | | | | | | add project/build.properties for benchmark projectkenji yoshida2016-12-071-0/+1
|/ / / / / / /
* | | | | | | Merge pull request #5580 from SethTisue/starr-is-now-2.12.1Seth Tisue2016-12-052-2/+2
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | bump version (now 2.12.2) + and STARR (now 2.12.1)
| * | | | | | | bump version (now 2.12.2) + and STARR (now 2.12.1)Seth Tisue2016-12-052-2/+2
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | as we normally do post-release
* | | | | | | Merge pull request #5570 from adriaanm/t10075Adriaan Moors2016-12-0510-22/+199
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-10075 propagate annotations to lazy val's underlying field
| * | | | | | | Drop annotations from trait static super accessorAdriaan Moors2016-12-052-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on review suggestion by retronym. See also scala/scala-dev#213
| * | | | | | | SI-10075 annotations go to lazy val's underlying fieldAdriaan Moors2016-12-058-19/+196
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This likely regressed in #5294. Review feedback from retronym: - Tie annotation triaging a bit closer together durban kindly provided initial version of test/files/run/t10075.scala And pointed out you must force `lazy val`, since `null`-valued field is serializable regardless of its type. Test test/files/run/t10075b courtesy of retronym
* | | | | | | Merge pull request #5573 from adriaanm/revert-part-5376Adriaan Moors2016-12-023-39/+34
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Remove existential infer hack enabled by #5376
| * | | | | | | Revert existential infer part of #5376Adriaan Moors2016-12-013-39/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It wasn't a good idea after all. Also removed some tracing code that I cannot imagine was ever used in a production compiler. It's still just a recompile away. Fixes scala/scala-dev#280
* | | | | | | | Merge pull request #5385 from retronym/topic/JEP-220Lukas Rytz2016-12-027-8/+151
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | Preliminary support for Java 9
| * | | | | | | Support Java 9 modular runtime imagesJason Zaugg2016-12-026-4/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://openjdk.java.net/jeps/220 changes the layout of the JDK to encapsulate the provided libraries with the new module system. This commit modifies the compiler's classpath implementation to scan the new location of these, the `jrt://` virtual filesystem. This might need to be adjusted once we provide a means for users to specify the subset of modules that they want to depend on, but for now reclaims the ground we lost. ``` ⚡ (java_use 9-ea; qscala) Welcome to Scala 2.12.0-20160908-223617-7e4ebda (Java HotSpot(TM) 64-Bit Server VM, Java 9-ea). Type in expressions for evaluation. Or try :help. scala> import StackWalker._, java.util.stream._, scala.collection.JavaConverters._ import StackWalker._ import java.util.stream._ import scala.collection.JavaConverters._ scala> (() => StackWalker.getInstance(java.util.EnumSet.of(Option.RETAIN_CLASS_REFERENCE)).walk[Seq[String]]((s: java.util.stream.Stream[StackFrame]) => s.iterator.asScala.take(3).map(_.toString).toList)).apply().mkString("\n") res0: String = .$anonfun$res0$1(<console>:21) .<init>(<console>:21) .<clinit>(<console>) scala> ``` I've marked the new class, `NioFile` as `private[scala]` to justify the forward compatibility whitelist entry. In principle we could use NioFile more widely rather than `PlainFile` I tried this out in https://github.com/retronym/scala/commit/b2d0a17a which passed CI. But to be conservative, I'm not submitting that change at this point.
| * | | | | | | Adapt to the removal of sun.boot.class.pathJason Zaugg2016-12-021-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Java 9. we can no longer introspect the boot classpath with a JVM provided system property. Instead, this commit passes a custom property which will be found by PathResolver when it constructs the compiler classpath.
| * | | | | | | SI-9833 Fix -nobootcp in the Unix scala scriptJason Zaugg2016-12-021-4/+3
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was not having the desired effect of placing the Scala library on the JVM's regular classpath. This commit honours this setting. Note that the Windows scripts have never supported the use of bootclasspath, so no changes are required. The existing bug: ``` (java_use 1.8; ~/scala/2.11.8/bin/scala -nobootcp -debug -e 'print("")') /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/java -Xmx256M -Xms32M -Xbootclasspath/a:/Users/jason/scala/2.11.8/lib/akka-actor_2.11-2.3.10.jar:/Users/jason/scala/2.11.8/lib/config-1.2.1.jar:/Users/jason/scala/2.11.8/lib/jline-2.12.1.jar:/Users/jason/scala/2.11.8/lib/scala-actors-2.11.0.jar:/Users/jason/scala/2.11.8/lib/scala-actors-migration_2.11-1.1.0.jar:/Users/jason/scala/2.11.8/lib/scala-compiler.jar:/Users/jason/scala/2.11.8/lib/scala-continuations-library_2.11-1.0.2.jar:/Users/jason/scala/2.11.8/lib/scala-continuations-plugin_2.11.8-1.0.2.jar:/Users/jason/scala/2.11.8/lib/scala-library.jar:/Users/jason/scala/2.11.8/lib/scala-parser-combinators_2.11-1.0.4.jar:/Users/jason/scala/2.11.8/lib/scala-reflect.jar:/Users/jason/scala/2.11.8/lib/scala-swing_2.11-1.0.2.jar:/Users/jason/scala/2.11.8/lib/scala-xml_2.11-1.0.4.jar:/Users/jason/scala/2.11.8/lib/scalap-2.11.8.jar -classpath "" -Dscala.home=/Users/jason/scala/2.11.8 -Dscala.usejavacp=true -Denv.emacs= scala.tools.nsc.MainGenericRunner print("") ``` Fixed by this patch: ``` ⚡ (java_use 1.8; qscala -nobootcp -debug -e 'print("")') /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/java -Xmx256M -Xms32M -classpath /Users/jason/code/scala/build/quick/classes/repl-jline-embedded:/Users/jason/code/scala/build/quick/classes/repl-jline:/Users/jason/code/scala/build/quick/classes/repl:/Users/jason/code/scala/build/quick/classes/compiler:/Users/jason/code/scala/build/quick/classes/library:/Users/jason/code/scala/build/quick/classes/reflect:/Users/jason/code/scala/build/quick/classes/interactive:/Users/jason/.ivy2/cache/org.apache.ant/ant/jars/ant-1.9.4.jar:/Users/jason/.ivy2/cache/org.apache.ant/ant-launcher/jars/ant-launcher-1.9.4.jar:/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-asm/bundles/scala-asm-5.1.0-scala-1.jar:/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-xml_2.12.0-RC1/bundles/scala-xml_2.12.0-RC1-1.0.5.jar:/Users/jason/.ivy2/cache/jline/jline/jars/jline-2.14.1.jar -Dscala.home=/Users/jason/code/scala/build/quick -Dscala.usejavacp=true -Denv.emacs= scala.tools.nsc.MainGenericRunner -nc print("") ```
* | | | | | | Merge pull request #5572 from SethTisue/merge-2.11.x-to-2.12.x-dec-1Adriaan Moors2016-12-013-1/+33
|\ \ \ \ \ \ \ | |_|_|_|_|_|/ |/| | | | | | merging 2.11.x onto 2.12.x [ci: last-only]
| * | | | | | Merge remote-tracking branch 'origin/2.11.x' into merge-2.11.x-to-2.12.x-dec-1Seth Tisue2016-12-013-1/+33
|/| | | | | |