summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Color REPL under -Dscala.colorBrian McKenna2014-09-213-2/+19
| | | | | | | | | | We already use -Dscala.color when using -Ytyper-debug This tries to reuse the colors chosen from the debug flag: * Bold blue for vals (e.g. "res0") * Bold green for types (e.g. "Int") * Magenta for the shell prompt (e.g. "scala>")
* Merge pull request #3984 from gourlaysama/wip/specJason Zaugg2014-09-1920-773/+656
|\ | | | | General formatting improvements in the spec
| * spec: fix broken links and anchors, including examplesAntoine Gourlay2014-09-176-15/+16
| | | | | | | | | | | | | | For examples, the "name" of the example (like "Example Ordered") is only used to derived its html id so that one can link to it (see `layouts/default.yml`). Ideally all examples should have a name; here I only added enough to satisfy existing links.
| * spec: remove trailing whitespace everywhereAntoine Gourlay2014-09-1716-660/+497
| |
| * spec: fix latex formatting all over the placeAntoine Gourlay2014-09-179-101/+104
| | | | | | | | | | | | | | | | | | Two things worth mentioning: - `\em` and `emph` are not supported by MathJax, - and things like `\mathcal{C}_0` require escaping the `_`, otherwise markdown sees it as the beginning of `_some string_`. It doesn't happen without the closing bracket in front, e.g. in `b_0`.
| * spec: add syntax highlighting for scala code with highlight.jsAntoine Gourlay2014-09-173-0/+42
| | | | | | | | | | | | | | | | | | | | | | This adds syntax highlighting for all code scala blocks. Highlighting is done after MathJax is done rendering so that latex can be used in code blocks (and it currently *is* used). Sadly Scala isn't common enough to be bundled in the highlight.min.js available from CDNs, so we commit a local version of version 8.2 with only scala bundled in it. The only other language used (ebnf) isn't supported by highlight.js.
| * spec: use the yaml title as the HTML titleAntoine Gourlay2014-09-152-4/+4
| |
* | Merge pull request #3988 from ghik/issue/8459Jason Zaugg2014-09-184-1/+32
|\ \ | | | | | | SI-8459 fix incorrect positions for incomplete selection trees
| * | SI-8459 fix incorrect positions for incomplete selection treesghik2014-09-174-1/+32
| | | | | | | | | | | | | | | | | | 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-182-2/+37
|\ \ \ | | | | | | | | SI-8852 Support joint compilation of Java interfaces w. statics
| * | | SI-8852 Support joint compilation of Java interfaces w. staticsJason Zaugg2014-09-182-2/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-187-12/+44
|\ \ \ \ | |_|/ / |/| | | This ensures that typechecking custom unapplications in silent mode
| * | | This ensures that typechecking custom unapplications in silent modeEugene Burmako2014-09-117-12/+44
| | | | | | | | | | | | | | | | | | | | | | | | 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-172-1/+5
|\ \ \ \ | |_|/ / |/| | | SI-8844 Fix regression with existentials + type aliases
| * | | SI-8844 Fix regression with existentials + type aliasesJason Zaugg2014-09-132-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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-164-14/+198
|\ \ \ \ | | | | | | | | | | SI-8680 Stream.addString is too eager
| * | | | SI-8680 Stream.addString is too eagerRex Kerr2014-09-124-14/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-162-27/+26
|\ \ \ \ \ | | | | | | | | | | | | 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-112-27/+26
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-163-2/+20
|\ \ \ \ \ | | | | | | | | | | | | SI-8806 Add lower bound check to Any lint
| * | | | | SI-8806 Add lower bound check to Any lintSom Snytt2014-09-053-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-169-33/+52
|\ \ \ \ \ \ | | | | | | | | | | | | | | isAnonymousClass/Function for delambdafy classes is not true
| * | | | | | isAnonymousClass/Function for delambdafy classes is not trueLukas Rytz2014-09-129-33/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1629-88/+1303
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | GenBCode: eliminate unreachable code
| * | | | | | | Address review feedback.Lukas Rytz2014-09-115-10/+10
| | | | | | | |
| * | | | | | | Remove stale local variables and exception handlers after DCELukas Rytz2014-09-1011-36/+386
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1010-7/+282
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tests for emitting expressions of type Nothing.
| * | | | | | | Tools to run the compiler in JUnit testsLukas Rytz2014-09-103-2/+136
| | | | | | | |
| * | | | | | | JUnit tests for dead code elimination.Lukas Rytz2014-09-109-72/+379
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JUnit tests may use tools from partest-extras (ASMConverters)
| * | | | | | | -Yopt mulit-choice flagLukas Rytz2014-09-092-1/+27
| | | | | | | |
| * | | | | | | Eliminate unreachable code in GenBCodeLukas Rytz2014-09-096-4/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We rely on dead code elimination provided by the ASM framework, as described in the ASM User Guide (http://asm.ow2.org/index.html), Section 8.2.1. It runs a data flow analysis, which only computes information for reachable instructions. Instructions for which no data is available after the analyis are unreachable. There's one issue with the ASM framework (or the way we use it): Data flow analysis requires the maxlocals and maxstack of each method to be computed. The ASM framework calculates these maxes only when writing the classfiles, not during code generation. In order to run DCE, we therefore run a MethodWriter beforehand on every method. This assings the MethodNode's maxStack/maxLocals, but it does more work (writes the instructions to a byte array). This is also what Miguel uses on his branch. The change is basically the same as https://github.com/lrytz/scala/commit/bfadf92c20. We could probably make this faster (and allocate less memory) by hacking the ASM framework: create a subclass of MethodWriter with a /dev/null byteVector. Another option would be to create a separate visitor for computing those values, duplicating the functionality from the MethodWriter. For now, I added some timers to be able to measure the time DCE takes. Here's compiling the library with -Ystatistics:jvm time in backend : 1 spans, 6597ms bcode initialization : 1 spans, 8ms (0.1%) code generation : 1 spans, 4580ms (69.4%) dead code elimination : 3771 spans, 742ms (11.2%) classfile writing : 1 spans, 879ms (13.3%)
| * | | | | | | Removed empty class, unused importsLukas Rytz2014-09-092-8/+2
| |/ / / / / /
* | | | | | | Merge pull request #3983 from retronym/merge/2.10.x-2.11.x-20140915Jason Zaugg2014-09-160-0/+0
|\ \ \ \ \ \ \ | |_|_|_|_|_|/ |/| | | | | | Merge 2.10.x to 2.11.x
| * | | | | | Merge commit '9ecfac8' into merge/2.10.x-2.11.x-20140915Jason Zaugg2014-09-150-0/+0
|/| | | | | |
| * | | | | | Merge pull request #3859 from xeno-by/topic/fundep-materialization-210xGrzegorz Kossakowski2014-09-1119-4/+215
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | [backport] SI-7470 implements fundep materialization
| | * | | | | | -Xfundep-materialization => -Yfundep-materializationEugene Burmako2014-09-094-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To quote gkossakowski: Thinking about it more, could we hide this behind 'Y' flag instead? We have lesser obligation to keep around Y flags and this is something we should remove from 2.11/2.12.
| | * | | | | | pull request feedbackEugene Burmako2014-07-031-0/+1
| | | | | | | |
| | * | | | | | [backport] SI-7470 implements fundep materializationEugene Burmako2014-07-0219-4/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backports 21a8c6c from the 2.11.x branch under -Xfundep-materialization as per Miles Sabin's request. Thanks Miles!
* | | | | | | | Merge pull request #3977 from terma/issue/8817Vlad Ureche2014-09-121-5/+4
|\ \ \ \ \ \ \ \ | |_|_|_|_|_|/ / |/| | | | | | | SI-8817 Correct scaladoc for scala.sys.addShutdownHook
| * | | | | | | SI-8817 Correct scaladoc for scala.sys.addShutdownHookterma2014-09-111-5/+4
| | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | - Remove mention that shutdown hook is daemon thread - Add link on scala.sys.ShutdownHookThread class
* | | | | | | Merge pull request #3846 from xeno-by/topic/move-quasiquotesGrzegorz Kossakowski2014-09-126-6/+6
|\ \ \ \ \ \ \ | |_|_|_|_|_|/ |/| | | | | | moves the impl of quasiquotes to scala.reflect
| * | | | | | moves the impl of quasiquotes to scala.reflectEugene Burmako2014-09-116-6/+6
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This brings consistency with scala.reflect.reify and scala.reflect.macros already existing in scala-compiler. To the contrast, scala.tools.reflect, the previous home of quasiquotes, is a grab bag of various stuff without any central theme.
* | | | | | Merge pull request #3968 from Feodorov/ticket/8398Grzegorz Kossakowski2014-09-103-19/+23
|\ \ \ \ \ \ | |_|_|_|/ / |/| | | | | SI-8398 - Compiler specifies lazy variables as methods
| * | | | | SI-8398 - unused warning reports lazy val as a methodKonstantin Fedorov2014-09-103-19/+23
|/ / / / / | | | | | | | | | | | | | | | 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-097-1/+39
|\ \ \ \ \ | | | | | | | | | | | | 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-097-1/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #3967 from retronym/topic/mathjaxGrzegorz Kossakowski2014-09-091-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix broken URL for MathJAX Javascript dependency.
| * | | | | | Fix broken URL for MathJAX Javascript dependency.Jason Zaugg2014-09-081-1/+1
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Loaded using an DNS alias for the CDN, as per the [instructions](http://docs.mathjax.org/en/latest/configuration.html) I also switched from `latest` to `2.3-latest`, so that we don't automatically perform major upgrades.
* | | | | | Merge pull request #3946 from gourlaysama/wip/t5254Grzegorz Kossakowski2014-09-092-11/+46
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-5254 running an empty scala script should succeed