summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Incorporated reviewer feedback.Paul Phillips2013-05-113-34/+35
| | | | Made things a little more consistent and self-apparent.
* Refactored stabilize.Paul Phillips2013-05-114-85/+128
| | | | | Mode elimination ramps up in difficulty now, so I pursued other forms of code hygiene.
* Eliminated HKmode.Paul Phillips2013-05-114-44/+53
| | | | It becomes context mode "TypeConstructor".
* Eliminated RETmode.Paul Phillips2013-05-114-10/+14
| | | | It becomes context mode "ReturnExpr".
* Eliminated SNDTRYmode.Paul Phillips2013-05-115-28/+38
| | | | It becomes context mode "SecondTry".
* Started eliminating modes.Paul Phillips2013-05-115-111/+118
| | | | | | | | | | | | | | Consolidating the scattered typer state in Context, where it's relatively easy to keep an eye on, rather than threaded throughout the typer in sneaky/sticky bitmasks. The general pattern will be what was once an explicitly passed around bit in Mode becomes an implicitly propagated-as-appropriate bit in Context. In this commit: ALTmode becomes context mode "PatternAlternative" STARmode becomes context mode "StarPatterns" SUPERCONSTRmode becomes context mode "SuperInit"
* Corralling Modes into a smaller pen.Paul Phillips2013-05-1111-261/+300
| | | | | | | | | | | | | | | | | | | | Attempting to reduce the frequency of low-level operations with modes. I mean stuff like this: if ((mode & (EXPRmode | LHSmode)) == EXPRmode) THey don't make those ten line boolean guards any easier to understand. Hopefully this will lead us toward eliminating some of the modes entirely, or at least better isolating their logic rather than having it interspersed at arbitrary points throughout the typer. Modes are in their entirety a leaked implementation detail. Typing a tree requires a tree and optionally an expected type. It shouldn't require a bucket of state bits. In subsequent commits I will start eliminating them. This commit also breaks adapt down into more digestible chunks.
* 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".
* | Merge pull request #2425 from paulp/pr/no-package-objectsPaul Phillips2013-05-102-116/+123
|\ \ | | | | | | Boil out some duplicated parser logic.
| * | 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-1021-50/+86
|\ \ | | | | | | 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-2721-49/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge pull request #2491 from paulp/pr/absolute-packagesPaul Phillips2013-05-07667-1018/+1469
|\ \ \ \ | |/ / / |/| | | Absolutized paths involving the scala package.
| * | | 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-0239-116/+525
|\ \ \ | | | | | | | | Merge 2.10.x
| * \ \ Merge 2.10.x into masterAdriaan Moors2013-05-0239-116/+525
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * \ \ Merge pull request #2475 from adriaanm/build-relative-symlinkAdriaan Moors2013-05-021-1/+3
| | |\ \ \ | | | | | | | | | | | | use relative symlink in distpack
| | | * | | 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 #2471 from paulp/pr/2.10.2/6532Paul Phillips2013-04-301-0/+2
| | |\ \ \ | | | | | | | | | | | | SI-6532 emit debug info in compiled java.
| | | * | | SI-6532 emit debug info in compiled java.Paul Phillips2013-04-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our handful of java source files weren't being compiled with line numbers, sourcefile, and other debugger aids. I don't really know how to test this so I'll enclose an excerpt of the bytecode diff of scala.runtime.IntRef to show that this change results in debug information. 2,3c2,4 > Compiled from "IntRef.java" 4a6 > SourceFile: "IntRef.java" 53a62,67 > LineNumberTable: > line 18: 0 > LocalVariableTable: > Start Length Slot Name Signature > 0 10 0 this Lscala/runtime/IntRef; > 0 10 1 elem I 62a77,81 > LineNumberTable: > line 19: 0 > LocalVariableTable: > Start Length Slot Name Signature > 0 8 0 this Lscala/runtime/IntRef;
| | * | | | Merge pull request #2432 from retronym/ticket/delayed-init-refPaul Phillips2013-04-304-0/+64
| | |\ \ \ \ | | | |/ / / | | |/| | | Warn on selection of vals from DelayedInit subclasses.
| | | * | | Warn on selection of vals from DelayedInit subclasses.Jason Zaugg2013-04-234-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-276-11/+123
| | |\ \ \ \ | | | | | | | | | | | | | | SI-7369 Avoid spurious unreachable warnings in patterns
| | | * | | | SI-7369 Avoid spurious unreachable warnings in patternsJason Zaugg2013-04-246-11/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-264-27/+55
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | SI-7367 scaladoc crash on constructing the model for annotations.
| | | * | | | | SI-7367 scaladoc crash on constructing the model for annotations.Eugene Vigdorchik2013-04-254-27/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | | | | | Merge pull request #2449 from heathermiller/readmefixAdriaan Moors2013-04-251-1/+1
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Corrects link in README.rst
| | | * | | | | | Corrects link in README.rstHeather Miller2013-04-251-1/+1
| | |/ / / / / /
| | * | | | | | Merge pull request #2448 from namin/update-linksHeather Miller2013-04-252-11/+6
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Update links to old website, in preparation for launch.
| | | * | | | | | Update links to old website, in preparation for launch.Nada Amin2013-04-252-11/+6
| | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed the contact form, since it's redundant with mailing lists and issue tracker.
| | * | | | | | Merge pull request #2444 from paulp/pr/value-class-cmp-warningPaul Phillips2013-04-253-17/+67
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-6943 warn on value class miscomparison.
| | | * | | | | | SI-6943 warn on value class miscomparison.Paul Phillips2013-04-243-17/+67
| | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-239-11/+57
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-6675 Avoid spurious warning about pattern bind arity.
| | | * | | | | | SI-6675 Avoid spurious warning about pattern bind arity.Jason Zaugg2013-04-219-11/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
| | * | | | | | | Merge pull request #2435 from retronym/ticket/7355Jason Zaugg2013-04-231-2/+3
| | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-7355 Handle spaces in paths in Windows batch files.
| | | * | | | | | | 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-217-31/+43
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-7330 better error when pattern's not a value
| | | * | | | | | SI-7330 better error when pattern isn't a valueAdriaan Moors2013-04-087-31/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-213-4/+19
| | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Quiet down overloaded implicit warning.