summaryrefslogtreecommitdiff
path: root/test/files
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #3401 from xeno-by/topic/freshEugene Burmako2014-01-221-3/+3
|\ | | | | SI-6879 improves Context.freshName
| * SI-6879 improves Context.freshNameEugene Burmako2014-01-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | Instead of per-compilation unit unique counters, the freshName API now uses a per-Global counter. Fresh names now also contain dollars to exclude clashes with supported user-defined names (the ones without dollar signs). This doesn’t fix the bug, because per-Global counters get created anew every time a new Global is instantiated, and that provides some potential for name clashes even for def macros, but at least it completely excludes clashes in typical situations.
* | Expose seq field for variable arity definitionsDenys Shabalin2014-01-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 2.11 we've changed TupleClass, ProductClass and FunctionClass endpoints to be exposed as (Int => Symbol) functions that never throw exceptions but rather return NoSymbol instead of previous error-prone indexed access on array that could explode. While simplifying one use case (indexed access) it complicated ability to check if symbol at hand is in fact a tuple, product or function: (1 to 22).map(TupleClass).toList.contains(symbol) To cover this extra use case we add a seq method to the variable arity class definitions that exposes a corresponding sequence of class symbols: TupleClass.seq.contains(symbol)
* | Merge pull request #3382 from soc/topic/std-inJason Zaugg2014-01-211-1/+1
|\ \ | |/ |/| Improve naming of ReadStdin
| * Improve naming of ReadStdinSimon Ochsenreither2014-01-181-1/+1
| | | | | | | | | | We don't need to say everything twice, methods are already prefixed with “read”.
* | Merge pull request #3392 from xeno-by/topic/untypecheckEugene Burmako2014-01-218-8/+8
|\ \ | | | | | | deprecates resetAllAttrs and resetLocalAttrs in favor of the new API
| * | deprecates resetAllAttrs and resetLocalAttrs in favor of the new APIEugene Burmako2014-01-218-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now have c.untypecheck, which is supposed to be a counterpart of c.typecheck in the sense that it goes back from typed trees to untyped ones: http://stackoverflow.com/questions/20936509/scala-macros-what-is-the-difference-between-typed-aka-typechecked-an-untyped. Let’s hope that c.untypecheck will soon be able to solve our problems with partially/incorrectly attributed trees emitted by macros: https://groups.google.com/forum/#!topic/scala-internals/TtCTPlj_qcQ.
* | | Merge pull request #3368 from retronym/ticket/8151Grzegorz Kossakowski2014-01-212-16/+0
|\ \ \ | | | | | | | | SI-8151 Remove -Yself-in-annots and associated implementation
| * | | SI-8151 Remove -Yself-in-annots and associated implementationJason Zaugg2014-01-152-16/+0
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This experimental option typechecked arguments of annotations with an injected value in scope named `self`: @Foo(self.foo < 1) This has been slated for removal [1] for some time. This commit removes it in one fell swoop, without any attempt at source compatibility with code that constructs or pattern matches on AnnotatedType. [1] https://groups.google.com/d/msg/scala-internals/VdZ5UJwQFGI/C6tZ493Yxx4J
* | | Merge pull request #3365 from retronym/ticket/8133Jason Zaugg2014-01-214-0/+33
|\ \ \ | | | | | | | | Fix regression with package objects, overloading
| * | | SI-8133 Fix regression with package objects, overloadingJason Zaugg2014-01-144-0/+33
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Regressed in f5c336d56, a refactoring of `typedIdent`. In that commit, an (ostensibly) accidental change arrived, equivalent to: - val pre1 = if (qual == EmptyTree) NoPrefix else if (sym.isTopLevel) sym.owner.thisType else qual.tpe + val pre1 = if (sym.isTopLevel) sym.owner.thisType else if (qual == EmptyTree) NoPrefix else qual.tpe Here, `qual` is a tree returned in the successful result of `Context#lookup`. This change itself looks innocuous (top level symbols can be prefixed with a qualifier or not, right?), but it exposed us to a bug in `makeAccessible`. It is responsible for rewriting, e.g, `scala.List` to `scala.package.List`. It has a few cases, but one of them relies relies on typechecking `Ident(nme.PACKAGE)`, and hoping that it will bind to the right place. That's fraught with danger, and breaks in the enclosed tests. This commit binds that Ident symbolically, and in the process factors a tiny bit of code in common with `TreeGen`. (More work is still needed here!) In the next commit, I'm going to revert the change to `pre1`. That would have also fixed the regression, albeit symptomatically.
* | | Merge pull request #3385 from xeno-by/ticket/8158Eugene Burmako2014-01-204-1/+53
|\ \ \ | | | | | | | | fixes some typos and types
| * | | addresses pull request feedbackEugene Burmako2014-01-202-2/+2
| | | |
| * | | SI-8158 compiler hangs printing out fancy typesEugene Burmako2014-01-204-1/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently, even though the compiler has safeguards against infinite type printouts, having a depth counter, we didn’t account for the cases when printouts are both self-referential and self-multiplying. For one, SI-8158 provides an example of such a type, which is a structural type that refers to itself twice in return types of its methods. At first, printing such a type would go deeper and deeper, but then it will hit the depth limit and start multiply indefinitely. This commit fixes this particular problem by recognizing self-references as this.type’s and printing them out as such. The subsequent commit will introduce a more general facility.
* | | | Merge 2.10.x into masterAdriaan Moors2014-01-181-0/+24
|\ \ \ \ | |/ / / |/| | |
| * | | Merge pull request #3356 from retronym/ticket/8138Jason Zaugg2014-01-181-0/+24
| |\ \ \ | | | | | | | | | | Fix bug with super-accessors / dependent types
| | * | | SI-8143 Fix bug with super-accessors / dependent typesJason Zaugg2014-01-121-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Super-accessors are generated as `DefDef`'s with `EmptyTree` as a placeholder for the RHS. This is filled in later in `Mixin` in `completeSuperAccessor`. A change in `Uncurry` (SI-6443 / 493197f), however, converted this to a `{ EmptyTree }`, which evaded the pattern match in mixin. This commit adds a special case to the dependent method treatment in Uncurry to avoid generating redundant blocks.
| * | | | Merge pull request #3364 from retronym/ticket/8152Jason Zaugg2014-01-151-0/+13
| |\ \ \ \ | | | | | | | | | | | | [nomaster] Backport variance validator performance fix
| | * | | | [nomaster] SI-8152 Backport variance validator performance fixJason Zaugg2014-01-141-0/+13
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | % time qbin/scalac test/files/pos/t8146-performance.scala real 0m2.015s user 0m2.892s sys 0m0.215s % time scalac-hash v2.10.3 test/files/pos/t8146-performance.scala real 1m13.652s user 1m14.245s sys 0m0.508s Cherry-picks one hunk from 882f8e64.
* | | | | Merge pull request #3383 from adriaanm/merge-2.10.xAdriaan Moors2014-01-1822-12/+178
|\ \ \ \ \ | | | | | | | | | | | | Merge 2.10.x
| * | | | | Merge commit 'd5801b9eee' from 2.10.x into masterAdriaan Moors2014-01-171-0/+24
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/typechecker/Typers.scala
| | * | | | Merge pull request #3328 from retronym/ticket/8111v2.10.4-RC2Jason Zaugg2014-01-121-0/+24
| | |\ \ \ \ | | | |/ / / | | |/| | | Repair symbol owners after abandoned named-/default-args
| | | * | | SI-8111 Repair symbol owners after abandoned named-/default-argsJason Zaugg2014-01-061-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Names/Defaults eagerly transforms an application with temporaries to maintain evaluation order, and dutifully changes owners of symbols along the way. However, if this approach doesn't work out, we throw away this and try a auto-tupling. However, we an still witness symbols owned by the temporaries. This commit records which symbols are owned by the context.owner before `transformNamedApplication`, and rolls back the changes before `tryTupleApply`. Perhaps a better approach would be to separate the names/defaults applicability checks from the evaluation-order-preserving transform, and only call the latter after we have decided to go that way.
| | * | | | [nomaster] SI-8114 Binary compat. workaround for erasure bug SI-7120Jason Zaugg2014-01-091-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't backport SI-7120 to 2.10.x as it changes erased signatures, which can lead to interop problems between 2.10.3 and 2.10.4. But, we can detect one of the nasty symptoms -- a bridge method with the same signature as its target -- and treat that. This commit detects duplicate bridges in the ASM (only) backend and removes them.
| * | | | | Merge commit 'aefe3fb844' into merge-2.10.xAdriaan Moors2014-01-172-0/+12
| |\| | | |
| | * | | | SI-6563 Test case for already-fixed crasherJason Zaugg2014-01-062-0/+12
| | |/ / / | | | | | | | | | | | | | | | Progressed to working in SI-7636 / c4bf1d5.
| | * | | [nomaster] codifies the state of the art wrt SI-8104Eugene Burmako2013-12-286-0/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As it was discovered in SI-8104, whiteboxity doesn’t apply equally to type parameters and type members of materialized type classes. During implicit search and subsequent type inference, whitebox type parameters are consistently erased to wildcards, whereas whitebox type members sometimes remain as is and get in the way of signature conformance checks. Unfortunately, 2.10.x can’t make use of type parameter whiteboxity, because it requires fundep materializers that were only merged into 2.11: https://github.com/scala/scala/pull/2499, and therefore Si-8104 seems to be a hard blocker for 2.10.x at the moment. Stay tuned for updates.
| * | | | Merge commit '97b9b2c06a' from 2.10.x into masterAdriaan Moors2014-01-1719-12/+142
| |\| | | | | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Check files updated: test/files/presentation/t8085*.check Conflicts: build.xml src/compiler/scala/tools/nsc/ast/parser/Parsers.scala src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
| | * | SI-8085 Fix BrowserTraverser for package objectsJason Zaugg2013-12-1810-11/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A source file like: import foo.bar package object baz Is parsed into: package <empty> { import foo.bar package baz { object `package` } } A special case in Namers compensates by adjusting the owner of `baz` to be `<root>`, rather than `<empty>`. This wasn't being accounted for in `BrowserTraverser`, which underpins `-sourcepath`, and allows the presentation compiler to load top level symbols from sources outside those passes as the list of sources to compile. This bug did not appear in sources like: package p1 package object p2 { ... } ... because the parser does not wrap this in the `package <empty> {}` This goes some way to explaining why it has gone unnoticed for so long.
| | * | Test demonstrating SI-8085Mirco Dotta2013-12-186-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * The presentation compiler sourcepath is now correctly set-up. * Amazingly enough (for me at least), the outer import in the package object seem to be responsible of the faulty behavior. In fact, if you move the import clause *inside* the package object, the test succeed! The test's output does provide the correct hint of this: ``` % diff /Users/mirco/Projects/ide/scala/test/files/presentation/t8085-presentation.log /Users/mirco/Projects/ide/scala/test/files/presentation/t8085.check @@ -1,3 +1,2 @@ reload: NodeScalaSuite.scala -prefixes differ: <empty>.nodescala,nodescala -value always is not a member of object scala.concurrent.Future +Test OK ``` Notice the ``-prefixes differ: <empty>.nodescala,nodescala``. And compare it with the output when the import clause is placed inside the package object: ``` % diff /Users/mirco/Projects/ide/scala/test/files/presentation/t8085-presentation.log /Users/mirco/Projects/ide/scala/test/files/presentation/t8085.check @@ -1,4 +1,2 @@ reload: NodeScalaSuite.scala -reload: NodeScalaSuite.scala -open package module: package object nodescala Test OK ``` Notice now the ``-open package module: package object nodescala``!
| | * | Report error on code size overflow, log method name.Adriaan Moors2013-12-122-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to silently skip class files that would exceed the JVM's size limits. While rare, this should still be an error. While I was at it, also included the name of the offending method.
| | * | Merge pull request #3261 from adriaanm/ticket-6426Adriaan Moors2013-12-112-12/+0
| | |\ \ | | | | | | | | | | Revert ", importable _."
| | | * | Revert "SI-6426, importable _."Adriaan Moors2013-12-102-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d2316df920ffa4804fe51e8f8780240c46efa982. We can't make `_` an illegal identifier -- it's legal in Java, so we must be able to name these Java underscores.
| | * | | Merge pull request #3253 from retronym/ticket/8062Adriaan Moors2013-12-113-0/+9
| | |\ \ \ | | | |/ / | | |/| | Fix inliner cycle with recursion, separate compilation
| | | * | SI-8062 Fix inliner cycle with recursion, separate compilationJason Zaugg2013-12-103-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ICodeReaders, which decompiles JVM bytecode to ICode, was not setting the `recursive` attribute of `IMethod`. This meant that the inliner got into a cycle, repeatedly inlining the recursive call. The method name `filter` was needed to trigger this as the inliner heuristically treats that as a more attractive inlining candidate, based on `isMonadicMethod`. This commit: - refactors the checking / setting of `virtual` - adds this to ICodeReaders - tests the case involving `invokevirtual` I'm not sure how to setup a test that fails without the other changes to `ICodeReader` (for invokestatic and invokespecial).
* | | | | Merge pull request #3381 from retronym/topic/debug-friendlinessEugene Burmako2014-01-182-0/+2
|\ \ \ \ \ | |/ / / / |/| | | | Fix compilation under -Ydebug
| * | | | Avoid cycles in Symbol toString under -YdebugJason Zaugg2014-01-172-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first of two commits to restore workingness to the compiler under `-Ydebug`. `ResetAttrs` is now called during case class unapply synthesis, after the UnTyper was recently banished. But, this class has some low-level tracing that is triggered under `-Ydebug` (irrespective of any `-Ylog` settings.) This tracing code calls `Symbol#toString`, which, in an attempt to discriminate primary from secondary constructors, accesses the info of its owner. This is sufficient to hit a dreaded `CyclicReferenceError`. The enclosed test compiles a case class under this option to show that things now compile. It still spews out unwanted output; this will be removed in the next commit.
* | | | | Merge pull request #3373 from densh/topic/std-liftable-refinementAdriaan Moors2014-01-171-1/+49
|\ \ \ \ \ | | | | | | | | | | | | A few minor changes to standard liftable instances and liftable support
| * | | | | Test edge cases of literal liftingDen Shabalin2014-01-161-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously in some corner situation proper Liftable instance might not have been resolved. In particular q"${true}" and q"${""}" used to fail.
| * | | | | Lift Some, None, Nil, Left, Right not just supertypesDenys Shabalin2014-01-161-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously leaf concrete types were not lifted which could have caused weird problems when types is too precise: val s1 = Some(2) q"$s1" // used to fail
* | | | | | Merge pull request #3380 from retronym/ticket/8157Adriaan Moors2014-01-172-0/+8
|\ \ \ \ \ \ | | | | | | | | | | | | | | Make overloading, defaults restriction PolyType aware
| * | | | | | SI-8157 Make overloading, defaults restriction PolyType awareJason Zaugg2014-01-172-0/+8
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Named/Default args levies an implementation restriction that only one overloaded alternative may declare defaults. But, this restriction failed to consider polymorphic methods. Rather than matching on MethodType, this commit uses `Type#paramms`, which handles PolyTypes and curried MethodTypes in one fell swoop.
* | | | | | Merge pull request #3283 from paulp/pr/dotless-targsAdriaan Moors2014-01-173-0/+18
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Dotless type application for infix operators.
| * | | | | Dotless type application for infix operators.Paul Phillips2013-12-173-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you have an aesthetic expresion like def f(xs: Iterator[Int]) = ( xs takeWhile (_ < 1000) map (_ * -1) filter (_ % 2 == 0) flatMap (x => List(x, x)) reduceOption (_ + _) maxBy (_.toString) ) And then for whatever reason you have to perform explicit type application in the midst of that expression, it's aggravating in the extreme that it has (had) to be rewritten in its entirety to accommodate that change. So now you can perform type application in the middle of it. For reasons not entirely clear to me postfix operators are excluded. The discussion as well as the approval for the infix variation of it can be found at: https://groups.google.com/forum/#!msg/scala-language/eJl1wnkEz9M/hR984-lqC5EJ
* | | | | | Merge pull request #3322 from rklaehn/issue/6253Ichoran2014-01-163-0/+189
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-6253 HashSet should implement union
| * | | | | | SI-6253 HashSet should implement unionRüdiger Klaehn2014-01-163-0/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements of HashSet.union that reuses the two trees as much as possible when calculating the union of two sets. This leads to significant performance improvements as well as to much better structural sharing. There is a comprehensive correctness test for union since there was not a single test for HashSet.union before. In addition, there are some tests of the desirable properties of the new implementation (structural sharing and efficiency regarding calls of key.hashCode). The other operations diff and intersect, which are conceptually very similar to union, are also implemented along with comprehensive test cases for both correctness and structural sharing. Note that while it appears that there is some code duplication between the three methods, they are sufficiently different that it is not possible to merge them into one without sacrificing performance.
* | | | | | | Merge pull request #3278 from magarciaEPFL/backendish48Adriaan Moors2014-01-162-0/+17
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | improvements to GenBCode
| * | | | | | | overzealous assert in BCodeBodyBuilder rejected throw nullMiguel Garcia2013-12-161-0/+7
| | | | | | | |
| * | | | | | | overzealous assert in GenBCodeMiguel Garcia2013-12-151-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The assert in question was aimed at ruling out gotos (ie "jumping-applys") in actual argument position of a jumping-apply. But the assert in question went overboard to also rule out a LabelDef in actual argument position. This commit removes the assert in question altogether. The unwanted behaviors, and only those, are rule out by the test added in this commit and the existing tests for SI-6089. See also https://issues.scala-lang.org/browse/SI-7749
* | | | | | | | SI-8148 fix anonymous functions with placeholdersDenys Shabalin2014-01-161-0/+5
| |_|_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quasiquotes used to fail to generate proper fresh identifiers for anonymous functions like: q"_ + _" Due to improper initialization of FreshNameCreator in quasiquote parser which was erroneously not preserved throughout parsing of the code snippet but re-created on every invocation.