summaryrefslogtreecommitdiff
path: root/test/files
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #4814 from soc/topic/drop-genasmLukas Rytz2015-10-2981-1561/+66
|\ | | | | Remove GenASM
| * Remove GenASM, merge remaining common code snippetsSimon Ochsenreither2015-10-2781-1561/+66
| | | | | | | | | | | | | | | | With GenBCode being the default and only supported backend for Java 8, we can get rid of GenASM. This commit also fixes/migrates/moves to pending/deletes tests which depended on GenASM before.
* | Merge pull request #4808 from retronym/ticket/9527Seth Tisue2015-10-274-0/+28
|\ \ | |/ |/| SI-9527 Fix NPE in ambiguous implicit error generation
| * SI-9527 Fix NPE in ambiguous implicit error generationJason Zaugg2015-10-214-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In #4673, an annotation was added to allow customization of the compiler error for ambigous implicits. This change had incorrect assumptions about the shape of trees that would be generated during implicit search, and failed to account for the results of eta expanded methods when searching for a function type. This commit: - Uses the symbol from `ImpilcitInfo`, rather than calling `Tree#symbol` which is fraught with the danger of returning a null symbol for something other than an application. - Adds a test for customized messages for a polymorphic, eta expanded method, and generalizes `treeTypeArgs` to handle the implicit tree of shape `{ (x: X) => f[A](x)}`.
* | Merge pull request #4820 from lrytz/t9535Lukas Rytz2015-10-273-0/+36
|\ \ | | | | | | SI-9535 correct bytecode and generic signatures for @throws[TypeParam]
| * | SI-9535 correct bytecode and generic signatures for @throws[TypeParam]Lukas Rytz2015-10-263-0/+36
| | | | | | | | | | | | | | | | | | | | | For @throws[E] where E is not a class type, GenASM incorrectly writes the non-class type to the classfile. GenBCode used to crash before this commit. Now GenBCode correctly emits the erased type (like javac) and adds a generic signature.
* | | Merge pull request #4815 from som-snytt/test/stringcontext-fJason Zaugg2015-10-272-193/+0
|\ \ \ | | | | | | | | f interp test is junit
| * | | f interp test is junitSom Snytt2015-10-252-193/+0
| |/ / | | | | | | | | | | | | | | | | | | Moves test/files/run/stringinterpolation_macro-run.scala to the junit test class test/junit/scala/StringContextTest.scala. Adds a couple of assertions to the test.
* | | Merge pull request #4807 from lrytz/opt/innerClassAttrLukas Rytz2015-10-262-4/+4
|\ \ \ | |/ / |/| | Simplify and correctify calculation of the InnerClass attribute
| * | Simplify and correctify calculation of the InnerClass attributeLukas Rytz2015-10-202-4/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | The InnerClass attribute needs to contain an entry for every nested class that is defined or referenced in a class. Details are in a doc comment in BTypes.scala. Instead of collecting ClassBTypes of nested classes into a hash map during code generation, traverse the class before writing it out to disk. The previous approach was incorrect as soon as the generated bytecode was modified by the optimzier (DCE, inlining). Fixes https://github.com/scala/scala-dev/issues/21.
* | merge 2.11.x onto 2.12.x, Oct 16 2015Seth Tisue2015-10-162-0/+46
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there were merge conflicts in the Eclipse config that I resolved with --ours. I invite @performantdata to submit a followup PR bringing the Eclipse stuff into a good state on 2.12.x. there was a test failure in test/junit/scala/collection/mutable/OpenHashMapTest.scala due to the 2.12 compiler emitting the field backing a private var differently (with an unmangled name). Lukas says the difference is expected, so I just updated the code in the test. there were no other merge conflicts. % git log --decorate --oneline -1 origin/2.11.x | cat ae5f0de (origin/HEAD, origin/2.11.x) Merge pull request #4791 from performantdata/issue/9508 % git log --decorate --oneline -1 origin/2.12.x | cat c99e53e (HEAD -> 2.12.x, origin/2.12.x) Merge pull request #4797 from lrytz/M3-versions % export MB=$(git merge-base 2.12.x origin/2.11.x) % echo $MB 42cafa21f3c4a08c6dd34608278f810b6ec2886f % git log --graph --oneline --decorate $MB...origin/2.11.x | cat * ae5f0de (origin/HEAD, origin/2.11.x) Merge pull request #4791 from performantdata/issue/9508 |\ | * 08dca37 (origin/pull/4791) SI-9508 fix classpaths in Eclipse configuration * | fe76232 Merge pull request #4798 from performantdata/issue/9513 |\ \ | * | 9c97a7f (origin/pull/4798) Suppress unneeded import. | * | 30d704d Document some OpenHashMap internal methods. | * | 1fb32fc SI-9513 decrement "deleted" count in OpenHashMap.put() when slot reused | |/ * | 14f875c Merge pull request #4788 from dk14/patch-1 |\ \ | * | 42acd55 (origin/pull/4788) explicitly specify insertion-order feature in docs | / * | 68ce049 Merge pull request #4771 from som-snytt/issue/9492-here |\ \ | * | f290962 (origin/pull/4771) SI-9492 Line trimming paste | * | bc3589d SI-9492 REPL paste here doc | / * | 9834fc8 Merge pull request #4610 from todesking/spec-implicits-remove-obsolete |\ \ | * | 46009b1 (origin/pull/4610) Add view/context-bound parameter ordering rule | * | 6eba305 Spec: Implicit parameters with context/view bound is allowed since 2.10 | / * | d792e35 Merge pull request #4789 from janekdb/2.11.x-param-names-predicates-operations |\ \ | |/ |/| | * b19a07e (origin/pull/4789) Rename forall, exists and find predicate and operator params. |/ * 648c7a1 Merge pull request #4790 from SethTisue/issue/9501 |\ | * 40d12f1 (origin/pull/4790) SI-9501 link README to Scala Hacker Guide * e0b5891 Merge pull request #4786 from performantdata/issue/9506 * 39acad8 (origin/pull/4786) SI-9506 suppress Scala IDE-generated files in the Eclipse project dirs * 74dc364 SI-9506 suppress Scala IDE-generated files in the Eclipse project dirs % git merge ae5f0de Auto-merging src/repl/scala/tools/nsc/interpreter/ILoop.scala Auto-merging src/library/scala/util/Either.scala Auto-merging src/library/scala/runtime/Tuple3Zipped.scala Auto-merging src/library/scala/runtime/Tuple2Zipped.scala Auto-merging src/library/scala/collection/parallel/ParIterableLike.scala Auto-merging src/library/scala/collection/immutable/ListMap.scala Auto-merging src/library/scala/collection/TraversableLike.scala Auto-merging src/eclipse/test-junit/.classpath CONFLICT (content): Merge conflict in src/eclipse/test-junit/.classpath Auto-merging src/eclipse/scaladoc/.classpath CONFLICT (content): Merge conflict in src/eclipse/scaladoc/.classpath Auto-merging src/eclipse/scala-compiler/.classpath Auto-merging src/eclipse/repl/.classpath CONFLICT (content): Merge conflict in src/eclipse/repl/.classpath Auto-merging src/eclipse/partest/.classpath CONFLICT (content): Merge conflict in src/eclipse/partest/.classpath Auto-merging src/eclipse/interactive/.classpath Auto-merging README.md Automatic merge failed; fix conflicts and then commit the result. % git checkout --ours src/eclipse/partest/.classpath % git checkout --ours src/eclipse/repl/.classpath % git checkout --ours src/eclipse/scaladoc/.classpath % git checkout --ours src/eclipse/test-junit/.classpath % git add -u % emacs test/junit/scala/collection/mutable/OpenHashMapTest.scala % git diff test/junit/scala/collection/mutable/OpenHashMapTest.scala | cat ... - val field = m.getClass.getDeclaredField("scala$collection$mutable$OpenHashMap$$deleted") + val field = m.getClass.getDeclaredField("deleted") ... % git add -u
| * Merge pull request #4771 from som-snytt/issue/9492-hereSeth Tisue2015-10-142-0/+46
| |\ | | | | | | SI-9492 REPL paste here doc
| | * SI-9492 REPL paste here docSom Snytt2015-09-272-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simple here documentish syntax for REPL paste. This makes it easier to paste a block of script (as opposed to transcript). It also means you won't accidentally ctl-D out of the REPL and then out of SBT and then out of the terminal window. ``` scala> :paste < EOF // Entering paste mode (EOF to finish) class C { def c = 42 } EOF // Exiting paste mode, now interpreting. defined class C scala> new C().c res0: Int = 42 scala> :paste <| EOF // Entering paste mode (EOF to finish) |class D { def d = 42 } EOF // Exiting paste mode, now interpreting. defined class D scala> new D().d res1: Int = 42 scala> :quit ```
* | | Merge commit 'bb3ded3' into merge-2.11-to-2.12-oct-5Lukas Rytz2015-10-0512-5/+148
|\| |
| * | Merge pull request #4720 from retronym/ticket/9029Jason Zaugg2015-09-2912-5/+148
| |\ \ | | |/ | |/| SI-9029 Fix regression in extractor patterns
| | * SI-7850 Additional tests for name based patmatJason Zaugg2015-09-212-0/+28
| | | | | | | | | | | | Found these in an old review branch of mine.
| | * SI-8989 Better error message for invalid extractor patternJason Zaugg2015-09-215-5/+51
| | |
| | * SI-9029 Fix regression in extractor patternsJason Zaugg2015-09-215-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The unified treatment of classical and named-based pattern matching does not correctly handle the generalization of "tuple capture". By "tuple capture", I mean: ``` scala> object Extractor { def unapply(a: Any): Option[(Int, String)] = Some((1, "2")) } defined object Extractor scala> "" match { case Extractor(x: Int, y: String) => } scala> "" match { case Extractor(xy : (Int, String)) => } warning: there was one deprecation warning; re-run with -deprecation for details scala> :warnings <console>:9: warning: object Extractor expects 2 patterns to hold (Int, String) but crushing into 2-tuple to fit single pattern (SI-6675) "" match { case Extractor(xy : (Int, String)) => } ^ ``` Name based pattern matching, new in Scala 2.11, allows one to deconstruct the elements that structurally resembles `ProductN`: ``` scala> class P2(val _1: Int, val _2: String) defined class P2 scala> object Extractor { def unapply(a: Any): Option[P2] = Some(new P2(1, "2")) } defined object Extractor scala> "" match { case Extractor(x: Int, y: String) => } ``` However, attempting to extract the `P2` in its entirety leads to an internal error: ``` scala> "" match { case Extractor(p2: P2) => } <console>:10: warning: fruitless type test: a value of type (Int, String) cannot also be a P2 "" match { case Extractor(p2: P2) => } ^ <console>:10: error: error during expansion of this match (this is a scalac bug). The underlying error was: type mismatch; found : P2 required: (Int, String) "" match { case Extractor(p2: P2) => } ^ ``` Note that this match was legal and warning free in 2.10. This commit avoids the hard-coded assumption that the "tuple capture" results in a `TupleN`, and instead keeps track of the product-ish type from which we extracted the element types. I have also opted not to limit the deprecation warning to `TupleN` extractors.
| * | Merge pull request #4757 from lrytz/t9375-2.11Lukas Rytz2015-09-227-7/+356
| |\ \ | | | | | | | | [backport] SI-9375 add synthetic readResolve only for static modules
| | * | [backport] SI-9375 add synthetic readResolve only for static modulesLukas Rytz2015-09-227-7/+356
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | For inner modules, the synthetic readResolve method would cause the module constructor to be invoked on de-serialization in certain situations. See the discussion in the ticket. Adds a comprehensive test around serializing and de-serializing modules.
* | | Merge pull request #4769 from retronym/topic/anyrefmap-serializableLukas Rytz2015-10-051-2/+3
|\ \ \ | | | | | | | | Make AnyRefMap serializable
| * | | Make AnyRefMap serializableJason Zaugg2015-09-251-2/+3
| | | |
* | | | SI-9498 Avoid caching bug with pattern type variablesJason Zaugg2015-09-301-0/+25
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Typechecking a pattern that defines a pattern type variable initially assigns abstract type symbol with open type bounds. Later on, pattern type inference kicks in to sharpen the type of the variable based on constraints imposed by the expected type (ie, the type of scrutinee of the pattern.) However, before inference does this, a `TypeRef` to the abstract type symbol can be queried for its base type with respect to some class, which leads to it populating an internal cache. This cache becomes stale when the underlying symbol has its type mutated. The repercussions of this meant that a subsequent call to `baseType` gave the wrong result (`NoType`), which lead to an `asSeenFrom` operation to miss out of substitution of a type variable. Note the appearance of `A` in the old type errors in the enclosed test case. This commit takes an approach similar to 286dafbd to invalidate caches after the mutation. I've routed both bandaids through the same first aid kit: I'm sure over time we'll add additional calls to this method, and additional cache invalidations within it.
* | | Add $deserializeLambda$ when inlining an indyLambda into a classLukas Rytz2015-09-231-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | Fixes https://github.com/scala/scala-dev/issues/39 When inlining an indyLambda closure instantiation into a class, and the closure type is serializable, make sure that the target class has the synthetic `$deserializeLambda$` method.
* | | Merge commit '03aaf05' into merge-2.11-to-2.12-sep-22Lukas Rytz2015-09-2214-47/+67
|\| |
| * | Merge pull request #4725 from retronym/topic/completely-2.11Lukas Rytz2015-09-2111-43/+36
| |\ \ | | | | | | | | Topic/completely 2.11
| | * \ Merge remote-tracking branch 'origin/2.11.x' into topic/completely-2.11Jason Zaugg2015-09-1768-0/+39
| | |\ \
| | * | | Fix completion for synthetic case modules and methodsJason Zaugg2015-09-101-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm pretty sure the `isSynthetic` call added in 854de25ee6 should instead be `isArtifact`, so that's what I've implemented here. `isSynthetic` used to also filter out error symbols, which are created with the flags `SYNTHETIC | IS_ERROR`. I've added an addition test for `isError`, which was needed to keep the output of `presentation/scope-completion-import` unchanged. The checkfile for `presentation/callcc-interpreter` is modified to add the additional completion proposals: synthetic companion objects.
| | * | | SI-5408 Prompt after incomplete script pasteSom Snytt2015-09-022-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Transcript paste mode invites the user to keep typing like regular paste mode, but really you must enter more transcript. This matters if the script ends in the middle of incomplete code that the user wants to complete by hand. Previously, ``` scala> scala> def f() = { // Detected repl transcript paste: ctrl-D to finish. // Replaying 1 commands from transcript. scala> def f() = { scala> scala> def f() = { // Detected repl transcript paste: ctrl-D to finish. | } // Replaying 1 commands from transcript. scala> def f() = { } f: ()Unit ``` Now, ``` scala> scala> def f() = { // Detected repl transcript. Paste more, or ctrl-D to finish. // Replaying 1 commands from transcript. scala> def f() = { | 42 | } f: ()Int scala> f() res0: Int = 42 ```
| | * | | Update power mode bannerSom Snytt2015-09-028-40/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The classic banner is available under -Dscala.repl.power.banner=classic. ``` scala> :power Power mode enabled. :phase is at typer. import scala.tools.nsc._, intp.global._, definitions._ Try :help or completions for vals._ and power._ ```
| * | | | Merge pull request #4716 from Ichoran/issue/9388Lukas Rytz2015-09-213-4/+31
| |\ \ \ \ | | | | | | | | | | | | SI-9388 Fix Range behavior around Int.MaxValue
| | * | | | SI-9388 Fix Range behavior around Int.MaxValueRex Kerr2015-09-193-4/+31
| | | |_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | terminalElement (the element _after_ the last one!) was used to terminate foreach loops and sums of non-standard instances of Numeric. Unfortunately, this could result in the end wrapping around and hitting the beginning again, making the first element bad. This patch fixes the behavior by altering the loop to end after the last element is encountered. The particular flavor was chosen out of a few possibilities because it gave the best microbenchmarks on both large and small ranges. Test written. While testing, a bug was also uncovered in NumericRange, and was also fixed. In brief, the logic around sum is rather complex since division is not unique when you have overflow. Floating point has its own complexities, too. Also updated incorrect test t4658 that insisted on incorrect answers (?!) and added logic to make sure it at least stays self-consistent, and fixed the range.scala test which used the same wrong (overflow-prone) formula that the Range collection did.
| * | | | Merge pull request #4752 from alexeyr/topic/errornonexistentfield-messageLukas Rytz2015-09-211-3/+3
| |\ \ \ \ | | | | | | | | | | | | [backport] Include owner in ErrorNonExistentField message
| | * | | | [backport] Include owner in ErrorNonExistentField messageAlexey Romanov2015-09-181-3/+3
| | |/ / / | | | | | | | | | | | | | | | This should be particularly helpful for synthetic field names like `evidence$21`.
* | | | | Merge commit 'a170c99' into 2.12.xLukas Rytz2015-09-2269-1/+45
|\| | | |
| * | | | fix t9370 so it works on Windows tooSeth Tisue2015-09-181-1/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | partest has custom code for -Xplugin handling (see DirectCompiler.updatePluginPath for details). that code has its own idea of what the syntax of -Xplugin is, different from Scalac's. partest's idea is that multiple paths should be separated by the platform classpath separator character, so : on Unix and ; on Windows. the .flags file here was using a colon, and that confuses partest on Windows, since partest was expecting a semicolon. it might be nice to fix partest to accept comma as the separator instead, which is standard for a scalac MultiStringSetting such as -Xplugin. but it turns out we have an out: we can just provide multiple -Xplugin flags. what evidence do I have that this is the right change? * the test still passes on both Windows and Mac OS X (manually tested); if Travis likes it, we'll know it passes on Linux too * I tried reverting Som's fix for SI-9370 (c32ba93) and the test failed, as expected, both with and without my change * I added a bunch of debugging output to DirectCompiler.updatePluginPath in partest, built a new partest jar, and used it to run the test on Windows with and without my fix, and verified by eye that the logic there was operating as expected in both cases and in conclusion, for Som's benefit: <insert cryptic joke here>
| * | / SI-9475 Dependent PolyTypes are dependent typesVlad Ureche2015-09-171-0/+19
| | |/ | |/| | | | | | | Such that uncurry can correctly un-dependify them.
| * | Merge pull request #4727 from SethTisue/unset-stray-execute-bitsSeth Tisue2015-09-1465-0/+0
| |\ \ | | | | | | | | unset inappropriate execute bits
| | * | unset inappropriate execute bitsSeth Tisue2015-09-0265-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I imagine these date back to old Subversion days and are probably the result of inadvertent commits from Windows users with vcs client configs. having the bit set isn't really harmful most of the time, but it's just not right, and it makes the files stand out in directory listings for no reason
| * | | SI-9369 Fix pattern matcher warnings for diamond shaped inheritance.Gerard Basler2015-09-122-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A previous optimization (d44a86f432a7f9ca250b014acdeab02ac9f2c304) for pattern matcher exhaustivity checks used a smarter encoding to ensure that the scrutinee can be equal to one child only. However, in case of traits between the root and leave type, a child can be of several types and these types should not be in a mutually exclusive group. A simple solution (hat tip to retronym) is to just put traits and classes into separate groups.
| * | | Merge pull request #4704 from VladUreche/issue/9442Jason Zaugg2015-09-061-0/+14
| |\ \ \ | | |_|/ | |/| | SI-9442 Fix the uncurry-erasure types
| | * | SI-9442 Fix the uncurry-erasure typesVlad Ureche2015-08-231-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the "uncurry-erased" type (the one after the uncurry phase) can lead to incorrect tree transformations. For example, compiling: ``` def foo(c: Ctx)(l: c.Tree): Unit = { val l2: c.Tree = l } ``` Results in the following AST: ``` def foo(c: Ctx, l: Ctx#Tree): Unit = { val l$1: Ctx#Tree = l.asInstanceOf[Ctx#Tree] val l2: c.Tree = l$1 // no, not really, it's not. } ``` Of course, this is incorrect, since `l$1` has type `Ctx#Tree`, which is not a subtype of `c.Tree`. So what we need to do is to use the pre-uncurry type when creating `l$1`, which is `c.Tree` and is correct. Now, there are two additional problems: 1. when varargs and byname params are involved, the uncurry transformation desugares these special cases to actual typerefs, eg: ``` T* ~> Seq[T] (Scala-defined varargs) T* ~> Array[T] (Java-defined varargs) =>T ~> Function0[T] (by name params) ``` we use the DesugaredParameterType object (defined in scala.reflect.internal.transform.UnCurry) to redo this desugaring manually here 2. the type needs to be normalized, since `gen.mkCast` checks this (no HK here, just aliases have to be expanded before handing the type to `gen.mkAttributedCast`, which calls `gen.mkCast`)
| * | | Merge pull request #4692 from JanBessai/Fix-SI-6636Adriaan Moors2015-08-312-0/+24
| |\ \ \ | | |_|/ | |/| | SI-6636 Fix macro expansion in toolboxes
| | * | SI-6636 Fix macro expansion in toolboxesJan Bessai2015-08-232-0/+24
| | | |
| * | | SI-9450 Fix triple quoted strings in REPL :power modeJason Zaugg2015-08-272-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some extra synthetic code generated under this mode failed to escape input before adding it to a literal string. It used to get away with this most of the time by triple quoting the literal. This commit reuses Scala string escaping logic buried in `Constant` to do this properly. Actually, the proper approach would be to build the synthetic code with trees and quasiquotes, and avoid the mess of stringly-genererated code. I threw in some defensive hygiene for the reference to `Nil` while I was in the neighbourhood.
| * | | Fix typos in spec, docs and commentsMichaƂ Pociecha2015-08-2312-13/+13
| | |/ | |/|
* | | Merge pull request #4711 from lrytz/opt/heuristicsLukas Rytz2015-09-225-23/+25
|\ \ \ | | | | | | | | Inliner heuristic for higher-order methods
| * \ \ Merge remote-tracking branch 'upstream/2.12.x' into opt/heuristicsLukas Rytz2015-09-1858-246/+617
| |\ \ \
| * | | | First version of inliningh heuristics that prefer higher-order methosLukas Rytz2015-09-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When invoking a higher-order method and the value passed for the SAM type is either a function literal or a parameter of the callsite method, inline the higher-order method into the callee. This is a first version, the heuristics will be refined further.
| * | | | Emit exception handlers for inlined methods in the correct orderLukas Rytz2015-09-181-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handler tables are lists of tuples (try-start, try-end, handler-start, exception-type). When an instruction throws, the first handler in the list that covers the instruction and matches the type is executed. For nested handlers, it is the job of the compiler to add them to the handler table in the correct order. When inlining a method, the handlers of the callee are prepended to the list of handlers in the callsite method. This ensures that the callee's handlers are tested first if an exception is thrown in the inlined code.