| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| | |
(cherry picked from commit e72c32db03b44d6eaf1c1872765a578c5445e15f)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |\
| | |
| | | |
Fix windows batch file with args containing parentheses
|
|\ \ \
| | |/
| |/| |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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)
|
| | | |
| \ | |
|\ \ \
| | | |
| | | |
| | | | |
into merge-2.10
|
| | |/
| | |
| | |
| | |
| | |
| | | |
If javap is already available, don't go hunting for tools.jar
This avoids the getResource bug in AbstractFileClassLoader.
|
| |/
| |
| |
| |
| | |
Submitted to master under SI-4936, this fix allows :javap
to work when tools.jar is discovered by REPL.
|
|\ \
| | |
| | | |
Add support for For loops to quasiquotes
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
1. q"for (..$enums) $body", q"for (..$enums) yield $body"
2. fq"..." quote to construct/deconstruct enumerators
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Encode values into real trees rather than non-tree case classes.
This is needed for re-usability of desugaring code between quasiquotes
and parser.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Otherwise it's annoying that trees that look the same are not equal
due to some fresh name hidden underneath. Due to this one test needs
to be changed to use plain equalsStructure.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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)
|
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
Modularize scaladoc... almost
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
|\ \ \ \
| | | | |
| | | | | |
SI-7747 Support class based wrappers in REPL
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
-Yrepl-class-based
Refactoring to reduce the number of if-else
Fix test.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Make parameters to implicit value classes private
|
| | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
I previously messed this up in a24e7fa, which caused
partest classpath again to include multiple version
of scala-library and friends.
We should really automate enforcing uniqueness of packages.
|
|\ \ \ \
| | | | |
| | | | | |
SI-7568 Adding Serializable to ResizableArrayAccess inner class
|
| | | | | |
|
| | |/ /
| |/| | |
|
|\ \ \ \
| |_|/ /
|/| | | |
SI-7958 Deprecate methods `future` and `promise` in the `scala.concurren...
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|\ \ \
| |/ /
|/| | |
M6 modules, partest depends on scala as provided.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The new partest now marks its scala dependencies as provided.
This is much more robust than before, and it breaks ugly cycles.
Updated the build for partest-extras to provide the required
scala-compiler dependency.
Also, upgrade pax-url-aether to 1.6.0.
Since our jenkins uses mirrors with passwords,
we needed a fix for https://ops4j1.jira.com/browse/PAXURL-217
in order to run osgi.test on jenkins, now that we use maven more.
We didn't hit this bug before because we were using a standard
location for the maven local repository, but that causes problems
with concurrent jenkins jobs accessing it.
So, I added the following to `~/.m2/settings`,
and then ran into the issue described above.
Also removed some non-essential uses of the extra-repo (slows stuff down),
and added a comment of how to make the osgi tests look in a certain
local m2 repo (for /some/ operations...)
```
<!--
Maven repos are not safe for concurrent access, thus give each job its own.
The WORKSPACE env var is set by jenkins to the path of the current job's workspace.
This settings file will cause ant/maven to break if WORKSPACE is not set (to a writeable directory).
I don't know how to encode a fall back, but I assume it's not needed as this is ~jenkins/.m2/settings.xml
-->
<localRepository>${WORKSPACE}/m2repo</localRepository>
```
|
|\ \
| | |
| | | |
Add buildcharacter.properties to .gitignore.
|
|/ / |
|
|\ \
| | |
| | | |
Paulper stack reduction
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Restores a form of the previous peekAhead bookkeeping.
Instead of tracking the current token and offset outside
of xxxAhead, peekingAhead uses `in.prev` and will push
back if the operation results in an empty tree.
|
| | |
| | |
| | |
| | | |
Check files
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Centralizes the scattered logic surrounding erroneous
pattern syntax. Consolidates the redundant lookahead
implementations. Eliminates var manipulation in favor
of recursion.
|
| | |
| | |
| | |
| | |
| | | |
One fewer Int to be whizzing around the parser hoping to
be confused with other Ints.
|
|\ \ \
| | | |
| | | | |
Faster PR validation
|
| | | |
| | | |
| | | |
| | | |
| | | | |
As soon as they are also modularized, we can go back to
only building/publishing the core (lib/reflect/compiler).
|