summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #3988 from ghik/issue/8459Jason Zaugg2014-09-183-0/+31
|\ | | | | SI-8459 fix incorrect positions for incomplete selection trees
| * SI-8459 fix incorrect positions for incomplete selection treesghik2014-09-173-0/+31
| | | | | | | | | | | | The mentioned issue is a presentation compiler issue, but its root cause is a bug in the parser which incorrectly assigned positions to incomplete selection trees (i.e. selections that lack an indentifier after dot and have some whitespace instead). In detail: for such incomplete selection trees, the "point" of the position should be immediately after the dot but instead was at the start of next token after the dot. For range positions, this caused a pathological situation where the "point" was greater than the "end" of the position. This position is later used by the typechecker during resolution of dynamic calls and causes it to crash. Of course, because a syntactically incorrect code is required for the bug to manifest, it only happens in the presentation compiler.
* | Merge pull request #3989 from retronym/ticket/8852Grzegorz Kossakowski2014-09-181-0/+34
|\ \ | | | | | | SI-8852 Support joint compilation of Java interfaces w. statics
| * | 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 #3974 from xeno-by/topic/buffer-pattern-expander-errorsGrzegorz Kossakowski2014-09-183-0/+31
|\ \ \ | |_|/ |/| | This ensures that typechecking custom unapplications in silent mode
| * | This ensures that typechecking custom unapplications in silent modeEugene Burmako2014-09-113-0/+31
| | | | | | | | | | | | | | | | | | doesn't leak uncatchable errors. Interestingly enough, the problem only manifested itself for custom unapply methods, not for synthetic ones generated for case classes.
* | | Merge pull request #3980 from retronym/ticket/8844Lukas Rytz2014-09-171-0/+4
|\ \ \ | |_|/ |/| | SI-8844 Fix regression with existentials + type aliases
| * | SI-8844 Fix regression with existentials + type aliasesJason Zaugg2014-09-131-0/+4
| | | | | | | | | | | | | | | | | | Regressed in 2a1b15e / SI-8283. Another specimen of an archetypal bug: unwanted dealising by using `typeSymbol`, rather than `typeSymbolDirect`.
* | | 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 #3941 from Ichoran/issue/8815Lukas Rytz2014-09-161-0/+15
|\ \ \ | | | | | | | | SI-8815 mutable.LongMap makes different choices for splitAt vs etc.
| * | | SI-8815 mutable.LongMap makes different choices for splitAt vs etc.Rex Kerr2014-09-111-0/+15
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that take/drop/splitAt/takeWhile/dropWhile inherit a smattering of foreach vs. iterator-based implementations. These aren't consistent unless they iterate in the same order. This probably reflects an undesirable underlying weakness, but in this particular case it was easy to make LongMap's foreach order agree with iterator. Made traversal order of other foreach-like methods match also. Also fixed a bug where Long.MinValue wasn't iterated. Added unit test for iteration coverage of extreme values.
* | | Merge pull request #3936 from som-snytt/issue/8806Jason Zaugg2014-09-162-1/+12
|\ \ \ | | | | | | | | SI-8806 Add lower bound check to Any lint
| * | | SI-8806 Add lower bound check to Any lintSom Snytt2014-09-052-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already exclude the lint check for infer-any if Any is somewhere explicit. This commit adds lower bounds of type params to the somewheres. Motivated by: ``` scala> f"${42}" <console>:8: warning: a type was inferred to be `Any`; this may indicate a programming error. f"${42}" ^ res0: String = 42 ```
* | | | 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.
* | | | | Merge pull request #3971 from lrytz/opt/dceJason Zaugg2014-09-1617-8/+760
|\ \ \ \ \ | |_|_|/ / |/| | | | GenBCode: eliminate unreachable code
| * | | | Address review feedback.Lukas Rytz2014-09-111-1/+3
| | | | |
| * | | | Remove stale local variables and exception handlers after DCELukas Rytz2014-09-105-7/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is required for correctness of the generated bytecode. Exception handlers and local variable descriptors specify code offset ranges. These offsets have to exist, not be eliminated.
| * | | | SI-8568 unreachable test now passes in GenBCodeLukas Rytz2014-09-101-1/+0
| | | | |
| * | | | Clarify why we emit ATHROW after expressions of type NothingLukas Rytz2014-09-109-6/+237
| | | | | | | | | | | | | | | | | | | | Tests for emitting expressions of type Nothing.
| * | | | Tools to run the compiler in JUnit testsLukas Rytz2014-09-102-0/+115
| | | | |
| * | | | JUnit tests for dead code elimination.Lukas Rytz2014-09-106-7/+204
| |/ / / | | | | | | | | | | | | JUnit tests may use tools from partest-extras (ASMConverters)
* / / / SI-8398 - unused warning reports lazy val as a methodKonstantin Fedorov2014-09-102-18/+22
|/ / / | | | | | | | | | Compiler internals treat lazy vals as methods. Therefore, we need to have a special case for them when assembling the warning message.
* | | Merge pull request #3938 from gourlaysama/wip/t8764Grzegorz Kossakowski2014-09-096-0/+38
|\ \ \ | | | | | | | | 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-096-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #3946 from gourlaysama/wip/t5254Grzegorz Kossakowski2014-09-091-0/+23
|\ \ \ \ | | | | | | | | | | SI-5254 running an empty scala script should succeed
| * | | | SI-5254 running an empty scala script should succeedAntoine Gourlay2014-08-261-0/+23
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The script runner made the assumption that "compilation succeeded" implies "there is a Main class to run", but this can be wrong if the script is empty (or only contains imports/comments). The ScriptRunner now uses the ClassPath utility to check if there really is a main class. If not, it doesn't try to run it and returns peacefully. This also makes `scala -e ''` succeed.
* | | | Merge pull request #3939 from lrytz/ystatsLukas Rytz2014-09-085-7/+120
|\ \ \ \ | |_|_|/ |/| | | -Ystatistics accepts a list of phases for which to print stats
| * | | Address PR feedback, fix MultiChoiceSetting.containsLukas Rytz2014-09-081-0/+2
| | | |
| * | | Use Enumeration for MultiChoiceSettingSom Snytt2014-09-051-1/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is pretty easy, since a ValueSet is a BitSet. When the setting is updated, recompute the current set of values, which is cheap and succinct. Checking a flag is also easy and fast. Choices in MultiChoiceSettings may enable other choices.
| * | | -Ystatistics accepts a list of phases, cleanups in MultiChoiceSettingLukas Rytz2014-09-021-1/+62
| | | | | | | | | | | | | | | | | | | | MultiChoiceSetting and Xlint with its deprecated aliases is now a bit simpler, but there's still room for improvement, as noted in comments.
| * | | Fix assertThrows, and the behaviors that it shadowedLukas Rytz2014-09-024-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | The test in StdNamesTest was introduced in cff8b569, where newTermName would throw on a negative length. In b090f97 this was changed to fix the negative length, but the test was not adapted (as it didn't fail).
* | | | 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 #3961 from lrytz/t8786-disable-testJason Zaugg2014-09-041-1/+3
|\ \ \ \ \ | | | | | | | | | | | | SI-8786 disable part of thest that's failing the jdk8 build
| * | | | | SI-8786 disable part of test that's failing the jdk8 buildLukas Rytz2014-09-041-1/+3
| | | | | |
* | | | | | Merge pull request #3932 from gourlaysama/wip/t8498Jason Zaugg2014-09-042-4/+7
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-8498 @compileTimeOnly should be aware of bridge methods.
| * | | | | | SI-8498 @compileTimeOnly should be aware of bridge methods.Antoine Gourlay2014-08-212-4/+7
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling a @compileTimeOnly method from another @compileTimeOnly method happens when the former gets a bridge method. It should not throw an error. Calling the bridge or the method will anyway.
* | | | | | Merge pull request #3951 from pawel-wiejacha/2.11.x_SI-8810_fixGrzegorz Kossakowski2014-09-032-3/+10
|\ \ \ \ \ \ | | | | | | | | | | | | | | scaladoc: fixed code block indentation normalization
| * | | | | | SI-8810 scaladoc: fixed code block indentation normalizationPaweł Wiejacha2014-09-032-3/+10
| | | | | | |
* | | | | | | SI-8113 allow a newline between a link target and titleAntoine Gourlay2014-09-032-0/+37
| |_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Parsing "[[http://foo.bar link title]]" stops at the first whitespace. This breaks pretty badly in: [[http://foo.bar link title]] It stops after "link", interprets what it parsed as a link to a member, obviously fails, and then just ouputs "title". It should at least return a proper error, or, even better, just allow a newline between the target and title. I went for the latter.
* | | | | | Merge pull request #3955 from som-snytt/issue/8410Grzegorz Kossakowski2014-09-032-0/+16
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-8410 Don't warn fatally on disabled flag
| * | | | | | SI-8410 Don't warn fatally on disabled flagSom Snytt2014-09-012-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since boolean settings can now be set false by user, summary warnings should not be issued when the flag is explicitly off (as opposed to unset, default). In particular, `-Xfatal-warnings` should not fail if there were no warnings otherwise. ``` $ ~/scala-2.11.2/bin/scalac -d /tmp -deprecation:false test/files/pos/t8410.scala $ ~/scala-2.11.2/bin/scalac -d /tmp -deprecation:false -Xfatal-warnings test/files/pos/t8410.scala warning: there were three deprecation warnings; re-run with -deprecation for details error: No warnings can be incurred under -Xfatal-warnings. one warning found one error found ``` After this commit: ``` $ skalac -d /tmp -Xfatal-warnings test/files/pos/t8410.scala warning: there were three deprecation warnings; re-run with -deprecation for details error: No warnings can be incurred under -Xfatal-warnings. one warning found one error found $ skalac -d /tmp -deprecation:false -Xfatal-warnings test/files/pos/t8410.scala ``` Similarly for other collecting flags: ``` $ skalac -d /tmp -optimise -Yinline-warnings -deprecation:false -Xfatal-warnings test/files/pos/t8410.scala test/files/pos/t8410.scala:14: warning: Could not inline required method dropWhile because access level required by callee not matched by caller. def k = List(0).dropWhile(_ < 1) // inlining warns doubly ^ test/files/pos/t8410.scala:14: warning: At the end of the day, could not inline @inline-marked method dropWhile def k = List(0).dropWhile(_ < 1) // inlining warns doubly ^ error: No warnings can be incurred under -Xfatal-warnings. two warnings found one error found $ skalac -d /tmp -optimise -Yinline-warnings:false -deprecation:false -Xfatal-warnings test/files/pos/t8410.scala ``` Footnote: handling of deprecated locals also changed in 2014: ``` $ ~/scala-2.11.0-M7/bin/scalac -d /tmp -deprecation -Xfatal-warnings test/files/pos/t8410.scala test/files/pos/t8410.scala:8: warning: method f in object Test is deprecated: Console println f // warns ^ error: No warnings can be incurred under -Xfatal-warnings. one warning found one error found $ ~/scala-2.11.0-M8/bin/scalac -d /tmp -deprecation -Xfatal-warnings test/files/pos/t8410.scala test/files/pos/t8410.scala:5: warning: method _f is deprecated: def g = { @deprecated("","") def _f = f ; _f } // warns in 2.11.0-M8 ^ test/files/pos/t8410.scala:6: warning: class X is deprecated: def x = { @deprecated("","") class X { def x = f } ; new X().x } // warns in 2.11.0-M8 ^ test/files/pos/t8410.scala:8: warning: method f in object Test is deprecated: Console println f // warns ^ error: No warnings can be incurred under -Xfatal-warnings. three warnings found one error found ```
* | | | | | | Merge commit 'b5759ef' into merge/2.10-to-2.11-sept-2Lukas Rytz2014-09-022-0/+19
|\ \ \ \ \ \ \
| * | | | | | | Prevent SI-8314 by adding a testKato Kazuyoshi2014-07-312-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original issue was fixed already. This test is just for make sure.
* | | | | | | | Merge pull request #3952 from gourlaysama/wip/t8828-lint-innacessibleGrzegorz Kossakowski2014-09-022-0/+21
|\ \ \ \ \ \ \ \ | |_|_|_|_|/ / / |/| | | | | | | SI-8828 fix regression in Xlint visibility warning for sealed classes
| * | | | | | | SI-8828 fix regression in Xlint visibility warning for sealed classesAntoine Gourlay2014-08-282-0/+21
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5dfcf5e reverted a change to `Symbol#isEffectivelyFinal` (made in adeffda) that broke overriding checks, and moved the new enhanced version to a new method. However, the test for inaccessible type access still uses the old one, so it lost the ability to see that the owner of some method is either final or sealed and not overridden. This just makes it use the new `isEffectivelyFinalOrNotOverriden`.
* | | | | | | 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.