summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2340 from folone/topic/kind-prAdriaan Moors2013-05-172-0/+44
|\ | | | | Added a :kind command to the REPL
| * Add :kind command to REPLEugene Yokota2013-04-202-0/+44
| | | | | | | | | | | | | | | | :kind command diplays the kind of types and type constructors in Scala syntax notation. scala> :kind (Int, Int) => Int scala.Function2's kind is F[-A1,-A2,+A3]
* | Merge pull request #2545 from paulp/issue/7482aPaul Phillips2013-05-172-0/+22
|\ \ | | | | | | SI-7482 Don't cook raw types after erasure.
| * | SI-7482 Don't cook raw types after erasure.Paul Phillips2013-05-162-0/+22
| | |
* | | Merge pull request #2454 from vigdorchik/scaladoc_fixesJason Zaugg2013-05-172-3/+3
|\ \ \ | | | | | | | | This is a cleanup of scaladoc code.
| * | | Improve code style in the Scaladoc implementation.Eugene Vigdorchik2013-05-162-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It fixes the following inefficiences or code style violations: - Explicit asInstanceOf calls. - Boxing symbols instead of using plain NoSymbol. - Matching `this` instead of late-binding.
* | | | Merge pull request #2374 from adriaanm/ticket-6815Jason Zaugg2013-05-176-0/+74
|\ \ \ \ | |_|/ / |/| | | SI-6815 untangle isStable and hasVolatileType
| * | | SI-6815 untangle isStable and hasVolatileTypeAdriaan Moors2013-05-166-0/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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 #2534 from retronym/ticket/3943Adriaan Moors2013-05-162-0/+21
|\ \ \ \ \ | | | | | | | | | | | | SI-3943 Test case for already-fixed Java interop bug
| * | | | | SI-3943 Test case for already-fixed Java interop bugJason Zaugg2013-05-152-0/+21
| |/ / / / | | | | | | | | | | | | | | | Confirmed that this was fixed in edee27f59.
* | / / / SI-7469 Remove @deprecated scala.util.loggingSimon Ochsenreither2013-05-163-8/+1
| |/ / / |/| | |
* | | | Merge pull request #2514 from scalamacros/topic/5923-masterJason Zaugg2013-05-1518-2/+117
|\ \ \ \ | | | | | | | | | | makes sense of implicit macros! now in master
| * | | | SI-7047 fixes silent for c.inferImplicitXXXEugene Burmako2013-05-123-0/+22
| | | | | | | | | | | | | | | | | | | | This is a port of https://github.com/scala/scala/commit/b4da864247 from 2.10.x.
| * | | | SI-7167 implicit macros decide what is divergenceEugene Burmako2013-05-128-2/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
| * | | | macroExpandAll is now triggered in all invocations of typedEugene Burmako2013-05-122-0/+4
| | | | | | | | | | | | | | | | | | | | This is a port of https://github.com/scala/scala/commit/bb73b9669a from 2.10.x.
| * | | | SI-5923 instantiates targs in deferred macro applicationsEugene Burmako2013-05-125-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In January I submitted a pull request that, as I thought back then, fixes SI-5923: https://github.com/scala/scala/commit/fe60284769. The pull request was merged, and everyone was happy that the bug got fixed. Unfortunately, the fix was: a) incomplete, b) broke something else, as noticed by Miles in https://groups.google.com/d/topic/scala-internals/7pA9CiiD3u8/discussion. Now we got a real fix in 2.10.x (https://github.com/scala/scala/commit/90ac5c4e13), and it's my pleasure to port it to master.
* | | | | Merge pull request #2503 from paulp/issue/6039Jason Zaugg2013-05-151-0/+18
|\ \ \ \ \ | |_|/ / / |/| | | | SI-6039 Harden against irrelevant filesystem details
| * | | | SI-6039 Harden against irrelevant filesystem detailsPaul Phillips2013-05-081-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The symbol loader need not create and populate package symbols merely because there is a directory somewhere. Every package created based on the existence of a directory should contain a classfile, either directly or indirectly.
* | | | | Merge pull request #2501 from paulp/pr/tailcalls-tostringPaul Phillips2013-05-121-1/+1
|\ \ \ \ \ | |_|/ / / |/| | | | Limit unnecessary calls to Type#toString.
| * | | | 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 #2470 from ihji/masterPaul Phillips2013-05-111-0/+11
|\ \ \ \ | | | | | | | | | | SI-7432 Range.min should throw NoSuchElementException on empty range
| * | | | SI-7432 add testcasesHeejong Lee2013-04-301-0/+11
| | | | |
* | | | | Merge pull request #2462 from magarciaEPFL/backendish9Paul Phillips2013-05-101-2/+2
|\ \ \ \ \ | |_|/ / / |/| | | | SI-6863 root cause fixed using factory of scala.runtime.*Ref
| * | | | SI-6863 root cause fixed using factory of scala.runtime.*RefMiguel Garcia2013-04-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit does away with an error-prone division of labor between UnCurry and LambdaLift, a division of labor by which UnCurry had to anticipate under which circumstances LambdaLift creates a scala.runtime.*Ref whose initial value is given by a an expression including a Try in non-statement position. That sounds complicated, and it is. The solution so far (fixing SI-6863) is replaced by a simpler approach, at the cost of forward binary comptability with pre-2.11 releases, this time fixing the root cause of SI-6863. From now on, a s.r.*Ref is instantiated via invocation of a static factory method in the s.r.*Ref class in question. Unlike the code that was emitted so far (which involved NEW refclass, DUP, expr, INVOKESPECIAL refclass.<init>) the "expr" doesn't appear on the operand stack on top of the *Ref value being initialized. In other words, the *Ref initialization is in statement position provided "expr" is.
* | | | | Merge pull request #2483 from adriaanm/merge-2.10.xPaul Phillips2013-05-0222-11/+354
|\ \ \ \ \ | | | | | | | | | | | | Merge 2.10.x
| * \ \ \ \ Merge 2.10.x into masterAdriaan Moors2013-05-0222-11/+354
| |\ \ \ \ \ | | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #2432 from retronym/ticket/delayed-init-refPaul Phillips2013-04-303-0/+53
| | |\ \ \ \ | | | | | | | | | | | | | | Warn on selection of vals from DelayedInit subclasses.
| | | * | | | Warn on selection of vals from DelayedInit subclasses.Jason Zaugg2013-04-233-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Which are likely to yield null, if the program didn't start. This is a common source of confusion for people new to the language, as was seen during the Coursera course. The test case shows that the usage pattern within Specs2 won't generate these warnings.
| | * | | | | Merge pull request #2439 from retronym/ticket/7369Adriaan Moors2013-04-275-0/+95
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | SI-7369 Avoid spurious unreachable warnings in patterns
| | | * | | | | SI-7369 Avoid spurious unreachable warnings in patternsJason Zaugg2013-04-245-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unreachability analysis draws on the enumerated domain of types (e.g sealed subclasses + null, or true/false), and also looks at all stable identifier patterns tested for equality against the same 'slot' in a pattern. It was drawing the wrong conclusions about stable identifier patterns. Unlike the domain constants, two such values may hold the same value, so we can't assume that matching X precludes matching Y in the same slot in a subsequent case. For example: val X: Boolean = true; val Y: Boolean = true def m1(t1: Tuple1[Boolean]) = t1 match { case Tuple1(true) => case Tuple1(false) => case Tuple1(false) => // correctly unreachable } def m2(t1: Tuple1[Boolean]) = t1 match { case Tuple1(X) => case Tuple1(Y) => // spurious unreachable warning } // // Before // reachability, vars: V2: Boolean ::= true | false// Set(false, Y, X, true) // = x1._1 V1: (Boolean,) ::= null | ... // = x1 equality axioms: V2=true#4 \/ V2=false#5 /\ -V2=false#5 \/ -V2=Y#3 /\ -V2=false#5 \/ -V2=X#2 /\ -V2=false#5 \/ -V2=true#4 /\ -V2=Y#3 \/ -V2=X#2 /\ -V2=Y#3 \/ -V2=true#4 /\ -V2=X#2 \/ -V2=true#4 // // After // reachability, vars: V2: Boolean ::= true | false// Set(false, Y, X, true) // = x1._1 V1: (Boolean,) ::= null | ... // = x1 equality axioms: V2=true#4 \/ V2=false#5 /\ -V2=false#5 \/ -V2=true#4
| | * | | | | | Merge pull request #2392 from vigdorchik/ticket/si-7367Paul Phillips2013-04-262-0/+26
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-7367 scaladoc crash on constructing the model for annotations.
| | | * | | | | | SI-7367 scaladoc crash on constructing the model for annotations.Eugene Vigdorchik2013-04-252-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scaladoc only checks primary constructor when building annotation model. Here we instead find the constructor matching the annotation's symbol. Also change TreeFactory.makeTree to return TreeEntity rather than Option[TreeEntity] and force the caller check for EmptyTree.
| | * | | | | | | SI-6943 warn on value class miscomparison.Paul Phillips2013-04-242-8/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's a very dangerous situation running around when you combine universal equality with value classes: // All over your code val x = "abc" if (x == "abc") ... // Hey let's make x a value class val x = new ValueClass("abc") // Uh-oh There was until now no warning when comparing a value class with something else. Now there is.
| | * | | | | | | Merge pull request #2420 from retronym/ticket/6675-2Jason Zaugg2013-04-232-0/+21
| | |\ \ \ \ \ \ \ | | | |_|/ / / / / | | |/| | | | | | SI-6675 Avoid spurious warning about pattern bind arity.
| | | * | | | | | SI-6675 Avoid spurious warning about pattern bind arity.Jason Zaugg2013-04-212-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 692372ce, we added a warning (under -Xlint) when binding a `TupleN` in to a single pattern binder, which wasn't allowed before 2.10.0, and more often than not represents a bug. However, that warning overstretched, and warned even when using a Tuple Pattern to bind to the elements of such a value. This commit checks for this case, and avoids the spurious warnings. A new test case is added for this case to go with the existing test for SI-6675: $ ./tools/partest-ack 6675 % tests-with-matching-paths ... 3 % tests-with-matching-code ... 2 # 3 tests to run. test/partest --show-diff --show-log \ test/files/neg/t6675-old-patmat.scala \ test/files/neg/t6675.scala \ test/files/pos/t6675.scala \ "" Testing individual files testing: [...]/files/pos/t6675.scala [ OK ] Testing individual files testing: [...]/files/neg/t6675-old-patmat.scala [ OK ] testing: [...]/files/neg/t6675.scala [ OK ] All of 3 tests were successful (elapsed time: 00:00:03)
| | * | | | | | | Merge pull request #2358 from adriaanm/ticket-7330Jason Zaugg2013-04-214-3/+13
| | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-7330 better error when pattern's not a value
| | | * | | | | | | SI-7330 better error when pattern isn't a valueAdriaan Moors2013-04-084-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Somehow an applied type managed to sneak past the type checker in pattern mode. Patterns must be values, though. `case C[_] =>` was probably meant to be `case _: C[_] =>` Advice is dispensed accordingly. (Generalizing the existing advice machinery.)
| | * | | | | | | | Merge pull request #2410 from paulp/pr/parameterized-implicitJason Zaugg2013-04-212-0/+14
| | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Quiet down overloaded implicit warning.
| | | * | | | | | | | Quiet down overloaded implicit warning.Paul Phillips2013-04-182-0/+14
| | | | |/ / / / / / | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently implicit classes product both a method symbol and a module symbol, both of which are marked implicit, which left this warning code believing there was an overloaded implicit method.
| | * | | | | | | | Merge pull request #2322 from retronym/ticket/7200Jason Zaugg2013-04-202-0/+84
| | |\ \ \ \ \ \ \ \ | | | |_|_|_|/ / / / | | |/| | | | | | | SI-7200 Test case for fixed type inference error.
| | | * | | | | | | SI-7200 Test case for fixed type inference error.Jason Zaugg2013-03-272-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Broken in 2.9.2 and 2.10.0, but working in 2.10.1 --- sandbox/2.10.0.log +++ sandbox/2.10.1.log def coflatMap[A >: Nothing <: Any, B >: Nothing <: Any](f: Test.Nel[A] => B): Test.Nel[A] => Test.Nel[B] = ((l: Test.Nel[A]) => Test.this.Nel.apply[B](f.apply(l), l.tail match { case immutable.this.Nil => immutable.this.Nil - case (hd: A, tl: List[A])scala.collection.immutable.::[A]((h @ _), (t @ _)) => { - val r: Test.Nel[Nothing] = NelFoo.this.coflatMap[A, Nothing](f).apply(Test.this.Nel.apply[A](h, t)); + case (hd: A, tl: List[A])scala.collection.immutable.::[?A1]((h @ _), (t @ _)) => { + val r: Test.Nel[B] = NelFoo.this.coflatMap[A, B](f).apply(Test.this.Nel.apply[A](h, t)); { - <synthetic> val x$1: Nothing = r.head; - r.tail.::[Nothing](x$1) + <synthetic> val x$1: B = r.head; + r.tail.::[B](x$1) } } })) b74c33eb86 represents the exact moment of progression. Comments in pos/t7200b.scala, a minimal test that demonstrates the problem without type constructors or code execution, pinpoint the line of code responsible for the fix. Incidentally, I'm currently on a train somewhere between Solothurn and Biel, and am consequently without the power of scala-bisector. Undeterred, and inspired by a line I saw in Skyfall last night ("sometimes the olds ways are better"), I just pulled off a two-hop bisection. Take that, O(log N)! The one remaining worry is the appearance of the type variable ?A1 in the output of -Xprint:typer for run/t7200.scala.
* | | | | | | | | | Merge pull request #2406 from paulp/issue/7362Paul Phillips2013-04-3012-671/+747
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-7362, crash in presentation compiler
| * | | | | | | | | | More useful checkfile output in interactive tests.Paul Phillips2013-04-3010-692/+692
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I resisted the urge to fix "aksTypeCompletion" for as long as I possibly could. While I was there I threw in what seem to be like significant output improvements, but you tell me.
| * | | | | | | | | | SI-7362, crash in presentation compiler.Paul Phillips2013-04-303-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code by retronym, test by huitseeker, I just move stuff around.
* | | | | | | | | | | SI-7349 Partest supports test-interfaceSom Snytt2013-04-307-71/+36
|/ / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Partest uses test-interface API to invoke ScalaCheck. This obviates ad hoc output checking for result status. The context class loader is set to a loader that the scaladoc scalacheck tests can use.
* | | | | | | | | | Merge pull request #2428 from hubertp/issue/7291Paul Phillips2013-04-304-6/+32
|\ \ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|_|/ / |/| | | | | | | | | SI-7291: Don't throw exceptions while encountering diverging expansion.
| * | | | | | | | | SI-7291: No exception throwing for diverging implicit expansionHubert Plociniczak2013-04-264-6/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.