summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #3143 from retronym/ticket/reflection-sync-restorAdriaan Moors2013-11-141-2/+9
|\ | | | | Revert "temporarily disables run/reflection-sync-subtypes"
| * Revert "temporarily disables run/reflection-sync-subtypes"Jason Zaugg2013-11-141-2/+9
| | | | | | | | | | | | | | | | | | This reverts commit 04e2dbb29830d0e511cdfa8c132a9fad91d657ed, by avoiding the ill-fated attempt to short-circuit the global reflection lock. I think we can do better performance wise, but lets at least get something correct to start with.
* | Merge pull request #3139 from dotta/issue/updated-eclipse-project-filesAdriaan Moors2013-11-142-4/+4
|\ \ | |/ |/| Updated Eclipse .classpath for partest and scaladoc projects
| * Updated Eclipse .classpath for partest and scaladoc projectsMirco Dotta2013-11-142-4/+4
| |
* | Merge pull request #3133 from adriaanm/merge-2.10Adriaan Moors2013-11-144-11/+28
|\ \ | | | | | | Merge 2.10
| * \ Merge commit '6045a05b83' into merge-2.10Adriaan Moors2013-11-131-2/+8
| |\ \ | | | | | | | | | | | | | | | | Conflicts: src/interactive/scala/tools/nsc/interactive/Global.scala
| | * | Fix completion after application with implicit argumentsJason Zaugg2013-11-061-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `List(1, 2, 3).map(f).<ctrl-space>` now works; before the tree had the type `(bf: CanBuildFrom[...]):...` and did not contribute completions from the result type. This commit checks if the tree has an implicit method type, and typechecks it as a qualifier. That is enough to get to `adaptToImplicitMethod` in the type checker, infer the implicit arguments, and compute the final result type accordingly.
| | | |
| | \ \
| *-. | | Merge commit '075f6f260c'; commit 'e09a8a2b7f' into merge-2.10Adriaan Moors2013-11-132-2/+10
| |\ \| |
| | * | | SI-6546 InnerClasses attribute refers to absent classPaul Phillips2013-11-042-2/+10
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At issue is that the optimizer would eliminate closure classes completely, then neglect to eliminate those classes from the container's InnerClasses attribute. This breaks tooling which expects those entries to correspond to real classes. The code change is essentially mgarcia's - I minimized it and put the caches in perRunCaches, and added the test case which verifies that after being compiled under -optimise, there are no inner classes. Before/after: 7,8d6 < InnerClasses: < public final #22; //class A_1$$anonfun$f$1 37,45c35,40 < #21 = Utf8 A_1$$anonfun$f$1 < #22 = Class #21 // A_1$$anonfun$f$1 < #23 = Utf8 Code --- > #21 = Utf8 Code
| | * | Merge pull request #3072 from retronym/backport/7519Adriaan Moors2013-10-241-2/+3
| | |\ \ | | | | | | | | | | [nomaster] SI-7519 Less brutal attribute resetting in adapt fallback
| | | * | [nomaster] SI-7519 Less brutal attribute resetting in adapt fallbackJason Zaugg2013-10-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prefers `resetLocalAttrs` over `resetAllAttrs`. The latter loses track of which enclosing class of the given name is referenced by a `This` node which prefixes the an applied implicit view. The code that `resetAllAttrs` originally landed in: https://github.com/scala/scala/commit/d4c63b#L6R804 Cherry picked from 433880e91cba9e1e926e9fcbf04ecd4aeb1d73eb Conflicts: src/compiler/scala/tools/nsc/typechecker/Typers.scala
| | * | | Merge pull request #3053 from som-snytt/issue/6026-AFCL-findresourceJason Zaugg2013-10-231-1/+15
| | |\ \ \ | | | | | | | | | | | | [nomaster] SI-6026 backport getResource bug fix
| | | * | | [nomaster] SI-6026 backport getResource bug fixSom Snytt2013-10-181-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Submitted to master under SI-4936, this fix allows :javap to work when tools.jar is discovered by REPL.
| | * | | | Merge pull request #3052 from som-snytt/issue/6026-javap-loadingJason Zaugg2013-10-231-12/+16
| | |\ \ \ \ | | | |_|/ / | | |/| | | SI-6026 REPL checks for javap before tools.jar
| | | * | | SI-6026 REPL checks for javap before tools.jarSom Snytt2013-10-181-12/+16
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | If javap is already available, don't go hunting for tools.jar This avoids the getResource bug in AbstractFileClassLoader.
| * | | | Merge commit '25bcba59ce' into merge-2.10Adriaan Moors2013-11-131-7/+10
| |\| | |
| | * | | SI-7295 Fix windows batch file with args containing parenthesesJason Zaugg2013-10-211-7/+10
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In command scripts, substitution of `FOO` in `if cond ( %FOO% )` happens *before* the condition is evaluated. One can use delayed expansion with `if cond (!FOO!)` to get a saner behaviour. Or, as I ended up doing here, use a goto in the body of the if rather than referring directly to variables there. Here's a cut down version to demonstrate the old problem: C:\Users\IEUser>type test.cmd @echo off setlocal enableextensions enabledelayedexpansion if [%~1]==[-toolcp] ( set CP=%~2 shift shift ) echo -toolcp %CP% echo %~1 %~2 C:\Users\IEUser>test.cmd a b -toolcp a b C:\Users\IEUser>test.cmd -toolcp "c:\program files" a b -toolcp c:\program files a b C:\Users\IEUser>test.cmd -toolcp "c:\program files" "a()b" "c()d" -toolcp c:\program files a()b c()d C:\Users\IEUser>test.cmd "a()b" "c()d" d was unexpected at this time. I don't understand exactly why the parentheses only mess things up in this situation. But regardless, lets find another way. My first attempt to fix this was based on the suggestion in the ticket. But, as shown below, this fails to capture the -toolcp. C:\Users\IEUser>type test.cmd @echo off setlocal enableextensions enabledelayedexpansion if [%~1]==[-toolcp] ( set CP=!2! shift shift ) echo -toolcp %CP% echo %~1 %~2 C:\Users\IEUser>test.cmd "a()b" "c()d" -toolcp a()b c()d C:\Users\IEUser>test.cmd -toolcp "c:\program files" "a()b" "c()d" -toolcp a()b c()d Last stop was the goto you'll find in this patch. With this patch applied, I tested on Windows 8 with the following: C:\Users\IEUser>type Desktop\temp.cmd ::#! @echo off call scala %0 %* goto :eof ::!# println("hello, world") println(argv.toList) C:\Users\IEUser>scala Desktop\temp.cmd "foo(bar)baz" "java" -Xmx256M -Xms32M -Dscala.home="C:\PROGRA~3\scala\bin\.." -Denv.emacs="" -Dscala.usejavacp=true -cp "..." scala.tools.nsc.MainGenericRunner Desktop\temp.cmd "foo(bar)baz" hello, world List(foo(bar)baz) C:\Users\IEUser>scala -toolcp "c:\program files" Desktop\temp.cmd "foo(bar)baz" "java" -Xmx256M -Xms32M -Dscala.home="C:\PROGRA~3\scala\bin\.." -Denv.emacs="" -Dscala.usejavacp=true -cp "...;c:\program files" scala.tools.nsc.MainGenericRunner -toolcp "c:\program files" Desktop\temp.cmd "foo(bar)baz" hello, world List(foo(bar)baz)
* | | | Merge pull request #3127 from ↵Adriaan Moors2013-11-131-3/+2
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | RajivKurian/OpenHashMap-nextPowerOfTwo-implementation Use an intrinsic for the next power of two calculation.
| * | | | Use an intrinsic for the next power of two calculation and also return the ↵Rajiv2013-11-111-3/+2
| | | | | | | | | | | | | | | | | | | | input as is if it is already a power of two
* | | | | Merge pull request #3129 from adriaanm/pr-rebase-3001Adriaan Moors2013-11-1336-212/+369
|\ \ \ \ \ | |_|/ / / |/| | | | [rebase] blackbox and whitebox macros
| * | | | blackbox restriction #4: can't customize pattern matchingEugene Burmako2013-11-121-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an application of a blackbox macro is used as an extractor in a pattern match, it triggers an unconditional compiler error, preventing customizations of pattern matching implemented with macros.
| * | | | blackbox restriction #3: can't affect implicit searchEugene Burmako2013-11-124-53/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an application of a blackbox macro is used as an implicit candidate, no expansion is performed until the macro is selected as the result of the implicit search. This makes it impossible to dynamically calculate availability of implicit macros.
| * | | | blackbox restriction #2: can't guide type inferenceEugene Burmako2013-11-121-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an application of a blackbox macro still has undetermined type parameters after Scala’s type inference algorithm has finished working, these type parameters are inferred forcedly, in exactly the same manner as type inference happens for normal methods. This makes it impossible for blackbox macros to influence type inference, prohibiting fundep materialization.
| * | | | blackbox restriction #1: can't refine the official return typeEugene Burmako2013-11-121-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an application of a blackbox macro expands into a tree `x`, the expansion is wrapped into a type ascription `(x: T)`, where `T` is the declared return type of the blackbox macro with type arguments and path dependencies applied in consistency with the particular macro application being expanded. This invalidates blackbox macros as an implementation vehicle of type providers.
| * | | | blackbox and whitebox macrosEugene Burmako2013-11-1235-142/+288
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first commit in the series. This commit only: 1) Splits Context into BlackboxContext and WhiteboxContext 2) Splits Macro into BlackboxMacro and WhiteboxMacro 3) Introduces the isBundle property in the macro impl binding Here we just teach the compiler that macros can now be blackbox and whitebox, without actually imposing any restrictions on blackbox macros. These restrictions will come in subsequent commits. For description and documentation of the blackbox/whitebox separation see the official macro guide at the scaladoc website: http://docs.scala-lang.org/overviews/macros/blackbox-whitebox.html Some infrastructure work to make evolving macros easier: compile partest-extras with quick so they can use latest library/reflect/...
* | | | Merge pull request #3090 from densh/pull/undo-forAdriaan Moors2013-11-1318-455/+851
|\ \ \ \ | | | | | | | | | | Add support for For loops to quasiquotes
| * | | | add comments that explain FreshName extractor from Quasiquotes cakeDen Shabalin2013-11-121-0/+4
| | | | |
| * | | | add comments that explain new for loop enumerator encodingDen Shabalin2013-11-121-0/+28
| | | | |
| * | | | re-implement hasAttachment directly in raw attachmentsDen Shabalin2013-11-122-1/+5
| | | | |
| * | | | add support for for loops and for enumerators to quasiquotesDen Shabalin2013-11-126-5/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. q"for (..$enums) $body", q"for (..$enums) yield $body" 2. fq"..." quote to construct/deconstruct enumerators
| * | | | implement inverse transformation to mkForDen Shabalin2013-11-123-9/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This effectively reconstructs a sequence of enumerators and body from the tree produced by mkFor. This lets to define bi-directional SyntacticFor and SyntacticForYield constructors/extractors to work with for loops. Correctness of the transformation is tested by a scalacheck test that generates a sequence of random enumerators, sugars them into maps/flatMaps/foreach/withFilter calls and reconstructs them back.
| * | | | add syntactic combinators that represent enumeratorsDen Shabalin2013-11-122-0/+95
| | | | |
| * | | | move for loop desugaring into tree genDen Shabalin2013-11-124-387/+379
| | | | |
| * | | | change intermidiate representation of for loop enumeratorsDen Shabalin2013-11-127-55/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Encode values into real trees rather than non-tree case classes. This is needed for re-usability of desugaring code between quasiquotes and parser.
| * | | | add support for importable attachmentsDen Shabalin2013-11-123-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously attachments weren't imported by importTree. Now a new marker trait has been added that lets attachments to import themselves to the new universe together with all their innards. Additionally a simpler subtrait is defined to mark attachments that can be imported as-is.
| * | | | add some post-typecheck tests for quasiquotesDen Shabalin2013-11-121-5/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Typecheck trees with toolbox and check that they are still matched by corresponding quasiquote. Fix tuples and function types matchers to account for different shape of trees after typing.
| * | | | add hasAttachment utility method to the internal apiDen Shabalin2013-11-122-1/+2
| | | | |
| * | | | make internal implementation of universe.build less restrictiveDen Shabalin2013-11-121-26/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Use protected instead of private to avoid needless lock-in 2. Use BuildImpl field type to expose non-protected members to the compiler (user-facing side in the reflection api stays the same)
| * | | | deduplicate tuple tree creation codeDen Shabalin2013-11-126-39/+34
| |/ / / | | | | | | | | | | | | | | | | | | | | Previously tuple tree generation code has been implemented in three place: tree builder, tree gen, build utils. Now it's just defined once in tree gen.
* | | | Merge pull request #3112 from adriaanm/modularize-scaladocJames Iry2013-11-138-31/+167
|\ \ \ \ | |_|_|/ |/| | | Modularize scaladoc... almost
| * | | Refactoring to prepare modularization of the compiler.Adriaan Moors2013-11-128-31/+167
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Actual modularization is delayed until 2.12. The one big (one-line) change is to make the interactive compiler independent of scaladoc. We have one "integration test": `MemoryLeaksTest`. This commit adds a bunch of comments marked `TODO: modularize the compiler`, that should be uncommented when we're ready to continue the modularization effort. I decided to merge them commented out to avoid having to rebase xml patches. There's still some chance of bitrot, but I'm willing to take my chances. I previously refactored the build to make it easier to add jars in a coherent way, which hinges on the `init-project-prop` mechanism, so the relevant properties are already injected there.
* | | Merge pull request #3123 from som-snytt/issue/7747-scrapcodes-fixAdriaan Moors2013-11-123-17/+60
|\ \ \ | | | | | | | | SI-7747 Support class based wrappers in REPL
| * | | SI-7747 Support class based wrappers clean upSom Snytt2013-11-105-75/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplified the code paths to just use one of two `Wrapper` types for textual templating. Simplified the class-based template to use the same `$iw` name for the both the class and the wrapper value. In addition, the $read value is an object extending $read, instead of containing an extra instance field, which keeps paths to values the same for both templates. Both styles trigger loading the value object by referencing the value that immediately wraps the user code, although for the class style, inner vals are eager and it would suffice to load the enclosing `$read` object. The proposed template included extra vals for values imported from history, but this is not necessary since such an import is always a stable path. (Or, counter-example to test is welcome.) The test for t5148 is updated as a side effect. Probably internal APIs don't make good test subjects. Modify -Y option message.
| * | | SI-7747 Support class based wrappers as alternative through switch ↵Prashant Sharma2013-11-105-14/+76
| |/ / | | | | | | | | | | | | | | | | | | | | | -Yrepl-class-based Refactoring to reduce the number of if-else Fix test.
* | | Merge pull request #3113 from adriaanm/pr-rebase-3046Adriaan Moors2013-11-124-21/+21
|\ \ \ | | | | | | | | Make parameters to implicit value classes private
| * | | Make parameters to implicit value classes privateJason Zaugg2013-11-124-21/+21
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So that they aren't offered as an autocomplete suggestion: implicit class Shouty(string: String) extends AnyVal { def SHOUT_! = string.toUpperCase + "!" } "". // autocompletion offers `.string` here The original incarnation of value classes didn't allow this sort of encapsulation, so we either invented goofy names like `__thingToAdd` or just picked `x` or `self`. But SI-7859 has delivered us the freedom to keep the accessor private. Should we keep any of these accessors around in a deprecated form? The implicit classes in Predef were added in 2.11.0-M2 (c26a8db067e4f), so they are okay. I think we can make reason that these APIs were both accidental and unlikely to be interpreted as public, so we can break them immediately. scala> Left(1).x res0: scala.util.Either[Int,Int] = Left(1) scala> import concurrent.duration._ import concurrent.duration._ scala> 1.n res1: Int = 1
* | | Merge pull request #3121 from rjfwhite/SI-7568James Iry2013-11-121-1/+1
|\ \ \ | | | | | | | | SI-7568 Adding Serializable to ResizableArrayAccess inner class
| * | | SI-7568 Adding Serializable to ResizableArrayAccess inner class of PriorityQueuerjfwhite2013-11-111-1/+1
| |/ /
* / / SI-7958 Deprecate methods `future` and `promise` in the `scala.concurrent` ↵Philipp Haller2013-11-122-14/+18
|/ / | | | | | | | | | | | | | | | | | | | | | | | | package object - The corresponding `apply` methods in the `Future` and `Promise` objects should be used instead. - Adjusted tests to use non-deprecated versions - Fixed doc comments not to use deprecated methods - Added comment about planned removal in 2.13.0
* | Merge pull request #3100 from som-snytt/paulp/reductionJason Zaugg2013-11-082-130/+175
|\ \ | | | | | | Paulper stack reduction