summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #3928 from kzys/dup-html-idsGrzegorz Kossakowski2014-09-021-4/+9
|\ | | | | Scaladoc: the value of an id attribute must be unique within a document
| * Scaladoc: the value of an id attribute must be unique within a documentKato Kazuyoshi2014-08-131-4/+9
| | | | | | | | The value of an id attribute must be unique, according to HTML spec.
* | Merge pull request #3920 from rubyu/issue/7350Grzegorz Kossakowski2014-09-011-0/+298
|\ \ | | | | | | SI-7350 Prevent resource leaks in PipedProcesses.runAndExitValue()
| * | Translate to jUnit test casesrubyu2014-08-263-345/+298
| | |
| * | SI-7350 Prevent resource leaks in PipedProcesses.runAndExitValue()rubyu2014-08-072-0/+345
| |/
* / Prevent SI-7905 by adding a testKato Kazuyoshi2014-07-312-0/+37
|/ | | | The original issue was fixed already. This test is just for make sure.
* Merge pull request #3877 from retronym/merge/2.11.x-to-2.12.x-20140714Jason Zaugg2014-07-1841-49/+258
|\ | | | | Merge 2.11.x to 2.12.x
| * Merge remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2014-07-1441-49/+258
| |\ | | | | | | | | | merge/2.11.x-to-2.12.x-20140714
| | * Merge pull request #3867 from lrytz/t8708Lukas Rytz2014-07-099-0/+75
| | |\ | | | | | | | | SI-8708 Fix pickling of LOCAL_CHILD child of sealed classes
| | | * SI-8708 Fix pickling of LOCAL_CHILD child of sealed classesLukas Rytz2014-07-079-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a sealed class or trait has local children, they are not pickled in as part of the children of the symbol (introduced in 12a2b3b to fix Aladdin bug 1055). Instead the compiler adds a single child class named LOCAL_CHILD. The parents of its ClassInfoType were wrong: the first parent should be a class. For sealed traits, we were using the trait itself. Also, the LOCAL_CHILD dummy class was entered as a member of its enclosing class, which is wrong: it represents a local (non-member) class, and it's a synthetic dummy anyway.
| | * | Merge pull request #3866 from Blaisorblade/issue/8677-backportLukas Rytz2014-07-091-0/+5
| | |\ \ | | | | | | | | | | SI-8677 Duration: Zero - Inf should be MinusInf
| | | * | [backport] SI-8677 Duration: Zero - Inf should be MinusInfPaolo G. Giarrusso2014-07-041-0/+5
| | | |/ | | | | | | | | | | | | | | | | Fixes #8677. Add basic tests. This is a backport from 2.12.x of dead39dc5f21c6eac41788e93426c50ddd398c24.
| | * | Use countElementsAsString for summarized warnings.Adriaan Moors2014-07-0419-19/+19
| | | |
| | * | Remove deprecationWarning, currentReporting from ReportingAdriaan Moors2014-07-041-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves us a bit closer to the goal of having a single entry point to reporting. Must modularize Reporting a bit so it can be used in Variances (need a reference to `currentRun` in `reflect.internal.Reporting`).
| | * | Uniformly route reporting through reporter.Adriaan Moors2014-07-041-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sharpen interfaces, reduce footprint of Reporting trait. Ideally, all reporting should indirect through reporter, and the `Reporting` trait itself should be restricted to a single method that retrieves the current `reporter`. Pull up some more reporting to reflect.internal. Would like to do more, but need to move partest to the reflect.internal interface first. (Its `errorCount` relies on `ERROR.count` in `tools.nsc.Reporter`.)
| | * | Move reporting logic into Reporting traitAdriaan Moors2014-07-046-14/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move code from Global/SymbolTable to separate Reporting traits to start carving out an interface in scala.reflect.internal.Reporting, with internals in scala.tools.nsc. Reporting is mixed into the cake. It contains a nested class PerRunReporting. Should do the same for debugging/logging. The idea is that CompilationUnit and Global forward all reporting to Reporter. The Reporting trait contains these forwarders, and PerRunReporting, which accumulates warning state during a run. In the process, I slightly changed the behavior of `globalError` in reflect.internal.SymbolTable: it used to abort, weirdly. I assume that was dummy behavior to avoid introducing an abstract method. It's immediately overridden in Global, and I couldn't find any other subclasses, so I don't think the behavior in SymbolTable was ever observed. Provide necessary hooks for scala.reflect.macros.Parsers#parse. See scala/reflect/macros/contexts/Parsers.scala's parse method, which overrides the reporter to detect when parsing goes wrong. This should be refactored, but that goes beyond the scope of this PR. Don't pop empty macro context stack. (Ran into this while reworking -Xfatal-warnings logic.) Fix -Xfatal-warnings behavior (and check files): it wasn't meant to influence warning reporting, except for emitting one final error; if necessary to fail the compile (when warnings but no errors were reported). Warnings should stay warnings. This was refactored in fbbbb22946, but we soon seem to have relapsed. An hour of gitfu did not lead to where it went wrong. Must've been a merge.
| | * | Unclutter Reporter. Move truncation to ReplReporter.Adriaan Moors2014-07-044-4/+8
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor to reduce the Reporter interface. Working towards minimal interfaces in scala.reflect.internal that can be consumed by sbt/IDE/.... The scala.tools.nsc package is entirely private to the compiler (in principle). A `Reporter` should only be used to inform (info/warning/error). No state. Ideally, we'd move to having only one reporter, whose lifetime is adjusted appropriately (from per-run in general to per-context for type checking, so errors can be buffered -- "silenced" -- during nested type checking calls). Start the clean up by moving truncation to the REPL, since it's not relevant for regular reporting. Perversely, we were checking truncation all the time, even though it's only on during a repl run. (Truncation is now always turned off in the repl under -verbose.) Untangle error resetting on symbols from error reporting (reportAdditionalErrors). This fixes a nice&subtle bug that caused feature warnings to be suppressed under `-Xfatal-warnings`: ``` def reportCompileErrors() { if (!reporter.hasErrors && reporter.hasWarnings && settings.fatalWarnings) globalError("No warnings can be incurred under -Xfatal-warnings.") if (reporter.hasErrors) { ... } else { // will erroneously not get here if // `reporter.hasWarnings && settings.fatalWarnings` // since the `globalError` call above means `reporter.hasErrors`... allConditionalWarnings foreach (_.summarize()) ... } } ``` The second `if`'s condition depends on the `globalError` call in the first `if`...
| | * Merge pull request #3736 from VladimirNik/print-types-issue-2.11.xAdriaan Moors2014-07-031-26/+51
| | |\ | | | | | | | | SI-8447 fix TypeTree printing (2.11.x)
| | | * TypeTree printing modified (SI-8447)VladimirNik2014-05-091-26/+51
| | | |
| | * | Merge pull request #3772 from densh/si/8609Adriaan Moors2014-07-031-0/+12
| | |\ \ | | | | | | | | | | SI-8609 Fix flattening of definitions and imports in quasiquotes
| | | * | SI-8609 Fix flattening of definitions and imports in quasiquotesDenys Shabalin2014-05-211-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quasiquotes allow to unquote trees with ..$ with block flattening semantics to simplify composition: val onetwo = q"1; 2" val onetwothree = q"..$onetwo; 3" // same as q"1; 2; 3" If there is no block it will be equivalent to $ unquoting: val one = q"1" val onetwo = q"..$one; 2" // same as q"1; 2" But the inconsistency here is that currently only terms support this single-element semantics. This commit extends this functionality to also support definitions and imports. So that following code works: val q1 = q"val x = 1" val q2 = q"..$q1; val y = 2" // same as q"val x = 1; val y = 2"
| | * | | Merge pull request #3828 from retronym/ticket/8675Adriaan Moors2014-07-034-0/+63
| | |\ \ \ | | | | | | | | | | | | SI-8675 Avoid unreported error after second try using implicit view
| | | * | | SI-8675 Add another test case for swallowed type errorsJason Zaugg2014-06-262-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported on scala-internals. After tightening up the treatment of undetermined type parameters in SI-7944, the enclosed test case no longer typechecks. And since the regression fixed in the previous commit, the error was swallowed by the typechecker only to be burped up by a crash in the backend.
| | | * | | SI-8675 Avoid unreported error after second try using implicit viewJason Zaugg2014-06-252-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is specific to situations in which we first typecheck an application `qual.m(arg)` against the method `m` directly provided by `qual`, and then fall back to `implicitView(qual).m(arg)`. Regressed in SI-3971 / 7fa77af, in which error reports were moved to the innermost `Apply`, and the check for `errorInResult` was accordingly changed to recurse through `Apply` trees. Before that change, we did not fall back to using a view. After the change, we do try a view. We retypecheck the arguments under the `retyping` mode (see `tryTypedArgs`), but this doesn't seem to be enough to avoid leaking the error typed nested trees from the first try. Here's an example from the enclosed test case: a.update(0, x[A]({new isString(true)})) `-- error typed refArrayOps(a).update(0, x[A]({new isString(true)})) ` `-- error type persists `-- this tree is retypecked by tryTypedArgs This commit changes `onError` to only proceed with the second try if the retyped argument trees are error free.
| | * | | | SI-8690 BufferedSource.mkString mistakenly skipped the first char.Antoine Gourlay2014-06-292-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mkString is overriden in BufferedSource for performance, but the implementation always used the wrong reader. This seems to be a typo (`allReader` is declared 5 lines earlier but never used, `charReader` is used in its place).
* | | | | | SI-8710 Fix crasher for value classes + private + overloadingJason Zaugg2014-07-111-0/+17
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The link between methods owned by a value class and the corresponding extension method in the companion is governed in part by a naming convention that depends on how many eponymous decls exist. This is easiest to explain with an example: % cat sandbox/test.scala && \ qscalac -Xprint:extmethods sandbox/test.scala \ | egrep 'class|object|def (foo|bar)|}$' class C(val x: Any) extends AnyVal { def foo(a: Int) = "" def foo(a: String) = "" def bar(a: Byte) } final class C extends scala.AnyVal { def foo(a: Int): String = C.foo$extension0(C.this)(a); def foo(a: String): String = C.foo$extension1(C.this)(a); def bar(a: Byte): Unit = C.bar$extension(C.this)(a); } <synthetic> object C extends AnyRef { final def foo$extension0($this: C)(a: Int): String = ""; final def foo$extension1($this: C)(a: String): String = ""; final def bar$extension($this: C)(a: Byte): Unit = (<empty>.asInstanceOf[Unit]: Unit); } } } Notice how the extension method names for `foo` are suffixed with a counter. This logic is contained in `extensionNames`. However, in the enclosed test cases, when we call `extensionNames` in a late phase of the compiler, in particular during erasure when we rewire `new C(x).foo(args)` to `C.foo$extensionN(x)(args)`, we crash. Why? The private method in the value class has been name mangled by `ExplicitOuter`'s use of `makeNotPrivate`, and we no longer appear to have multiple eponymous methods in play. We could try to fix this by changing `extensionNames` to poke around through the scopes of the value class and its companion in a manner insensitive to expanded names. This might look something like: - info.decl(imeth.name) + newOverloadedSymbol(info.decls.filter(sym => unexpandedName(sym) == unexpandedName(imeth.name)) But in fact we never need to expand the name of a private method in an value class, nor its corresponding companion, as: - calls to private value class members end up as calls to public extension methods - extension methods already have a the `$extension[N]` suffix and need no further mangling. This commit: - Resets `PRIVATE` and `LOCAL` when deriving the extension method - Adds a special case to `ExplicitOuter` to imbue the special knowledge that a call to `SomeValueClass#somePrivateMethod` need not `makeNotPrivate`, as erasure will come along later and rewire that to a (public) extension method.
* | | | | Merge pull request #3843 from Blaisorblade/topic/fix-minus-infAdriaan Moors2014-07-031-0/+5
|\ \ \ \ \ | | | | | | | | | | | | SI-8677 Duration: Zero - Inf should be MinusInf
| * | | | | SI-8677 Duration: Zero - Inf should be MinusInfPaolo G. Giarrusso2014-06-281-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Fixes #8677. Add basic tests.
* | | | | | Merge remote-tracking branch 'origin/2.11.x' into merge/2.11.x-2.12.x-20140627Jason Zaugg2014-06-2791-109/+503
|\ \ \ \ \ \ | |/ / / / / |/| / / / / | |/ / / /
| * | | | Merge pull request #3778 from xeno-by/topic/plugins-is-blackboxJason Zaugg2014-06-275-0/+40
| |\ \ \ \ | | | | | | | | | | | | adds MacroPlugin.pluginsIsBlackbox
| | * | | | adds MacroPlugin.pluginsIsBlackboxEugene Burmako2014-05-225-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an important omission in the current macro plugin API, which was designed before the blackbox vs whitebox separation was implemented. Even if one overrides pluginsTypedMacroBody and pluginsMacroExpand, that would still be not enough to write a custom macro expander, because typedImplicit1 uses isBlackbox, which is tightly coupled with the standard way of reading/writing macro signatures.
| * | | | | Merge pull request #3780 from xeno-by/topic/rangepos-macro-argsJason Zaugg2014-06-274-0/+16
| |\ \ \ \ \ | | | | | | | | | | | | | | macro args now correctly preserve range positions
| | * | | | | macro args now correctly preserve range positionsEugene Burmako2014-05-234-0/+16
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Somewhen in the 2.11.0 development cycle we started duplicating macro arguments for increased robustness. What wasn't taken into account though is that Tree.duplicate destroys range positions. This commit fixes the problem. 2.10.x is unaffected by this bug, because it doesn't duplicate the args yet.
| * | | | | Merge pull request #3832 from jrudolph/w/fix-tailrecJason Zaugg2014-06-274-2/+92
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-8657 don't miss tailrec defs in more positions
| | * | | | | SI-8657 don't miss tailrec defs in more positionsJohannes Rudolph2014-06-254-2/+92
| | | |/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) First operand of boolean expression using `&&` or `||`. Second operands of those boolean exprs were already treated specially here but handling for first operands was missing. 2) Condition of `If`. Also added a test for guards.
| * | | | | Merge pull request #3749 from huitseeker/issue/DeprecWarningJason Zaugg2014-06-2761-71/+71
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-8185 Correct grammar for single-warning compilation run
| | * | | | | SI-8185 Correct grammar for single-warning compilation runFrançois Garillot2014-05-1461-71/+71
| | | | | | |
| * | | | | | Merge pull request #3758 from gourlaysama/wip/t7372Ichoran2014-06-261-2/+2
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-7372 fix wrong insertion point for binary & linear search.
| | * | | | | | SI-7372 fix wrong insertion point for binary & linear search.Antoine Gourlay2014-06-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It should return the position the value would have if it was a part of the sequence. Somehow even the test was wrong.
| * | | | | | | Merge pull request #3806 from clhodapp/fix/SI-6967Adriaan Moors2014-06-253-31/+67
| |\ \ \ \ \ \ \ | | |_|_|/ / / / | |/| | | | | | SI-6967 Fix ClassTag unapply for primitives
| | * | | | | | SI-6967 Fix ClassTag unapply for primitivesclhodapp2014-06-103-31/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes the behavior of ClassTag's Any-accepting unapply overload. Previously, ClassTag had overloads of unapply that accepted all of the Java primitive aliases (language-supported magic classes extending AnyVal), as well as an implementation that accepted an Any. All of the AnyVal-accepting (more specific) versions of the methods worked correctly. However, the Any-accepting version incorrectly handled these types. For example, ClassTag.Int.unapply(3) would return Some(3) (through the Int-accepting overload), while ClassTag.Int.unapply(3: Any) would return None (through the Any-accepting overload). This commit unifies these behaviors, making ClassTag.Int.unapply(3: Any) return Some(3). It accomplishes this by adding a pattern match on the type of that method's argument, which will delegate to one of the more-specifically-typed overloads if possible. It also improves the formatting of the code a bit. One thing to note (though I doubt anyone will ever do this based on this message) is that the AnyVal-subtype-accepting overloads should be removed in Scala 2.12, as they are unneeded. I placed a note to this effect into the code.
| * | | | | | | SI-8672 Better end-of-sentence detection for ScaladocJason Zaugg2014-06-202-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first sentence of a Scaladoc comment is parsed as the summary. However, this was breaking of the sentence at the first `.`, even if that was immediately followed by another character. This commit only considers a period followed by whitespace, EOL or EOF as the end of a sentence.
| * | | | | | | Merge pull request #3797 from retronym/topic/exhaust-compoundJason Zaugg2014-06-113-0/+45
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-8631 Treat `A with Sealed` as enumerable for pattern matching
| | * | | | | | | SI-8631 Treat `A with Sealed` as enumerable for pattern matchingJason Zaugg2014-06-103-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enumerate the subtypes of sealed parent types of refinement types, and filter those that conform to the refinement type. Such types can crop up easily when LUB-bing case classes which add `Product with Serializable` to the mix.
| * | | | | | | | Merge pull request #3781 from retronym/topic/8611Jason Zaugg2014-06-117-0/+129
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-8611 Avoid accidental patmat unification with refinement types
| | * | | | | | | | SI-8611 Avoid accidental patmat unification with refinement typesJason Zaugg2014-06-107-0/+129
| | |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the enclosed test, t8611a.scala, the patterns `O.{A, B}` were incorrect treated as equivelent by the combination of `uniqueTpForTree` and `Const.uniqueTpForTree`. `uniqueTpForTree` used `Type#narrow` to try to create a distinct type for each new pattern tree it encountered. However, narrowing a `RefinedType` does not create a distinct type as we are used to when narrowing, e.g. a class type. // Type def narrow: Type = if (phase.erasedTypes) this else { val cowner = commonOwner(this) refinedType(this :: Nil, cowner, EmptyScope, cowner.pos).narrow } // CompoundType override def narrow: Type = typeSymbol.thisType This commit creates a fresh existential type symbol rather than trying to use `narrow`. I've included a unit test to show the sublteties of narrowing refinment types.
| * | | | | | | | Merge pull request #3777 from som-snytt/issue/5905-testJason Zaugg2014-06-101-3/+5
| |\ \ \ \ \ \ \ \ | | |/ / / / / / / | |/| | | | | | | SI-5905 Clarify test case
| | * | | | | | | SI-5905 Clarify test caseSom Snytt2014-05-221-3/+5
| | | |_|_|_|/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The language feature options are discovered reflectively, but it is nice to enforce that expected options are supplied. Short of that, the code string includes a rowdy postfix operator. It still does enforce that at least one option was discovered.
* | | | | | | | Merge remote-tracking branch 'origin/2.11.x' into merge/2.11.x-to-2.12.xJason Zaugg2014-06-1021-142/+253
|\| | | | | | |
| * | | | | | | Merge pull request #3815 from retronym/topic/java8-support-2Adriaan Moors2014-06-104-104/+31
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Java 8 agnostism for our test suite