summaryrefslogtreecommitdiff
path: root/test/files
Commit message (Collapse)AuthorAgeFilesLines
* 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.
| * | | | Revert workaround for SI-8334Lukas Rytz2015-09-173-22/+17
| | | | | | | | | | | | | | | | | | | | The new optimizer doesn't have this problem.
* | | | | Merge pull request #4749 from retronym/ticket/9473Lukas Rytz2015-09-2217-73/+74
|\ \ \ \ \ | | | | | | | | | | | | SI-9473 Cleaner references to statically owned symbols
| * | | | | SI-9473 Cleaner references to statically owned symbolsJason Zaugg2015-09-2217-73/+74
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ever wonder why `identity("")` typechecks to `scala.this.Predef.identity("")`? It turns out that `mkAttributedRef` was importing `q"$scalaPackageClass.this.Predef._"` for all these years, rather than `q"$scalaModule.Predef._"`. This commit makes `mkAttributedRef` special case static owners by referring the the corresponding module, instead.
* | | | | SI-9479 Fix regression w. inherited overloads in package objectJason Zaugg2015-09-192-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One shouldn't base any decisions of the owner of an overloaded symbol. Instead, the owner of each of the alternatives should be considered. This gotcha is super easy to forget, as I did with my change to simplify the way we detect whether we need to add the `.package` prefix to a tree.
* | | | | Merge pull request #4699 from alexeyr/patch-1Lukas Rytz2015-09-181-3/+3
|\ \ \ \ \ | | | | | | | | | | | | Include owner in ErrorNonExistentField message
| * | | | | Include owner in ErrorNonExistentField messageAlexey Romanov2015-09-141-3/+3
| | |/ / / | |/| | | | | | | | | | | | | This should be particularly helpful for synthetic field names like `evidence$21`.
* | | | | Merge pull request #4689 from retronym/topic/trait-default-specializationLukas Rytz2015-09-182-0/+17
|\ \ \ \ \ | |_|/ / / |/| | | | Preparation for using default methods in traits
| * | | | Don't generate specialized overrides in traitsJason Zaugg2015-08-112-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The term "specialized override" is used to describe a method in a synthetic specialized subclass that generically substitutes the specialized type args into the siganture of a generic method. For example, `trait T[@spec A] { def t(a: A) }` gives rise to `def t(a: Int)` under the type environment `A=Int`. This commit avoids doing this for specialized traits, only classes have these overrides now. The motivation is to make it simpler to use specialized interfaces (like `T$mcI$sp` from the example above) as Java functional interfaces.
| * | | | Test case for the status quo in specialized traitsJason Zaugg2015-08-112-0/+18
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A deferred method in the generic interface ends up with a corresponding, generically substituted version in the specialized sub interface. This is superfluous and problematic when we start adding default methods to the interfaces. The subsequent commit will remove them.
* | | | Merge pull request #4732 from SethTisue/merge-2.11.x-sep-8Adriaan Moors2015-09-0917-14/+58
|\ \ \ \ | | | | | | | | | | Merge 2.11.x into 2.12.x [ci: last-only]
| * | | | Merge remote-tracking branch 'origin/2.11.x' into 2.12.xSeth Tisue2015-09-0817-14/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | only trivial merge conflicts here. not dealing with PR #4333 in this merge because there is a substantial conflict there -- so that's why I stopped at 63daba33ae99471175e9d7b20792324615f5999b for now
* | | | | Merge pull request #4731 from soc/SI-7155Seth Tisue2015-09-081-112/+0
|\ \ \ \ \ | |/ / / / |/| | | | SI-7155 Remove deprecated private s.c.m.AVLTree
| * | | | SI-7155 Remove deprecated private s.c.m.AVLTreeSimon Ochsenreither2015-09-051-112/+0
| | | | |
* | | | | Merge pull request #4671 from lrytz/t9375-easyJason Zaugg2015-09-086-7/+337
|\ \ \ \ \ | | | | | | | | | | | | SI-9375 add synthetic readResolve only for static modules
| * | | | | SI-9375 add synthetic readResolve only for static modulesLukas Rytz2015-07-306-7/+337
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #4673 from puffnfresh/issue/6806Jason Zaugg2015-09-087-0/+44
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | SI-6806 Add an @implicitAmbiguous annotation
| * | | | | SI-6806 Add an @implicitAmbiguous annotationBrian McKenna2015-08-117-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example usage: trait =!=[C, D] implicit def neq[E, F] : E =!= F = null @annotation.implicitAmbiguous("Could not prove ${J} =!= ${J}") implicit def neqAmbig1[G, H, J] : J =!= J = null implicit def neqAmbig2[I] : I =!= I = null implicitly[Int =!= Int] Which gives the following error: implicit-ambiguous.scala:9: error: Could not prove Int =!= Int implicitly[Int =!= Int] ^ Better than what was previously given: implicit-ambiguous.scala:9: error: ambiguous implicit values: both method neqAmbig1 in object Test of type [G, H, J]=> Main.$anon.Test.=!=[J,J] and method neqAmbig2 in object Test of type [I]=> Main.$anon.Test.=!=[I,I] match expected type Main.$anon.Test.=!=[Int,Int] implicitly[Int =!= Int] ^
* | | | | | Merge pull request #4590 from som-snytt/issue/6810Lukas Rytz2015-08-242-0/+54
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-6810 Disallow EOL in char literal
| * | | | | | SI-6810 Test for CRSom Snytt2015-06-292-3/+13
| | | | | | |
| * | | | | | SI-6810 Disallow EOL in char literalSom Snytt2015-06-292-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's clear that char literals are one-lined like normal string literals. By the same token, pun intended, char literals accept unicode escapes the same as string literals, including `\u000A`. This commit adds the usual exclusions (CR, NL, SU). The spec is outdated in outlawing chars that are not "printable", in particular, the ASCII control codes. The original intention may have been that the ordinary string escapes are required, such as "\b\n". Note that some common escapes are absent, such as "\a".
* | | | | | | Merge remote-tracking branch 'origin/2.11.x' into 2.12.xSeth Tisue2015-08-2025-113/+124
|\ \ \ \ \ \ \ | |_|_|_|/ / / |/| | | | / / | | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | all conflicts were because the changes changed code that doesn't exist anymore in 2.12; they were resolved with `git checkout --ours` c201eac changed bincompat-forward.whitelist.conf but I dropped the change in this merge because it refers to AbstractPromise which no longer exists in 2.12
| * | | | | Revert "SI-8346 Rebuild invariant sets in #toSet, avoiding CCE"Adriaan Moors2015-08-182-40/+0
| | |_|_|/ | |/| | |
| * | | | Merge pull request #4554 from som-snytt/issue/1931Seth Tisue2015-08-0622-73/+116
| |\ \ \ \ | | | | | | | | | | | | SI-1931 Hide Predef.any2stringadd in REPL