summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit '644eb7078a' into wip/fresh-merge2Paul Phillips2013-02-0134-81/+4357
|\ | | | | | | | | | | Conflicts: build.xml src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
| * Merge pull request #2034 from scalamacros/topic/reify-staticXXXPaul Phillips2013-01-311-18/+18
| |\ | | | | | | evicts eponymous packages and objects from tests
| | * evicts eponymous packages and objects from testsEugene Burmako2013-01-311-18/+18
| | | | | | | | | | | | | | | | | | As I figured out from http://groups.google.com/group/scala-internals/browse_thread/thread/ace970a799dcf7a0, current behavior with same-named objects silently taking precedence over same-named packages is a bug and shouldn't be relied upon.
| * | Merge pull request #2021 from gkossakowski/issue/SI-7009Grzegorz Kossakowski2013-01-318-4/+108
| |\ \ | | | | | | | | SI-7009: `@throws` annotation synthesized incorrectly
| | * | SI-7009: `@throws` annotation synthesized incorrectlyGrzegorz Kossakowski2013-01-305-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 990b3c7 made `scala.throws` annotation polymorphic but forgot to adapt compiler code that synthesizes it, e.g. when parsing class files. The consequence was that we would get non-deterministically either `scala.throws` or `scala.throws[T]` as a type for synthesized annotation. The reason is that `Symbol.addAnnotation` would call `tpe` method which does not initialization of symbol so type parameters list would not be determined correctly. Only if info of that symbol was forced for other reason we would get `scala.throws[T]`. That non-deterministic behavior was observed in sbt's incremental compiler. Another problem we have is that Scala allows polymorphic exceptions so in ClassfileParser we could synthesize `@throws` annotation with wrong (polymorphic) type applied. In such case the best we can do is to convert such type to monomorphic one by introducing existentials. Here's list of changes this commit introduces: * The `Symbol.addAnnotation` that takes symbol as argument asserts that the type represented by that symbol is monomorphic (disabled due to cycles; see comments in the code) * Introduce `Symbol.addAnnotation` overload that allows us to pass an applied type * Change all places where polymorphic annotations are synthesized to pass an applied type * Handle polymorphic exception types in `ClassfileParser.parseExceptions` Fixes SI-7009.
| | * | Test case for SI-7009.Grzegorz Kossakowski2013-01-294-0/+85
| | | | | | | | | | | | | | | | | | | | The next commit fixes the problem itself and it's easier to see in diff what's being fixed exactly.
| * | | Merge pull request #1989 from adriaanm/rework-pr-1945Paul Phillips2013-01-3110-11/+17
| |\ \ \ | | | | | | | | | | SI-6968 Simple Tuple patterns aren't irrefutable
| | * | | SI-6968 Simple Tuple patterns aren't irrefutableJason Zaugg2013-01-2710-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reverts part of c82ecab. The parser can't assume that a pattern `(a, b)` will match, as results of `.isInstanceOf[Tuple2]` can't be statically known until after the typer. The reopens SI-1336, SI-5589 and SI-4574, in exchange for fixing this regression SI-6968. Keeping all of those fixed will require a better definition of irrefutability, and some acrobatics to ensure safe passage to the ambiguous trees through typechecking.
| * | | | Merge pull request #2031 from JamesIry/2.10.x_SI-6669Paul Phillips2013-01-312-1/+27
| |\ \ \ \ | | | | | | | | | | | | SI-6669 Add . to the default scalap classpath
| | * | | | SI-6669 Add . to the default scalap classpathJames Iry2013-01-302-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default classpath for scalap did not include '.' which made it behave differently from javap in an annoying way. This commit adds it to the default. Also included is a test to make sure it's in the default but does not corrupt a user specified classpath.
| * | | | | Merge pull request #2028 from JamesIry/2.10.x_SI-6728Paul Phillips2013-01-314-5/+14
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-6728 Fixes crash in parser on incomplete for expression
| | * | | | | SI-6728 Fixes crash in parser on incomplete for expressionJames Iry2013-01-304-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parser was trying to take the position of an empty expression which would crash. Son on the empty expression case in TreeBuilder# makeWhile it tries to do that and, if that failed, gets a position that wraps both the condition and the body. I also made a slight improvement to the UnsupportedOperationEx messages in Position.
| * | | | | | Merge pull request #2014 from gkossakowski/bytecode-testingGrzegorz Kossakowski2013-01-305-0/+104
| |\ \ \ \ \ \ | | |_|/ / / / | |/| | | | | Add Bytecode test (ASM-based) to partest.
| | * | | | | Add Bytecode test (ASM-based) to partest.Grzegorz Kossakowski2013-01-295-0/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a new kind of test `Bytecode` that allows one to inspect bytecode generated for given piece of Scala code. The bytecode inspection is achieved by inspection of ASM trees. See the included example for details. NOTE: This commit does not introduce a new category of pratest tests. Bytecode tests should be run in `jvm` category of partest tests. Specific list of changes: * Add BytecodeTest that contains common utilities to partest * Add asm to classpath when compiling partest. That's not a new dependency as it's being already done for javac task we were running while compiling partest. * Add an example test that shows how to count null checks in given method.
| * | | | | | Merge pull request #1997 from retronym/ticket/7035Paul Phillips2013-01-304-29/+38
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-7035 Centralize case field accessor sorting.
| | * | | | | | SI-7035 Centralize case field accessor sorting.Jason Zaugg2013-01-284-29/+38
| | | |_|/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is both burdensome and dangerous to expect callers to reorder these. This was seen in the field permutation in the unapply method; a regression in 2.10.0.
| * | | | | | Merge pull request #2008 from paulp/pr/asSeenFromOptGrzegorz Kossakowski2013-01-301-6/+6
| |\ \ \ \ \ \ | | |_|_|/ / / | |/| | | | | Optimization in AsSeenFromMap.
| | * | | | | Optimization in AsSeenFromMap.Paul Phillips2013-01-291-6/+6
| | | |/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Despite all the eyes which have traveled over this code, we all managed to miss this: // Note that pre and clazz are fixed at construction class AsSeenFromMap(pre: Type, clazz: Symbol) { ... def apply(tp: Type): Type = if (skipPrefixOf(pre, clazz)) tp else ... } Additionally, the exclusion condition in asSeenFrom contained a useless check, here: // !isPossiblePrefix(clazz) alone is enough pre.normalize.isTrivial && !isPossiblePrefix(clazz)
| * | | | | Merge pull request #2020 from adriaanm/rebase-pr-1994-2.10.xAdriaan Moors2013-01-302-8/+4026
| |\ \ \ \ \ | | | | | | | | | | | | | | [retarget #1994 to 2.10.x] SI-6726 Improving pattern matcher analysis performance
| | * | | | | Remove gratuitous varJason Zaugg2013-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In favour of a somber val.
| | * | | | | SI-6726 Further optimization of pattern analysisJason Zaugg2013-01-302-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Manually fuse `.filterNot(..).map` in dropUnit. Before: real 1m23.574s user 1m51.795s sys 0m2.634s After: real 1m4.883s user 1m30.754s sys 0m1.776s
| | * | | | | SI-6726 Hash consing for Pattern matching Sym-sJason Zaugg2013-01-302-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the test case: https://issues.scala-lang.org/browse/SI-6726?focusedCommentId=61207&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-61207 time scalac -Ystatistics -Ystop-after:patmat sandbox/gen.scala Before: real 1m47.737s user 2m14.314s sys 0m2.783s After: real 1m23.574s user 1m51.795s sys 0m2.634s
| | * | | | | SI-6726 Add benchmark used for testing pattern matcher.Jason Zaugg2013-01-301-0/+4005
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To be manually run, results referenced in subsequent commmits.
* | | | | | | Merge commit '62681e191a' into wip/fresh-merge2Paul Phillips2013-02-010-0/+0
|\| | | | | |
| * | | | | | Merge pull request #2007 from retronym/backport/1021Adriaan Moors2013-01-303-1/+12
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | [backport] Fix for SI-6154, VerifyError originating in uncurry.
| | * | | | | | [backport] Fix for SI-6154, VerifyError originating in uncurry.Paul Phillips2013-01-293-1/+12
| | | |/ / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lhs still might be an Ident. Miguel did all the work, I just wrote it down in code form. (cherry picked from commit 48f8235822a2a100d6c4e8d3d7349df565ac6d40)
* | | | | | | Merge commit 'ccd7abe897' into wip/fresh-merge2Paul Phillips2013-02-014-83/+139
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala
| * | | | | | Merge pull request #2025 from paulp/issue/6516Paul Phillips2013-01-302-1/+20
| |\ \ \ \ \ \ | | |_|/ / / / | |/| | | | | SI-6516, macros comparing types with == instead of =:=.
| | * | | | | SI-6516, macros comparing types with == instead of =:=.Paul Phillips2013-01-302-1/+20
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I gift-wrapped this ticket four months ago: 'I think it will be enough to say "tpe =:= MacroContextClass.tpe" rather than == .' Indeed. Had to open my own gift. Thanks, paulp!
| * | | | | Merge pull request #1912 from retronym/ticket/6651James Iry2013-01-292-7/+63
| |\ \ \ \ \ | | |_|_|/ / | |/| | | | SI-6651 Extension methods types may depend on the typed of the wrapped value
| | * | | | SI-6551 Expand test case into uncomfortable areas.Jason Zaugg2013-01-291-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | trait T { type U } class A(val a: T) extends AnyVal { def foo[TT <: a.U] = 0 } It works! But it's pure serendipity. After extmethods, the careful student of ASTs will find: object A { final def foo$extension[TT >: Nothing <: A.this.a.U]($this: A): Int = 0; } `A.this` doesn't belong. For now we just include this case under our test umbrella.
| | * | | | SI-6651 Substitute `this` in extension method sigsJason Zaugg2013-01-292-7/+56
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows for the likes of: class A[X](val x: X) extends AnyVal { def foo(xy: x.Y) {} } We have to do this in both directions, when synthesizing the extension method in `Extender#transform`, and later on when Erasure tries to find the corresponding extension methods by backing out the original signatures from the signatures of the synthesized methods in the companion. In the first case, we have to be careful to use a stable reference to the `self` parameter, which can satisfy the dependent types.
* | | | | Merge commit 'c1dd8bbaa4' into wip/fresh-merge2Paul Phillips2013-02-010-0/+0
|\| | | |
| * | | | Merge pull request #2010 from retronym/backport/1985Jason Zaugg2013-01-292-0/+0
| |\ \ \ \ | | |/ / / | |/| | | [backport] Disabled SI-6987.
| | * | | [backport] Disabled SI-6987.Paul Phillips2013-01-292-0/+0
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It causes spurious failures - a typical example: [partest] testing: [...]/files/run/t6987.scala [FAILED] [partest] did not get the string expected, full results were: [partest] Fast Scala compiler version 2.11.0-20130126-111937-f01e001c77 -- Copyright 2002-2013, LAMP/EPFL [partest] [Given arguments: -shutdown -verbose] [partest] [Transformed arguments: -shutdown -verbose -current-dir /localhome/jenkins/b/workspace/scala-checkin-manual] [partest] [VM arguments: ] [partest] java.net.ConnectException: Connection refused [partest] [Connecting to compilation daemon at port 32808 failed; re-trying...] [partest] [No compilation server running.] [partest] (cherry picked from commit 53d5df5c1d52b941732c243159de4f44456f03b4)
| * | | Merge pull request #1981 from retronym/backport/1187Adriaan Moors2013-01-284-7/+42
| |\ \ \ | | | | | | | | | | [backport] SI-3577 BoundedWildcardType handling
| | * | | [backport] SI-3577 BoundedWildcardType handlingJason Zaugg2013-01-264-7/+42
| | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 3c91b32d699a9e29d685ac20c9805f96c9f2db2c Author: Jason Zaugg <jzaugg@gmail.com> Date: Fri Aug 24 01:16:47 2012 +0200 Mention BoundedWildcardType in "a standard type pattern match". (cherry picked from commit 00e46b3dbcea2b72fd3941b7ffc2efba382871e9) commit 0664be2b69b1ce013e937bc93f4e84b891676f1f Author: Jason Zaugg <jzaugg@gmail.com> Date: Fri Aug 24 01:05:07 2012 +0200 Make RefChecks#validateVariance aware of BoundedWildcardType. The only test case that I know for this will be neutered by the imminent fix for SI-6258; so I haven't been able to test this. But trying this manually, you can see that this patch defers the the SI-6258 to the erasure phase. Original: scala.MatchError: ? (of class scala.reflect.internal.Types$BoundedWildcardType) at scala.tools.nsc.typechecker.RefChecks$RefCheckTransformer$$anon$3.scala$tools$nsc$typechecker$RefChecks$RefCheckTransformer$$anon$$validateVariance$1(RefChecks.scala:894) at scala.tools.nsc.typechecker.RefChecks$RefCheckTransformer$$anon$3.validateVariance(RefChecks.scala:965) Modified: java.lang.ClassCastException: scala.reflect.internal.Types$TypeRef$$anon$6 cannot be cast to scala.reflect.internal.Types$TypeBounds at scala.reflect.internal.Types$TypeMap.mapOver(Types.scala:4160) at scala.reflect.internal.transform.Erasure$ErasureMap.apply(Erasure.scala:156) (cherry picked from commit 2b4e7183fd24113cca5e868456668fd05c848168) commit 6ad651c94faf463133c742feb2aee59ef782ea1f Author: Jason Zaugg <jzaugg@gmail.com> Date: Fri Aug 24 00:54:59 2012 +0200 SI-3577 Make varianceInType aware of BoundedWildcardType. (cherry picked from commit 21105654c40ed0c462142bcbb6c8eced77f8b07a)
* | | | Merge pull request #2027 from paulp/pr/fix-empty-packagePaul Phillips2013-02-014-2/+18
|\ \ \ \ | | | | | | | | | | Fix access to empty package from the repl.
| * | | | Fix access to empty package from the repl.Paul Phillips2013-01-304-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems that way back in f5c336d566 three months ago I booched the repl's ability to get at the empty package. I've noticed this a hundred times but strangely it has not been reported by anyone else. Perhaps you are all religious package users. In any case, it is back.
* | | | | Merge pull request #2045 from paulp/pr/partest-ackPaul Phillips2013-01-311-43/+113
|\ \ \ \ \ | | | | | | | | | | | | Overhaul of tools/partest-ack.
| * | | | | Overhaul of tools/partest-ack.Paul Phillips2013-01-311-43/+113
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I decided what would be really handy for test selection is being able to run all the tests which were created or modified at the same time as something else. Right now that is at file granularity, though it would be simple enough to generalize it such that any expression which can be translated to a set of git commits can also be turned into a selection of tests. I added some other options as well: Usage: $0 <regex> [-dfquvp] [ack options] -d pass --debug to partest -f pass --failed to partest -q DON'T pass --show-log and --show-diff to partest -u pass --update-check to partest -v pass --verbose to partest -p <path> select tests appearing in commits where <path> was also modified Example usage: > tools/partest-ack -p src/compiler/scala/tools/nsc/typechecker/Checkable.scala % tests-modified-in-same-commit ... 12 # 12 tests to run. Testing individual files testing: [...]/files/pos/t6537.scala [ OK ] Testing individual files testing: [...]/files/neg/unchecked-impossible.scala [ OK ] testing: [...]/files/neg/t1872.scala [ OK ] testing: [...]/files/neg/t4302.scala [ OK ] testing: [...]/files/neg/unchecked-knowable.scala [ OK ] testing: [...]/files/neg/unchecked-abstract.scala [ OK ] [etc]
* | | | | Merge pull request #2013 from paulp/pr/normalize-lessPaul Phillips2013-01-3122-58/+128
|\ \ \ \ \ | |/ / / / |/| | | | Changes many calls from normalize to dealiasWiden.
| * | | | Expanded the comment on Type#normalize.Paul Phillips2013-01-301-0/+22
| | | | | | | | | | | | | | | | | | | | As suggested by reviewer.
| * | | | Changes many calls to normalize to dealiasWiden.Paul Phillips2013-01-2920-53/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling normalize is very aggressive and is usually the wrong thing. It is one of the leading contributors to non-determinism in compiler outcomes (often of the form "I gave a debugging or logging compiler option and it started/stopped working") and should be used only in very specific circumstances. Almost without exception, dealiasWiden is what you want; not widen, not normalize. If possible I will remove normalize from Type entirely, making it private to those areas of the compiler which actually require it.
| * | | | Renames normalize to normalizeModifiers.Paul Phillips2013-01-291-5/+5
| | | | | | | | | | | | | | | | | | | | Since we still have too many methods called normalize.
| * | | | Pending test for SI-5459.Paul Phillips2013-01-291-0/+48
| | | | |
* | | | | Merge pull request #1858 from eed3si9n/topic/xmlscopePaul Phillips2013-01-292-2/+35
|\ \ \ \ \ | | | | | | | | | | | | SI-6939 Fix namespace binding (xmlns) not overriding outer binding
| * | | | | SI-6939 Fix namespace binding (xmlns) not overriding outer bindingEugene Yokota2013-01-272-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given a nested XML literal to the compiler Elem instance is generated with namespace binding of the inner element copying that of the outer element: val foo = <x:foo xmlns:x="http://foo.com/"> <x:bar xmlns:x="http://bar.com/"><x:baz/></x:bar></x:foo> With the above example, `foo.child.head.scope.toString` returns " xmlns:x="http://bar.com/" xmlns:x="http://foo.com/"" This is incorrect since the outer xmls:x should be overridden by the inner binding. XML library also parses XML document in a similar manner: val foo2 = scala.xml.XML.loadString("""<x:foo xmlns:x="http://foo.com/"><x:bar xmlns:x="http://bar.com/"><x:baz/></x:bar></x:foo>""") Despite this erroneous behavior, since the structure of NamespaceBinding class is designed to be singly-linked list, the stacking of namespace bindings allows constant-time creation with simple implementation. Since the inner namespace binding comes before the outer one, query methods like `getURI` method behave correctly. Because this bug is manifested when Elem is turned back into XML string, it could be fixed by shadowing the redefined namespace binding right when buildString is called. With this change `foo.child.head.scope.toString` now returns: " xmlns:x="http://bar.com/""
* | | | | | Merge pull request #2002 from gkossakowski/bring-back-MurmurHashAdriaan Moors2013-01-292-0/+205
|\ \ \ \ \ \ | | | | | | | | | | | | | | Revert "SI-6811 Misc. removals in util, testing, io, ..."
| * | | | | | Revert "SI-6811 Misc. removals in util, testing, io, ..."Grzegorz Kossakowski2013-01-282-0/+205
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This partially reverts commit f931833df8cc69d119f636d8a553941bf7ce2349. The commit got reverted because it breaks Sbt that relies on the old implementation of MurmurHash. The new implementation got introduced in Scala 2.10 but sbt supports Scala 2.9 so there's no way to migrate it to the new implementation hence we have to keep the old one a while longer. Review by @paulp