summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #5607 from adriaanm/rebase-5551Adriaan Moors2016-12-213-0/+65
|\ | | | | Override equals and hashCode for WrappedArray
| * Override equals and hashCode for WrappedArrayAlexey Romanov2016-12-213-0/+65
| |
* | Merge pull request #5583 from lrytz/t10093Adriaan Moors2016-12-215-8/+52
|\ \ | | | | | | SI-10093 don't move member traits to constructor body in constructors
| * | SI-10093 don't move member traits to constructor body in constructorsLukas Rytz2016-12-065-8/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes a regression introduced in c8e6050. Member traits with only abstract definitions (`isInterface`) were moved into the primary constructor by mistake. (Flatten moved the classes back.) The member trait was duplicated into the constructor of specialized subclasses, causing it to be generated multiple times. Also removes some unnecessary `isMixinConstructor` checks: the mixin constructor is always the primary constructor. This commit also clarifies (and tests) what `isInterface` means: for scala-defined traits, it means there are only abstract members. For java-defined interfaces, it is always true.
* | | Merge pull request #5610 from dwijnand/sbtLukas Rytz2016-12-2116-22/+22
|\ \ \ | | | | | | | | Fix how "sbt" is written
| * | | Fix how "sbt" is writtenDale Wijnand2016-12-2116-22/+22
|/ / / | | | | | | | | | | | | | | | | | | | | | "sbt" is not an acronym (it used to be, but it isn't any longer). It's a proper name, like "iPhone" or "eBay". So, just like you wouldn't write "Get Started With EBay" or "How To Reset Your IPhone", we don't write "Using the Sbt Build".
* | | Merge pull request #5608 from retronym/merge/2.11.x-to-2.12.x-20161220Lukas Rytz2016-12-2036-58/+474
|\ \ \ | | | | | | | | Merge 2.11.x to 2.12.x [ci: last-only]
| * \ \ Merge remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2016-12-2036-58/+474
| |\ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | merge/2.11.x-to-2.12.x-20161220 Conflicts: bincompat-backward.whitelist.conf build.xml src/compiler/scala/tools/nsc/typechecker/Typers.scala src/library/scala/collection/immutable/NumericRange.scala
| | * | Merge pull request #5605 from szeiger/wip/fix-07-linksAdriaan Moors2016-12-192-4/+4
| | |\ \ | | | | | | | | | | Fix spec links to `07-implicits.html`
| | | * | Fix spec links to `07-implicits.html`Stefan Zeiger2016-12-182-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | The file referenced by the current links actually exists under http://www.scala-lang.org/files/archive/spec/2.11/ but with a different design than the rest. It seems to be left over from an older version.
| | * | | Merge pull request #5604 from sjrd/scalajs-friendly-assertthrowsLukas Rytz2016-12-171-5/+4
| | |\ \ \ | | | | | | | | | | | | Use ClassTag instead of Manifest in AssertUtil.assertThrows.
| | | * | | Use ClassTag instead of Manifest in AssertUtil.assertThrows.Sébastien Doeraene2016-12-171-5/+4
| | |/ / / | | | | | | | | | | | | | | | | | | | | This allows it to work in Scala.js, which supports `ClassTag`s but not `Manifest`s.
| | * | | Merge pull request #5487 from lrytz/java-constantsAdriaan Moors2016-12-1522-2/+341
| | |\ \ \ | | | | | | | | | | | | SI-3236 constant types for literal final static java fields
| | | * | | neg test for parsing constants in Java sourcesLukas Rytz2016-11-027-0/+104
| | | | | |
| | | * | | Support implicit converstions from java literalsLukas Rytz2016-11-021-38/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For example, public static final byte b = 127 is allowed, but 128 is not. Also factor out a method that parses a literal. It could be used to parse annotations (and their literal arguments) in Java sources.
| | | * | | SI-3236 constant types for literal final static java fieldsJohannes Rudolph2016-10-2815-2/+234
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we don't parse Java expressions, fields of Java classes coming from source files never have constant types. This prevents using static java fields in annotation arguments in mixed compilation This PR assigns constant types to final static java fields if the initializer is a simple literal.
| | * | | | Merge pull request #5454 from som-snytt/issue/9834-2.11Adriaan Moors2016-12-157-16/+78
| | |\ \ \ \ | | | | | | | | | | | | | | SI-9834 Improve error on failed op=
| | | * | | | SI-9834 Show expansion of update on errorSom Snytt2016-11-252-3/+5
| | | | | | |
| | | * | | | SI-9834 Improve error on failed op=Som Snytt2016-11-257-16/+76
| | | | |/ / | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If rewriting `x += y` fails to typecheck, emit error messages for both the original tree and the assignment. If rewrite is not attempted because `x` is a val, then say so. The error message at `tree.pos` is updated with the additional advice. SI-8763 Crash in update conversion When there are already errors, don't attempt mechanical rewrites.
| | * | | | Merge pull request #5590 from 2m/mima-0.1.13-scala-2.11Seth Tisue2016-12-123-26/+2
| | |\ \ \ \ | | | | | | | | | | | | | | Upgrade MiMa to 0.1.13
| | | * | | | Upgrade MiMa to 0.1.13Martynas Mickevičius2016-12-083-26/+2
| | | | | | |
| | * | | | | Merge pull request #5574 from ptrcarta/patch-1Lukas Rytz2016-12-121-1/+1
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | fix eBNF error by removing wrong closing brace
| | | * | | | | fix eBNF error by removing wrong closing braceptrcarta2016-12-021-1/+1
| | | |/ / / /
| | * / / / / SI-10086 NumericRange.min|max with custom Integral (#5575)Tobias Schlatter2016-12-122-2/+46
| | |/ / / / | | | | | | | | | | | | SI-10086 NumericRange.min|max with custom Integral
* | | | | | Merge pull request #5598 from retronym/topic/jdk9-bootcp-repl-javapLukas Rytz2016-12-202-4/+8
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Support extra module references in the REPL
| * | | | | Support extra module references in the REPLJason Zaugg2016-12-122-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, scala-compiler.jar is in the bootclasspath, which gives us a `null` when we call `classOf[IMain].getClassLoader`. That value is used as the parent class loader of the classloader that evals code in the REPL. Under JDK9, this breaks lookup of classes on the module path: ``` scala -J--add-modules=java.compiler -J--add-exports=jdk.jdeps/com.sun.tools.javap=ALL-UNNAMED Welcome to Scala 2.12.1 (Java HotSpot(TM) 64-Bit Server VM, Java 9-ea). Type in expressions for evaluation. Or try :help. scala> new com.sun.tools.javap.JavapTask(); java.lang.NoClassDefFoundError: com/sun/tools/javap/JavapTask at java.base/java.lang.Class.getDeclaredMethods0(Native Method) at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:2948) ``` A workaround is to use `-nobootcp`. This commit uses the system classloader as the parent in place of the null classloader to make this work in both cases. ``` qscala -J--add-modules=java.compiler -J--add-exports=jdk.jdeps/com.sun.tools.javap=ALL-UNNAMED 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> new com.sun.tools.javap.JavapTask(); res0: com.sun.tools.javap.JavapTask = com.sun.tools.javap.JavapTask@1f1cddf3 scala> ``` Note that the `:javap` command still requires `-nobootcp` because code in the REPL implements an interface in a the `java.compiler` module.
* | | | | | Merge pull request #5539 from som-snytt/issue/10068Adriaan Moors2016-12-198-4/+66
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-10068 Only permit elidable methods
| * | | | | | SI-10068 Only permit elidable methodsSom Snytt2016-12-148-4/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In refchecks, check that symbol with `@elidable` is a method. When eliding in uncurry, doublecheck. The check is enabled under `-Xsource:2.13`.
* | | | | | | 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
| | | | | | | | | | | |