summaryrefslogtreecommitdiff
path: root/src/compiler
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | | SI-10154 Fix implicit search regression for term-owned objectsJason Zaugg2017-01-201-1/+2
| | |_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A recent change to fix lookup of companion implicits of term-owned classes (#5550) caused a regression in the enclosed test case. The previous approach of calling `Scope#lookup(companionName)` was replaced by a lookup of the scope entry of the original name followed by a narrower search lookup for the companion name, to ensure that it was a true companion, and not just a same-named module from defined at a different nested scope. However, module class symbols are not themselves entered into scopes, so the first part of the new scheme fails. We need to add a special case modules here. I've chosen to just call `.sourceModule` on module classes. For module classes in the current run (all term owned symbols will fall into this category), this amounts to using the value of the field `ModuleClassSymbol#module`.
* | | | | | | | Merge pull request #5686 from ↵Seth Tisue2017-02-141-1/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | propensive/make-abstractvar-context-error-more-precise Correct the AbstractVar error message to be more correct
| * | | | | | | | Correct the AbstractVar error messageJon Pretty2017-02-091-1/+1
| | |_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The error currently reads "only classes can have declared but undefined members", which isn't true on two counts: traits can have them, and concrete classes cannot. This corrects the error message to read "only traits and abstract classes can have declared but undefined members".
* | | | | | | | Merge pull request #5691 from som-snytt/issue/eolLukas Rytz2017-02-131-39/+30
|\ \ \ \ \ \ \ \ | |_|_|_|_|_|_|/ |/| | | | | | | EOL is System.lineSeparator
| * | | | | | | EOL is System.lineSeparatorSom Snytt2017-02-131-39/+30
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old EOL is EOL. Use `println()` when feasible and obvious. Minor cleanup of surrounding code.
* | | | | | | Merge pull request #5676 from som-snytt/issue/10173Lukas Rytz2017-02-131-3/+4
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | SI-10173 Crash output shows true line number
| * | | | | | SI-10173 Crash output shows true line numberSom Snytt2017-02-051-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Where true means 1-based, for whatever tree was last to typer.
* | | | | | | Merge pull request #5245 from dwijnand/trailing-commasAdriaan Moors2017-02-081-0/+11
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-4986 The glorious return of Comma McTraily
| * | | | | | | SIP-27 Tweak and test wildstar in REPLDale Wijnand2017-01-081-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From https://github.com/scala/scala/pull/5245#issuecomment-266658070
| * | | | | | | SI-4986 SIP-27 Trailing Comma (multi-line only) supportDale Wijnand2016-12-111-0/+8
| | | | | | | |
* | | | | | | | Merge pull request #5646 from som-snytt/issue/8685Adriaan Moors2017-02-071-0/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-8685 Warn on deprecated case ctor
| * | | | | | | | SI-8685 Warn on deprecated case ctorSom Snytt2017-01-161-0/+1
| | |_|/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The narrow use case in the ticket was just to warn on `C.apply` when the constructor has been deprecated. Someone added code to warn after the apply is rewritten, but it wasn't checking the constructor (and the tree was checked before but not after transform).
* | | | | | | | Merge pull request #5642 from janekdb/topic/MB-calculation-correctionAdriaan Moors2017-02-071-1/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Calculate MB instead of MiB
| * | | | | | | | Calculate MB instead of MiBJanek Bogucki2017-01-151-1/+1
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | This is consistent with same calculation in Compilers.freeMemoryString.
* | | | | | | | Merge pull request #5585 from som-snytt/issue/10097Adriaan Moors2017-02-072-17/+45
|\ \ \ \ \ \ \ \ | |_|_|/ / / / / |/| | | | | | | SI-10097 Error if no non-implicit case class param
| * | | | | | | SI-10097 Adapt unless -Xsource:2.13Som Snytt2016-12-142-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For 2.12 migration, insert missing case class param section, strip caseaccessor from implicit paramsection, and deprecate the adaptation.
| * | | | | | | SI-8704 Also warn if effectively multiple implicitSom Snytt2016-12-142-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current semantics are that leading implicit param turns the parameter section into an implicit section (though without making other params implicitly implicit). Warn if more than one head of a param section is implicit, since that results in multiple implicit param sections.
| * | | | | | | SI-8704 Error on bad implicit sectionsSom Snytt2016-12-141-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of aborting when a class def has extra parameter section, take all parameter sections and sanity check the use of leading implicit to indicate an implicit parameter section.
| * | | | | | | SI-10097 Error if no non-implicit case class paramSom Snytt2016-12-141-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Case class must have a non-implicit param list. Error early, error often. Also update spec to say that class implicitly gets a non-implicit parameter section if it doesn't have one, and that a case class must have one.
* | | | | | | | Merge pull request #5666 from Philippus/issue/10030Lukas Rytz2017-02-031-1/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-10030 - added quotes in case the path contains a space and an 8.3-…
| * | | | | | | | SI-10030 - added quotes in case the path contains a space and an ↵Philippus Baalman2017-01-301-1/+1
| | |/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | 8.3-compliant path is not available
* / | | | | | | SI-9729 -Xmaxerrs to limit messagesSom Snytt2017-01-313-8/+15
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 2.7.2, console reporter has limited error messages to a fixed 100. Use `-Xmaxerrs -Xmaxwarns` as from `javac` to configure.
* | | | | | | Merge pull request #5583 from lrytz/t10093Adriaan Moors2016-12-211-5/+5
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | 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-061-5/+5
| | |_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | Fix how "sbt" is writtenDale Wijnand2016-12-212-4/+4
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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 remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2016-12-203-19/+104
|\ \ \ \ \ \ | | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #5487 from lrytz/java-constantsAdriaan Moors2016-12-152-2/+61
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-3236 constant types for literal final static java fields
| | * | | | | 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-282-2/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | | SI-9834 Show expansion of update on errorSom Snytt2016-11-251-3/+4
| | | | | | |
| * | | | | | SI-9834 Improve error on failed op=Som Snytt2016-11-251-16/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | | [nomerge] SI-10037 ASR/LSR switched in ICodeReaderSom Snytt2016-11-102-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Noticed when inlining from a class file. The test doesn't work because inlining fails with bytecode unavailable due to: ``` scala.reflect.internal.MissingRequirementError: object X in compiler mirror not found. ```
| * | | | | | [backport] Replace println with log calls in BrowsingLoadersIulian Dragos2016-10-251-4/+4
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This alternative symbol loader is used in the presentation compiler and may generate output even when the compiler should be silent. See SI-8717 for more context, even though this does not really fix the ticket.
| * | | | | Merge pull request #5343 from milessabin/topic/si-2712-backportAdriaan Moors2016-10-181-0/+1
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-2712 Add support for higher order unification
| | * | | | | SI-2712 Add support for higher order unificationMiles Sabin2016-08-151-0/+1
| | | | | | |
* | | | | | | Merge pull request #5539 from som-snytt/issue/10068Adriaan Moors2016-12-193-3/+21
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-10068 Only permit elidable methods
| * | | | | | | SI-10068 Only permit elidable methodsSom Snytt2016-12-143-3/+21
| | |_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-192-1/+2
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | 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-181-0/+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-181-1/+1
| | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #5558 from larsrh/topic/deprecated-y-flagsAdriaan Moors2016-12-134-15/+3
|\ \ \ \ \ \ | | | | | | | | | | | | | | Remove deprecated -Y flags
| * | | | | | delete dead codeLars Hupel2016-12-011-2/+0
| | | | | | |
| * | | | | | remove deprecated compiler flag "-Yinfer-by-name"Lars Hupel2016-12-012-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This was slated for removal in 2.12.
| * | | | | | remove deprecated compiler flag "-Yeta-expand-keeps-star"Lars Hupel2016-12-013-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This was slated for removal in 2.12.
* | | | | | | Merge pull request #5543 from retronym/ticket/10069Lukas Rytz2016-12-121-2/+2
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-10069 Fix code gen errors with array updates, Nothing
| * | | | | | | SI-10069 Fix code gen errors with array updates, NothingJason Zaugg2016-12-021-2/+2
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #5550 from retronym/ticket/3772Lukas Rytz2016-12-122-5/+26
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-3772 Fix detection of term-owned companions
| * | | | | | | Refactor companion lookup methods after code reviewJason Zaugg2016-11-291-1/+1
| | | | | | | |