summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* SI-7469 Remove @deprecated scala.util.parsing.astSimon Ochsenreither2013-05-132-381/+0
|
* Merge pull request #2501 from paulp/pr/tailcalls-tostringPaul Phillips2013-05-121-6/+6
|\ | | | | Limit unnecessary calls to Type#toString.
| * Limit unnecessary calls to Type#toString.Paul Phillips2013-05-081-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Logging revealed a few thousand calls to the often expensive Type#toString emerging from tailcalls. The error message was being generated for all methods even though it was only issued in rare cases (and for the particular tailrec failure which made the call, extremely rare.) The remaining boatload of unnecessary Type#toString calls are much harder to fix due to the design of "AbsTypeError" and the fact that the compiler approaches mutability like a cat approaches a loaded gun. See SI-6149.
* | Merge pull request #2470 from ihji/masterPaul Phillips2013-05-111-2/+2
|\ \ | | | | | | SI-7432 Range.min should throw NoSuchElementException on empty range
| * | SI-7432 Range.min should throw NoSuchElementException on empty rangeHeejong Lee2013-04-301-2/+2
| | | | | | | | | | | | | | | For consistency, range.max and range.min should throw NoSuchElementException on an empty range.
* | | Merge pull request #2512 from som-snytt/issue/partest-exec-logPaul Phillips2013-05-111-4/+5
|\ \ \ | | | | | | | | Par-Test includes log in transcript of failed exec
| * | | Par-Test includes log in transcript of failed execSom Snytt2013-05-101-4/+5
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | The previous behavior was that the Failure is generated before the log is appended to the transcript. That meant that the summary transcripts wouldn't include the log file. Luckily, the transcript would say something like "jvm > showFail-run.log".
* | | Boil out some duplicated parser logic.Paul Phillips2013-05-101-116/+108
| | | | | | | | | | | | Our focus today is on packages and package objects.
* | | Flesh out copyMemberDef methods with copyModuleDef.Paul Phillips2013-05-101-0/+15
| | |
* | | Merge pull request #2462 from magarciaEPFL/backendish9Paul Phillips2013-05-1020-48/+84
|\ \ \ | | | | | | | | SI-6863 root cause fixed using factory of scala.runtime.*Ref
| * | | indentation typoMiguel Garcia2013-04-301-6/+6
| | | |
| * | | SI-6863 root cause fixed using factory of scala.runtime.*RefMiguel Garcia2013-04-2720-47/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit does away with an error-prone division of labor between UnCurry and LambdaLift, a division of labor by which UnCurry had to anticipate under which circumstances LambdaLift creates a scala.runtime.*Ref whose initial value is given by a an expression including a Try in non-statement position. That sounds complicated, and it is. The solution so far (fixing SI-6863) is replaced by a simpler approach, at the cost of forward binary comptability with pre-2.11 releases, this time fixing the root cause of SI-6863. From now on, a s.r.*Ref is instantiated via invocation of a static factory method in the s.r.*Ref class in question. Unlike the code that was emitted so far (which involved NEW refclass, DUP, expr, INVOKESPECIAL refclass.<init>) the "expr" doesn't appear on the operand stack on top of the *Ref value being initialized. In other words, the *Ref initialization is in statement position provided "expr" is.
* | | | Merge pull request #2489 from som-snytt/issue/partest-show-diffPaul Phillips2013-05-102-1/+13
|\ \ \ \ | |_|/ / |/| | | Partest can --show-diff again after incremental report.
| * | | Partest can --show-diff again after incremental report.Som Snytt2013-05-032-1/+13
| | | | | | | | | | | | | | | | | | | | A flag is set in NestUI to look for "diff" in the transcript of failing tests.
* | | | Merge pull request #2493 from paulp/pr/null-hardeningPaul Phillips2013-05-077-8/+16
|\ \ \ \ | | | | | | | | | | Hardening against nulls for deserialization.
| * | | | Hardening against nulls for deserialization.Paul Phillips2013-05-037-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When one attempts to populate data structures via deserialization, nulls tend to show up in unlikely or "impossible" places. Now there are a few fewer.
* | | | | Absolutized paths involving the scala package.Paul Phillips2013-05-03667-1018/+1469
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Confusing, now-it-happens now-it-doesn't mysteries lurk in the darkness. When scala packages are declared like this: package scala.collection.mutable Then paths relative to scala can easily be broken via the unlucky presence of an empty (or nonempty) directory. Example: // a.scala package scala.foo class Bar { new util.Random } % scalac ./a.scala % mkdir util % scalac ./a.scala ./a.scala:4: error: type Random is not a member of package util new util.Random ^ one error found There are two ways to play defense against this: - don't use relative paths; okay sometimes, less so others - don't "opt out" of the scala package This commit mostly pursues the latter, with occasional doses of the former. I created a scratch directory containing these empty directories: actors annotation ant api asm beans cmd collection compat concurrent control convert docutil dtd duration event factory forkjoin generic hashing immutable impl include internal io logging macros man1 matching math meta model mutable nsc parallel parsing partest persistent process pull ref reflect reify remote runtime scalap scheduler script swing sys text threadpool tools transform unchecked util xml I stopped when I could compile the main src directories even with all those empties on my classpath.
* | | | Merge pull request #2407 from paulp/pr/immutable-tailcallsAdriaan Moors2013-05-031-116/+111
|\ \ \ \ | |/ / / |/| | | Rewrite TailCalls for performance and immutability.
| * | | Rewrite TailCalls for performance and immutability.Paul Phillips2013-04-171-116/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While logging symbols created after typer, I discovered that TailCalls was far and away the largest creator. It turns out this was due to a bug where thousands of labels were eagerly created during tail call analysis, even if the method weren't tail recursive and no label would ever be required. This commit shaves 10% off the total number of method symbol creations (compiling quick.lib drops from 88K to 80K.)
* | | | Merge pull request #2483 from adriaanm/merge-2.10.xPaul Phillips2013-05-0214-95/+164
|\ \ \ \ | | | | | | | | | | Merge 2.10.x
| * \ \ \ Merge 2.10.x into masterAdriaan Moors2013-05-0214-95/+164
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bincompat-forward.whitelist.conf src/compiler/scala/tools/nsc/matching/Patterns.scala src/compiler/scala/tools/nsc/transform/patmat/Logic.scala src/compiler/scala/tools/nsc/typechecker/Infer.scala src/scaladoc/scala/tools/nsc/doc/model/ModelFactory.scala test/files/neg/t5663-badwarneq.check
| | * | | | use relative symlink in distpackAdriaan Moors2013-04-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To simplify building a release on jenkins, we run distpack-opt in one job, store the `dists/` directory in a tar ball, archive that artifact and copy it to the downstream jobs that package on windows and unix. To make the tarball portable between machines, it must not use absolute symlinks.
| | * | | | Merge pull request #2432 from retronym/ticket/delayed-init-refPaul Phillips2013-04-301-0/+11
| | |\ \ \ \ | | | | | | | | | | | | | | Warn on selection of vals from DelayedInit subclasses.
| | | * | | | Warn on selection of vals from DelayedInit subclasses.Jason Zaugg2013-04-231-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Which are likely to yield null, if the program didn't start. This is a common source of confusion for people new to the language, as was seen during the Coursera course. The test case shows that the usage pattern within Specs2 won't generate these warnings.
| | * | | | | Merge pull request #2439 from retronym/ticket/7369Adriaan Moors2013-04-271-11/+28
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | SI-7369 Avoid spurious unreachable warnings in patterns
| | | * | | | | SI-7369 Avoid spurious unreachable warnings in patternsJason Zaugg2013-04-241-11/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unreachability analysis draws on the enumerated domain of types (e.g sealed subclasses + null, or true/false), and also looks at all stable identifier patterns tested for equality against the same 'slot' in a pattern. It was drawing the wrong conclusions about stable identifier patterns. Unlike the domain constants, two such values may hold the same value, so we can't assume that matching X precludes matching Y in the same slot in a subsequent case. For example: val X: Boolean = true; val Y: Boolean = true def m1(t1: Tuple1[Boolean]) = t1 match { case Tuple1(true) => case Tuple1(false) => case Tuple1(false) => // correctly unreachable } def m2(t1: Tuple1[Boolean]) = t1 match { case Tuple1(X) => case Tuple1(Y) => // spurious unreachable warning } // // Before // reachability, vars: V2: Boolean ::= true | false// Set(false, Y, X, true) // = x1._1 V1: (Boolean,) ::= null | ... // = x1 equality axioms: V2=true#4 \/ V2=false#5 /\ -V2=false#5 \/ -V2=Y#3 /\ -V2=false#5 \/ -V2=X#2 /\ -V2=false#5 \/ -V2=true#4 /\ -V2=Y#3 \/ -V2=X#2 /\ -V2=Y#3 \/ -V2=true#4 /\ -V2=X#2 \/ -V2=true#4 // // After // reachability, vars: V2: Boolean ::= true | false// Set(false, Y, X, true) // = x1._1 V1: (Boolean,) ::= null | ... // = x1 equality axioms: V2=true#4 \/ V2=false#5 /\ -V2=false#5 \/ -V2=true#4
| | * | | | | | Merge pull request #2392 from vigdorchik/ticket/si-7367Paul Phillips2013-04-262-27/+29
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-7367 scaladoc crash on constructing the model for annotations.
| | | * | | | | | SI-7367 scaladoc crash on constructing the model for annotations.Eugene Vigdorchik2013-04-252-27/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scaladoc only checks primary constructor when building annotation model. Here we instead find the constructor matching the annotation's symbol. Also change TreeFactory.makeTree to return TreeEntity rather than Option[TreeEntity] and force the caller check for EmptyTree.
| | * | | | | | | SI-6943 warn on value class miscomparison.Paul Phillips2013-04-241-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's a very dangerous situation running around when you combine universal equality with value classes: // All over your code val x = "abc" if (x == "abc") ... // Hey let's make x a value class val x = new ValueClass("abc") // Uh-oh There was until now no warning when comparing a value class with something else. Now there is.
| | * | | | | | | Merge pull request #2420 from retronym/ticket/6675-2Jason Zaugg2013-04-236-11/+32
| | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-6675 Avoid spurious warning about pattern bind arity.
| | | * | | | | | | SI-6675 Avoid spurious warning about pattern bind arity.Jason Zaugg2013-04-216-11/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 692372ce, we added a warning (under -Xlint) when binding a `TupleN` in to a single pattern binder, which wasn't allowed before 2.10.0, and more often than not represents a bug. However, that warning overstretched, and warned even when using a Tuple Pattern to bind to the elements of such a value. This commit checks for this case, and avoids the spurious warnings. A new test case is added for this case to go with the existing test for SI-6675: $ ./tools/partest-ack 6675 % tests-with-matching-paths ... 3 % tests-with-matching-code ... 2 # 3 tests to run. test/partest --show-diff --show-log \ test/files/neg/t6675-old-patmat.scala \ test/files/neg/t6675.scala \ test/files/pos/t6675.scala \ "" Testing individual files testing: [...]/files/pos/t6675.scala [ OK ] Testing individual files testing: [...]/files/neg/t6675-old-patmat.scala [ OK ] testing: [...]/files/neg/t6675.scala [ OK ] All of 3 tests were successful (elapsed time: 00:00:03)
| | * | | | | | | | SI-7355 Handle spaces in paths in Windows batch files.Bjorn Regnell2013-04-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed "%1%" and %2% to "%~1" and %~2 to allow spaces in paths by surrounding quotes according to advice at: http://stackoverflow.com/questions/473117/pass-path-with-spaces-as-parameter-to-bat-file http://ss64.com/nt/syntax-args.html
| | * | | | | | | | Merge pull request #2387 from vigdorchik/interactive_scaladocAdriaan Moors2013-04-221-2/+4
| | |\ \ \ \ \ \ \ \ | | | |_|_|/ / / / / | | |/| | | | | | | Interactive scaladoc: demand new typer run when done.
| | | * | | | | | | Interactive scaladoc: mark new typer run when done.Eugene Vigdorchik2013-04-171-2/+4
| | | | |/ / / / / | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of now, when backgroundCompile is in the same typer run as scaladoc-fetching logic, typer is confused with stale symbols.
| | * | | | | | | Merge pull request #2358 from adriaanm/ticket-7330Jason Zaugg2013-04-213-28/+30
| | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-7330 better error when pattern's not a value
| | | * | | | | | | SI-7330 better error when pattern isn't a valueAdriaan Moors2013-04-083-28/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Somehow an applied type managed to sneak past the type checker in pattern mode. Patterns must be values, though. `case C[_] =>` was probably meant to be `case _: C[_] =>` Advice is dispensed accordingly. (Generalizing the existing advice machinery.)
| | * | | | | | | | Merge pull request #2410 from paulp/pr/parameterized-implicitJason Zaugg2013-04-211-4/+5
| | |\ \ \ \ \ \ \ \ | | | |_|_|_|/ / / / | | |/| | | | | | | Quiet down overloaded implicit warning.
| | | * | | | | | | Quiet down overloaded implicit warning.Paul Phillips2013-04-181-4/+5
| | | | |_|/ / / / | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently implicit classes product both a method symbol and a module symbol, both of which are marked implicit, which left this warning code believing there was an overloaded implicit method.
* | | | | | | | | Merge pull request #2406 from paulp/issue/7362Paul Phillips2013-04-303-19/+17
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-7362, crash in presentation compiler
| * | | | | | | | | More useful checkfile output in interactive tests.Paul Phillips2013-04-302-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I resisted the urge to fix "aksTypeCompletion" for as long as I possibly could. While I was there I threw in what seem to be like significant output improvements, but you tell me.
| * | | | | | | | | SI-7362, crash in presentation compiler.Paul Phillips2013-04-301-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code by retronym, test by huitseeker, I just move stuff around.
* | | | | | | | | | Merge pull request #2476 from paulp/pr/2446-passingPaul Phillips2013-04-3027-351/+770
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Partest PR up to the passing commit.
| * | | | | | | | | | SI-7409 Par-Test: A crash is not a DNC for neg testsSom Snytt2013-04-303-31/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A compiler crash does not count as Does Not Compile for purposes of a negative test. Changing the test kind from "neg" to "dnc" is out of scope for this PR. Even if the user asks to update the check file with the crash result, we must prevent him from doing so. Any further attempts to update the check file with a crash will dispatch the Scala SWAT squad which will race to his location and physically restrain the user. Only Martin holds the code which will allow the squad to stand down. So make sure his cell is on next time you want to --update-check. A neg test will stop trying to compile after the first failed round, which is all that matters. By popular request, a new test outcome is emitted when the check file is updated. It is called "Updated". It even has its own short status, the double-plus that is reminiscent of diff output.
| * | | | | | | | | | Partest has an optionable wait period.Som Snytt2013-04-305-13/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Partest --timeout "30 seconds" to time out the test run. It will not hang on timeout ("I hang with Par-Test" t-shirts not-withstanding). It's beyond the scope of this commit to investigate argument parsing: `partest --timeout "\"30 seconds"\" --pos`
| * | | | | | | | | | SI-7349 Partest supports test-interfaceSom Snytt2013-04-307-194/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Partest uses test-interface API to invoke ScalaCheck. This obviates ad hoc output checking for result status. The context class loader is set to a loader that the scaladoc scalacheck tests can use.
| * | | | | | | | | | Update ScalaCheck to 1.10.1.Som Snytt2013-04-3015-124/+444
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Puts test-interface on the class path.
| * | | | | | | | | | Partest testnum field width is sensitive to total testsSom Snytt2013-04-302-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow the hyphens to line up on a column within the output for a test category or "kind". ``` $ partest files/neg/t4134.scala --run Selected 1348 tests drawn from 1 named test categories, specified tests & starting 1 test in neg ok 1 - neg/t4134.scala & starting 1347 tests in run ok 1 - run/absoverride.scala ok 2 - run/amp.scala ok 3 - run/adding-growing-set.scala ```
| * | | | | | | | | | SI-7358 Partest fails on scalacheck failureSom Snytt2013-04-301-14/+18
| |/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A failing test generates a test failure. The failure log is added to the transcript. The log stream is closed when done.
* | | | | | | | | | Merge pull request #2453 from magarciaEPFL/backendish6Paul Phillips2013-04-301-13/+18
|\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | | SI-7422 GenASM populates and clears its maps within a Run
| * | | | | | | | | no need to manually clear perRunCaches in GenASMMiguel Garcia2013-04-271-3/+0
| | | | | | | | | |