summaryrefslogtreecommitdiff
path: root/test/files/run
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | Merge pull request #3982 from retronym/ticket/8845Lukas Rytz2014-10-062-0/+18
|\ \ \ \ \ | |_|/ / / |/| | | | SI-8845 Control flow pot-pourri crashes GenASM, but not -BCode
| * | | | SI-8845 Control flow pot-pourri crashes GenASM, but not -BCodeJason Zaugg2014-10-012-0/+18
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given that we'll switch to GenBCode in 2.12, the test case showing the bug is fixed under that option is all I plan to offer for this bug. The flags file contains `-Ynooptimize` to stay locked into `GenBCode`.
* | | | Merge pull request #4010 from lrytz/t8087Jason Zaugg2014-10-011-0/+12
|\ \ \ \ | |/ / / |/| | | SI-8087 keep annotations on mixed-in private[this] fields
| * | | SI-8087 keep annotations on mixed-in private[this] fieldsLukas Rytz2014-09-301-0/+12
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Related to SI-2511 / eea7956, which fixed the same issue for non `private[this]` fields. If you have trait T { private[this] val f = 0 } class C extends T Mixin geneartes an accessor method `T.f` with owner `T`. When generating the field in `C`, the Mixin.mixinTraitMembers calls `fAccessor.accessed`. The implementation of `accessed` does a lookup for a member named `"f "` (note the space). The bug is that `private[this]` fields are not renamed to have space (`LOCAL_SUFFIX_STRING`) in their name, so the accessed was not found, and no annotations were copied from it.
* | | Merge pull request #4011 from lrytz/t8445-6622Jason Zaugg2014-09-304-0/+72
|\ \ \ | | | | | | | | SI-8445, SI-6622 test cases, already fixed
| * | | SI-8445, SI-6622 test cases, already fixedLukas Rytz2014-09-294-0/+72
| |/ / | | | | | | | | | | | | | | | | | | | | | They were most likely fixed in #3931 / e3107465c3. The test case for SI-6622 is taken from Jason's PR #2654. I adjusted the EnclosingMethod to be `null` in two places in the check file, for the classes that are owned by fields (not methods).
* / / Cleanup a few flags in test/files/Antoine Gourlay2014-09-293-3/+0
|/ / | | | | | | | | | | | | | | | | | | * String interpolation isn't Xexperimental anymore A few useless Xexperimental flags in tests were left behind by 6917cca, after string interpolation was made non-experimental in 983f414. * things added under -Xfuture in 2.10 are very much Xpresent now, the flag isn't needed anymore.
* / SI-8852 Support joint compilation of Java interfaces w. staticsJason Zaugg2014-09-181-0/+34
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had to change the java parser to accomodate this language change in Java 8. The enclosed test does not require JDK8 to run, it only tests JavaParsers. Here is a transcript of my manual testing using Java 8. ``` % tail test/files/run/8852b/{Interface.java,client.scala} ==> test/files/run/8852b/Interface.java <== public interface Interface { public static int staticMethod() { return 42; } } ==> test/files/run/8852b/client.scala <== object Test extends App { assert(Interface.staticMethod() == 42) } // Under separate compilation, statics in interfaces were already working % rm /tmp/*.class 2> /dev/null; javac -d /tmp test/files/run/8852b/Interface.java && scalac-hash v2.11.2 -classpath /tmp -d /tmp test/files/run/8852b/client.scala && scala-hash v2.11.2 -classpath /tmp -nc Test // Under joint compilation, statics in interfaces now work. % rm /tmp/*.class 2> /dev/null; qscalac -d /tmp test/files/run/8852b/{client.scala,Interface.java} && javac -d /tmp test/files/run/8852b/Interface.java && qscala -classpath /tmp -nc Test ```
* Merge pull request #3848 from Ichoran/issue/8680Lukas Rytz2014-09-161-0/+53
|\ | | | | SI-8680 Stream.addString is too eager
| * SI-8680 Stream.addString is too eagerRex Kerr2014-09-121-0/+53
| | | | | | | | | | | | | | | | | | | | Used the standard method of sending out two iterators, one twice as fast as the others, to avoid hanging on .force, .hasDefiniteSize, and .addString. .addString appends a "..." as the last element if it detects a cycle. It knows how to print the cycle length, but there's no good way to specify what you want right now, so it's not used. Added tests in t8680 that verify that cyclic streams give the expected results. Added to whitelist names of methods formerly used for recursion (now looping).
* | Merge pull request #3972 from lrytz/BCodeDelambdafyFixJason Zaugg2014-09-164-0/+11
|\ \ | | | | | | isAnonymousClass/Function for delambdafy classes is not true
| * | isAnonymousClass/Function for delambdafy classes is not trueLukas Rytz2014-09-124-0/+11
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Ydelambdafy:method lambda classes are not anonymous classes, and not anonymous function classes either. They are somethig new, so there's a new predicate isDelambdafyFunction. They are not anonymous classes (or functions) because anonymous classes in Java speak are nested. Delambdafy classes are always top-level, they are just synthetic. Before this patch, isAnonymous was sometimes accidentailly true: if the lambda is nested in an anonymous class. Now it's always false.
* | Address review feedback.Lukas Rytz2014-09-111-1/+3
| |
* | Clarify why we emit ATHROW after expressions of type NothingLukas Rytz2014-09-107-0/+187
|/ | | | Tests for emitting expressions of type Nothing.
* Merge pull request #3938 from gourlaysama/wip/t8764Grzegorz Kossakowski2014-09-093-0/+22
|\ | | | | SI-8764 fix return type of case class productElement under Xexperimental
| * [nomaster] SI-8764 fix return type of case class productElement under ↵Antoine Gourlay2014-09-093-0/+22
| | | | | | | | | | | | | | | | | | | | Xexperimental Under Xexperimental, productElement now returns the lub instead of the weak lub of case class parameter types (numeric widening shouldn't magically happen *inside* productElement). This was removed from 2.12.x in 6317ae2.
* | Merge pull request #3935 from lrytz/t8803Jason Zaugg2014-09-052-0/+73
|\ \ | | | | | | SI-8803 generate super accessor for super[A], if A is outer superclass
| * | SI-8803 generate super accessor for super[A], if A is outer superclassLukas Rytz2014-08-202-0/+73
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | class C extends A with T { class I { C.super[T] C.super[A] } } A super call in a nested class of the form super[T] where T is a parent trait of the outer class doesn't need an accessor: mixin can directly re-route the call to the correct implementation class - it's statically known to be T$class. However, if a nested class accesses super[A] and A is the superclass of the outer class (not a trait), then we need a super accessor in the outer class. We need to add the mixin name to the super accessor name, otherwise it clashes with non-qualified super accessors.
* | Merge pull request #3948 from retronym/ticket/8823Grzegorz Kossakowski2014-09-021-0/+10
|\ \ | | | | | | SI-8823 Exclude specialized methods from extension method rewrite
| * | SI-8823 Exclude specialized methods from extension method rewriteJason Zaugg2014-08-271-0/+10
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | If a value class extends a specialized class, it can sprout specialized members after the specialization info transformer has run. However, we only install extension methods for class members we know about at the extmethods phase. This commit simply disables rewiring calls to these methods in erasure to an extention method. This follows the approach taken from super accessors. Note: value class type parameters themselves currently are not allowed to be specialized.
* | Merge pull request #3931 from lrytz/opt/tracked-finalLukas Rytz2014-09-011-1/+1
|\ \ | | | | | | GenBCode refactoring (remove Tracked) and fix InnerClass / EnclosingMethod attributes
| * | Fix InnerClass / EnclosingMethod attributesLukas Rytz2014-09-011-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit seems bigger than it is. Most of it is tests, and moving some code around. The actual changes are small, but a bit subtle. The InnerClass and EnclosingMethod attributes should now be close to the JVM spec (which is summarized in BTypes.scala). New tests make sure that changes to these attributes, and changes to the way Java reflection sees Scala classfiles, don't go unnoticed. A new file, BCodeAsmCommon, holds code that's shared between the two backend (it could hold more, future work). In general, the difficulty with emitting InnerClass / EnclosingMethod is that we need to find out source-level properties. We need to make sure to do enough phase-travelling, and work around destructive changes to the ownerchain in lambdalift (we use originalOwner a lot). The change to JavaMirrors is prompted by the change to the EnclosingMethod attribute, which changes Java reflection's answer to getEnclosingMethod and getEnclosingConstructor. Classes defined in field initializers no longer have an enclosing method, just an enclosing class, which broke an assumption in JavaMirrors. There's one change in erasure. Before this change, when an object declaration implements / overrides a method, and a bridge is required, then the bridge method was actually a ModuleSymbol (it would get the lateMETHOD flag and be emitted as a method anyway). This is confusing, when iterating through the members of a class, you can find two modules with the same name, and one of them doesn't have a module class. Now, such bridge methods will be MethodSymbols. Removed Symbol.originalEnclosingMethod, that is a backend thing and doesn't need to live in the symbol API.
* / SI-8627 make Stream.filterNot non-eagerLukas Rytz2014-08-271-1/+1
|/ | | | | | | | | | | | | | | | The obvious fix, overriding `filterNot` in Stream, is not binary compatible, see https://github.com/scala/scala/pull/3925 Instead, this makes `filterImpl` in TaversableLike private[scala], which allows overriding it in Stream. The corresponding mima-failures can be whitelisted, as the changes are only to private[scala]. In 2.12.x we can remove the override of `filter` in Stream, but in 2.11.x this is not binary compatible. Eventually we'd also like to make filter / filterNot in TraversableLike final, but that's not source compatible, so it cannot be done in 2.12.x.
* Merge pull request #3902 from gourlaysama/wip/t4563Lukas Rytz2014-08-1275-77/+77
|\ | | | | SI-4563 friendlier behavior for Ctrl+D in the REPL
| * SI-4563 friendlier behavior for Ctrl+D in the REPLAntoine Gourlay2014-07-2975-77/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | Closing the REPL with Ctrl+D does not issue a newline, so the user's prompt displays on the same line as the `scala>` prompt. This is bad. We now force a newline before closing the interpreter, and display `:quit` while we're at it so that people know how to exit the REPL (since `exit` doesn't exist anymore). The tricky part was to only add a newline when the console is interrupted, and *not* when it is closed by a command (like `:quit`), since commands are processed after their text (including newline) has been sent to the console.
* | Merge pull request #3889 from som-snytt/issue/6476-altLukas Rytz2014-08-121-18/+0
|\ \ | | | | | | SI-6476 Improve error on escapement
| * | SI-6476 DocumentationSom Snytt2014-07-181-18/+0
| | | | | | | | | | | | And adjust the test.
* | | Orphan check fileSom Snytt2014-08-031-1/+0
| |/ |/| | | | | | | | | Orphaned by the override check reversion that deleted the test source. 2524fdde3edc7b668fdb4bf68e990141d3ec18d6
* | Better error message than 'bad symbolic reference'.Adriaan Moors2014-07-224-12/+14
| | | | | | | | | | | | Let's not scare people, and try to give them some advice. PS: we should really come up with a better mechanism for testing errors/warnings
* | SI-8738 Regression in range equalityRex Kerr2014-07-201-0/+16
|/ | | | | | Missed the case of comparing a non-empty range to an empty one. Fixed by checking nonEmpty/isEmpty on other collection. Added a test to verify the behavior.
* SI-8525 Clarify usage of -Xlint:_,flagSom Snytt2014-07-161-6/+0
| | | | | | | | | | | | | | | | | | | | | Also clarify usage of -Xlint flag. Align more with javac -Xlint:all,-flag,flag where once a flag is explicitly enabled it cannot be disabled, but where the wildcard is a backstop only. (There is no all option yet here.) -Xlint and -Xlint:_ just set a flag which is consulted by any unset lint warning. Xlint warnings consult the state of Xlint when they are unset. Individual -Ywarn-ings do not. Other warnings are explicitly set to false. They can only be enabled programmatically. Some tests are corrected. Also, option order is no longer significant, see the unit test.
* Merge pull request #3792 from som-snytt/issue/8525Lukas Rytz2014-07-163-0/+27
|\ | | | | SI-8525 -Xlint:nowarn-missing-interpolator
| * SI-8525 No anonymous lintSom Snytt2014-07-102-1/+4
| | | | | | | | | | | | | | | | | | Turn anonymous references to `settings.lint` into named settings. After that, trust to Adriaan to make them filterable. There are a few remaining top-level -Y lint warnings that are deprecated.
| * SI-8525 Add -Xlint:-warn-missing-interpolatorSom Snytt2014-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | Turn off lint warnings with negating prefix, and add a lint-only warning for the infamously nagging "Did you forget the interpolator?" That message is made more dignified. Without `-Xlint:false`, there is no mechanism to turn off anonymous linters once `-Xlint` is selected.
| * SI-8610 -Xlint is multichoice optionSom Snytt2014-07-083-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make -Xlint a "multichoice" option for purposes of option parsing. This allows turning on "lint with these warnings" instead of only "turn off these warnings but enable other lint warnings". ``` $ scalac -Xlint:warn-adapted-args linty.scala # lint plus a warning $ scalac -Xlint warn-adapted-args linty.scala # same $ scalac -Xlint linty.scala # same as now $ scalac -Xlint -- linty.scala # ok, not necessary $ scalac -Xlint _ -- linty.scala # another funky underscore ``` This would also enable Xlint options that are not standalone options, although that is not implemented in this commit. For example, `-Xlint:no-missing-interpolator` could be used to disable that warning. (There is no `-Xoption:flavor=off` syntax.) (`no-` switches would not be enabled by `_`.)
* | Merge pull request #3817 from phaller/topic/typetagsLukas Rytz2014-07-155-7/+40
|\ \ | | | | | | SI-5919 TypeTags and Exprs should be serializable
| * | SI-5919 TypeTags and Exprs should be serializablePhilipp Haller2014-07-155-7/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Make TypeCreator and TreeCreator extend Serializable. - When replacing a SerializedTypeTag with a TypeTag or WeakTypeTag, do not use scala.reflect.runtime.universe.rootMirror, since it is unlikely to find user classes; instead, create a runtime mirror using the context ClassLoader of the current thread. Use the same logic for SerializedExpr. - Remove writeObject/readObject methods from SerializedTypeTag and SerializedExpr since they are unused. - Add @throws annotation on writeReplace and readResolve methods. - Handle SecurityException if the current thread cannot access the context ClassLoader. - To make type tags of primitive value classes serializable, make PredefTypeCreator a top-level class. Otherwise, it would retain a reference to the enclosing Universe, rendering the TypeCreator non-serializable. Binary compatibility: - Keep nested PredefTypeCreator class to avoid backward binary incompatible change. - Keep `var` modifiers on the class parameters of SerializedTypeTag for backward binary compatibility. - Adds filter rules to forward binary compatibility whitelist: - `TypeCreator`, `PredefTypeCreator`, and `TreeCreator` must now extend from `Serializable`. - Must have new class `scala.reflect.api.PredefTypeCreator` to avoid problematic outer reference.
* | | Merge pull request #3845 from xeno-by/topic/attachment-subclassingJason Zaugg2014-07-151-0/+0
|\ \ \ | | | | | | | | relaxes attachment-matching rules
| * | | relaxes attachment-matching rulesEugene Burmako2014-07-101-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | It came as a surprise recently, but attachments.contains/get/update/remove require the class of the payload to match the provided tag exactly, not taking subclassing into account. This commit fixes the oversight.
* | | | Merge pull request #3844 from xeno-by/topic/rangepos-subpatternsJason Zaugg2014-07-154-0/+25
|\ \ \ \ | |_|/ / |/| | | prevents c.internal.subpatterns from destroying rangeposes
| * | | prevents some reflection APIs from destroying rangeposesEugene Burmako2014-07-104-0/+25
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit continues the work started in fcb3932b32. As we've figured out the hard way, exposing internally maintained trees (e.g. macro application) to the user is dangerous, because they can mutate the trees in place using one of the public APIs, potentially corrupting our internal state. Therefore, at some point we started duplicating everything that comes from the user and goes back to the user. This was generally a good idea due to the reason described above, but there was a problem that we didn't foresee - the problem of corrupted positions. It turns out that Tree.duplicate focuses positions in the tree being processed, turning range positions into offset ones, and that makes it impossible for macro users to make use of precise position information. I also went through the calls to Tree.duplicate to see what can be done to them. In cases when corruptions could happen, I tried to replace duplicate with duplicateAndKeepPositions. Some notes: 1) Tree rehashing performed in TreeGen uses duplicates here and there (e.g. in mkTemplate or in mkFor), which means that if one deconstructs a macro argument and then constructs it back, some of the positions in synthetic trees might become inaccurate. That's a general problem with synthetic trees though, so I don't think it should be addressed here. 2) TypeTree.copyAttrs does duplication of originals, which means that even duplicateAndKeepPositions will adversely affect positions of certain publicly accessible parts of type trees. I'm really scared to change this though, because who knows who can use this invariant. 3) Some methods that can be reached from the public API (Tree.substituteXXX, c.reifyXXX, c.untypecheck, ...) do duplicate internally, but that shouldn't be a big problem for us, because nothing is irreversibly corrupted here. It's the user's choice to call those methods (unlike with TypeTree.copyAttrs) and, if necessary, they can fixup the positions themselves afterwards. 4) Macro engine internals (macro impl binding creation, exploratory typechecking in typedMacroBody) use duplicate, but these aren't supposed to be seen by the user, so this shouldn't be a problem. 5) Certain parser functions, member syntheses and typer desugarings also duplicate, but in those cases we aren't talking about taking user trees and screwing them up, but rather about emitting potentially imprecise positions in the first place. Hence this commit isn't the right place to address these potential issues.
* | | Merge pull request #3878 from som-snytt/issue/8608Lukas Rytz2014-07-153-0/+20
|\ \ \ | | | | | | | | SI-8608 f interpolator emits constant strings
| * | | SI-8608 f interpolator emits constant stringsSom Snytt2014-07-143-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When invoking `format` is obviated by a lack of formatting fields, then just degenerate to an unenhanced constant string. This means it doesn't cost anything to use f"$$ordinary" in place of "$ordinary", which may cause warnings under -Xlint. Note that certain format literals, in particular for line separator %n, are not actually literals and can't be replaced at compile time.
* | | | SI-8117 Fix bug when mixing well-positioned named and positional argsLukas Rytz2014-07-112-0/+5
|/ / / | | | | | | | | | | | | | | | The method `missingParams` which returns undefined parameters of a given invocation expression still assumed that named arguments can only appear after positional ones.
* | | Merge pull request #3867 from lrytz/t8708Lukas Rytz2014-07-093-0/+37
|\ \ \ | |_|/ |/| | SI-8708 Fix pickling of LOCAL_CHILD child of sealed classes
| * | SI-8708 Fix pickling of LOCAL_CHILD child of sealed classesLukas Rytz2014-07-073-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a sealed class or trait has local children, they are not pickled in as part of the children of the symbol (introduced in 12a2b3b to fix Aladdin bug 1055). Instead the compiler adds a single child class named LOCAL_CHILD. The parents of its ClassInfoType were wrong: the first parent should be a class. For sealed traits, we were using the trait itself. Also, the LOCAL_CHILD dummy class was entered as a member of its enclosing class, which is wrong: it represents a local (non-member) class, and it's a synthetic dummy anyway.
* | | Use countElementsAsString for summarized warnings.Adriaan Moors2014-07-0414-14/+14
|/ /
* / SI-8690 BufferedSource.mkString mistakenly skipped the first char.Antoine Gourlay2014-06-292-0/+14
|/ | | | | | | mkString is overriden in BufferedSource for performance, but the implementation always used the wrong reader. This seems to be a typo (`allReader` is declared 5 lines earlier but never used, `charReader` is used in its place).
* Merge pull request #3778 from xeno-by/topic/plugins-is-blackboxJason Zaugg2014-06-275-0/+40
|\ | | | | adds MacroPlugin.pluginsIsBlackbox
| * adds MacroPlugin.pluginsIsBlackboxEugene Burmako2014-05-225-0/+40
| | | | | | | | | | | | | | | | | | | | This is an important omission in the current macro plugin API, which was designed before the blackbox vs whitebox separation was implemented. Even if one overrides pluginsTypedMacroBody and pluginsMacroExpand, that would still be not enough to write a custom macro expander, because typedImplicit1 uses isBlackbox, which is tightly coupled with the standard way of reading/writing macro signatures.