summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2285 from vigdorchik/silence_scaladocPaul Phillips2013-03-2362-527/+511
|\ | | | | Remove unrecognized doc comments
| * Doc -> C-style comments for local symbols to avoid "discardingEugene Vigdorchik2013-03-2162-528/+512
| | | | | | | | | | unmoored doc comment" warning when building distribution for scala itself.
* | Merge pull request #2265 from rjolly/scripting9Paul Phillips2013-03-234-9/+72
|\ \ | | | | | | script engine : better binding mechanism + reflexive access through bound variable "engine"
| * | The script engine is given a better binding mechanism and reflexive accessRaphael Jolly2013-03-222-4/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Better binding mecanism : formerly done through the default SimpleBindings shipped with the API, it now goes through a custom IBindings class which uses the bind method of the interpreter instead of simply making the bindings available as a Map. Reflexive access : the script engine is made available to itself through a bound variable "engine" of type javax.script.ScriptEngine. This will allow "variable injection" i.e. programmatic redefinition of variables, among others.
| * | Bypass determination of protection domain when resource is not in a jarRaphael Jolly2013-03-222-5/+11
| | |
* | | Merge pull request #2260 from som-snytt/issue/5717-assert-pkgdirPaul Phillips2013-03-232-28/+33
|\ \ \ | | | | | | | | SI-5717 error when bytecode cannot be written
| * | | SI-5717 error when bytecode cannot be writtenSom Snytt2013-03-222-28/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there's an existing file foo when emitting a class file for foo.Bar, then emit an error at foo.Bar, similar to what javac does. The error message looks something like: foo.scala:4: error: error writing object Foo: ./mypkg/Foo.class: ./mypkg is not a directory
* | | | Merge pull request #2259 from Blaisorblade/issue/6123-try-3Paul Phillips2013-03-222-6/+8
|\ \ \ \ | |_|/ / |/| | | SI-6123: -explaintypes should not explain errors which won't be reported, new attempt
| * | | SI-6123: -explaintypes should not explain errors which won't be reportedPaolo G. Giarrusso2013-03-152-6/+8
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -explainTypes means that only type tests which *fail* should be reported in more detail by using explainTypes. Hence, callers of explainTypes should check if type errors are being ignored, by checking context.reportErrors. Hence, this check is added to Inferencer, and another call site is redirected to that method. Moreover, explainTypes should only be called if an error exists. Enforce that in checkSubType, and remove spurious home-made explainTypes output. Finally, in ContextErrors, stop checking `settings.explaintypes.value` before calling `explainTypes` which will check it again. Note that this patch does not fix all occurrences, but only the ones which showed up during debugging. The other ones never cause problems, maybe because they occur when contextErrors is in fact guaranteed to be true. We might want to fix those ones anyway. This fixes regressions in c800d1fec5241ed8c29e5af30465856f9b583246 and 78f9ef3906c78413ff8835fdad3849bfe5516be2. Thanks to hubertp (Hubert Plociniczak) for the first round of review. Refs #6123 backport to _2.10.x_
* | | Merge pull request #2287 from vigdorchik/ticket/si-7102James Iry2013-03-221-0/+2
|\ \ \ | | | | | | | | SI-7102 Override isEmpty for bitsets with an efficient implementation
| * | | SI-7102 Specialize isEmpty for bitsetsEugene Vigdorchik2013-03-211-0/+2
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently bitsets use default isEmpty implementation inherited from Set, which tests for "size == 0". Calculating the size of a word in a bitmap requires summing through all bits set, whereas testing for emptyness needs only one comparison with zero. This commit overrides the default implementation with the specialized one looking for a non-zero word in this bitmap.
* | | Merge pull request #2239 from paulp/pr/warningsAdriaan Moors2013-03-2145-164/+130
|\ \ \ | |/ / |/| | Warnings removal and other cleanup.
| * | Removed dead src directory.Paul Phillips2013-03-121-1/+0
| | | | | | | | | | | | One line of commentary referenced from nowhere can't be very useful.
| * | Eliminate a bunch of -Xlint warnings.Paul Phillips2013-03-1243-162/+113
| | | | | | | | | | | | | | | | | | Mostly unused private code, unused imports, and points where an extra pair of parentheses is necessary for scalac to have confidence in our intentions.
| * | Warn about forgotten string interpolators.Paul Phillips2013-03-122-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | In the compiler sources this arrives with a number of false positives, because we frequently work with strings containing $foo where foo is an in-scope identifier. I think in normal source code this will be less of a problem, or none at all; but to be conservative the warning is born under -Xlint.
* | | Merge pull request #2262 from mesagie/patch-4James Iry2013-03-201-5/+4
|\ \ \ | | | | | | | | removed a redundant var in JavaWriter.flagsToStr
| * | | removed a redundant var in JavaWriter.flagsToStrSagie Davidovich2013-03-151-5/+4
| | | | | | | | | | | | the variable x was assigned to, but was never used.
* | | | Merge pull request #2251 from soc/SI-7236James Iry2013-03-202-14/+14
|\ \ \ \ | | | | | | | | | | SI-7236 Deprecate ThreadPoolTaskSupport and friends
| * | | | SI-7236 Deprecate ThreadPoolTaskSupport and friendsSimon Ochsenreither2013-03-132-14/+14
| | | | |
* | | | | Merge pull request #2235 from vigdorchik/si_5513James Iry2013-03-201-1/+50
|\ \ \ \ \ | | | | | | | | | | | | SI-5513: add inplace set-theoretic operations for mutable bitsets.
| * | | | | SI-5513: add inplace set-theoretic operations for mutable bitsets.Eugene Vigdorchik2013-03-111-1/+50
| | | | | |
* | | | | | Merge pull request #2219 from chuvoks/rbtRebalanceJames Iry2013-03-201-24/+45
|\ \ \ \ \ \ | | | | | | | | | | | | | | Optimize RedBlackTree rebalance method by using null optimized list implementation.
| * | | | | | Optimize rebalance method by using null optimized list implementation.Juha Heljoranta2013-03-131-24/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rebalance method relies heavily on s.c.i.List. By replacing List with null optimized version, NList, rebalance operation is significantly more faster. Test indicate +10 % performance improvement for tree sizes >= 100. Existing tests verify red-black tree invariants, including operations involving tree rebalance.
* | | | | | | Merge pull request #2244 from paulp/pr/notNullAdriaan Moors2013-03-1718-202/+127
|\ \ \ \ \ \ \ | |_|_|_|/ / / |/| | | | | | SI-7247, deprecate NotNull.
| * | | | | | Eliminated containsNull.Paul Phillips2013-03-133-81/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a little trickier than the previous. I introduced a new method 'isBottomSubClass' which is the obvious complement to the beloved 'isNonBottomSubClass'. In eliminating the two call sites of containsNull I might have overshot the mark a bit when I rewrote fourthTry and thirdTryRef, but who is going to argue with such beauty as this.
| * | | | | | Completely remove isNotNull/notNull.Paul Phillips2013-03-131-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restarted the Zamboni and collected these as well. Author was convinced by reviewer that clinging to isNotNull like Linus's security blanket will not help us with landing a picture of the Great Pumpkin. YAGNI, Charlie Brown.
| * | | | | | SI-7247, deprecated NotNull.Paul Phillips2013-03-133-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed NotNull from tests and the parentage of AnyVal. Removed the tests which were actually testing anything to do with NotNull; massaged the others to forget NotNull and/or not to name local things NotNull.
| * | | | | | Remove -Xcheck-null setting.Paul Phillips2013-03-135-47/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Maybe this was useful in some way; but no way I ever saw. I have comments which tell me this is exposed in the IDE so I left a stub. I also removed mkCheckInit. That probably sounds like it's related to -Xcheckinit. Guess again, guy-who-thinks-names-mean-things. It was only used by -Xcheck-null.
| * | | | | | Removed -Ynotnull setting.Paul Phillips2013-03-1312-68/+25
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It never worked and it would periodically jump out and bite someone. Slash and burn so new plants can take root. Eliminated NotNullType and NotNullClass, internal elements. Removed notNull method on Type, which no longer has a purpose. Retained 'def isNotNull' because there are types which are known by construction not to be null (ThisType, ConstantType as long as the constant isn't null, etc.) and that's still useful to know.
* | | | | | Merge pull request #2214 from JamesIry/master_constant_optimizationJames Iry2013-03-153-2/+633
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Analyze constants to remove unnecessary branches
| * | | | | Cleanup of constant optimizationJames Iry2013-03-141-144/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit cleans up constant optimization from the review of https://github.com/scala/scala/pull/2214 . * drops are done using the instruction's consumed count rather than a numeric literal * drops are moved into one common method in the main instruction interpreter * One instance of x.length > y.length is replaced with x.lengthCompare(y.length) > 0 * NaN is dealt with by treating it as an UNKNOWN * A test is added to make sure NaN semantics aren't broken. * The constant-optmization test is improved with tests for switch statements
| * | | | | Analyze constants to remove unnecessary branchesJames Iry2013-03-073-2/+650
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds analysis and optimization of constants to remove unnecessary branches. It uses abstract interpretation to determine what constant(s) a particular stack slot or variable might or might not hold at a given spot and uses that knowledge to eliminate branches that cannot be taken. Its primary goal is null check removal, but it also works for other constants. Several tests are modified to include the new optimization phase. Two new tests are added. One verifies that branching still works as expected. The other verifies that branches are removed.
* | | | | | Merge pull request #2215 from paulp/issue/7228Paul Phillips2013-03-136-49/+51
|\ \ \ \ \ \ | |_|_|_|/ / |/| | | | | SI-7228, bug in subtyping.
| * | | | | Fix it-never-happened performance regression.Paul Phillips2013-03-131-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Diligent reviewer observed that a hot spot was possibly being made hotter. Reviewer's suggested remedy was a spectacular bust, but studious observation revealed the news lash that expensive methods are expensive and we should avoid calling them if we can. Put short-circuit test back in front of unapply call. Now the time spent in unapply is within a few percent.
| * | | | | Moved some numeric subtyping logic closer to center.Paul Phillips2013-03-103-17/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed bug in numeric widening related to continuations, which enabled simplifying isNumericSubType.
| * | | | | Simplified the widening logic.Paul Phillips2013-03-101-17/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Should speak for itself. Whenever someone changed @switch from an error to a warning, it broke all the tests which depended on the error. I added -Xfatal-warnings to a couple which needed it. And one of those tests was then failing, as it must now since we couldn't get away with what was being attempted, so I moved it to pending.
| * | | | | SI-7228, bug in weak subtyping.Paul Phillips2013-03-104-19/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Another in the category of bugs which involve narrowing, widening, mediuming, dealiasing, weakening, normalizing, denormalizing, supernormalizing, subnormalizing, and double-bounded supersubnormalizing. This is probably not the ideal fix, but it is an improvement.
* | | | | | Merge pull request #2242 from adriaanm/merge-2.10.xPaul Phillips2013-03-135-11/+26
|\ \ \ \ \ \ | | | | | | | | | | | | | | Merge 2.10.x into master
| * \ \ \ \ \ Merge 2.10.x into masterAdriaan Moors2013-03-124-10/+25
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/reflect/reify/Errors.scala src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
| | * \ \ \ \ \ Merge pull request #2224 from retronym/ticket/7238Adriaan Moors2013-03-111-3/+3
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-7328 Bail out of names/defaults when args are error typed
| | | * | | | | | SI-7328 Bail out of names/defaults if args are error typedJason Zaugg2013-03-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid a crasher later on with a null type inside a sequence argument.
| | * | | | | | | Merge pull request #2225 from retronym/ticket/7234Adriaan Moors2013-03-111-7/+10
| | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-7234 Make named args play nice with dep. method types
| | | * | | | | | | SI-7234 Make named args play nice with dep. method typesJason Zaugg2013-03-091-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some care is needed to avoid interaction with constant types (e.g pos/z1730.scala) and with existentials (e.g. t3507-old.scala).
| | * | | | | | | | Merge pull request #2223 from scalamacros/ticket/7235Adriaan Moors2013-03-112-0/+6
| | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | reifier is now aware of SI-7235
| | | * | | | | | | | reifier is now aware of SI-7235Eugene Burmako2013-03-092-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SI-7235 is caused by a long-standing todo in typedRefinement, which leads to originals of compound type trees swallowing their stats. I'm not sure how exactly to fix SI-7235, but what I am sure about is that we shouldn't silently discard stats during reification. This patch introduces a new implementation restrictions, which now reports that reify of compound type trees with non-empty stats isn't going to work.
| | * | | | | | | | | SI-7226 Fix inference regression caused by TypeVar equality.Jason Zaugg2013-03-091-0/+6
| | | |_|/ / / / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TypeVars, being mutable creatures, mustn't have structural equality/hashing, otherwise TypeRefs that differ only by having distinct TypeVars as components get wrongly uniqued together. The reported bug showed the disaterous consequences: constraints from the `C?[Int]` in the return type applied to the `?C[?A]` in the parameter list. This commit overrides `equals` and `hashCode` in `TypeVar` to use reference equality. An alternative fix would be to drop the `case`-ness of the class, as was the case before 0cde930b when this regressed.
| * | | | | | | | | Merge 2.10.x into masterAdriaan Moors2013-03-121-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/typechecker/Typers.scala
| | * | | | | | | | Fix SI-7224.Iulian Dragos2013-03-071-1/+1
| | | |/ / / / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't focus positions assigned to the TypeTree of a parent of a Template when the parent exists in the source. A focused position (instance of `OffsetPosition`) makes it invisible to the presentation compiler when it looks for the innermost enclosing tree of a given position (breaking hyperlinking, for example).
* | | | | | | | | Update sbt.latest.version to sbt's latest version.Paul Phillips2013-03-131-2/+3
| |_|_|_|_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | And tweak deprecated stub so it compiles with 0.12.2.
* | | | | | | | Merge pull request #2236 from retronym/ticket/6601-2Paul Phillips2013-03-123-2/+8
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-6601 Close access loophole for value class constructors