summaryrefslogtreecommitdiff
path: root/test/files/specialized
Commit message (Collapse)AuthorAgeFilesLines
* SI-9847 Nuance pure expr statement warningSom Snytt2016-07-083-4/+4
| | | | | | | | | | Clarify the current warning, which means that an expression split over multiple lines may not be parsed as naively expected. When typing a block, attempt minor nuance. For instance, a single expression is not in need of parens. Try to avoid duplicate warnings for expressions that were adapted away from result position.
* Fix minor typoNafer Sanabria2016-04-041-1/+1
|
* SI-9571 Avoid boxing primitives in string concatenationMarko Elezovic2016-02-061-1/+1
|
* Fix 36 typos (d-f)Janek Bogucki2015-06-211-1/+1
|
* Make specialization aware of anonymous functions.James Iry2013-11-062-0/+18
| | | | | | | | During development of late delmabdafying there was a problem where specialization would undo some of the work done in uncurry if the body of the lambda had a constant type. That would result in a compiler crash as when the delambdafy phase got a tree shape it didn't understand. This commit has a fix and a test.
* Cull extraneous whitespace.Paul Phillips2013-09-1814-49/+49
| | | | | | | | | | | | | | | | | | | | | One last flurry with the broom before I leave you slobs to code in your own filth. Eliminated all the trailing whitespace I could manage, with special prejudice reserved for the test cases which depended on the preservation of trailing whitespace. Was reminded I cannot figure out how to eliminate the trailing space on the "scala> " prompt in repl transcripts. At least reduced the number of such empty prompts by trimming transcript code on the way in. Routed ConsoleReporter's "printMessage" through a trailing whitespace stripping method which might help futureproof against the future of whitespace diseases. Deleted the up-to-40 lines of trailing whitespace found in various library files. It seems like only yesterday we performed whitespace surgery on the whole repo. Clearly it doesn't stick very well. I suggest it would work better to enforce a few requirements on the way in.
* Merge 2.10.x into masterAdriaan Moors2013-06-283-1/+59
|\ | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/typechecker/Duplicators.scala src/library/scala/concurrent/Future.scala test/files/jvm/scala-concurrent-tck.scala
| * SI-7343 Fixed phase ordering in specializationVlad Ureche2013-06-123-1/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specialization rewires class parents during info transformation, and the new info then guides the tree changes. But if a symbol is created during duplication, which runs after specialization, its info is not visited and thus the corresponding tree is not specialized. One manifestation is the following: ``` object Test { class Parent[@specialized(Int) T] def spec_method[@specialized(Int) T](t: T, expectedXSuper: String) = { class X extends Parent[T]() // even in the specialized variant, the local X class // doesn't extend Parent$mcI$sp, since its symbol has // been created after specialization and was not seen // by specialzation's info transformer. ... } } ``` We can fix this by forcing duplication to take place before specialization. Review by @dragos, @paulp or @axel22.
* | SI-7344 Specialize methods in private scopesVlad Ureche2013-06-281-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This performs method specialization inside a scope other than a {class, trait, object}: could be another method or a value. This specialization is much simpler, since there is no need to record the new members in the class signature, their signatures are only visible locally. It works according to the usual logic: - we use normalizeMember to create the specialized symbols - we leave DefDef stubs in the tree that are later filled in by tree duplication and adaptation The solution is limited by SI-7579: since the duplicator loses the sym annotations when duplicating, this expansion and rewiring can only take place in code that has not been subject to duplication. You can see the test case for an example. Review by @dragos, @paulp or @axel22.
* | SI-7003 Partest redirects stderr to log fileSom Snytt2013-05-256-5/+22
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some scalac output is on stderr, and it's useful to see that in the log file, especially for debugging. Adds a line filter for logs, specified as "filter: pattern" in the test source. Backslashes are made forward only when detected as paths. Test alignments: Deprecations which do not pertain to the system under test are corrected in the obvious way. When testing deprecated API, suppress warnings by deprecating the Test object. Check files are updated with useful true warnings, instead of running under -nowarn. Language feature imports as required, instead of running under -language. Language feature not required, such as casual use of postfix. Heed useful warning. Ignore broken warnings. (Rarely, -nowarn.) Inliner warnings pop up under -optimise only, so for now, just filter them out where they occur. Debug output from the test required an update.
* 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.
* removes array tagsEugene Burmako2012-06-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before 2.10 we had a notion of ClassManifest that could be used to retain erasures of abstract types (type parameters, abstract type members) for being used at runtime. With the advent of ClassManifest (and its subtype Manifest) it became possible to write: def mkGenericArray[T: Manifest] = Array[T]() When compiling array instantiation, scalac would use a ClassManifest implicit parameter from scope (in this case, provided by a context bound) to remember Ts that have been passed to invoke mkGenericArray and use that information to instantiate arrays at runtime (via Java reflection). When redesigning manifests into what is now known as type tags, we decided to explore a notion of ArrayTags that would stand for abstract and pure array creators. Sure, ClassManifests were perfectly fine for this job, but they did too much - technically speaking, one doesn't necessarily need a java.lang.Class to create an array. Depending on a platform, e.g. within JavaScript runtime, one would want to use a different mechanism. As tempting as this idea was, it has also proven to be problematic. First, it created an extra abstraction inside the compiler. Along with class tags and type tags, we had a third flavor of tags - array tags. This has threaded the additional complexity though implicits and typers. Second, consequently, when redesigning tags multiple times over the course of Scala 2.10.0 development, we had to carry this extra abstraction with us, which exacerbated the overall feeling towards array tags. Finally, array tags didn't fit into the naming scheme we had for tags. Both class tags and type tags sound logical, because, they are descriptors for the things they are supposed to tag, according to their names. However array tags are the odd ones, because they don't actually tag any arrays. As funny as it might sound, the naming problem was the last straw that made us do away with the array tags. Hence this commit.
* repairs the tests after the refactoring spreeEugene Burmako2012-06-081-1/+3
|
* Add the first iteration of the `util.hashing` package.Aleksandar Prokopec2012-06-072-60/+0
| | | | | | | | | | | | | | | | | Move `MurmurHash3` to `util.hashing`. Make the `class` private and retain a public companion `object`, and put the `MurmurHash3.Hashing` implementations for various types in the companion. Add a method which composes `ByteswapHashing` with some other hashing. Rename `hashOf` to `hash`. Fix chi-square test in a test-case. Review by @jsuereth. Moved a failing test that seems to use some other library version to pending.
* Clutch modification to tree printing.Paul Phillips2012-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | Don't print trees under -Xprint:all if they're identical to the tree printed at the previous phase. It only works for a single compilation unit but that is a huge step forward for us debuggers. For instance this file: trait Foo { def f = 5 } used to produce 332 lines of output and now produces 92, with zero loss of information. It ends with: [[syntax trees at end of cleanup]] // a.scala: tree is unchanged since mixin [[syntax trees at end of icode]] // a.scala: tree is unchanged since mixin [[syntax trees at end of inliner]] // a.scala: tree is unchanged since mixin [[syntax trees at end of inlineExceptionHandlers]] // a.scala: tree is unchanged since mixin [[syntax trees at end of closelim]] // a.scala: tree is unchanged since mixin [[syntax trees at end of dce]] // a.scala: tree is unchanged since mixin [[syntax trees at end of jvm]] // a.scala: tree is unchanged since mixin
* resurrects manifests in their pre-2.10 gloryEugene Burmako2012-04-232-0/+82
|
* migrates stdlib and compiler to tagsEugene Burmako2012-04-232-8/+8
| | | | | * all usages of ClassManifest and Manifest are replaced with tags * all manifest tests are replaced with tag tests
* virtpatmat on by default; chicken out: -XoldpatmatAdriaan Moors2012-04-141-1/+1
| | | | | | | some tests (unreachability, exhaustivity, @switch annotation checking) are still run under -Xoldpatmat, but that will change before we go into RC mode (then the test/ partest of this commit will be reverted) removed irrelevant dependency on patmat
* New starr to support new fundamental laws of reality.Paul Phillips2012-03-141-2/+2
| | | | | | | | | | And grueling recovery from branch drift. Merges a portion (and only a portion) of topic/inline into master. The major changes which come with this merge are: AnyVal is unsealed, can be extended directly. ScalaObject is no longer with us.
* Prevent extaneous output in SI-5005Vlad Ureche2012-02-161-1/+5
|
* Added test files to verify previous commit.Erik Osheim2012-02-152-0/+56
| | | | | | | | | | Tests scalac -optimize -Xprint:specialize -Ylog:inliner output to verify that final/@inline + specialization are being handled correctly (that is, the original class' specialized methods should not be final/@inline, but its specialized subclass' should be). This test was written by Vlad Ureche based on the bug report in SI-5005.
* Specialization action.Paul Phillips2012-02-143-22/+9
| | | | | | | | | | | | | | | | | | | | | The crickets at http://www.scala-lang.org/node/11901 were in unanimous agreement that I should proceed as suggested. - No arguments to @specialize gets you 10/10, not 9/10 - Fixed bugs in AnyRef specialization revealed by trying to use it - Specialized Function1 on AnyRef. - Changed AnyRef specialization to use OBJECT_TAG, not TVAR_TAG. - Deprecated SpecializableCompanion in favor of Specializable, which has the virtue of being public so it can be referenced from outside the library. - Cooked up mechanism to group specializable types so we don't have to repeat ourselves quite so much, and create a few groups for illustrative purposes. I'm not too serious about those names but I used up all my name-thinking-up brain for the day. - Updated genprod and friends since I had to regenerate Function1. - Put tests for a bunch of remaining specialization bugs in pending. Closes SI-4740, SI-4770, SI-5267.
* Make specialization pick up opportunities when the Iulian Dragos2012-01-172-0/+31
| | | | | | specialized method has additional (non-specialized) type parameters. This fix comes from Stefan's desire to specialize HLists (see corresponding test). review by @prokopec
* Begone t1737...Hubert Plociniczak2011-11-0211-44/+44
|
* Fix for NumericRange boundary condition.Paul Phillips2011-10-311-1/+1
| | | | | Contributed by Thomas Switzer. Closes SI-4985, no review.
* Removing the code which has been deprecated sin...Paul Phillips2011-08-151-1/+1
| | | | | | | Removing the code which has been deprecated since 2.8.0. Contributed by Simon Ochsenreither, although deleting code is such fun one hesitates to call it a contribution. Still, we will. Closes SI-4860, no review.
* Making Range creation less slow, no review.Paul Phillips2011-05-211-1/+1
|
* Added a temporary fix for #4351, but disabled i...Aleksandar Pokopec2011-03-242-0/+21
| | | | | | | | | | | | | Added a temporary fix for #4351, but disabled it because the extend specialized class with nonspecialized type-parameters is used in the stdlib already. Disabling scala.parallel package, adding the currently disabled scala.concurrent package which will be implemented in some of the next releases. Review by phaller.
* Adding some tests for #3651.Aleksandar Pokopec2011-03-224-0/+28
| | | | | No review.
* Some boundary conditions in range.Paul Phillips2011-03-191-1/+1
| | | | | | | infix implicits to Integral and Fractional. As a bonus this patch knocked 10,000 long boxings off a specialized test. Who knew. Closes #4308, #4321, review by community.
* Always forget that checking system properties c...Paul Phillips2011-03-171-6/+5
| | | | | | | | | Always forget that checking system properties causes exceptions in applets and such. Made the system property wrapper wrap its access checks in some more wrapping. I spent a long time trying to write a test for the security manager but it's hopeless without knowing all the details of the test environment. Closes #4346, no review.
* Modify BufferedSource to use a BufferedLineIter...Donna Malayeri2011-03-071-1/+1
| | | | | | | Modify BufferedSource to use a BufferedLineIterator to speed up line-by-line reads on large files. Updated testfile which used this class. Closes #4186. Review (of fft.check) by prokopec.
* Renamed Application to App.Martin Odersky2011-02-212-2/+2
|
* A missing test.Aleksandar Pokopec2011-02-092-0/+52
| | | | | No review
* Added a test case for anyref specialization.Aleksandar Pokopec2011-02-092-0/+59
|
* Removed the probe for integers in spec-matrix.Iulian Dragos2011-01-192-2/+1
|
* Allow box(unbox) elimination for the Null type,...Iulian Dragos2011-01-185-8/+65710
| | | | | | Allow box(unbox) elimination for the Null type, plus testing that specialization tests do not box too much. review by extempore.
* Disabled failing specialization test.Aleksandar Pokopec2011-01-172-3/+0
| | | | | No review.
* Added specialized test to ant build, and ported...Aleksandar Pokopec2011-01-171-1/+1
| | | | | | | | Added specialized test to ant build, and ported old specialized 'run' tests to check the number of boxings. No review.
* Adapted specialization tests to track number of...Aleksandar Pokopec2011-01-1720-0/+373
| | | | | | | Adapted specialization tests to track number of boxings. Review by dragos
* Added 'specialized' tests.Aleksandar Pokopec2011-01-171-0/+10
Added a new test group - specialized. Modified partest to add a jar with instrumented classes to classpath when compiling and running tests. Added a primary version of the instrumented BoxesRuntime, and a script to produce a jar for it. Added the 'speclib' folder to partest files, which contains the jar with the instrumented classes. Review by dragos.