summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Disabled SI-6987.Paul Phillips2013-01-262-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]
* Merge remote-tracking branch 'origin/2.10.x' into pr/merge-2.10Paul Phillips2013-01-2521-2/+388
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/2.10.x: SI-6969, mishandling of SoftReferences in method cache. SI-7011 Fix finding constructor type in captured var definitions SI-6987 Tests fsc verbose output SI-6987 Fixes fsc compile server verbose output SI-6231 Report unsupported free var capture by a trait. SI-6666 Restrict hidden `this` access in self/super calls. SI-6902 Check unreachability under @unchecked SI-6976 Fix value class separate compilation crasher. Closes SI-6952: add correct error positions for Dynamic feature check. Conflicts: src/compiler/scala/tools/nsc/CompileServer.scala src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala
| * Merge pull request #1956 from JamesIry/SI-7011_2.10.xJames Iry2013-01-252-0/+8
| |\ | | | | | | SI-7011 Fix finding constructor type in captured var definitions
| | * SI-7011 Fix finding constructor type in captured var definitionsJames Iry2013-01-232-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a captured var was initialized with an empty tree then finding the type of the empty tree was being handled improperly. The fix is to look for primary constructors on the tree's type symbol rather than the tree's symbol. A test is included. In order to make the problem more testable the debug logging of the issue is changed to a debug warn.
| * | Merge pull request #1946 from retronym/ticket/6231Paul Phillips2013-01-252-0/+21
| |\ \ | | | | | | | | SI-6231 Report unsupported free var capture by a trait.
| | * | SI-6231 Report unsupported free var capture by a trait.Jason Zaugg2013-01-212-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a class nested in a trait captures a free variable from the enclosing scope of the trait, the transformation to add that variable to the `init` method of the trait implementation class happens *after* the abstract trait interface has been extracted. This would lead to a crash when trying to find the corresponding interface method. This commit detects this situation and reports an implementation restriction. The enclosed test case shows a workaround. To lift this restriction, LambdaLifter should add the getters and make sure they end up in the trait interface. Looks like Martin tried this once: // LambdaLift.scala // // Disabled attempt to to add getters to freeParams // this does not work yet. Problem is that local symbols need local names // and references to local symbols need to be transformed into // method calls to setters. // def paramGetter(param: Symbol): Tree = { // val getter = param.newGetter setFlag TRANS_FLAG resetFlag PARAMACCESSOR // mark because we have to add them to interface // sym.info.decls.enter(getter) // val rhs = Select(gen.mkAttributedThis(sym), param) setType param.tpe // DefDef(getter, rhs) setPos tree.pos setType NoType // } // val newDefs = if (sym.isTrait) freeParams ::: (ps map paramGetter) else freeParams
| * | | Merge pull request #1951 from JamesIry/SI-6987_2.10.xPaul Phillips2013-01-252-0/+44
| |\ \ \ | | | | | | | | | | SI-6987 Fixes fsc compile server verbose output
| | * | | SI-6987 Tests fsc verbose outputJames Iry2013-01-222-0/+44
| | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit includes a test of fsc's verbose output. In order for it to work, CompileServer's main method had to be modified to remove a sys exit 0 at the end. It was redundant and made testing a bit harder. In order to prevent a race condition between server and client start up, this commit also adds a server callback that decrements a CountDownLatch that the main testing thread waits for. Finally, the server had to be modified to use Console.withErr and Console.withOut instead of mutating the global System.err and System.out variables. Otherwise the test would be unreliable.
| * | | Merge pull request #1938 from retronym/ticket/6666Paul Phillips2013-01-252-0/+172
| |\ \ \ | | | | | | | | | | SI-6666 Restrict hidden `this` access in self/super calls.
| | * | | SI-6666 Restrict hidden `this` access in self/super calls.Jason Zaugg2013-01-202-0/+172
| | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Detect when classes (user authored or compiler generated) local to a self or super constructor argument would require premature access to the in-construction instance. The same restriction applies for classes and objects; for objects, the premature access would result in a null via MODULE$ field. A residual error has been lodged as SI-6997. I'd like to remove calls to `Symbol#outerClass` (which relies on the flaky flag INCONSTRUCTOR, see my comments in the JIRA issue for more discussion) from `LambdaLift` and `ExplicitOuter`, and instead use the stack of active self/super calls to know when to skip an enclosing class. That will obviate that flag.
| * | | Merge pull request #1928 from retronym/ticket/6902Paul Phillips2013-01-254-0/+47
| |\ \ \ | | | | | | | | | | SI-6902 Check unreachability under @unchecked
| | * | | SI-6902 Check unreachability under @uncheckedJason Zaugg2013-01-194-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only exhaustiveness checking should be disabled if the scrutinee of a match as annotated as `: @unchecked`. This was the pre-2.10.x behaviour. This also fixes a variation of the closed ticket, SI-6011. The exhaustiveness check is needed to safely fallback from emitting a table switch if duplicate cases are detected.
| * | | | Merge pull request #1907 from namin/si-6952Paul Phillips2013-01-253-1/+20
| |\ \ \ \ | | | | | | | | | | | | Closes SI-6952: add correct error positions for Dynamic feature check.
| | * | | | Closes SI-6952: add correct error positions for Dynamic feature check.amin2013-01-163-1/+20
| | | | | |
| * | | | | Merge pull request #1902 from paulp/issue/6969Paul Phillips2013-01-252-0/+29
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-6969, mishandling of SoftReferences in method cache.
| | * | | | | SI-6969, mishandling of SoftReferences in method cache.Paul Phillips2013-01-242-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | More interesting to test than it was to fix. The soft reference is now dereferenced once, the locally stored underlying value ascertained to be non-null, and the remainder of the references to the value use the local var. The enclosed test reliably NPEs without this patch.
| * | | | | | Merge pull request #1910 from retronym/ticket/6976Paul Phillips2013-01-253-0/+44
| |\ \ \ \ \ \ | | |/ / / / / | |/| | | | | SI-6976 Fix value class separate compilation crasher.
| | * | | | | SI-6976 Fix value class separate compilation crasher.Jason Zaugg2013-01-163-0/+44
| | | |/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't guarantee that the owner of the value class is initialized, and if it isn't, the search for the companion module will turn up bubkis. This is a localized fix, but I'd be suprised if there weren't other places that suffered from the same problem. Wouldn't it be nicer to have something like: // doesn't force info sym.raw.info sym.raw.companionModule // forces info sym.info sym.companionModule
* | | | | | Merge commit 'e7ecaa00bb' into pr/merge-2.10Paul Phillips2013-01-251-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: test/partest
| * | | | | Merge pull request #1949 from khernyo/partest-scalac-opts-fixPaul Phillips2013-01-241-1/+0
| |\ \ \ \ \ | | | | | | | | | | | | | | Use the same default scalac options in all three partest frontends
| | * | | | | Use the same default scalac options in all three partest frontendsSzabolcs Berecz2013-01-221-1/+0
| | | |_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make ConsoleRunner, AntRunner and SBTRunner take scalac options from "partest.scalac_opts" property. Also remove leftover "-deprecation" option from test/partest. The change to SBTRunner was not tested as sbt test is currently broken.
| * | | | | Merge pull request #1952 from retronym/backport/1599Paul Phillips2013-01-242-0/+9
| |\ \ \ \ \ | | | | | | | | | | | | | | [backport] Fix SI-6637 (misoptimization in erasure)
| | * | | | | [backport] Fix SI-6637 (misoptimization in erasure)Jason Zaugg2013-01-232-0/+9
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit f9ef5300ab561628e53c654df9000c75f488d74a Author: Jan Niehusmann <jan@gondor.com> Date: Fri Nov 9 15:05:58 2012 +0100 Fix SI-6637 (misoptimization in erasure) Move the optimization one level deeper so the expression being tested with isInstanceOf is always evaluated. (cherry picked from commit b540aaee4ba30e2dd980456a44e8c6d732222df1)
| * | | | | Merge pull request #1953 from retronym/backport/1586Paul Phillips2013-01-243-0/+97
| |\ \ \ \ \ | | | | | | | | | | | | | | [backport] Fix unsafe array opt. / opt. primitive Array(...)
| | * | | | | [backport] Fix unsafe array opt. / opt. primitive Array(...)Jason Zaugg2013-01-233-0/+97
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SI-6611, SI-6247 (partial fix) The original commits on master were a bit circuitous, this is squashed to a neat little package. I had to add type arguments to the Array.apply calls in the test case, they are inferred on master. commit 41ff05dfdbcf032157b3509ace633f2e7a12295c Author: Jason Zaugg <jzaugg@gmail.com> Date: Sun Nov 4 14:44:59 2012 +0100 Refactor guards checking for a particular overload of Array.apply. (cherry picked from commit 092345a24c22a821204fb358d33272ae8f7353be) commit 1e5c942deccaf64f8d57bd8891b912381d7f220a Author: Jason Zaugg <jzaugg@gmail.com> Date: Sun Nov 4 14:17:25 2012 +0100 Expand optimization of Array(e1, ..., en) to primitive arrays. (cherry picked from commit 8265175ecc42293997d59049f430396c77a2b891) commit ab1bf77e39f2dfeacf3fc107ccb2907a1867f04c Author: Jason Zaugg <jzaugg@gmail.com> Date: Sat Nov 3 13:34:20 2012 +0100 SI-6611 Tighten up an unsafe array optimization The net was cast too wide and was unsafely optimizing away array copies. (cherry picked from commit dad886659faca4fba2d4937c9bc6780591b02c27) And also: Optimize primitive Array(e1, ..., en) Expands an existing optimization for reference arrays to apply to primitives, as well. Fixes one aspect of SI-6247. (cherry picked from commit cac5a08611f9511ba4d94b99db630404efae190a) Conflicts: src/compiler/scala/tools/nsc/transform/CleanUp.scala More principled tree copying. Canonical > home-spun. Conflicts: src/compiler/scala/tools/nsc/transform/CleanUp.scala
| * | | | | Merge pull request #1954 from retronym/backport/1565Paul Phillips2013-01-243-0/+19
| |\ \ \ \ \ | | | | | | | | | | | | | | [backport] SI-6567 Warning for Option(implicitView(foo))
| | * | | | | [backport] SI-6567 Warning for Option(implicitView(foo))Jason Zaugg2013-01-233-0/+19
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 284bd754fa5dfc8bc626b0c5ebe85d872dd044cb Author: Jason Zaugg <jzaugg@gmail.com> Date: Sat Nov 3 16:19:46 2012 +0100 SI-6567 Warning for Option(implicitView(foo)) I've seen the reported problem before in the wild. It seems worthy of a special warning, so long as we advocate Option.apply as an alternative to `if (x == null) Some(x) else None`. It is behind -Xlint at the moment, an option that could do with some promotion. (cherry picked from commit 0bcb9e9169146e3f589c6c9f65cc4a5523b78120)
* | | | | | Merge commit 'ac432bcde6' into pr/merge-2.10Paul Phillips2013-01-2521-11/+514
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'ac432bcde6': Fix broken build. SI-6434 Pretty print function types with by name arg as (=> A) => B Removed class files. SI-6994 Avoid spurious promiscuous catch warning Addressing warnings. SI-6439 Avoid spurious REPL warnings about companionship use ArrayBuffer instead of Array to build Formulae SI-6942 more efficient unreachability analysis use Constant::isIntRange even if it's NIH SI-6956 determine switchability by type, not tree SI-5568 Comment improvements for getClass on primitive intersection. SI-5568 Fixes verify error from getClass on refinement of value type SI-6923 Context now buffers warnings as well as errors Conflicts: src/compiler/scala/tools/nsc/interpreter/IMain.scala src/compiler/scala/tools/nsc/transform/Erasure.scala src/compiler/scala/tools/nsc/typechecker/Contexts.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala test/files/neg/t4851.check Note: This merge excludes b07228aebe7a as it breaks master.
| * | | | | Merge pull request #1929 from retronym/ticket/6439Paul Phillips2013-01-242-0/+88
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-6439 Avoid spurious REPL warnings about companionship
| | * | | | | SI-6439 Avoid spurious REPL warnings about companionshipJason Zaugg2013-01-192-0/+88
| | | |_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `val m` isn't a companion of `trait m`, check the pair of eponymous symbols are a ((class|trait), object) pair before emitting the warning. In order to correctly check this one a type alias is involved, `definedSymbols` must avoid normalizing through type aliases. AFAICT this is an improvement to the other clients of that Map, one such power mode progression is demonstrated at the end of the test case.
| * | | | | Merge pull request #1935 from retronym/ticket/6994Paul Phillips2013-01-242-0/+9
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-6994 Avoid spurious promiscuous catch warning
| | * | | | | SI-6994 Avoid spurious promiscuous catch warningJason Zaugg2013-01-202-0/+9
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | It was being issued upon re-typechecking of a transformed tree. Now we disable the warning post-typer.
| * | | | | Fix broken build.Paul Phillips2013-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | It's all system admin, all the time, here at scala ranch.
| * | | | | SI-6434 Pretty print function types with by name arg as (=> A) => BJames Iry2013-01-232-0/+18
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were pretty printing a function type with one by name arg as => A => B, but because => is right associative that's formally equivalent to => (A => B) and that's entirely a different thing. This commit changes the pretty printer in Typers.scala to check for a byname argument on a function type and wrap it in parens. A REPL test is included.
| * | | | Removed class files.Paul Phillips2013-01-212-0/+0
| | | | | | | | | | | | | | | | | | | | Someone checked in a pair of .class files.
| * | | | Merge pull request #1915 from adriaanm/ticket-6942Paul Phillips2013-01-203-0/+300
| |\ \ \ \ | | |/ / / | |/| | | SI-6942 more efficient CNF conversion in patmat analysis
| | * | | SI-6942 more efficient unreachability analysisAdriaan Moors2013-01-173-0/+300
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid blowing the stack/the analysis budget by more eagerly translating the propositions that model matches to CNF. First building a large proposition that represents the match, and then converting to CNF tends to blow the stack. Luckily, it's easy to convert to CNF as we go. The optimization relies on `CNF(P1 /\ ... /\ PN) == CNF(P1) ++ CNF(...) ++ CNF(PN)`: Normalizing a conjunction of propositions yields the same formula as concatenating the normalized conjuncts. CNF conversion is expensive for large propositions, so we push it down into the conjunction and then concatenate the resulting arrays of clauses (which is cheap). (CNF converts a free-form proposition into an `Array[Set[Lit]]`, where: - the Array's elements are /\'ed together; - and the Set's elements are \/'ed; - a Lit is a possibly negated variable.) NOTE: - removeVarEq may throw an AnalysisBudget.Exception - also reworked the interface used to build formula, so that we can more easily plug in SAT4J when the time comes
| * | | | Merge pull request #1904 from JamesIry/SI-5568_2.10.xGrzegorz Kossakowski2013-01-182-0/+25
| |\ \ \ \ | | |/ / / | |/| | | SI-5568 Fixes verify error from getClass on refinement of value type
| | * | | SI-5568 Comment improvements for getClass on primitive intersection.James Iry2013-01-151-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Based on code review here are a few comment cleanups and the removal of some dead test code.
| | * | | SI-5568 Fixes verify error from getClass on refinement of value typeJames Iry2013-01-152-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ().asInstanceOf[AnyRef with Unit].getClass and 5.asInstanceOf[AnyRef with Int].getClass would cause a verify error. Going the other way, i.e. [Unit with AnyRef] or [Int with AnyRef] worked fine. This commit fixes it that both directions work out to BoxedUnit or java.lang.Integer.
| * | | | Merge pull request #1914 from retronym/ticket/6601Grzegorz Kossakowski2013-01-173-0/+8
| |\ \ \ \ | | | | | | | | | | | | SI-6601 Publicise derived value contstructor after pickler
| | * | | | SI-6601 Publicise derived value contstructor after picklerJason Zaugg2013-01-163-0/+8
| | | |/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise the access restrictions are not enforced under separate compilation. See also SI-6608.
| * | | | Merge pull request #1854 from pufuwozu/ticket-SI-6923Paul Phillips2013-01-173-2/+21
| |\ \ \ \ | | | | | | | | | | | | SI-6923 Context now buffers warnings as well as errors
| | * | | | SI-6923 Context now buffers warnings as well as errorsBrian McKenna2013-01-073-2/+21
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code that was silently typed would not report warnings, even if it returned a successful result. This appeared in the following code which didn't show warnings even with -Ywarn-adapted-args: def foo(a: Any) = a; foo(1, 2) While the following would show the expected warning: def foo[A](a: Any) = a; foo(1, 2)
| * | | | Merge pull request #1905 from adriaanm/ticket-6956Paul Phillips2013-01-172-0/+27
| |\ \ \ \ | | |_|_|/ | |/| | | SI-6956 determine switchability by type, not tree
| | * | | SI-6956 determine switchability by type, not treeAdriaan Moors2013-01-152-0/+27
| | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Constant folding will set the type of a constant tree to `ConstantType(Constant(folded))`, while the tree itself can be many different things (in casu, an Ident). We used to look at the tree directly when deciding whether to emit a switch. Now we look at the tree's type. VoilĂ .
* | | | Revert "SI-5824 Fix crashes in reify with _*"Paul Phillips2013-01-252-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0a25ee3431d0314c782dd2e6620bc75c4de0d1a4. It came with a test failure which I overlooked.
* | | | Merge pull request #1930 from aztek/ticket/5824Paul Phillips2013-01-252-0/+9
|\ \ \ \ | | | | | | | | | | SI-5824 Fix crashes in reify with _*
| * | | | SI-5824 Fix crashes in reify with _*Evgeny Kotelnikov2013-01-222-0/+9
| | | | | | | | | | | | | | | | | | | | Reification crashes if "foo: _*" construct is used. This happens besause type tree is represented either with TypeTree, or with Ident (present case), and `toPreTyperTypedOrAnnotated' only matches of the former. The fix is to cover the latter too. A test is included.
* | | | | Merge pull request #1931 from danielhopkins/remove-pimpingPaul Phillips2013-01-256-136/+136
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | Small terminology change aimed at improving inclusion.