summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* SI-8015 Unprintables in messagesSom Snytt2014-01-083-4/+17
| | | | | | The line content to display should include the whole line, inclusive of embedded line breaks, and any control chars should be displayed in unicode escape.
* SI-8015 Count lines by EOLsSom Snytt2014-01-089-24/+80
| | | | | | | | Source lines were counted by "line break chars", including FF. Clients of `pos.line` seem to all expect the ordinary line num, so that is what they get. Unicode processing now precedes line ending processing.
* Merge pull request #3289 from soc/SI-7492-reduxJason Zaugg2014-01-081-4/+4
|\ | | | | SI-7492 Make scala.runtime.MethodCache private[scala]
| * SI-7492 Make scala.runtime.MethodCache private[scala]Simon Ochsenreither2013-12-191-4/+4
| | | | | | | | | | These are internal implementation details which shouldn't be exposed to users (and might go away when support for invokedynamic is added).
* | Merge pull request #3331 from retronym/ticket/8120Jason Zaugg2014-01-082-1/+14
|\ \ | | | | | | SI-8120 Avoid tree sharing when typechecking patmat anon functions
| * | SI-8120 Avoid tree sharing when typechecking patmat anon functionsJason Zaugg2014-01-072-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When typechecking an empty selector `Match` corresponding to: { case ... => ... }: (A => B) We wrap it in a `Function` and typecheck: (x$1 => x$1 match { case ... => ... }) Local symbols in this expression (representing values bound by the pattern, or just definitions in the body or guard) are then owned by the anonymous function's symbol. However, if we ever discard this `Function` and start anew with the empty selector match, as happens during the fallback to use a view on the receiver in `tryTypedApply`, we found that we had mutated the cases of the original tree, and allowed orphaned local symbols to escape into the compiler pipeline. This commit uses duplicated trees for the the cases in the synthetic `Match` to avoid this problem. `duplicateAndKeepPositions` is used to preserve range positions; without this scala-refactoring PrettyPrinterTest fails. `Tree#duplicate` uses offset positions in the copied tree, which is appropriate when both the original and the copy are going to end up in the final tree.
* | | Merge pull request #3325 from clhodapp/fix/double.absJason Zaugg2014-01-082-0/+22
|\ \ \ | | | | | | | | Fix (postfix abs for -0.0)
| * | | SI-8102 -0.0.abs must equal 0.0clhodapp2014-01-062-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | SI-8102 points out that -0.0.abs returns -0.0 (in error). The same issue exists for -0.0f. This commit fixes the issue for both by delegating to math.abs.
* | | | Merge pull request #3306 from Ichoran/topic/junit-set-mapJason Zaugg2014-01-083-170/+479
|\ \ \ \ | | | | | | | | | | Improved testing framework for sets and maps.
| * | | | Improved testing framework for sets and maps.Rex Kerr2013-12-263-170/+479
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switched to JUnit testing framework for sets and maps. They now test broadly against each other for consistency. Tests for mutable.AnyRefMap and mutable.LongMap are folded in here (originals removed). There is still lots of redundancy with other tests that has not been removed. This framework is also designed to enable more robust testing of changes to implementations of sets and maps; although it's still quite possible to get a broken implementation through, these tests should make it harder to get the fundamentals wrong.
* | | | | Merge pull request #3301 from Ichoran/issue/7837Jason Zaugg2014-01-082-2/+31
|\ \ \ \ \ | | | | | | | | | | | | Resolves SI-7837, failure in quickSort.
| * | | | | SI-7837 quickSort, along with Ordering[K], may result in stackoverflow ↵Rex Kerr2013-12-312-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | because the code uses '==' instead of 'equiv' == instead of equiv (from Ordering) was used by mistake. Fixed. Also created a test to make sure that == is not used by throwing an exception if it is (as suggested by Jason).
* | | | | | Merge pull request #3305 from xeno-by/topic/copy-untypedJason Zaugg2014-01-087-49/+102
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | awakens default getter synthesis from the untyper nightmare
| * | | | | untyper is no moreEugene Burmako2014-01-071-36/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike with default getters, removing untyper from case class synthesis was trivial. Just resetLocalAttrs on a duplicate of the provided class def, and that’s it. resetAllAttrs, you’re next. We’ll get to you! Eventually...
| * | | | | awakens default getter synthesis from the untyper nightmareEugene Burmako2014-01-077-40/+117
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our happy little macro paradise is regularly invaded by resetAllAttrs, the bane of all macros and typers. It’s so ruthless and devastating that we’ve been long scheming to hack something really cool and to one day defeat it. Today we make the first step towards the happy future. Today we overthrow the UnTyper, resetAllAttrs’s elder brother that rules in the kingdoms of GetterLand and CaseClassia, and banish him from the land of getters. In the name of what’s good and meta, let’s band together and completely drive him away in a subsequent pull request! To put it in a nutshell, instead of using untyper on a DefDef to do default getter synthesis, the commit duplicates the DefDef and does resetLocalAttrs on it. As default getter synthesis proceeds with figuring out type and value parameters for the getter, then its tpt and finally its rhs, the commit destructures the duplicated DefDef and then assembles the default getter from the destructured parts instead of doing copyUntyped/copyUntypedInvariant on the original DefDef. I would say the test coverage is pretty good, as I had to figure out 3 or 4 test failures before I got to the stage when everything worked. Iirc it tests pretty exotic stuff like polymorphic default parameters in both second and third parameter lists, so it looks like we're pretty good in this department.
* | | | | Merge pull request #3313 from OlivierBlanvillain/upstreamJason Zaugg2014-01-034-4/+4
|\ \ \ \ \ | |_|_|/ / |/| | | | Fix typos in documentation
| * | | | Fix typos in documentationOlivier Blanvillain2013-12-284-4/+4
| |/ / /
* | | | Merge pull request #3284 from soc/SI-7880Jason Zaugg2014-01-032-9/+20
|\ \ \ \ | | | | | | | | | | SI-7880 Fix infinite loop in ResizableArray#ensureSize
| * | | | SI-7880 Fix infinite loop in ResizableArray#ensureSizeSimon Ochsenreither2013-12-232-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This issue was triggered for values greater than Int.MaxValue/2, which caused the computation of the new array size to overflow and become negative, leading to an infinite loop.
* | | | | Merge pull request #3239 from soc/SI-8052Jason Zaugg2014-01-033-24/+44
|\ \ \ \ \ | | | | | | | | | | | | SI-8052 Disallow `macro` as an identifier
| * | | | | SI-8052 Disallow `macro` as an identifierSimon Ochsenreither2013-12-093-24/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that the change could look a lot cleaner, at the cost of returning more generic error messages. I decided that at least for 2.11 I'll keep scalac remembering that macro was a standard identifier name once, so that we can point out more precisely what's wrong with users' code.
* | | | | | Merge pull request #3245 from densh/si/8047Jason Zaugg2014-01-0315-13/+64
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-8047 change fresh name encoding in quasiquotes to avoid symbol owner corruption
| * | | | | | Use t- prefix instead of si- prefix for test filesDen Shabalin2013-12-169-0/+0
| | | | | | |
| * | | | | | SI-8047 change fresh name encoding to avoid owner corruptionDen Shabalin2013-12-166-13/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously a following encoding was used to represent fresh names that should be created at runtime of the quasiquote: build.withFreshTermName(prefix1) { name$1 => ... build.withFreshTermName(prefixN) { name$N => tree } ... } It turned out that this encoding causes symbol corruption when tree defines symbols of its own. After being spliced into anonymous functions, the owner chain of those symbols will become corrupted. Now a simpler and probably better performing alternative is used instead: { val name$1 = universe.build.freshTermName(prefix1) ... val name$N = universe.build.freshTermName(prefixN) tree } Here owner stays the same and doesn’t need any adjustment.
* | | | | | | Merge pull request #3254 from xeno-by/topic/typeCheckJason Zaugg2014-01-0351-67/+79
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | typeCheck => typecheck
| * | | | | | | typeCheck => typecheckEugene Burmako2013-12-1051-67/+79
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | This method has always been slightly bothering me, so I was really glad when Denys asked me to rename it. Let’s see how it pans out.
* | | | | | | Merge pull request #3299 from xuwei-k/stream-flatten-exampleJason Zaugg2014-01-031-1/+1
|\ \ \ \ \ \ \ | |_|_|_|_|/ / |/| | | | | | fix Stream#flatten example
| * | | | | | fix Stream#flatten examplexuwei-k2013-12-231-1/+1
| | |_|_|/ / | |/| | | |
* | | | | | Merge pull request #3297 from paulp/pr/7406Jason Zaugg2013-12-313-1/+16
|\ \ \ \ \ \ | | | | | | | | | | | | | | crasher with specialized lazy val
| * | | | | | SI-7406 crasher with specialized lazy valPaul Phillips2013-12-213-1/+16
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts a tiny bit of f7d5f45aa7 where the crasher was introduced. The enclosed test case compiles and runs under 2.9, but prints the wrong answer. It crashes in 2.10 and until this patch. Now it compiles and prints the right answer.
* | | | | | Merge pull request #3288 from xeno-by/topic/f-interpolatorJason Zaugg2013-12-3015-24/+53
|\ \ \ \ \ \ | | | | | | | | | | | | | | makes boxity of fast track macros configurable
| * | | | | | makes boxity of fast track macros configurableEugene Burmako2013-12-1915-24/+53
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, all built-in macros were assumed to be whitebox, but that’s actually not the case. Just quasiquote macros have to be whitebox, while the rest can be blackbox. This also fixes SI-8091, because blackbox macros are typechecked differently and therefore the necessary implicit conversion kicks in. If `f”...”` were to remain a whitebox macro, then due to the changes introduced in commit https://github.com/scala/scala/commit/a3b33419b02cafb7e2c6fed6dd96151859fc7d77 we would have to explicitly ascribe its expansion as String to achieve the same effect. After I made reify blackbox, several tests had to be changed, because we now explicitly ascribe the expansion with `c.Expr[T]`, which changes `toString`. Also, a number of less obvious corrections had to be applied, because things like `reify(<constant>).splice` have stopped being optimized away due to `reify(<constant>)` no longer having a narrow `c.Expr[<constant>.type]`, making it ineligible for constant folding. Moreover, this change forced me to adjust our approach to positioning blackbox wrappings, because after being changed to blacbox and starting using wrappings, f”...” interpolators used in the compiler started crashing -Yrangepos builds. Now wrapping Typed nodes are assigned with transparent positions.
* | | | | | Merge pull request #3307 from paulp/pr/ant-build-targetsJason Zaugg2013-12-301-0/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Added .ant-targets-build.xml to .gitignore.
| * | | | | | Added .ant-targets-build.xml to .gitignore.Paul Phillips2013-12-261-0/+1
| | |/ / / / | |/| | | | | | | | | | | | | | | | Something generates this repo-dirtying file during ant replacestarr.
* | | | | | Merge pull request #3308 from rklaehn/topic/hashset-comment-cleanupJason Zaugg2013-12-302-71/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | Remove commented out code from HashSet and HashMap
| * | | | | | Remove commented out code from HashSet and HashMapRüdiger Klaehn2013-12-272-71/+2
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove an ancient, commented out microbenchmark from HashSet and HashMap. Also, fix indentation for while loop in HashSet.foreach and remove some other commented out code that no longer serves any purpose.
* | | | | | Merge pull request #3314 from xeno-by/topic/rootsJason Zaugg2013-12-302-1/+20
|\ \ \ \ \ \ | | | | | | | | | | | | | | makes well-known packages and package classes consistent with each other
| * | | | | | makes well-known packages and package classes consistent with each otherEugene Burmako2013-12-292-1/+20
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discovered in https://groups.google.com/forum/#!topic/scala-user/RckXE90LoXo, RootClass.sourceModule and EmptyPackageClass.sourceModule used to incorrectly return NoSymbol instead of RootModule and EmptyPackage. This is now fixed.
* | | | | | Merge pull request #3292 from xeno-by/topic/duplicate-macro-argsJason Zaugg2013-12-301-3/+3
|\ \ \ \ \ \ | | | | | | | | | | | | | | duplicates arguments to macro typer APIs
| * | | | | | duplicates arguments to macro typer APIsEugene Burmako2013-12-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit continues the tendency set by the parent commit to duplicate as much as possible in order to avoid potential confusion that users might run into when compiler internals start leaking. Here we plumb another way that by-reference sharing of trees might bite unsuspecting macro writers. Previously we have duplicated macro expansions, macro arguments, c.macroApplication, and now it’s arguments to typeCheck and resetAttrs. There is still an unlikely situation when someone gets to c.enclosingXXX and then starts typechecking around, but that’s left for future work, as it’s yet unclear what to do with c.enclosingXXX APIs.
* | | | | | | Merge pull request #3298 from retronym/topic/uptodateJason Zaugg2013-12-301-24/+33
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | <uptodate> Ant-ics
| * | | | | | | Invalidate <uptodate> checks on edits to build-ant-macros.xmlJason Zaugg2013-12-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was recently refactored from build.xml. Changing either file should invalidate caches.
| * | | | | | | Fix Ant uptodate checking in OSGI JAR creationJason Zaugg2013-12-221-24/+31
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes to the compiler or library were not triggering recreation of the OSGI JARs, which are used in the local maven deployment tasks. Reason: this Ant-ipattern: <fileset base="/foo"> <include name="/foo/bar.baz"/> </fileset> Instead, we should use a <filelist/>, which doesn't require a base directory. This can be composed into a <srcresources/> element in the <uptodate/>. Phew!
* | | | | | | Merge pull request #3309 from xeno-by/topic/expand-dynamicJason Zaugg2013-12-309-6/+87
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-7777 SI-8006 assorted fixes for dynamics
| * | | | | | | SI-8006 prevents infinite applyDynamicNamed desugaringsEugene Burmako2013-12-286-3/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since mkInvoke, the applyDynamic/selectDynamic/etc desugarer, is disconnected from typedNamedApply, the applyDynamicNamed argument rewriter, the latter doesn’t know whether it needs to apply the rewriting because the application has just been desugared or it needs to hold on because it’s already performed a desugaring on this tree. This commit introduces the attachment that links these translation facilities, preventing infinite applyDynamicNamed desugarings.
| * | | | | | | SI-7777 applyDynamic macro fails for nested applicationEugene Burmako2013-12-275-3/+40
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Interplay between the insertApply desugaring and the invokeDynamic desugarings is already quite brittle, but the real fun begins when macros crash the party. The proposed patch enriches the `isDesugaredApply` check performed in `mkInvoke`, the invokeDynamic desugarer, and makes sure that everything is safe and sound in the macroland.
* | | | | | | Merge pull request #3311 from xeno-by/topic/fine-points-of-whiteboxity-masterEugene Burmako2013-12-286-0/+64
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | (master) codifies the state of the art wrt SI-8104
| * | | | | | | codifies the state of the art wrt SI-8104Eugene Burmako2013-12-286-0/+64
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As it was discovered in SI-8104, whiteboxity doesn’t apply equally to type parameters and type members of materialized type classes. During implicit search and subsequent type inference, whitebox type parameters are consistently erased to wildcards, whereas whitebox type members sometimes remain as is and get in the way of signature conformance checks.
* | | | | | | Merge pull request #3310 from xeno-by/topic/overload-dynamicEugene Burmako2013-12-287-7/+54
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | SI-6355 SI-7059 it is possible to overload applyDynamic
| * | | | | | SI-6355 SI-7059 it is possible to overload applyDynamicEugene Burmako2013-12-287-7/+54
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As our discussion at https://issues.scala-lang.org/browse/SI-6355 shows, it looks like it is possible to overload applyDynamic, even though a straightforward way is closed. This commit codifies the pattern proposed by @paulp and makes sure that it doesn’t break in the future.