summaryrefslogtreecommitdiff
path: root/src/compiler
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | Merge pull request #5205 from adriaanm/misc-optAdriaan Moors2016-06-024-44/+50
|\ \ \ \ \ | | | | | | | | | | | | Small optimizations around use of Scopes.
| * | | | | Compute constrParamAccessors once. It's expensiveAdriaan Moors2016-06-011-22/+26
| | | | | |
| * | | | | opt: fuse some operations on `Scope`sAdriaan Moors2016-06-014-22/+24
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | `Scope`'s `filter` is implemented using `toList`, so may as well start with `toList`ourselves. Also fused some `filter`/`foreach` combos.
* | | | | Merge pull request #5207 from lrytz/nan-compareAdriaan Moors2016-06-023-17/+14
|\ \ \ \ \ | | | | | | | | | | | | Fix comparisons involving NaN
| * | | | | Fix comparisons involving NaNLukas Rytz2016-06-023-17/+14
| |/ / / / | | | | | | | | | | | | | | | | | | | | Floating point comparisons involving NaN should always return false, except for !=. Fixes a regression introduced by #4963.
* | | | | Merge commit '90215ce' into merge-2.11-to-2.12-june-1Lukas Rytz2016-06-012-1/+8
|\ \ \ \ \ | | |_|/ / | |/| | |
| * | | | Merge pull request #4998 from som-snytt/issue/7898-iLukas Rytz2016-06-012-1/+8
| |\ \ \ \ | | | | | | | | | | | | SI-7898 Read user input during REPL warmup
| | * | | | SI-7898 Read user input during REPL warmupSom Snytt2016-05-202-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The compiler is created on main thread and user input is read on an aux thread (opposite to currently). Fixes completion when `-i` is supplied. Now `-i` means pasted and new option `-I` means line-by-line. The temporary reader uses postInit to swap in the underlying reader. Completion is disabled for the temporary reader, rather than blocking while it waits for a compiler. But manically hitting tab is one way of knowing exactly when completion is live.
* | | | | | Merge commit 'cba585d' into merge-2.11-to-2.12-june-1Lukas Rytz2016-06-011-44/+64
|\| | | | |
| * | | | | Merge pull request #5169 from som-snytt/issue/4625Lukas Rytz2016-05-231-44/+64
| |\ \ \ \ \ | | |/ / / / | |/| | | | SI-4625 Recognize App in script
| | * | | | SI-4625 Warn on first non-toplevel onlySom Snytt2016-05-171-42/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed the warning when main module is accompanied by snippets. Minor clean-up so even I can follow what is returned.
| | * | | | SI-4625 Warn when discarding script objectSom Snytt2016-05-171-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's pretty confusing when your script object becomes a local and then nothing happens. Such as when you're writing a test and it takes forever to figure out what's going on.
| | * | | | SI-4625 Permit arbitrary top-level in scriptSom Snytt2016-05-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In an unwrapped script, where a `main` entry point is discovered in a top-level object, retain all top-level classes. Everything winds up in the default package.
| | * | | | SI-4625 App is a thingSom Snytt2016-05-161-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Scripting knows it by name.
| | * | | | SI-4625 Recognize App in scriptSom Snytt2016-05-161-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cheap name test: if the script object extends "App", take it for a main-bearing parent. Note that if `-Xscript` is not `Main`, the default, then the source is taken as a snippet and there is no attempt to locate an existing `main` method.
* | | | | | Merge commit '90706b0' into merge-2.11-to-2.12-june-1Lukas Rytz2016-06-011-2/+0
|\| | | | | | |_|/ / / |/| | | |
| * | | | Remove default value for sourcepath in scalac (ant version). (#5166)Krzysztof Romanowski2016-05-171-2/+0
| |/ / /
* | | | Merge pull request #5076 from soc/topic/deprecations-sinceLukas Rytz2016-05-3014-57/+81
|\ \ \ \ | | | | | | | | | | Improvements to deprecations related to `since` parameter
| * | | | Add since arg to deprecationWarning and use itSimon Ochsenreither2016-05-2914-59/+79
| | | | |
| * | | | Lower-case spelling of @deprecated messagesSimon Ochsenreither2016-05-281-1/+1
| | | | |
| * | | | SI-9084 Add `since` (if available) to deprecation warningsSimon Ochsenreither2016-05-285-11/+15
| | | | |
* | | | | Merge pull request #5193 from som-snytt/issue/9794Lukas Rytz2016-05-301-1/+1
|\ \ \ \ \ | |/ / / / |/| | | | SI-9794 Error advice uses decoded method name
| * | | | SI-9794 Error advice uses decoded method nameSom Snytt2016-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So much work went into polishing this error message, it's worth buffing the method name when it's an operator. The message now says `+` instead of `$plus`.
* | | | | Merge pull request #5102 from milessabin/2.12.xJason Zaugg2016-05-271-1/+2
|\ \ \ \ \ | | | | | | | | | | | | SI-2712 Add support for partial unification of type constructors
| * | | | | -Xexperimental mode now only includes -Ypartial-unificationMiles Sabin2016-05-241-1/+1
| | | | | |
| * | | | | SI-2712 Add support for higher order unificationMiles Sabin2016-05-241-0/+1
| | | | | |
* | | | | | Merge pull request #5186 from lrytz/inlinerM5Jason Zaugg2016-05-275-13/+82
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | Debug flag to print a summary of the inliner's work
| * | | | | Debug flag to print a summary of the inliner's workLukas Rytz2016-05-245-13/+82
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example output below. Note that inlining List.map fails because the trait forwarder uses `INVOKESPECIAL` for now, will change with pr 5177. $ cat Test.scala class C { def foo = Map(1 -> 'a', 2 -> 'b') def bar(l: List[Int]) = l.map(_ + 1) } $ qsc -Yopt-log-inline _ -Yopt:l:classpath Test.scala Inlining into C.foo (initially 36 instructions, ultimately 72): - Inlined scala/Predef$ArrowAssoc$.$minus$greater$extension (8 instructions) 2 times: the callee is annotated `@inline` Inlining into C.bar (initially 12 instructions, ultimately 12): - Failed to inline scala/collection/immutable/List.map (the callee is a higher-order method, the argument for parameter (bf: Function1) is a function literal): The callee scala/collection/immutable/List::map(Lscala/Function1;Lscala/collection/generic/CanBuildFrom;)Ljava/lang/Object; contains the instruction INVOKESPECIAL scala/collection/TraversableLike.map (Lscala/Function1;Lscala/collection/generic/CanBuildFrom;)Ljava/lang/Object; that would cause an IllegalAccessError when inlined into class C.
* | | | | Rename -Yopt to -opt, -Yopt-warnings to -opt-warningsLukas Rytz2016-05-2512-85/+85
| | | | | | | | | | | | | | | | | | | | Keep -Yopt-inline-heuristics and -Yopt-trace unchanged
* | | | | Merge pull request #4935 from som-snytt/issue/8044-tickvarAdriaan Moors2016-05-241-8/+8
|\ \ \ \ \ | |/ / / / |/| | | | SI-8044 Allow binding backquoted varid in patterns
| * | | | SI-8044 Allow any id in explicit pattern bindingSom Snytt2016-05-201-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows arbitrary identifier in `X @ pat`, including non-varids. This goes to regularity. Users of this syntax are not likely to be confused by the "backquoted var id is stable" rule. Also for sequence pattern, `X @ _*`.
| * | | | SI-8044 Allow binding backquoted varid in patternsSom Snytt2016-05-201-7/+8
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, a varid could not be backquoted, so that it was not possible to introduce variables with names such as `type` in a match expression. This commit allows backquoted varids in `case x @ _` and `case x: Int`. In neither position is a stable id accepted, that is, an id with leading uppercase. Therefore, this commit merely relaxes the backquoted varid to be taken as a normal varid in these contexts.
* | | | Merge pull request #5179 from liff/topic/SI-9781Adriaan Moors2016-05-231-1/+3
|\ \ \ \ | | | | | | | | | | Check left side of an assignment expression for errors; fixes SI-9781
| * | | | SI-9781 Don't convert erroneous expression to assignmentOlli Helenius2016-05-201-1/+3
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `convertToAssignment` is triggered on a type error but it doesn't seem to really care what the error is as long as the expression can be converted to an assignment expression. This patch fixes that by checking whether the qualifier of the selection contains any errors before deciding to continue with the conversion.
* | | | Merge pull request #5106 from milessabin/topic/hkgadtAdriaan Moors2016-05-231-1/+0
|\ \ \ \ | | | | | | | | | | SI-9760 Fix for higher-kinded GADT refinement
| * | | | SI-9760 Fix for higher-kinded GADT refinementMiles Sabin2016-04-191-1/+0
| | | | |
* | | | | Merge pull request #5122 from lrytz/t9121Stefan Zeiger2016-05-231-1/+1
|\ \ \ \ \ | | | | | | | | | | | | SI-9121 test case (fixed in new optimizer), SI-9179 test case
| * | | | | SI-9121 test case (fixed in new optimizer), SI-9179 test caseLukas Rytz2016-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also adds a mising phase travel in the backend. A comment already points out why it's necessary, but it was actually forgotten.
* | | | | | Merge pull request #5162 from milessabin/t9361Lukas Rytz2016-05-231-2/+3
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-9361 fixed assert allowing display of improved error message.
| * | | | | | SI-9361 fixed assert allowing display of improved error message.Miles Sabin2016-05-141-2/+3
| | |_|_|_|/ | |/| | | |
* | | | | | Merge pull request #5153 from petermz/ticket/5463Lukas Rytz2016-05-231-1/+11
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | SI-5463 Check .jars before using them
| * | | | | SI-5463 Check .jars before using thempeterz2016-05-171-1/+11
| |/ / / / | | | | | | | | | | | | | | | Make broken JAR files on compiler classpath cause a fatal error
* | | | | Merge pull request #4988 from som-snytt/issue/backtick-barAdriaan Moors2016-05-201-2/+2
|\ \ \ \ \ | |_|_|/ / |/| | | | SI-9665 Backquoted vbar in extractor pattern
| * | | | SI-9665 Backquoted vbar in extractor patternSom Snytt2016-03-151-2/+2
| | | | | | | | | | | | | | | | | | | | Allow an infix extractor named `|`, when backquoted.
* | | | | Merge pull request #5176 from lrytz/t9671Lukas Rytz2016-05-193-20/+33
|\ \ \ \ \ | | | | | | | | | | | | SI-9671, SI-7397 fix null.asInstanceOf[Int] when pt erases to Object
| * | | | | SI-9066 fix null.asInstanceOf[Unit]Lukas Rytz2016-05-181-0/+4
| | | | | |
| * | | | | SI-9671, SI-7397 fix null.asInstanceOf[Int] when pt erases to ObjectLukas Rytz2016-05-183-20/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Erasure first replaces null.asInstanceOf[Int] by unbox(null). If the expected type erases to object, erasure then introduces a box operation, yielding box(unbox(null)). Note that this value is a box of zero, not null. Erasure has an optimization to replace box(unbox(x)) in case x is of primitive type. 60f1b4b extended this to the case when x is null, which is incorrect in general. The reason was to prevent creating a primitive box to be stored in the unused generic field when creating an instance of a specialized class. A special case ensures that this optimization is still performed.
* | | | | | Generate static forwarders for object members in companion interface (#5131)Jason Zaugg2016-05-191-2/+1
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to disable generation of static forwarders when a object had a trait as a companion, as one could not add methods with bodies to an interface in JVM 6. The JVM lifted this restriction to support default methods in interfaces, so we can lift the restriction on static forwarders, too. Fixes https://github.com/scala/scala-dev/issues/59
* | / / / SI-8756 Fix generic signature for refinement of primitiveJason Zaugg2016-05-181-1/+1
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Java generic signature generation was making the wrong assumption about how refinement types should erase to Java generics. This commit passes through the current value of `primitiveOk`, rather than forcing it to `true`. This flag is true when generating the signature for `f2`, but false in `i2` (as we are in a type argument position).
* | | | Merge pull request #5146 from som-snytt/issue/9045-msgLukas Rytz2016-05-132-36/+34
|\ \ \ \ | | | | | | | | | | SI-9045 Error on recursive ctor