summaryrefslogtreecommitdiff
path: root/test/files
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #915 from gkossakowski/SI-6035-specialized-flagAdriaan Moors2012-07-173-0/+19
|\ | | | | SI-6035: Specialization and separate compilation.
| * SI-6035: Specialization and separate compilation.Grzegorz Kossakowski2012-07-163-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix an issue when specialization wouldn't work properly in a setting where separate compilation was involved. E.g. if you inherit from a class that is specialized and has been compiled separately you might not get proper forwarders generated. A test-case that this commit adds covers that scenario. The root cause of this issue was the fact that SPECIALIZED flag was not pickled. Thanks to recent Flags reorganization (see a9b85db) all that needs to be done is to set the flag before pickling. We choose to that in superaccessors phase because it's a phase that runs before pickling and after type checking (so we can check if given symbol has an annotation). Removed old logic from uncurry that was responsible for setting flags that is not needed anymore because we set them in superaccessors. Review by @axel22 and @paulp.
* | Merge pull request #910 from adriaanm/redo-847-ticket-6028Adriaan Moors2012-07-174-0/+112
|\ \ | | | | | | SI-6028 Avoid needless symbol renaming in lambdalift
| * | SI-6028 Avoid needless symbol renaming in lambdalift.Jason Zaugg2012-07-144-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Preserve names of all referenced free vars. Only the proxy symbols have the fresh names. The resulting natural beauty is evident in the diff of t6028.check. This subsumes the treatment in 0e170e4b that ensured named parameter calls cannot see mangled names; pos/t6028 confirms as much.
| * | A test case that scrutinises lambdalifter's output.Jason Zaugg2012-07-142-0/+106
| |/ | | | | | | | | | | | | | | | | | | | | No doubt there are plenty of additional variations that could be added to exercise more code paths. This is the unflattering "before" photo; the next commit will make over the name mangling and reveal the simple beauty of unmangled names. References SI-6028
* | Merge pull request #913 from gkossakowski/partest-instrumentedAdriaan Moors2012-07-163-0/+33
|\ \ | | | | | | Partest: add `instrumented` test category.
| * | Partest: add `instrumented` test category.Grzegorz Kossakowski2012-07-163-0/+33
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --- (taken from README) Tests in `instrumented/` directory are executed the same way as in `run/` but they have additional byte-code instrumentation performed for profiling. You should put your tests in `instrumented/` directory if you are interested in method call counts. Examples include tests for specialization (you want to count boxing and unboxing method calls) or high-level tests for optimizer where you are interested if methods are successfuly inlined (so they should not be called at runtime) or closures are eliminated (so no constructors of closures are called). Check `scala.tools.partest.instrumented.Instrumentation` to learn how to use the instrumentation infrastructure. The instrumentation itself is achieved by attaching a Java agent to the forked VM process that injects calls to profiler. Check `scala.tools.partest.javaagent.ProfilingAgent` for details. --- A few notes on low-level details of this change: * Partest now depends on asm library for byte-code instrumentation (`build.xml`) * Build additional jar called `scala-partest-javaagent.jar` that is used with `-javaagent:` option. (`build.xml`) * Set `-javaagent:` option for all tests in `instrumented/` directory. (`RunnerManger.scala`) * Introduce a new category of tests called `instrumented`. * Add one instrumented test to demonstrate usage and test new infrastructure itself. (`InstrumentationTest.scala`) Review by @phaller.
* | Merge pull request #876 from adriaanm/ticket-6011bAdriaan Moors2012-07-169-1/+83
|\ \ | | | | | | SI-6011 switches: unreachability, guard-free form
| * | SI-6011 switches: unreachability, guard-free formAdriaan Moors2012-07-169-1/+83
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A complete overhaul. The original implementation in SI-5830 (#821) was pretty buggy. [from the doc comment of `collapseGuardedCases`:] Collapse guarded cases that switch on the same constant (the last case may be unguarded). Cases with patterns A and B switch on the same constant iff for all values x that match A also match B and vice versa. (This roughly corresponds to equality on trees modulo alpha renaming and reordering of alternatives.) The rewrite only applies if some of the cases are guarded (this must be checked before invoking this method). The rewrite goes through the switch top-down and merges each case with the subsequent cases it is implied by (i.e. it matches if they match, not taking guards into account) If there are no unreachable cases, all cases can be uniquely assigned to a partition of such 'overlapping' cases, save for the default case (thus we jump to it rather than copying it several times). (The cases in a partition are implied by the principal element of the partition.) The overlapping cases are merged into one case with their guards pushed into the body as follows (with P the principal element of the overlapping patterns Pi): `{case Pi if(G_i) => B_i }*` is rewritten to `case P => {if(G_i) B_i}*` The rewrite fails (and returns Nil) when: (1) there is a subsequence of overlapping cases that has an unguarded case in the middle; only the last case of each subsequence of overlapping cases may be unguarded (this is implied by unreachability) (2) there are overlapping cases that differ (tested by `caseImpliedBy`) cases with patterns A and B are overlapping if for SOME value x, A matches x implies B matches y OR vice versa <-- note the difference with case equality defined above for example `case 'a' | 'b' =>` and `case 'b' =>` are different and overlapping (overlapping and equality disregard guards) Improved by @retronym's feedback in the following ways: - fix patternEquals (it's now quadratic, but correct) - update neg/t6011 to test the improved patternEquals - remove side-effect-in-condition ugliness - introduce isGuardedCase - docs & various code clarity Also closes SI-6048 (duplicate).
* | Merge pull request #897 from lrytz/t5956Adriaan Moors2012-07-163-5/+23
|\ \ | |/ |/| SI-5956 trigger copy generation with correct namer
| * SI-5956 trigger copy generation with correct namerLukas Rytz2012-07-133-5/+23
| | | | | | | | | | | | the call to `addCopyMethod` passes `templateNamer`, which is supposed to be the namer of the case class template. with two classes of the same name, `addCopyMethod` was triggered in the wrong template.
* | Merge pull request #902 from paulp/topic/name-implicitsAdriaan Moors2012-07-144-0/+35
|\ \ | | | | | | Implicits to encourage more Name-dropping.
| * \ Merge branch '2.10.x' into topic/name-implicitsPaul Phillips2012-07-1348-347/+946
| |\ \
| * | | Implicits to encourage more Name-dropping.Paul Phillips2012-07-064-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This creates implicits in cakes across the land from: String => TermName String => TypeName And also from: Name => NameOps[Name] // lower priority TermName => NameOps[TermName] TypeName => NameOps[TypeName] What this is all about, using "drop" as a motivating example, is that these should all work: "abc" drop 1 // "bc": String ("abc": TermName) drop 1 // "bc": TermName ("abc": TypeName) drop 1 // "bc": TypeName (("abc": TypeName): Name) drop 1 // "bc": Name But this should not: ("bc": Name) // ambiguity error This requires drop not being directly on Name; peer implicits from String => TermName and String => TypeName; implicit classes to install drop on TermName and TypeName; and a lower priority implicit class to allow ops on Names. Review by @xeno.by .
* | | | SI-5957 enable direct parsing of nested java class classfileLukas Rytz2012-07-122-0/+17
| |_|/ |/| | | | | | | | by weakening an assertion. explained in the source comment.
* | | Merge pull request #874 from adriaanm/ticket-6022Adriaan Moors2012-07-112-0/+8
|\ \ \ | | | | | | | | SI-6022 model type-test-implication better
| * | | SI-6022 model type-test-implication betterAdriaan Moors2012-07-112-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | we use subtyping as a model for implication between instanceof tests i.e., when S <:< T we assume x.isInstanceOf[S] implies x.isInstanceOf[T] unfortunately this is not true in general. SI-6022 expects instanceOfTpImplies(ProductClass.tpe, AnyRefClass.tpe), but ProductClass.tpe <:< AnyRefClass.tpe does not hold because Product extends Any however, if x.isInstanceOf[Product] holds, so does x.isInstanceOf[AnyRef], and that's all we care about when modeling type tests
* | | | Merge branch '2.10.x' into topic/pickledflagsPaul Phillips2012-07-1130-43/+359
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | Conflicts: src/reflect/scala/reflect/internal/Flags.scala
| | | |
| | \ \
| | \ \
| | \ \
| | \ \
| | \ \
| | \ \
| | \ \
| *-------. \ \ Merge commit 'refs/pull/825/head'; commit 'refs/pull/827/head'; commit ↵Adriaan Moors2012-07-1130-43/+359
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 'refs/pull/828/head'; commit 'refs/pull/850/head'; commit 'refs/pull/858/head' into 2.10.x
| | | | | * | | | SI-6042 Improve type selection from volatile type errorJason Zaugg2012-07-082-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Display the type of the typed qualifier (qual1), to avoid the message "Illegal type selection from volatile type null". - Show the upper bound, which is used to calculate the volatility.
| | | | * | | | | SI-5974 make collection.convert.Wrappers serializableLukas Rytz2012-07-052-0/+11
| | | | | | | | |
| | | * | | | | | Allow attachments for symbols, just like for trees.Lukas Rytz2012-07-057-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes the two global hash maps in Namers, and the one in NamesDefaults. Also fixes SI-5975.
| | | * | | | | | Enhanced presentation compiler test infrastructureMirco Dotta2012-07-057-35/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Removed unneeded .flags. * Renamed a few methods in `InteractiveTest`. * Force the presentation compiler to shut down after each test. * -sourcepath in the .flags file is now relative to the test's base directory. * Use `InteractiveReporter` in Presentation Compiler tests. By using the `InteractiveReporter`, compilation errors are collected in the compilation unit. This was necessary for testing SI-5975.
| | * | | | | | | stringinterpolation macro test filesAdriaan Moors2012-07-064-0/+266
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds test files neg: checks the error messages generated by the compiler run: checks the macro implementation features
| | * | | | | | | adds the sha1 files of the new starr / stringContext.fDominik Gruntz2012-07-068-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit provides the new sha1 codes of the new STARR. Moreover, it replaces the implementation of StringContext.f to `macro ???`. The implementation is magically hardwired into `scala.tools.reflect.MacroImplementations.macro_StringInterpolation_f` by the new STARR.
* | | | | | | | | Pickled flag reorgMartin Odersky2012-07-117-11/+7
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleaned up and optimized code that maps between raw and pickled flags. Avoids mystery constants. Makes a whole bunch of new flags be pickled which were not pickled before (more precisely: Everything in InitialFlags with value greater than 1 << 31 which is not in FlagsNotPickled now gets pickled whereas before it wasn't. Among these: VARARGS, IMPLCLASS, SPECIALZED, DEFAULTINIT, SYNCHRONIZED. I am curious how many tickets will get fixed by this change. The first one I noted is t5504, which previously enforced the buggy behavior through a neg check! There are also some build manager check file changes that have to do with the fact that flags now print in a different order for performance reasons.
* | | | | | | | Merge pull request #856 from havocp/sip14-execution-changesAdriaan Moors2012-07-104-112/+233
|\ \ \ \ \ \ \ \ | |_|_|_|_|/ / / |/| | | | | | | Collection of updates to SIP-14 (scala.concurrent)
| * | | | | | | Collection of updates to SIP-14 (scala.concurrent)Havoc Pennington2012-07-094-112/+233
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Developed by Viktor Klang and Havoc Pennington - add Promise.isCompleted - add Future.successful and Future.failed - add ExecutionContextExecutor and ExecutionContextExecutorService for Java interop - remove defaultExecutionContext as default parameter value from promise and future - add ExecutionContext.Implicits.global which must be explicitly imported, rather than the previous always-available value for the implicit EC - remove currentExecutionContext, since it could create bugs by being out of sync with the implicit ExecutionContext - remove Future task batching (_taskStack) and Future.releaseStack This optimization should instead be implemented either in a specific thread pool or in a specific ExecutionContext. Some pools or ExecutionContexts may not want or need it. In this patch, the defaultExecutionContext does not keep the batching optimization. Whether it should have it should perhaps be determined through benchmarking. - move internalBlockingCall to BlockContext and remove currentExecutionContext In this patch, BlockContext must be implemented by Thread.currentThread, so the thread pool is the only place you can add custom hooks to be run when blocking. We implement BlockContext for the default ForkJoinWorkerThread in terms of ForkJoinPool.ManagedBlocker. - add public BlockContext.current and BlockContext.withBlockContext These allow an ExecutionContext or other code to override the BlockContext for the current thread. With this API, the BlockContext is customizable without creating a new pool of threads. BlockContext.current is needed to obtain the previous BlockContext before you push, so you can "chain up" to it if desired. BlockContext.withBlockContext is used to override the context for a given piece of code. - move isFutureThrowable into impl.Future - add implicitNotFound to ExecutionContext - remove default global EC from future {} and promise {} - add ExecutionContext.global for explicit use of the global default EC, replaces defaultExecutionContext - add a timeout to scala-concurrent-tck tests that block on SyncVar (so tests time out rather than hang) - insert blocking{} calls into concurrent tck to fix deadlocking - add NonFatal.apply and tests for NonFatal - add OnCompleteRunnable marker trait This would allow an ExecutionContext to distinguish a Runnable originating from Future.onComplete (all callbacks on Future end up going through onComplete). - rename ListenerRunnable to CallbackRunnable and use for KeptPromise too Just adds some clarity and consistency.
* | | | | | | | Removing the actor migration undeterministic test.Vojin Jovanovic2012-07-091-188/+0
|/ / / / / / /
* | | | | | | New logic for TermSymbol.resolveOverloadedclhodapp2012-07-089-2/+319
| | | | | | |
* | | | | | | Merge pull request #843 from scalamacros/ticket/6036Adriaan Moors2012-07-082-0/+33
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-6036 yet again makes sense of magic symbols
| * | | | | | | SI-6036 yet again makes sense of magic symbolsEugene Burmako2012-07-062-0/+33
| |/ / / / / /
* | | | | | | Merge pull request #838 from adriaanm/ticket-2442Adriaan Moors2012-07-071-1/+1
|\ \ \ \ \ \ \ | |_|_|_|/ / / |/| | | | | | SI-2442 sealedness for java enums non-experimental
| * | | | | | SI-2442 sealedness for java enums non-experimentalAdriaan Moors2012-07-061-1/+1
| |/ / / / /
* | | | | / Tweak test to pass under java 7.Paul Phillips2012-07-061-1/+1
| |_|_|_|/ |/| | | |
* | | | | Merge pull request #834 from paulp/issue/3836-2Adriaan Moors2012-07-063-0/+55
|\ \ \ \ \ | |/ / / / |/| | | | Fix SI-3836 not-really-ambiguous import detection.
| * | | | Fix SI-3836 not-really-ambiguous import detection.Paul Phillips2012-07-053-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | Normalize types before declaring that two imports are ambiguous, because they might be the same thing. Review by @moors.
* | | | | Merge pull request #830 from heathermiller/topic/tryeither-fixesAdriaan Moors2012-07-065-87/+330
|\ \ \ \ \ | |_|_|_|/ |/| | | | SI-5981, SI-5979, SI-5973, SI-5890 Closed. Maintenance to Try.
| * | | | SI-5981, SI-5979, SI-5973 Closed. Maintenance to Try.Heather Miller2012-07-055-87/+330
| | | | |
* | | | | Merge pull request #824 from adriaanm/ticket-4691_6008Adriaan Moors2012-07-066-1/+61
|\ \ \ \ \ | | | | | | | | | | | | [SI-4691, SI-6008] improve patmat analyses: irrefutable user-defined extractors, no-op type tests
| * | | | | SI-6008 use static knowledge of success of type testsAdriaan Moors2012-07-053-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | augment the equality axioms to take into account that a type test against the static type of a variable succeeds unless the variable is null for exhaustivity we disregard null, so the type test always succeeds during unreachability we model this knowledge as the obvious implication
| * | | | | SI-4691 exhaustivity: `unapply: Some` = irrefutableAdriaan Moors2012-07-053-0/+47
| |/ / / / | | | | | | | | | | | | | | | overhauls treeMakersToConds in the process -- was getting a bit unwieldy
* | | | | Merge pull request #826 from lrytz/t5907Adriaan Moors2012-07-064-5/+152
|\ \ \ \ \ | | | | | | | | | | | | SI-5907, SI-5009 case-class copy defaults only for first param list
| * | | | | SI-5907, SI-5009 case-class copy defaults only for first param listLukas Rytz2012-07-054-5/+152
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | `copy` no longer returns anonymous functions if there are multiple parameter lists, reverts most of 40e7cab7a2. Cleaned up the special type completer for copy methods.
* | | | | Merge pull request #822 from scalamacros/ticket/5959Adriaan Moors2012-07-062-0/+75
|\ \ \ \ \ | |_|_|/ / |/| | | | SI-5959 type equality now accounts for mirrors
| * | | | SI-5959 type equality now accounts for mirrorsEugene Burmako2012-07-042-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TypeRef(ThisType(<package1>), sym, args) should always be equal to TypeRef(ThisType(<package2>), sym, args) regardless of whether package1 and package2 actually represent the same symbols of not. This goes for subtyping (<:<) and type equality (=:=). However regular equality (==) and hashconsing is unaffected as per http://groups.google.com/group/scala-internals/browse_thread/thread/4bef4e6987bb68fe This is done to account for the fact that mirrors share normal symbols, but never share package symbols. Therefore at times it will occur that the same types loaded by different mirrors appear different because of the package symbols. More details: https://issues.scala-lang.org/browse/SI-5959.
* | | | | SI-6033 Closed. Provides implicit conversion from java.math.BigInteger to BigIntDominik Gruntz2012-07-051-0/+5
| |_|/ / |/| | |
* | | | Merge pull request #821 from adriaanm/64acb46ab7Adriaan Moors2012-07-059-35/+109
|\ \ \ \ | | | | | | | | | | SI-5830 switches: support guards, unreachability
| * | | | SI-5830 switches: support guards, unreachabilityAdriaan Moors2012-07-039-35/+109
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | turn switches with guards into guard-free switches by collecting all cases that are (possibly) guarded by different guards but that switch on the same constant, and pushing the implied if-then-else into the collapsed case body ``` case C if G1 => B1 case C if Gi => Bi case C if GN => BN ``` becomes ``` case C => if (G1) B1 else if (Gi) Bi else if (GN) BN else default() // not necessary if GN == EmptyTree ``` default() is a jump to the default case; to enable this, we wrap a default() { } labeldef around the last case's body (the user-defined default or the synthetic case that throws the matcherror) so we can jump to the default case after the last guard is checked (assuming unreachability is checked, once we ended up in a non-default case, one of the guards either matches or we go to the default case) the unreachability analysis is minimal -- we simply check (after rewriting to guard-free form) that: - there are no duplicate cases - the default case comes last misc notes: - can't jump in exception handlers (TODO: a more fine-grained analysis on when we need to jump) - work around SI-6015 (test file run/t5830.scala crashed the inliner) - propagate type of case body to label def of default case (needed for existentials, see e.g., t2683) - the default(){} LabelDef breaks SelectiveANFTransform -- workaround: don't write guarded switches in CPS code (do the above transformation manually)
* | | | Merge pull request #777 from retronym/ticket/2796Adriaan Moors2012-07-043-0/+33
|\ \ \ \ | | | | | | | | | | SI-2796 Warn if early definitions are used with a trait.