summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix for SI-4744, another variety of cycle.Paul Phillips2012-10-0914-17/+51
| | | | | | | | | | | | | | | | | | | | | I threw this in with the previous commit behind -Ybreak-cycles, but this one is much less sketchy. Explanation: have to handle f-bounds more deftly. Namers forces lower bounds to prevent recursion in that direction, but a light touch is required to handle these two situations differently: // This is a cyclic type parameter - an error is correct class A[T <: Comparable[_ <: T]] // This is not cyclic - it flips the arrow class B[T <: Comparable[_ >: T]] Long have I been haunted by the knowledge that you can write class B in java, but not in scala: public class B<T extends Comparable<? super T>> {} It's over! We've achieved parity with java.
* Experimental option -Ybreak-cycles.Paul Phillips2012-10-0921-45/+152
| | | | | | | | | Overcomes cycles encountered during classfile parsing in possibly sketchy fashion. "illegal cyclic reference involving class Foo" is the watchword. See SI-3809.
* Merge pull request #1477 from paulp/continuations-inference-bugPaul Phillips2012-10-093-1/+65
|\ | | | | Possible fix for continuations bug.
| * Possible fix for continuations bug.Paul Phillips2012-10-083-1/+65
|/ | | | | | | | | It comes looking for an implicit from (A @foo) => B and gives up, despite the fact that there is an implicit from A => B. Maybe there is some good reason for this, and/or I would fully believe there is a better way to fix it, but I'll propose this and wait to hear about the good reason and/or better way.
* Merge pull request #1472 from paulp/merge-2.10Paul Phillips2012-10-0839-740/+6361
|\ | | | | Merge 2.10
| * Merge remote-tracking branch 'origin/2.10.0-wip' into merge-2.10Paul Phillips2012-10-0739-740/+6361
|/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/2.10.0-wip: MethodSymbol.params => MethodSymbol.paramss SI-6471 Update jquery from 1.4.2 to 1.8.2 undeprecates manifests for 2.10.0 SI-6451: Rename classes in `unchecked-abstract.scala` test. Put more implementation restrictions on value classes. Fixed problem in SI-6408 Revised restrictions for value classes and unversal traits SI-6436 Handle ambiguous string processors fixes a bug in a weak cache in runtime reflection Conflicts: test/files/neg/classmanifests_new_deprecations.check test/files/neg/unchecked-abstract.check
| * Merge pull request #1470 from scalamacros/topic/paramssPaul Phillips2012-10-077-21/+20
| |\ | | | | | | MethodSymbol.params => MethodSymbol.paramss
| | * MethodSymbol.params => MethodSymbol.paramssEugene Burmako2012-10-077-21/+20
| |/ | | | | | | | | | | | | | | This matter was discussed at scala-internals: http://groups.google.com/group/scala-internals/browse_thread/thread/6414d200cf31c357 And I am convinced with Paul's argument: consistency of the convention is very important.
| * Merge pull request #1455 from scalamacros/topic/manifestsJosh Suereth2012-10-059-49/+40
| |\ | | | | | | undeprecates manifests for 2.10.0
| | * undeprecates manifests for 2.10.0Eugene Burmako2012-10-039-49/+40
| | | | | | | | | | | | | | | | | | | | | | | | Since scala-reflect.jar is going to be declared experimental for 2.10.0, it doesn't make sense to deprecate manifests in favor of type tags. Class manifests, however, ARE deprecated for class tags, because class tags don't require scala-reflect.jar and are generated independently of type tags.
| * | Merge pull request #1463 from VladUreche/issue/6471Josh Suereth2012-10-043-557/+6035
| |\ \ | | | | | | | | SI-6471 Update jquery from 1.4.2 to 1.8.2
| | * | SI-6471 Update jquery from 1.4.2 to 1.8.2Vlad Ureche2012-10-043-557/+6035
| |/ / | | | | | | | | | | | | | | | | | | | | | This reopens SI-6170 that was fixed by 1be1f760. I don't want to start a revert war, but I see two reasons we should stick to newer jquerys: - they provide better compatibility to new browsers - having diagrams not working is much more annoying than having the splitter not work
| * | Merge pull request #1451 from gkossakowski/SI-6451Grzegorz Kossakowski2012-10-042-64/+64
| |\ \ | | |/ | |/| SI-6451: Rename classes in `unchecked-abstract.scala` test.
| | * SI-6451: Rename classes in `unchecked-abstract.scala` test.Grzegorz Kossakowski2012-10-032-64/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported Miguel, `Con` is problematic name of a class on Windows and makes this test to fail. Renamed classes to something else which hopefully make Windows build happy again. Closes SI-6451. Review by @magarciaEPFL or @paulp.
| * | Merge pull request #1443 from gkossakowski/anyval-restrictionsGrzegorz Kossakowski2012-10-0313-47/+161
| |\ \ | | | | | | | | AnyVal/value classes restrictions
| | * | Put more implementation restrictions on value classes.Grzegorz Kossakowski2012-10-037-14/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nested objects, classes and lazy vals are disallowed at any nesting level in value classes; e.g. lazy vals local to a method defined in a value class. There are still allowed in universal traits. This is a temporary, implementation restriction that is planned to be addressed in future releases of Scala. Error messages has been updated to communicate that intent. Moved tests for SI-5582 and SI-6408 to pending folder. They have to stay there until implementation restrictions are addressed. Closes SI-6408 and SI-6432. Review by @odersky, @harrah and @adriaanm.
| | * | Fixed problem in SI-6408Martin Odersky2012-10-032-1/+13
| | | | | | | | | | | | | | | | Fixed problem reported in comment, where inner classes of value classe caused a compiler crash.
| | * | Revised restrictions for value classes and unversal traitsMartin Odersky2012-10-038-44/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and brought compiler in line with them. One thing we can accept IMO are nested classes (nested objects are still a problem). In fact, it makes no sense to exclude nested classes from value classes but not from universal traits. A class nested in universal trait will becomes a class nested in a value class by inheritance. Note that the reflection library already contains a universal trait with a nested class (IndexedSeqLike), so we should accept them if we can.
| * | | Merge pull request #1446 from retronym/ticket/6436-2Grzegorz Kossakowski2012-10-035-1/+39
| |\ \ \ | | |_|/ | |/| | SI-6436 Handle ambiguous string processors
| | * | SI-6436 Handle ambiguous string processorsJason Zaugg2012-10-025-1/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, we got in an inifinite loop by chasing the error typed result of adaptToMemberWithArgs. One point of befuddlement remains: why did t6436 and t6436b behave differently before this change?
| * | | Merge pull request #1439 from scalamacros/topic/reflective-uniquesJosh Suereth2012-10-021-1/+2
| |\ \ \ | | |_|/ | |/| | fixes a bug in a weak cache in runtime reflection
| | * | fixes a bug in a weak cache in runtime reflectionEugene Burmako2012-10-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Entries in SynchronizedTypes.uniques could previously be garbage collected in-between a successful call to contains and an actual cache lookup. The patch could be a one-liner, but I don't want to use HOFs in this function, whose prototype is a hotspot in the compiler. Also the fix doesn't touch scalac in any way. It only applies to reflective universes that provide runtime reflection functionality.
* | | | Merge pull request #1382 from paulp/topic/tpe_starPaul Phillips2012-10-0727-233/+212
|\ \ \ \ | | | | | | | | | | Defanged dummy type arguments.
| * | | | Overhauled documentation and structure of tpe/tpeHK/etc.Paul Phillips2012-10-022-83/+99
| | | | | | | | | | | | | | | | | | | | | | | | | Trying to make the code structure as hotspot friendly as I can, which is no mean feat.
| * | | | All the actual changes of tpe to tpe_* or tpeHK.Paul Phillips2012-10-0223-49/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are the call sites which formerly could be seen to call .tpe on a symbol with unapplied type parameters. Now each such call site makes an explicit choice about what is intended for the result type.
| * | | | Hardening in appliedType and Subst*Map.Paul Phillips2012-10-021-26/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All driven by the knowledge gained from logging all the calls to tpe and appliedType and seeing what was coming through there. Some needless type creation is avoided in the maps, and appliedType will squawk to those who listen when it sees something out of order.
| * | | | Cleanup in old Typers code.Paul Phillips2012-10-021-37/+22
| | | | | | | | | | | | | | | | | | | | Using established facilities for doing established things.
| * | | | Defanged dummy type arguments.Paul Phillips2012-10-021-14/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Spending a few hours on yet another tpe vs. tpeHK bug drove me to finally go after the dragon in his cave. I created a separate method for when you want to receive an invalid type which will cause mysterious crashes later if it is out of your sight for five seconds. def tpeHK : Type // unapplied type params stay unapplied def tpe_* : Type // unapplied type params applied as dummy args def tpe : Type // if there are unapplied type params, ABORT Actually it doesn't really abort, but I had it print a stack trace during development so I could track down every site which blindly calls tpe and see why they were doing it. Now it only admonishes you under -Ydebug. This way is a big step forward: you have to make a choice, which is good, because if you choose not to decide you still have made a choice, only mostly what you have chosen is bugs.
| * | | | Removed obsolete migration test.Paul Phillips2012-10-024-55/+0
| | | | | | | | | | | | | | | | | | | | Arrays are not Seqs: a fact known by all and sundry.
* | | | | Merge pull request #1466 from jroper/patch-1Paul Phillips2012-10-063-3/+56
|\ \ \ \ \ | | | | | | | | | | | | SI-6478 Fixing JavaTokenParser.ident
| * | | | | SI-6478 Fixing JavaTokenParser identJames Roper2012-10-053-3/+56
| | | | | |
* | | | | | Merge pull request #1465 from paulp/infer-method-alternativePaul Phillips2012-10-055-227/+304
|\ \ \ \ \ \ | | | | | | | | | | | | | | Improvements to overloading resolution code.
| * | | | | | Incorporated pull request feedback.Paul Phillips2012-10-054-55/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And fixed the test I broke at the last minute. Reworked tupling logic to make it harder to break. Expanded test coverage.
| * | | | | | Merge branch 'master' into infer-method-alternativePaul Phillips2012-10-05100-236/+307
| |\ \ \ \ \ \ | |/ / / / / / |/| | | | | |
* | | | | | | Merge pull request #1467 from paulp/passing-testsPaul Phillips2012-10-0461-100/+0
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Move tests out of pending.
| * | | | | | | Moved a bunch of passing tests out of pending.Paul Phillips2012-10-0455-100/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the test names can be believed, this covers SI-294 SI-1751 SI-1782 SI-2318 SI-3897 SI-4649 SI-4786 SI-5293 SI-5399 SI-5418 SI-5606 SI-5610 SI-5639 Most of these were moved to pending in 1729b26500 due to failures of unknown cause. It was suggested they be brought back "as soon as possible" and that was three months ago; I suppose it's now possible. If they need to be disabled again, please move them to test/disabled, not to test/pending. "disabled" should mean a formerly passing test in limbo; "pending" tests document bugs which await fixing. I also removed some dead files in test/ - the files with a "cmds" extension are from a failed experiment and do not do anything.
| * | | | | | | Moved some disabled test to the right place.Paul Phillips2012-10-046-0/+0
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | It's test/disabled/XXX, not test/files/disabled/XXX.
* | | | | | | Merge pull request #1447 from paulp/spuriousPaul Phillips2012-10-0410-38/+65
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | Spurious warning elimination.
| * | | | | | Fix for spurious warning.Paul Phillips2012-10-046-31/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Eliminates spurious "catch block may intercept non-local return" seen in recent builds of master. Unified some catch logic in TreeInfo, and removed some which never worked.
| * | | | | | Eliminated pattern matcher warning.Paul Phillips2012-10-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implicit extractor must be available to pattern match on abstract type. Requires prior commit not to crash under -Yrangepos.
| * | | | | | Fix for rangepos crasher.Paul Phillips2012-10-044-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wrapClassTagUnapply was generating an unpositioned tree which would crash under -Yrangepos. See SI-6338.
* | | | | | | Merge pull request #1369 from som-snytt/issue/6406-regextractPaul Phillips2012-10-046-34/+110
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Regex.unapplySeq should not take Any (Fixes SI-6406)
| * | | | | | | Regex.unapplySeq should not take Any (Fixes SI-6406)Som Snytt2012-09-206-34/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This deprecates unapplySeq(Any) and adds overloaded unapplySeq(CharSequence) and unapplySeq(Match), with the putative advantage that you can't try to extract the unextractable. Regex is massaged so that the underlying Pattern is primary, rather than the String-valued expression. Regex and its unanchored companion (I almost wrote unmoored) share a Pattern object, so that unapplySeq(Match) can easily test whether the Match was generated by this Regex; in that case, the match result is used immediately, instead of reapplying the regex to the matched string. The documentation is massaged to reflect unanchored and also to align with the underlying terminology, e.g., "subgroup" really just means "group."
* | | | | | | | Merge pull request #1429 from paulp/topic/shortClassPaul Phillips2012-10-046-13/+80
|\ \ \ \ \ \ \ \ | |_|/ / / / / / |/| | | | | | | Added utility function shortClass.
| * | | | | | | Added utility function shortClass.Paul Phillips2012-09-296-13/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pretty sick of names like scala> typeOf[List[Int]].getClass.getName res0: String = scala.reflect.internal.Types$TypeRef$$anon$1 I wrote this so I can see what the class of some arbitrary thing is in a way which my little brain can understand. For the example above we get scala> shortClassOfInstance(typeOf[List[Int]]) res0: String = ArgsTypeRef with AliasTypeRef Let's pimp a "shortClassName" onto AnyRef and be happy.
* | | | | | | | Merge pull request #1456 from paulp/has-symbol-fieldPaul Phillips2012-10-0418-51/+52
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Renamed hasSymbol to hasSymbolField.
| * | | | | | | | Renamed hasSymbol to hasSymbolField.Paul Phillips2012-10-0318-51/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suggestion by retronym that the obvious implementation of "hasSymbol" be called "hasSymbol" reminded me we have a method called "hasSymbol" which does not have that implementation, and which has burned us already with subtle bugginess. I think that "hasSymbolField" is self-documenting.
| | | | * | | | | Worked over inferMethodAlternative.Paul Phillips2012-10-043-186/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We shouldn't let these core methods become so complicated. They are way harder to follow than is necessary. It is why nobody ever fixes the bugs in them. This is only the beginning really. So many things in the compiler would border on trivial to fix if one didn't have to navigate so much cruft and indirection. Here are some methods which no longer exist: - hasExactlyNumParams. A dubious name for a method containing the expression "len <= n + 1". - resolveOverloadedMethod. A method which returns a list of symbols can't be resolving all that much. - isUnitForVarArgs. Take a guess as to what that method does. Ha ha, you were not even close. Still on my hit list: - "very similar logic to doTypedApply in typechecker" I find a good rule of thumb is never to write a comment which paraphrases to "this is very similar to that." This entire patch is the fault of a. moors for trying to cherry-pick a comment of mine from github into trunk. This patch hopefully makes the comment unnecessary.
| | | | * | | | | Replaced some <code> comments.Paul Phillips2012-10-041-20/+20
| |_|_|/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | With the far more readable not-html comments of modern times.
* | | | | | | | Merge pull request #1460 from axel22/issue/6467-cherry-masterJosh Suereth2012-10-046-10/+32
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-6467: Zero element in aggregate now by-name