summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #3563 from adriaanm/t5479Grzegorz Kossakowski2014-02-228-2/+16
|\ | | | | SI-5479 deprecate DelayedInit outside of App
| * SI-5479 link to release notes instead of jira queryAdriaan Moors2014-02-202-3/+3
| |
| * SI-5479 deprecate DelayedInit outside of AppAdriaan Moors2014-02-198-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | DelayedInit's semantics are way too surprising. For example, it delays initialization of fields, so that fields on objects that extend `App` (which `extends DelayedInit`) are not initialized until the `main` method is called. For more details and a proposed alternative, see https://issues.scala-lang.org/browse/SI-4330?jql=labels%20%3D%20delayedinit%20AND%20resolution%20%3D%20unresolved. Support for `App` will continue -- we'll special case it.
* | Merge pull request #3567 from retronym/ticket/8315Jason Zaugg2014-02-226-3/+28
|\ \ | | | | | | SI-8315 Fix crash in dead code elimination
| * | SI-8315 Fix crash in dead code eliminationJason Zaugg2014-02-205-0/+27
| | | | | | | | | | | | | | | | | | | | | It was a cache invalidation bug. We need to mark the Code as touched to invalidate the caches behind `predecessors` and `successors`.
| * | SI-8315 Better debugging facility for ICodeJason Zaugg2014-02-201-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suffix the phase name to avoid clobbering files. % qbin/scalac -Xprint-icode -Xprint:inline -Yinline -Ydead-code sandbox/test.scala 1>/dev/null 2>/dev/null % ls *.icode A$$anonfun$crash$1_icode.icode Listt_icode.icode A$$anonfun$crash$1_inliner.icode Listt_inliner.icode A_icode.icode Nill$_icode.icode A_inliner.icode Nill$_inliner.icode
* | | Merge pull request #3562 from adriaanm/t8197Jason Zaugg2014-02-212-1/+14
|\ \ \ | | | | | | | | SI-8197 Overload resolution should not consider default arguments
| * | | SI-8197 Overload resolution should not consider default argumentsAdriaan Moors2014-02-192-1/+14
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The spec says > Let B be the set of alternatives in A that are applicable (§6.6) > [...] It is an error if none of the members in B is applicable. If > there is one single applicable alternative, that alternative is > chosen. Otherwise, let C be the set of applicable alternatives which > don’t employ any default argument in the application to e1, ..., em. > It is again an error if C is empty. Otherwise, one chooses the most > specific alternative among the alternatives in C [...]. There are many ways to interpret this, but none of them involves excluding default getters, which is what the old code was doing. We now exclude all alternatives that define any default arguments. NOTE: according to SI-4728, this should fail to compile with an ambiguity error. The compiler has been accepting this program for all of 2.10.x, as far as I can tell, so let's not change that for 2.11.0-RC1...
* | | Merge pull request #3557 from adriaanm/t8224Jason Zaugg2014-02-216-37/+48
|\ \ \ | | | | | | | | SI-8224 Fix regression in f-bound aware LUBs
| * | | SI-8224 Fix regression in f-bound aware LUBsJason Zaugg2014-02-186-37/+48
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disable the heuristic approach to recursive bounds unless the compiler is running under `-Xstrict-inference`. [the above was not authored by the original author] In db46c71e88, steps were taken to avoid blowing up in the pathological LUB calculation needed for: def trav = List(List(), Stream()) This skipped a level in the base class sequence when f-bounds were detected at the current level. In that example, when `lublist` was about to: mergePrefixAndArgs( typeOf[LinearSeqOptimized[A, List[A]]], typeOf[LinearSeqOptimized[A, Stream[A]]], ) If it proceeded (as in 2.10.3), the LUB is invalid: error: type arguments [B[_ >: D with C <: B[_ >: D with C <: A]],s.c.immutable.LinearSeq[B[_ >: D with C <: A]] with s.c.AbstractSeq[B[_ >: D with C <: A]] with s.c.LinearSeqOptimized[B[_ >: D with C <: A],s.c.immutable.LinearSeq[A] with s.c.AbstractSeq[A] with s.c.LinearSeqOptimized[A,Immutable with Equals with java.io.Serializable] with java.io.Serializable] with java.io.Serializable] do not conform to trait LinearSeqOptimized's type parameter bounds [+A,+Repr <: s.c.LinearSeqOptimized[A,Repr]] To avoid this, the added code would skip to the first non-F-bounded base type of the same arity of each element in the list. This would get to: LinearSeqLike[D, Stream[D]] LinearSeqLike[C, List[C]] which are lubbable without violating the type constraints. I don't think this was the right remedy. For starters, as seen in this bug report, SI-8224, if the list of types are identical we have let a perfectly good lub slip through our fingers, and end up calculating too general a type. More generally, if the type arguments in f-bounded positions coincide, we don't risk calculating a ill-bounded LUB. Furthermore, the code was widening each of the types separately; this isn't something we want to do within `if (isUniformFrontier)`. AFAICT this was just wasteful and as all `ts0` start with the same type symbol, so `typeConstructorList` should be uniform. This commit restricts this base-class skipping to situations where the argument inferred for an type argument that is used as an f-bound is not: a) an existential (as created by `mergePrefixAndArgs` in invariant positions.), or b) equivalent to one of the corresponding input type arguments (this is the case that fixes the regression in pos/8224.scala)
* | | Merge pull request #3546 from VladimirNik/typedTreesPrinter-2.11.0Jason Zaugg2014-02-218-61/+292
|\ \ \ | | | | | | | | CodePrinter added to Printers 2.11.0
| * | | PrintersTest commentedVladimirNik2014-02-201-1151/+809
| | | |
| * | | fixes for wrappingIntoTermVladimirNik2014-02-202-2/+3
| | | |
| * | | block wrapping for trees modifiedVladimirNik2014-02-202-5/+50
| | | |
| * | | block processing fixed for syntactics in typechecked treesVladimirNik2014-02-204-6/+7
| | | |
| * | | printOwners support added to Printers; whitespaces removedVladimirNik2014-02-205-184/+187
| | | |
| * | | move methods for typechecked trees processing to TreeInfoVladimirNik2014-02-203-62/+65
| | | |
| * | | CodePrinter: TypedTreePrinter merged with ParsedTreePrinterVladimirNik2014-02-201-123/+89
| | | |
| * | | lazy vals printing fixed for typechecked treesVladimirNik2014-02-203-15/+44
| | | |
| * | | printers flag processing improvements: printRootPkg flag fixed, comments to ↵VladimirNik2014-02-202-14/+30
| | | | | | | | | | | | | | | | flags metadata printing added
| * | | Attributed val/var processing for syntactics (SI-8180)VladimirNik2014-02-205-854/+1363
| | | | | | | | | | | | | | | | | | | | | | | | TypedTreesPrinter added changes based on pull request comments: print root packages flag; tests for syntactics; SyntacticEmptyTypeTree added to Printers
* | | | Merge pull request #3555 from adriaanm/rebase-3553Jason Zaugg2014-02-2112-14/+44
|\ \ \ \ | | | | | | | | | | Small Predef cleanup
| * | | | SI-7788 Avoid accidental shadowing of Predef.conformsAdriaan Moors2014-02-185-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename `conforms` to `$conforms` and put in a minimal backstop: pos/t7788.scala TODO: predicate the backwards compatibility shim for `Predef_conforms` on `-Xsource:2.10`
| * | | | SI-8229 Source compatible name for implicit any2stringaddJason Zaugg2014-02-188-8/+25
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To support the established pattern for disabling it for an compilation unit. Update scaladoc's knowledge of our "typeclasses". Leave a `private[scala]` version of `StringAdd` (public in bytecode) to ensure binary compatibility with 2.11.0-M8 for partest.
* | | | Merge pull request #3558 from adriaanm/t4577Jason Zaugg2014-02-213-3/+41
|\ \ \ \ | | | | | | | | | | SI-4577 singleton type pattern test should use `eq`, not `==`
| * | | | SI-4577 singleton type pattern test should use `eq`, not `==`Adriaan Moors2014-02-183-3/+41
| |/ / / | | | | | | | | | | | | | | | | | | | | I find it hard to imagine anyone is relying on `case x: foo.type =>` erroneously being compiled to `foo == x` instead of the spec'ed `foo eq x`, so let's finally fix this.
* | | | Merge pull request #3564 from adriaanm/t6675Jason Zaugg2014-02-216-5/+8
|\ \ \ \ | | | | | | | | | | SI-6675 deprecation warning for auto-tupling in patterns
| * | | | SI-6675 deprecation warning for auto-tupling in patternsAdriaan Moors2014-02-196-5/+8
| | |_|/ | |/| | | | | | | | | | | | | | NOTE: when the deprecation warning becomes an error, SI-6111 must become a `won't fix`
* | | | Merge pull request #3569 from xeno-by/ticket/8316Jason Zaugg2014-02-2017-9/+261
|\ \ \ \ | | | | | | | | | | SI-8316 SI-8318 SI-8248 reintroduces resetAllAttrs
| * | | | SI-8316 SI-8318 SI-8248 reintroduces resetAllAttrsEugene Burmako2014-02-2017-9/+261
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, due to the aforementioned bugs we have to delay our triumph over resetAllAttrs. Therefore, I'm rolling back the internal changes to scalac introduced in https://github.com/scala/scala/pull/3485. Our public reflection API interface in Scala 2.11 is still going to contain only resetLocalAttrs, but both the reifier and the label typechecker are too heavily addicted to resetAllAttrs to do away with it right now.
* | | | Merge pull request #3568 from densh/topic/qq-terminologyEugene Burmako2014-02-2016-212/+212
|\ \ \ \ | |_|/ / |/| | | Fix quasiquote terminology to be consistent with Scheme
| * | | Tweak signature for quasiquote's applyDenys Shabalin2014-02-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Even though quasiquotes are whitebox macros their return values are in fact always trees. This might help IDEs with macro expansions turned off.
| * | | Fix quasiquote terminology to be consistent with SchemeDenys Shabalin2014-02-2015-211/+211
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Rename cardinality into rank. Shorter word, easier to understand, more appropriate in our context. 2. Previously we called any dollar substitution splicing but this is not consistent with Scheme where splicing is substitution with non-zero rank. So now $foo is unquoting and ..$foo and ...$foo is unquote splicing or just splicing. Correspondingly splicee becomes unquotee. 3. Rename si7980 test into t7980
* | | Merge pull request #3560 from gkossakowski/issue/SI-8306Adriaan Moors2014-02-193-1/+13
|\ \ \ | |/ / |/| | SI-8306: handle SWITCH nodes with just default case
| * | SI-8306: handle SWITCH nodes with just default caseGrzegorz Kossakowski2014-02-193-1/+13
|/ / | | | | | | | | | | | | | | | | | | | | | | Handle properly SWITCH nodes that contain just a default case in optimizer (ConstantOptimization). SWITCH with just default case is expressed as a node with empty tags and exactly one label. We can handle such nodes easily by introducing a shortcut in logic that computes reachableLabels. Add a test case which triggers patmat to generate SWITCH node with just a default case. Fixes SI-8306.
* | Merge pull request #3452 from xeno-by/topic/palladium0Jason Zaugg2014-02-19327-3046/+6736
|\ \ | |/ |/| SI-8063 and its seventy friends
| * undeprecates typeSignature and typeSignatureInEugene Burmako2014-02-181-2/+0
| | | | | | | | | | | | | | As per Jason's feedback, these are now undeprecated, being aliases for info and infoIn. I haven't touched the newly introduced setInfo family of methods, because I think that on internal level we don't need setTypeSignature anyway.
| * improves situation with auto-initEugene Burmako2014-02-182-9/+26
| | | | | | | | | | | | | | Symbol.typeSignature and Symbol.typeSignatureIn no longer auto-init. Neither does Symbol.toString (something that I introduced a few commits ago). However Type.toString still does, and that should be enough to get robust prettyprinting with minimal risk. Details are in comments.
| * makes sure compat._ provides full compatibility with 2.10.xEugene Burmako2014-02-1813-0/+632
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is extremely important to enable cross-versioning Scala 2.10 codebases against Scala 2.11 using Jason's trick with: // TODO 2.11 Remove this after dropping 2.10.x support. private object HasCompat { val compat = ??? }; import HasCompat._ def impl(c: Context)(...): ... = { import c.universe._ import compat._ ... }
| * reverses SI-6484Eugene Burmako2014-02-188-51/+5
| | | | | | | | | | Unfortunately I have to revert b017629 because of SI-8303. There are projects (e.g. slick) that use typeOf in annotations, which effectively means bye-bye.
| * tests for SI-8300Eugene Burmako2014-02-187-0/+125
| | | | | | | | | | | | Highlights the dilemma with rich type members in the cake that no longer exists. One used to have to choose between overloading or patmat/extmeth friendliness, but couldn't have both. Thanks to retronym we can have it all.
| * Merge remote-tracking branch 'retronym/topic/8301' into topic/palladium0Eugene Burmako2014-02-184-5/+60
| |\
| * \ Merge remote-tracking branch 'origin/master' into topic/palladium0Eugene Burmako2014-02-1727-385/+120
| |\ \
| * | | better deprecation message for Symbol.companionSymbolEugene Burmako2014-02-161-1/+1
| | | |
| * | | Merge remote-tracking branch 'origin/master' into topic/palladium0Eugene Burmako2014-02-16139-949/+2539
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/reflect/macros/compiler/Resolvers.scala src/compiler/scala/reflect/macros/contexts/Typers.scala src/compiler/scala/tools/reflect/ToolBoxFactory.scala src/reflect/scala/reflect/api/BuildUtils.scala
| * | | | adds missing signature of appliedTypeEugene Burmako2014-02-152-0/+6
| | | | | | | | | | | | | | | | | | | | Again, thanks to sbt.
| * | | | adds more tests for enclosingOwnersEugene Burmako2014-02-156-0/+106
| | | | | | | | | | | | | | | | | | | | | | | | | Makes sure that it's possible to cover sbt's use cases, and also checks that we can distinguish vals from vars (should anyone ever need that).
| * | | | updates deprecation hints in compatEugene Burmako2014-02-152-35/+35
| | | | | | | | | | | | | | | | | | | | | | | | | Now when we have internal.decorators, it is reasonable to advertise them to the users.
| * | | | some extension methods that I forgot to exposeEugene Burmako2014-02-153-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | Thanks, sbt. Once I'm done with sbt, I'll write up tests that ensure that I haven't forgotten anything.
| * | | | fixes compat for tree and type extractorsEugene Burmako2014-02-156-225/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When I removed XXXDef(...) and XXXType(...) methods from the public API, I put compatibility stubs in compat via implicit classes enriching XXXExtractor traits with apply methods. Unfortunately, this doesn't work, because if XXXDef or XXXType have any kind of an apply method left in the public API, then implicit classes won't even be considered when resolving calls to XXXDef(...) or XXXType(...). Therefore I had to put those removed methods back and adorn them with an implicit parameter that can only be resolved when "import compat._" is in place. Quite extravagant, yes, but goes along the lines with the design goals of the refactoring, which are: 1) Break source compatibility for users who are using methods that are now moved to internal in order to attract attention. 2) Provide an easy way to fix the breakage by importing compat._, which will pimp back all the missing APIs with deprecation warnings that are going to guide migration.