summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #3580 from gkossakowski/issue/SI-8330Grzegorz Kossakowski2014-02-243-3/+30
|\ | | | | SI-8330: Mismatch in stack heights
| * SI-8330: Mismatch in stack heightsGrzegorz Kossakowski2014-02-243-3/+30
|/ | | | | | | | | | | | The SI-8233 / 9506d52 missed one case when we need to DROP a null from a stack: when unboxed Unit is an expected type. If we forgot to do that in a context where two branches were involved we could end up with unbalanced stack sizes. Let's fix that omission and a test covering that specific case to the original test for SI-8233. Fixes SI-8330.
* Merge pull request #3577 from adriaanm/pr3573-fixupAdriaan Moors2014-02-231-0/+0
|\ | | | | SI-8324 fix permutation in test filename
| * SI-8324 fix permutation in test filenameAdriaan Moors2014-02-231-0/+0
| |
* | Merge pull request #3559 from adriaanm/t1503Grzegorz Kossakowski2014-02-2310-4/+111
|\ \ | | | | | | SI-1503 don't assume unsound type for ident/literal patterns
| * | SI-1503 don't assume unsound type for ident/literal patternsAdriaan Moors2014-02-1910-4/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix only kicks in under -Xfuture. We also warn under -Xlint. What type should a variable bound to the value matched by a pattern have? To avoid CCEs, it should be a type that's implied by the matching semantics of the pattern. Usually, the type implied by a pattern matching a certain value is the pattern's type, because pattern matching implies instance-of checks. However, Stable Identifier and Literal patterns are matched using `==`, which does not imply a type for the binder that binds the matched value. The change in type checking due to this fix is that programs that used to crash with a CCE (because we blindly cast to the type of the pattern, which a `==` check does not imply) now get a weaker type instead (and no cast). They may still type check, or they may not. To compensate for this fix, change `case x@Foo => x` to `case x: Foo.type => x`, if it's important that `x` have type `Foo.type`. See also: - SI-4577: matching of singleton type patterns uses `eq`, not `==` (so that the types are not a lie). - SI-5024: patmat strips unused bindings, but affects semantics
* | | Merge pull request #3571 from xeno-by/ticket/8321Adriaan Moors2014-02-2344-22/+844
|\ \ \ | | | | | | | | SI-8321 bundles can't be whitebox
| * | | more clean up in the macro engineEugene Burmako2014-02-211-14/+3
| | | | | | | | | | | | | | | | | | | | Now when SI-7507 is fixed in starr, we can actually remove a workaround and make a 10 line reduction in the size of Resolvers.scala.
| * | | more tests for macro bundlesEugene Burmako2014-02-2126-0/+443
| | | | | | | | | | | | | | | | | | | | Given the recent glaring oversight in macro bundles, I have to have more tests in order to make sure that things are going to work as they should.
| * | | more helpful bundle error messagesEugene Burmako2014-02-214-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment, bundle selection mechanism is pretty picky. If a candidate bundle's parameter isn't either blackbox.Context, whitebox.Context or PrefixType refinement thereof, then it's not a bundle and the user will get a generic error. However we can be a bit more helpful and admit classes that are almost like bundles (looksLikeMacroBundleType), have them fail isMacroBundleType, and then emit a much prettier error message to the user that would tell them that bundles must be monomorphic and their sole parameter should not just be any subtype of blackbox.Context or whitebox.Context.
| * | | prohibits polymorphic bundlesEugene Burmako2014-02-216-4/+67
| | | | | | | | | | | | | | | | | | | | | | | | It's not like they were inducing bugs, but I can't see how polymorphism can be useful for macro bundles, hence imho it's better to reduce the number of degrees of freedom of the system.
| * | | bundles now reject invalid context typesEugene Burmako2014-02-215-9/+37
| | | | | | | | | | | | | | | | | | | | Vanilla macros only allow blackbox.Context, whitebox.Context and PrefixType refinements thereof. Bundles should behave in the same way.
| * | | SI-8321 whitebox bundles are now recognized as suchEugene Burmako2014-02-2113-2/+297
| | | | | | | | | | | | | | | | | | | | whitebox.Context <: blackbox.Context, so in order to check for blackboxity it's not enough to check whether the context used is <: blackbox.Context.
| * | | minor code cleanup in the macro engineEugene Burmako2014-02-212-3/+3
| | | |
* | | | Merge pull request #3574 from greenrd/SI-7962Adriaan Moors2014-02-231-3/+2
|\ \ \ \ | |_|_|/ |/| | | SI-7962 Scalac runner does not work within Emacs's terminal
| * | | SI-7962 Scalac runner does not work within Emacs's terminalRobin Green2014-02-221-3/+2
| |/ / | | | | | | | | | | | | | | | - Always set the env.emacs system property - scalac only cares about whether the system property has a non-empty value, not whether it is set or not. Fixes 7962
* | | Merge pull request #3575 from retronym/ticket/scaladoc-qbinGrzegorz Kossakowski2014-02-221-0/+1
|\ \ \ | | | | | | | | Fix ./build/<stage>/bin/scaladoc
| * | | Fix ./build/<stage>/bin/scaladocJason Zaugg2014-02-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Was: ./build/quick/bin/scaladoc -version Exception in thread "main" java.lang.NoClassDefFoundError: scala/tools/nsc/ScalaDoc Caused by: java.lang.ClassNotFoundException: scala.tools.nsc.ScalaDoc Now: % for tool in ./build/quick/bin/{fsc,scala,scalac,scaladoc,scalap}; do $tool -version; done Fast Scala compiler version 2.11.0-20140222-144307-b0dcf79875 -- Copyright 2002-2013, LAMP/EPFL Scala code runner version 2.11.0-20140222-144307-b0dcf79875 -- Copyright 2002-2013, LAMP/EPFL Scala compiler version 2.11.0-20140222-144307-b0dcf79875 -- Copyright 2002-2013, LAMP/EPFL Scaladoc version 2.11.0-20140222-144307-b0dcf79875 -- Copyright 2002-2013, LAMP/EPFL Scala classfile decoder version 2.0.1 -- (c) 2002-2013 LAMP/EPFL
* | | | Merge pull request #3573 from retronym/ticket/8324Grzegorz Kossakowski2014-02-227-13/+30
|\ \ \ \ | | | | | | | | | | SI-8324 Fix regression in override checks for sealed classes
| * | | | SI-8324 Fix regression in override checks for sealed classesJason Zaugg2014-02-227-13/+30
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adeffda25 changed `Symbol#isEffectivelyFinal` to help the optimizer by inferring finality within sealed class hierarchies. However, this change wasn't neccesarily welcome for other clients of that method. In the enclosed test case, we see that overriding checks in `RefChecks` regressed. This commit moves the enhanced version into a new method and selectively uses it in the optimizer (and the tail call optimizer).
* | | | Merge pull request #3572 from retronym/ticket/8197Adriaan Moors2014-02-222-1/+10
|\ \ \ \ | |_|/ / |/| | | SI-8197 Only consider immediate params for defaults, overloading
| * | | SI-8197 Only consider immediate params for defaults, overloadingJason Zaugg2014-02-222-1/+10
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A recent commit fixed the behaviour of overloading with regards to discarding candiates that include default arguments. The old check was checking the wrong flag. But, the new code is actually checking all parameter lists for defaults, which led to a regression in scala-io, which is distilled in the enclosed test case. Applications are typechecked one parameter list at a time, so a holistic check for defaults doesn't seem to make sense; only defaults in the first parameter list ought to count.
* | | 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`