summaryrefslogtreecommitdiff
path: root/test/files/neg
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2596 from retronym/ticket/7519Jason Zaugg2013-06-092-0/+25
|\ | | | | SI-7519 Less brutal attribute resetting in adapt fallback
| * SI-7519 Less brutal attribute resetting in adapt fallbackJason Zaugg2013-05-252-0/+25
| | | | | | | | | | | | | | | | Prefers `resetLocalAttrs` over `resetAllAttrs`. The latter loses track of which enclosing class of the given name is referenced by a `This` node which prefixes the an applied implicit view. The code that `resetAllAttrs` originally landed in: https://github.com/scala/scala/commit/d4c63b#L6R804
* | Merge pull request #2622 from scalamacros/pullrequest/paradisePaul Phillips2013-06-072-1/+11
|\ \ | | | | | | Backport from paradise/macros
| * | fixes a crash on a degenerate macro definitionEugene Burmako2013-06-072-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous version of the MacroImplReference extractor didn't take into the account the fact that RefTree.qualifier.symbol can be null (and it can be null if RefTree is an Ident, because then qualifier is an EmptyTree). This led to NPEs for really weird macro defs that refer to local methods as their corresponding macro impls. Now I check for this corner case, and the stuff now longer crashes. This was wrong; this is how I fixed it; the world is now a better place.
* | | Merge branch 'pr/merge-2.10.2' into masterPaul Phillips2013-06-0410-13/+53
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * pr/merge-2.10.2: SI-7375 ClassTag for value class aliases SI-7507 Fix lookup of private[this] member in presence of self type. SI-7532 Fix regression in Java inner classfile reader SI-7517 Fix higher kinded type inference regression SI-7516 Revert "SI-7234 Make named args play nice w. depmet types" A test case for a recent LUB progression. SI-7421 remove unneeded extra-attachement in maven deploy SI-7486 Regressions in implicit search. SI-7509 Avoid crasher as erronous args flow through NamesDefaults SI-6138 Centralize and refine detection of `getClass` calls SI-7497 Fix scala.util.Properties.isMac SI-7473 Bad for expr crashes postfix Increase build.number to 2.10.3 SI-7391 Always use ForkJoin in Scala actors on ... ... Java 6 and above (except when the porperty actors.enableForkJoin says otherwise) Reimplementing much of the DefaultPromise methods Optimizations: 1) Avoiding to call 'synchronized' in tryComplete and in tryAwait 2) Implementing blocking by using an optimized latch so no blocking ops for non-blockers 3) Reducing method size of isCompleted to be cheaper to inline 4) 'result' to use Try.get instead of patmat c.typeCheck(silent = true) now suppresses ambiguous errors Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf src/compiler/scala/reflect/macros/contexts/Typers.scala src/compiler/scala/reflect/reify/package.scala src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/compiler/scala/tools/reflect/ToolBoxFactory.scala src/library/scala/concurrent/impl/Promise.scala src/reflect/scala/reflect/internal/Types.scala
| * \ \ Merge remote-tracking branch 'origin/2.10.2' into pr/mergePaul Phillips2013-06-034-13/+16
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/2.10.2: SI-7532 Fix regression in Java inner classfile reader SI-7517 Fix higher kinded type inference regression SI-7516 Revert "SI-7234 Make named args play nice w. depmet types" SI-7486 Regressions in implicit search. SI-7509 Avoid crasher as erronous args flow through NamesDefaults
| | * \ \ Merge pull request #2590 from paulp/issue/7486Jason Zaugg2013-05-272-13/+0
| | |\ \ \ | | | | | | | | | | | | SI-7486 Regressions in implicit search.
| | | * | | SI-7486 Regressions in implicit search.Paul Phillips2013-05-232-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | Revert e86832d7e8 and dd33e280e2.
| | * | | | SI-7509 Avoid crasher as erronous args flow through NamesDefaultsJason Zaugg2013-05-232-0/+16
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix for SI-7238 caused this regression. This commit marks taints whole Apply with an ErrorType if it has an erroneous argument, so as to stop a later crash trying to further process the tree.
| * | | | SI-7507 Fix lookup of private[this] member in presence of self type.Jason Zaugg2013-05-312-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the following code: trait Cake extends Slice trait Slice { self: Cake => // must have self type that extends `Slice` private[this] val bippy = () // must be private[this] locally(bippy) } `ThisType(<Slice>)`.findMember(bippy)` excluded the private local member on the grounds that the first class in the base type sequence, `Cake`, was not contained in `Slice`. scala> val thisType = typeOf[Slice].typeSymbol.thisType thisType: $r.intp.global.Type = Slice.this.type scala> thisType.baseClasses res6: List[$r.intp.global.Symbol] = List(trait Cake, trait Slice, class Object, class Any) This commit changes `findMember` to use the symbol of the `ThisType`, rather than the first base class, as the location of the selection.
| * | | | Merge pull request #2578 from retronym/ticket/6138Adriaan Moors2013-05-292-0/+12
| |\ \ \ \ | | | | | | | | | | | | SI-6138 Centralize and refine detection of `getClass` calls
| | * | | | SI-6138 Centralize and refine detection of `getClass` callsJason Zaugg2013-05-232-0/+12
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `getClass` is special cased in the compiler; this is described in in the comments on `Definitions.Any_getClass`. Part of this happens in `Typer#stabilize`. This was trying to determine if an Ident or Select node was a call to `getClass` by merits of the name of the tree's symbol and by checking that the its type (if it was a MethodType or PolyType) had no parameters in the primary parameter list. Overloaded user defined `getClass` methods confused this check. In the enclosed test case, the tree `definitions.this.getClass` had an `OverloadedType`, and such types always report an empty list of `params`. This commit: - changes `stabilize` to use `isGetClass`, rather than the homebrew check - changes `isGetClass` to consider a `Set[Symbol]` containing all `getClass` variants. This moves some similar code from `Erasure` to `Definitions` - keeps a fast negative path in `isGetClass` based on the symbol's name
| * / / / SI-7473 Bad for expr crashes postfixSom Snytt2013-05-232-0/+14
| |/ / / | | | | | | | | | | | | | | | | | | | | This commit makes building PostfixSelect robust against a bad pos on its operand, which can happen if a bad for expression results in an EmptyTree.
* | | | Revert "SI-7517 type constructors too eagerly normalized."Paul Phillips2013-06-032-34/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 14534c693d2eb6acafaf8244c14b5643388fbd67. It turns out this approach was breaking the working variations in the submitted test case even as it was unbreaking the unworking one, but I never managed to uncomment them. Fortunately retronym's test case was not so lackadaisical.
* | | | Merge pull request #2615 from paulp/issue/7517Paul Phillips2013-06-032-0/+34
|\ \ \ \ | |_|/ / |/| | | SI-7517 type constructors too eagerly normalized.
| * | | SI-7517 type constructors too eagerly normalized.Paul Phillips2013-05-312-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I think 403eadd0f1 was largely a symptomatic remedy (not that we shouldn't harden against such outcomes) and that this commit gets closer to the root causes. The unanticipated change to test/files/run/t6113.check is like a cry of support from the jury box. -Foo[[X](Int, X)] +Foo[AnyRef{type l[X] = (Int, X)}#l] We should continue to look at calls to normalize with grave suspicion.
* | | | refactors macro compilationEugene Burmako2013-05-287-39/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upgrades the way that macro defs are compiled by factoring out most of the logic in typedMacroBody and related errors in ContextErrors into an standalone cake. This leads to tighter cohesion and better code reuse as the cake is isolated from the rest of the compiler and is much easier to evolve than just a method body. Increased convenience of coding macro compilation allowed me to further clarify the implementation of the macro engine (e.g. take a look at Validators.scala) and to easily implement additional features, namely: 1) Parameters and return type of macro implementations can now be plain c.Tree's instead of previously mandatory c.Expr's. This makes macros more lightweight as there are a lot of situations when one doesn't need to splice macro params (the only motivation to use exprs over trees). Also as we're on the verge of having quasiquotes in trunk, there soon will be no reason to use exprs at all, since quasiquotes can splice everything. 2) Macro implementations can now be defined in bundles, standalone cakes built around a macro context: http://docs.scala-lang.org/overviews/macros/bundles.html. This further reduces boilerplate by simplifying implementations complex macros due to the fact that macro programmers no longer need to play path-dependent games to use helpers.
* | | | refactors macro testsEugene Burmako2013-05-28114-537/+549
| | | | | | | | | | | | | | | | | | | | | | | | | | | | putting in a nutshell, this patch: * condenses some macro-XXX-a/b/c/... bundles * renames some tests to prepare for other macro flavors * introduces some additional tests
* | | | macro engine refactoringEugene Burmako2013-05-284-1/+169
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Macro impl bindings now store more information in signatures. Previously it was a flattened List[Int] corresponding to flattened paramss, now it's List[List[Int]] to preserve the lengths of parameter lists. Also now we distinguish between c.Expr parameters and others. Previously actual and reference macro signatures were represented as tuples of vparamss, rets, and sometimes tparams. Now they are all abstracted behind MacroImplSig. Finally this patch provides better error messages in cases of argsc <-> paramsc and argc <-> paramc mismatches.
* | | Print raw types correctly.Paul Phillips2013-05-264-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "For convenience, these are usable as stub implementations" bit has generated surprisingly few angry letters, but I noticed today it blows it on raw types. Or, used to blow it. /** As seen from class Sub, the missing signatures are as follows. * For convenience, these are usable as stub implementations. * (First one before this commitw as 'def raw(x$1: M_1)' */ def raw(x$1: M_1[_ <: String]): Unit = ??? def raw(x$1: Any): Unit = ???
* | | SI-7003 Partest redirects stderr to log fileSom Snytt2013-05-252-5/+5
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some scalac output is on stderr, and it's useful to see that in the log file, especially for debugging. Adds a line filter for logs, specified as "filter: pattern" in the test source. Backslashes are made forward only when detected as paths. Test alignments: Deprecations which do not pertain to the system under test are corrected in the obvious way. When testing deprecated API, suppress warnings by deprecating the Test object. Check files are updated with useful true warnings, instead of running under -nowarn. Language feature imports as required, instead of running under -language. Language feature not required, such as casual use of postfix. Heed useful warning. Ignore broken warnings. (Rarely, -nowarn.) Inliner warnings pop up under -optimise only, so for now, just filter them out where they occur. Debug output from the test required an update.
* | Merge pull request #2562 from som-snytt/issue/double-pluginv2.11.0-M3Jason Zaugg2013-05-2031-0/+303
|\ \ | | | | | | SI-7494 Each plugin must only be instantiated once.
| * | SI-7494 Tests for status quoSom Snytt2013-05-1931-0/+303
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Exploit SI-6446 fix to move old pending tests for plugins to the active pool. Also, nuance the partest runner to allow the compiler to crash with a FatalError if a check file is present. Some of the plugin tests make phase assembly throw. One of the legacy tests was moved back to pending: There seems to be a race for who shall be deemed truly dependent. Back to pending for you! apm@mara:~/projects/snytt/test$ ./partest files/neg/t7494-cyclic-dependency/ Selected 1 tests drawn from specified tests > starting 1 test in neg ok 1 - neg/t7494-cyclic-dependency 1/1 passed (elapsed time: 00:00:04) Test Run PASSED apm@mara:~/projects/snytt/test$ ./partest files/neg/t7494-cyclic-dependency/ Selected 1 tests drawn from specified tests > starting 1 test in neg !! 1 - neg/t7494-cyclic-dependency [output differs] > 0/1 passed, 1 failed in neg >>>>> Transcripts from failed tests >>>>> > partest files/neg/t7494-cyclic-dependency % scalac t7494-cyclic-dependency/ThePlugin.scala % scalac t7494-cyclic-dependency/sample_2.scala error: Cycle in compiler phase dependencies detected, phase cyclicdependency1 reacted twice! % diff files/neg/t7494-cyclic-dependency-neg.log files/neg/t7494-cyclic-dependency.check @@ -1 +1 @@ -error: Cycle in compiler phase dependencies detected, phase cyclicdependency1 reacted twice! +error: Cycle in compiler phase dependencies detected, phase cyclicdependency2 reacted twice! 0/1 passed, 1 failed (elapsed time: 00:00:04) Test Run FAILED
* | | Merge v2.10.1-326-g4f8c306' into merge/v2.10.1-326-g4f8c306-to-masterJason Zaugg2013-05-17269-722/+2691
|\| | | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ================================================================ Merge commit 'v2.10.1-326-g4f8c306' into merge/v2.10.1-326-g4f8c306-to-master Conflicts: src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala src/reflect/scala/reflect/runtime/JavaMirrors.scala ================================================================ Merge -s ours 4e64a27 ([nomaster commit range]) ================================================================ Merge commit '0ae7e55' into merge/v2.10.1-326-g4f8c306-to-master Conflicts: src/compiler/scala/tools/nsc/typechecker/Macros.scala
| * Merge pull request #2374 from adriaanm/ticket-6815Jason Zaugg2013-05-174-0/+41
| |\ | | | | | | SI-6815 untangle isStable and hasVolatileType
| | * SI-6815 untangle isStable and hasVolatileTypeAdriaan Moors2013-05-164-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `Symbol::isStable` is now independent of `Symbol::hasVolatileType`, so that we can allow stable identifiers that are volatile in ident patterns. This split is validated by SI-6815 and the old logic in RefChecks, which seems to assume this independence, and thus I don't think ever worked: ``` if (member.isStable && !otherTp.isVolatile) { if (memberTp.isVolatile) overrideError("has a volatile type; cannot override a member with non-volatile type") ``` Introduces `admitsTypeSelection` and `isStableIdentifierPattern` in treeInfo, and uses them instead of duplicating that logic all over the place. Since volatility only matters in the context of type application, `isStableIdentifierPattern` is used to check patterns (resulting in `==` checks) and imports.
| * | Merge pull request #2519 from som-snytt/issue/regex-revertAdriaan Moors2013-05-161-5/+4
| |\ \ | | |/ | |/| SI-6406 Restore deprecated API
| | * SI-6406 Restore deprecated APISom Snytt2013-05-121-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original patch for SI-6406 was intended for 2.10 but during those volatile weeks of early autumn, it missed the boat. A deprecated method was incorrectly tagged at 2.10 and later removed; this restores the method and its test, and resets the deprecation clock to 2.11. The deprecation tool should confirm that changes occur on the git timeline as claimed.
| * | Merge pull request #2514 from scalamacros/topic/5923-masterJason Zaugg2013-05-153-0/+30
| |\ \ | | |/ | |/| makes sense of implicit macros! now in master
| | * SI-7167 implicit macros decide what is divergenceEugene Burmako2013-05-123-0/+30
| | | | | | | | | | | | | | | | | | This is a port of https://github.com/scala/scala/commit/8168f118c9 from 2.10.x, with an additional change to the `enclosingImplicits` and `openImplicits` APIs, which encapsulates tuples of `pt` and `tree` into `ImplicitCandidate`.
| * | Limit unnecessary calls to Type#toString.Paul Phillips2013-05-081-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Logging revealed a few thousand calls to the often expensive Type#toString emerging from tailcalls. The error message was being generated for all methods even though it was only issued in rare cases (and for the particular tailrec failure which made the call, extremely rare.) The remaining boatload of unnecessary Type#toString calls are much harder to fix due to the design of "AbsTypeError" and the fact that the compiler approaches mutability like a cat approaches a loaded gun. See SI-6149.
| * Merge pull request #2483 from adriaanm/merge-2.10.xPaul Phillips2013-05-0212-11/+171
| |\ | | | | | | Merge 2.10.x
| | * Merge 2.10.x into masterAdriaan Moors2013-05-0212-11/+171
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #2428 from hubertp/issue/7291Paul Phillips2013-04-302-6/+11
| |\ \ \ | | | | | | | | | | SI-7291: Don't throw exceptions while encountering diverging expansion.
| | * | | SI-7291: No exception throwing for diverging implicit expansionHubert Plociniczak2013-04-262-6/+11
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we don't throw exceptions for normal errors it was a bit odd that we don't do that for DivergingImplicit. As SI-7291 shows, the logic behind catching/throwing exception was broken for divergence. Instead of patching it, I rewrote the mechanism so that we now another SearchFailure type related to diverging expansion, similar to ambiguous implicit scenario. The logic to prevent diverging expansion from stopping the search had to be slightly adapted but works as usual. The upside is that we don't have to catch diverging implicit for example in the presentation compiler which was again showing that something was utterly broken with the exception approach.
| * / / Route -explaintypes through reporter.Paul Phillips2013-04-291-0/+4
| |/ / | | | | | | | | | | | | | | | Sick of seeing Console printlns during partest runs. You should not print anything to Console.{out,err} if it's ever going to happen outside developerland.
| * | Eliminate a pile of -Xlint warnings.Paul Phillips2013-04-231-7/+0
| | | | | | | | | | | | | | | | | | Some unused private code, unused imports, and points where an extra pair of parentheses is necessary for scalac to have confidence in our intentions.
| * | SI-7324 jvm not cool with 255+ parametersPaul Phillips2013-04-212-0/+61
| | | | | | | | | | | | Fail those monster methods rather than generating bad bytecode.
| * | Merge remote-tracking branch 'origin/2.10.x' into ↵Jason Zaugg2013-04-206-9/+14
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | merge/v2.10.1-245-g5147bb2-to-master Conflicts: src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala
| * \ \ Merge pull request #2336 from retronym/topic/deprecated-inheritance-tweakAdriaan Moors2013-04-153-14/+15
| |\ \ \ | | | | | | | | | | SI-7312 @deprecatedInheritance now ignores same-file subclasses
| | * | | SI-7312 @deprecatedInheritance now ignores same-file subclassesJason Zaugg2013-03-303-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to deprecate external inheritances as a prelude to sealing a class, without enduring the warnings ourselved in interlude.
| * | | | Merge remote-tracking branch 'origin/2.10.x' into ↵Jason Zaugg2013-04-154-0/+88
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | merge/v2.10.1-235-g4525e92-to-master Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/reflect/scala/reflect/internal/Types.scala
| * | | | | Transcendent rewrite of isSameType.Paul Phillips2013-04-052-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A highly satisfying rewrite of isSameType. It's faster, clearer, shorter, better commented, and closer to correct. I am especially pleased that t5580b stopped compiling, given that nobody seemed to have much idea why it compiled in the first place.
| * | | | | SI-6289 Paulptest demonstrating javac errorsSom Snytt2013-04-044-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is Paul's test demonstrating that Javac errors are correctly transcribed in the test transcript. A gratuitous Scala class is added to a later round to show that the test halts after the first error. The runner must supply absolute paths to javac so that absolute paths are reported in errors and stripped away by partest. The check file is differentiated for Java 6 and 7, and partest's runner will now post-process the `diff log check` to strip the diff which does not apply.
| * | | | | SI-6289 Partest in technicolor and showing javac errorsSom Snytt2013-04-042-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Paulptest includes color and simplified test scarfing. Scalap tests are moved to the conventional name and location. Testicolor missed out on Josh Suereth's tweak to sort the files in a compilation round. Restore sortiness to test sources. Testicolor is due to one of Paul's branches on a timeline that apparently did not include the destruction of planet Earth and its colonies by the Xindi. Thanks also to Szabolcs Berecz for his merge effort. Merging is thankless work, but not as thankless as merging in a timeline that actually does terminate in the destruction of your home world and Enterprise. Archer had a supremely difficult choice: rescue humanity or live out his retirement with T'Pol waiting on him hand and foot? I'm sure I don't know how I'd choose.
| * | | | | Merge pull request #2337 from retronym/ticket/7110-2Paul Phillips2013-04-033-0/+13
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-7110 Warn about naked try without catch/finally
| | * | | | | SI-7110 Warn about naked try without catch/finallyJason Zaugg2013-03-293-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, this was allowed: scala> try ( 1 / 0 ) java.lang.ArithmeticException: / by zero But since the advent of util.Try, the subtle difference to the following seems dangerous: scala> import util.Try import util.Try scala> Try ( 1 / 0 ) res4: scala.util.Try[Int] = Failure(java.lang.ArithmeticException: / by zero) Discussion: https://groups.google.com/d/topic/scala-language/fy2vXD_3fF8/discussion There was some concern that this curtails a handy, temporary way to remove the exception handlers from some code. But after thinking about this, I contend that: a) those people can easily stomach the warning temporarily (modulo, of course, those with -Xfatal-warnings.) b) putting this warning behind Xlint will disable it for those who need it most: beginners. I also chose not to refer to 'scala.util.Try' in the error message as I think that has as much potential to confuse as it does to clarify.
| * | | | | | Merge remote tracking branch 'origin/2.10.x' into ↵Jason Zaugg2013-04-028-0/+107
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | topic/merge-2.10.x-to-v2.11.0-M2-74-g00e6c8b Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf build.xml src/compiler/scala/reflect/reify/utils/Extractors.scala src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala src/compiler/scala/tools/nsc/transform/patmat/MatchOptimization.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/partest/scala/tools/partest/nest/ReflectiveRunner.scala src/reflect/scala/reflect/internal/Types.scala src/reflect/scala/reflect/runtime/JavaUniverse.scala test/files/run/inline-ex-handlers.check test/files/run/t6223.check test/files/run/t6223.scala test/scaladoc/scalacheck/IndexTest.scala
| * \ \ \ \ \ \ Merge pull request #2318 from retronym/ticket/7259-masterAdriaan Moors2013-04-012-0/+16
| |\ \ \ \ \ \ \ | | |_|_|_|/ / / | |/| | | | | | [forward port] SI-7259 Fix detection of Java defined Selects
| | * | | | | | SI-7259 Fix detection of Java defined SelectsJason Zaugg2013-03-262-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix for SI-3120, 3ff7743, introduced a fallback within `typedSelect` that accounted for the ambiguity of a Java selection syntax. Does `A.B` refer to a member of the type `A` or of the companion object `A`? (The companion object here is a fiction used by scalac to group the static members of a Java class.) The fallback in `typedSelect` was predicated on `context.owner.enclosingTopLevelClass.isJavaDefined`. However, this was incorrectly including Select-s in top-level annotations in Scala files, which are owned by the enclosing package class, which is considered to be Java defined. This led to nonsensical error messages ("type scala not found.") Instead, this commit checks the compilation unit of the context, which is more direct and correct. (As I learned recently, `currentUnit.isJavaDefined` would *not* be correct, as a lazy type might complete a Java signature while compiling some other compilation unit!) A bonus post factum test case is included for SI-3120. Manual forward port of f046853 which was not merged as part of the routine 2.10.x to master merge. The test case uncovered a NullPointerExceptiion crasher in annotation typechecking introduced in 5878099c; this has been prevented with a null check. Conflicts: src/compiler/scala/tools/nsc/typechecker/Typers.scala