summaryrefslogtreecommitdiff
path: root/test/files/pos
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge pull request #2215 from paulp/issue/7228Paul Phillips2013-03-133-19/+76
|\ \ \ | | | | | | | | SI-7228, bug in subtyping.
| * | | Simplified the widening logic.Paul Phillips2013-03-102-19/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-101-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 2.10.x into masterAdriaan Moors2013-03-123-0/+61
|\ \ \ \ | |/ / / |/| / / | |/ / | | | | | | Conflicts: src/compiler/scala/reflect/reify/Errors.scala src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
| * | Merge pull request #2225 from retronym/ticket/7234Adriaan Moors2013-03-112-0/+35
| |\ \ | | | | | | | | SI-7234 Make named args play nice with dep. method types
| | * | SI-7234 Make named args play nice with dep. method typesJason Zaugg2013-03-092-0/+35
| | |/ | | | | | | | | | | | | | | | Some care is needed to avoid interaction with constant types (e.g pos/z1730.scala) and with existentials (e.g. t3507-old.scala).
| * / SI-7226 Fix inference regression caused by TypeVar equality.Jason Zaugg2013-03-091-0/+26
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 master.Adriaan Moors2013-03-052-0/+14
|\| | | | | | | | | | | | | | | Resurrect some undead code from 373ded2ad3 (tuple2Pickler). Conflicts: src/compiler/scala/tools/nsc/interactive/CompilerControl.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala
| * Merge pull request #2193 from adriaanm/patmat-refactorAdriaan Moors2013-03-053-0/+25
| |\ | | | | | | merge 2.10.1 into 2.10.x
| | * Merge 2.10.1 into 2.10.xAdriaan Moors2013-03-031-0/+11
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | The fix for SI-7183 in 440bf0a8c2 was forward ported in f73d50f46c. Conflicts: src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala
| | | * Merge pull request #2168 from retronym/ticket/7183Adriaan Moors2013-03-012-0/+14
| | | |\ | | | | | | | | | | SI-7183 Disable unreachability for withFilter matches.
| | | | * SI-7183 Disable unreachability for withFilter matches.Jason Zaugg2013-02-252-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids spurious unreachable warnings on code that the user didn't write. The parser desugars for-comprehensions such as: for (A(a) <- List(new A)) yield a To: List(new A()).withFilter(((check$ifrefutable$2) => check$ifrefutable$2: @scala.unhecked match { case A((a @ _)) => true case _ => false }) ) But, if `A.unapply` returns `Some[_]`, the last case is dead code. (Matching against a regular case class *would* fall through in the caes of a null scrutinee.) In SI-6902, we enabled unreachability warnings, even if the scrutinee was annotated as @unchecked. That was consistent with the 2.9.2 behaviour, it was only disabled temporarily (actually, accidentally) in 2.10.0. But, the old pattern matcher didn't warn about this code. This commit makes the pattern matcher recognise the special scrutinee based on its name and disables both exhaustivity *and* unreachability analysis. To do so, the we generalize the boolean flag `unchecked` to the class `Suppression`.
| | * | | [port] SI-7183 Disable unreachability for withFilter matches.Adriaan Moors2013-03-032-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | This is a forward port of #2168 (originally for 2.10.1, but the pattern matcher has since been refactored in 2.10.x.)
* | | | | Merge 2.10.x into master.Adriaan Moors2013-03-051-0/+26
|\| | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/transform/Erasure.scala
| * | | | Merge pull request #2178 from scalamacros/ticket/7190Paul Phillips2013-03-051-0/+26
| |\ \ \ \ | | |/ / / | |/| | | SI-7190 macros no longer give rise to bridges
| | * | | SI-7190 macros no longer give rise to bridgesEugene Burmako2013-02-271-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | Amazingly enough, this got through all the testing we performed. But now erasure knows that it shouldn't generate bridges for macro methods.
| | | | |
| \ \ \ \
| \ \ \ \
| \ \ \ \
*---. \ \ \ \ Merge 2.10.x into master.Adriaan Moors2013-03-051-0/+11
|\ \ \ \ \ \ \ | | |_|/ / / / | |/| | / / / | | | |/ / / | | |/| / / | | | |/ / Fix check file for run/t7185.
| | | * | Merge pull request #2167 from retronym/ticket/7126Adriaan Moors2013-03-011-0/+11
| | | |\ \ | | | | | | | | | | | | SI-7126 Account for the alias types that don't dealias.
| | | | * | SI-7126 Account for the alias types that don't dealias.Jason Zaugg2013-02-251-0/+11
| | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After this change: qbin/scalac -Ydebug test/files/pos/t7126.scala 2>&1 | grep warning warning: dropExistential did not progress dealiasing Test.this.T[Test.this.T], see SI-7126 one warning found T[T]? Really? The true bug lies somewhere else; the comments of the ticket illuminate the general areas of concern.
* | | | | Merge branch 2.10.1 into masterAdriaan Moors2013-02-271-0/+13
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/ast/Trees.scala src/library/scala/concurrent/impl/ExecutionContextImpl.scala
| * | | | Merge 2.10.1 into 2.10.x.Adriaan Moors2013-02-271-0/+13
| |\ \ \ \ | | |/ / / | |/| / / | | |/ /
| | * / SI-7180 Fix regression in implicit scope of HK type alias.Jason Zaugg2013-02-251-0/+13
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | We actually need to call normalize here, otherwise we don't progress through #1 below. [infer implicit] scala.this.Predef.implicitly[Higher[Foo.Bar]] with pt=Higher[Foo.Bar] in object Foo 1. tp=Foo.Bar tp.normalize=[A <: <?>]Foo.Bar[A] tp.dealias=Foo.Bar 2. tp=Foo.Bar[A] tp.normalize=Box[A] tp.dealias=Box[A]
| | * Additional test case for Lukas' fix to annotated originals.Jason Zaugg2013-02-212-0/+14
| | | | | | | | | | | | | | | This was inspired by the regression that Mark encountered when upgrading SBT from 2.10.0 to 2.10.1-RC1.
* | | Merge 2.10.x into master.Adriaan Moors2013-02-205-0/+49
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: build.number src/compiler/scala/tools/nsc/doc/base/MemberLookupBase.scala src/compiler/scala/tools/nsc/typechecker/Macros.scala test/files/presentation/doc/doc.scala
| * | Merge pull request #2118 from lrytz/annotatedRetypingJames Iry2013-02-192-0/+14
| |\ \ | | | | | | | | Fix typing idempotency bug with Annotated trees
| | * | Additional test case for Lukas' fix to annotated originals.Jason Zaugg2013-02-182-0/+14
| | | | | | | | | | | | | | | | | | | | This was inspired by the regression that Mark encountered when upgrading SBT from 2.10.0 to 2.10.1-RC1.
| * | | SI-5744 evidence params are now SYNTHETICUladzimir Abramchuk2013-02-162-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The macro def <-> macro impl correspondence check compares names of the corresponding parameters in def and impl and reports an error if they don't match. This was originally designed to avoid confusion w.r.t named arguments (which ended up being never implemented as described in SI-5920). Sometimes parameter names are generated by the compiler, which puts the user in a tough position. Luckily, there's an escape hatch built it, which omits the name correspondence check if one of the parameters is SYNTHETIC. Everything went well until we realized that evidences generated by context bounds aren't SYNTHETIC, which led to the bug at hand. Marking auto-generated evidence parameters SYNTHETIC was only the first step, as the correspondence checker uses parameter symbols, not parameter trees. Why's that a problem? Because SYNTHETIC doesn't get propagated from def trees to their underlying symbols (see ValueParameterFlags). Unfortunately one cannot just change ValueParameterFlags, because that would break printouts generated in TypeDiagnostics, which is designed to not print synthetic symbols. Thus we modify methodTypeErrorString in TypeDiagnostics to always print synthetic symbols. Therefore now we propagate all paramSym.flags when doing correspondent sweeps to keep them in sync between def trees and their underlying symbols. This fixes the problem.
| * | | Merge pull request #2115 from retronym/ticket/7091Adriaan Moors2013-02-121-0/+7
| |\ \ \ | | |/ / | |/| | SI-7091 Don't try to put a protected accessor in a package.
| | * | SI-7091 Don't try to put a protected accessor in a package.Jason Zaugg2013-02-111-0/+7
| | |/ | | | | | | | | | | | | | | | | | | This shows up when a protected[pack] class has a constructor with a default argument. Regressed in f708b87 / SI-2296.
* | | Merge remote-tracking branch 'scala/2.10.x' into patmat-refactor-masterAdriaan Moors2013-02-122-0/+31
|\| | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/typechecker/Implicits.scala
| * | Merge pull request #2111 from retronym/2.10.xJames Iry2013-02-111-0/+11
| |\ \ | | | | | | | | SI-6514 Avoid spurious dead code warnings
| | * | SI-6514 Avoid spurious dead code warningsJason Zaugg2013-02-101-0/+11
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `deadCode.expr` stores the method symbol most recently encountered in `handleMonomorphicCall`, and uses this to avoid warnings for arguments to label jumps and `Object#synchronized` (which sneakily acts by-name without advertising the fact in its type.) But this scheme was insufficient if the argument itself contains another method call, such as `matchEnd(throw e(""))`. This commit changes the single slot to a stack, and also grants exemption to `LabelDef` trees. They were incorrectly flagged in the enclosed test case after I made the the first change.
| * / SI-6225 Fix import of inherited package object implicitsJason Zaugg2013-02-091-0/+20
| |/ | | | | | | | | The prefix in the ImplicitInfo must be com.acme.`package`.type, rather than com.acme.
* | Merge pull request #2057 from paulp/pr/revert-6355Paul Phillips2013-02-121-0/+16
|\ \ | | | | | | SI-6355, weakend implementation restriction on applyDynamic.
| * | SI-6355, weakend implementation restriction on applyDynamic.Paul Phillips2013-02-121-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I realized one can successfully call an overloaded applyDynamic, under conditions such as these: def applyDynamic[T1](m: String)(x1: T1): Any = 1 def applyDynamic[T1, T2](m: String)(x: T1, y: T2): Any = 2 def applyDynamic[T1, T2, T3](m: String)(x: T1, y: T2, z: T3): Any = 3 So I weakened the overloading restriction to allow overloading if each method has a distinct number of type parameters. This very likely still allows the creation of uncallable overloads, but an overly restrictive rule is worse. If the overload cannot be called, it will still be discovered at the call site.
* | | Maintenance of Predef.Paul Phillips2013-02-1238-163/+163
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Deprecates much of Predef and scala.Console, especially: - the read* methods (see below) - the set{Out,Err,In} methods (see SI-4793) 2) Removed long-deprecated: - Predef#exit - Predef#error should have gone, but could not due to sbt At least the whole source base has now been future-proofed against the eventual removal of Predef#error. The low justification for the read* methods should be readily apparent: they are little used and have no call to be in global namespace, especially given their weird ad hoc semantics and unreasonably tempting names such as readBoolean(). 3) Segregated the deprecated elements in Predef from the part which still thrives. 4) Converted all the standard Predef implicits into implicit classes, value classes where possible: - ArrowAssoc, Ensuring, StringFormat, StringAdd, RichException (value) - SeqCharSequence, ArrayCharSequence (non-value) Non-implicit deprecated stubs prop up the names of the formerly converting methods.
* | Merge remote-tracking branch 'origin/2.10.x' into merge-210Paul Phillips2013-02-109-5/+81
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/2.10.x: Fix for paramaccessor alias regression. Expanded bytecode testing code. SI-5675 Discard duplicate feature warnings at a position accommodates pull request feedback term and type reftrees are now reified uniformly SI-6591 Reify and path-dependent types SI-7096 SubstSymMap copies trees before modifying their symbols SI-6961 no structural sharing in list serialization SI-6187 Make partial functions re-typable [backport] SI-6478 Fixing JavaTokenParser ident SI-7100 Fixed infinite recursion in duplicators SI-6146 More accurate prefixes for sealed subtypes. SI-5082 Cycle avoidance between case companions SI-6113 typeOf now works for type lambdas SI-5824 Fix crashes in reify with _* SI-7026: parseTree should never return a typed one SI-7070 Turn restriction on companions in pkg objs into warning Conflicts: src/compiler/scala/reflect/reify/codegen/GenSymbols.scala src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/compiler/scala/tools/reflect/ToolBoxFactory.scala src/library/scala/collection/immutable/List.scala src/reflect/scala/reflect/internal/TreeInfo.scala src/reflect/scala/reflect/internal/Types.scala src/reflect/scala/reflect/internal/settings/MutableSettings.scala src/reflect/scala/reflect/runtime/Settings.scala test/files/buildmanager/t2650_1/t2650_1.check test/files/buildmanager/t2657/t2657.check test/files/neg/t3234.check test/files/run/idempotency-this.check test/files/run/macro-typecheck-macrosdisabled2.check test/files/run/showraw_tree.check test/files/run/showraw_tree_ids.check test/files/run/showraw_tree_kinds.check test/files/run/showraw_tree_types_ids.check test/files/run/showraw_tree_types_typed.check test/files/run/showraw_tree_types_untyped.check test/files/run/showraw_tree_ultimate.check test/files/run/t2886.check test/files/run/t5225_2.check test/files/run/t5374.check test/files/run/t5374.scala test/files/run/t6329_repl.check test/files/run/toolbox_typecheck_macrosdisabled2.check
| * Merge pull request #2017 from retronym/ticket/6666James Iry2013-02-081-47/+0
| |\ | | | | | | Booking more progress on SI-6666
| * \ Merge pull request #2088 from retronym/ticket/6146James Iry2013-02-072-0/+61
| |\ \ | | | | | | | | SI-6146 More accurate prefixes for sealed subtypes.
| | * | SI-6146 More accurate prefixes for sealed subtypes.Jason Zaugg2013-02-072-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When analysing exhaustivity/reachability of type tests and equality tests, the pattern matcher must construct a set of sealed subtypes based on the prefix of the static type of and the set of sealed descendent symbols of that type. Previously, it was using `memberType` for this purpose. In simple cases, this is sufficient: scala> class C { class I1; object O { class I2 } }; object D extends C defined class C defined module D scala> typeOf[D.type] memberType typeOf[C#I1].typeSymbol res0: u.Type = D.I1 But, as reported in this bug, it fails when there is an additional level of nesting: scala> typeOf[D.type] memberType typeOf[c.O.I2 forSome { val c: C }].typeSymbol res5: u.Type = C.O.I2 This commit introduces `nestedMemberType`, which uses `memberType` recursively up the prefix chain prefix chain. scala> nestedMemberType(typeOf[c.O.I2 forSome { val c: C }].typeSymbol, typeOf[D.type], typeOf[C].typeSymbol) res6: u.Type = D.O.Id
| * | | Merge pull request #2079 from JamesIry/2.10.x_SI-7070James Iry2013-02-075-5/+0
| |\ \ \ | | | | | | | | | | SI-7070 Turn restriction on companions in pkg objs into warning
| | * | | SI-7070 Turn restriction on companions in pkg objs into warningJames Iry2013-02-065-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation restriction created from SI-5954 in 3ef487ecb6733bfe3c13d89780ebcfc81f9a5ea0 has two problems. 1) The problematic code works fine if compile with sbt. That means the restriction is breaking some people needlessly. 2) It's not binary compatible. To fix all that this commit changes the error into a warning and removes the setting used to get around the restriction.
| * | | | Merge pull request #1995 from retronym/ticket/5082James Iry2013-02-071-0/+14
| |\ \ \ \ | | | | | | | | | | | | SI-5082 Cycle avoidance between case companions
| | * | | | SI-5082 Cycle avoidance between case companionsJason Zaugg2013-02-071-0/+14
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can synthesize the case companion unapply without forcing the info of the case class, by looking at the parameters in the `ClassDef` tree, rather than at `sym.caseFieldAccessors`. Access to non-public case class fields routed through the already-renamed case accessor methods. The renamings are conveyed via a back-channel (a per-run map, `renamedCaseAccessors`), rather than via the types to give us enough slack to avoid the cycle. Some special treatment of private[this] parameters is needed to avoid a misleading error message. Fortunately, we can determine this without forcing the info of the case class, by inspecting the parameter accessor trees. This change may allow us to resurrect the case class ProductN parentage, which was trialled but abandoned in the lead up to 2.10.0.
| * | | | SI-7100 Fixed infinite recursion in duplicatorsVlad Ureche2013-02-071-0/+6
| | | | |
| | | | |
| \ \ \ \
| \ \ \ \
| \ \ \ \
*---. \ \ \ \ Merge commit 'b43ae58f31'; commit 'b579a42ee3'; commit '81fa831609' into ↵Paul Phillips2013-02-101-47/+0
|\ \ \ \ \ \ \ | | | |_|_|/ / | | |/| | | / | | | | |_|/ | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | merge-210 * commit 'b43ae58f31': introduces an exhaustive java-to-scala test SI-6989 privateWithin is now populated in reflect * commit 'b579a42ee3': SI-6888 Loosen criteria for $outer search. * commit '81fa831609': Class symbols can't be contravariant. SI-6666 Catch VerifyErrors in the making in early defs. Broader checks for poisonous this references. Add a test case from the comments of SI-6666. SI-6666 Account for nesting in setting INCONSTRUCTOR Move a test from pos to run to highlight bytecode deficiencies. Conflicts: src/compiler/scala/tools/nsc/interpreter/IMain.scala
| | | * | | Move a test from pos to run to highlight bytecode deficiencies.Jason Zaugg2013-01-281-47/+0
| | | | | | | | | | | | | | | | | | | | | | | | We'll address them in subsequent commits.
* | | | | | Merge commit '558c059227' into merge-210Paul Phillips2013-02-092-0/+12
|\ \ \ \ \ \ | | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '558c059227': SI-7060 More conservative dead code elim marking Conflicts: src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala
| * | | | | Merge pull request #2059 from VladUreche/issue/7060James Iry2013-02-062-0/+12
| |\ \ \ \ \ | | |_|/ / / | |/| | | | SI-7060 More conservative dead code elim marking
| | * | | | SI-7060 More conservative dead code elim markingVlad Ureche2013-02-052-0/+12
| | | |_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In dead code elimination, a DROP instruction that gets marked as useful and can be reached via several paths needs to also mark all the reaching definitions as useful, else we'll get unbalanced stacks on the two paths. A simplistic example: ``` BB1: CALL X // useful, leaves a LONG on the stack JUMP BB3 BB2: LOAD_FIELD Y // not useful JUMP BB3 BB3: DROP LONG // useful because "CALL X" is useful // but unless we mark "LOAD_FIELD Y" as useful too // we'll get unbalanced stacks when reaching BB3 ``` This patch addresses the unbalanced stack problem by adding all the reaching definitions of a useful DROP as useful instructions too.