Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/2.12.x' into opt/heuristics
Browse files Browse the repository at this point in the history
  • Loading branch information
lrytz committed Sep 18, 2015
2 parents 91cd6d1 + 76269ca commit 133e7d0
Show file tree
Hide file tree
Showing 146 changed files with 1,440 additions and 984 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -86,7 +86,7 @@ A pull request should consist of commits with messages that clearly state what p

Commit logs should be stated in the active, present tense.

A commit's subject should be 60 characters or less. Overall, think of
A commit's subject should be 72 characters or less. Overall, think of
the first line of the commit as a description of the action performed
by the commit on the code base, so use the active voice and the
present tense. That also makes the commit subjects easy to reuse in
Expand All @@ -113,7 +113,7 @@ Our pull request bot, Scabot, automatically builds all the commits in a PR indiv

Click on the little x next to a commit sha to go to the overview of the PR validation job. To diagnose a failure, consult the console output of the job that failed.

See the [scala-jenkins-infra repo](https://github.com/scala/scala-jenkins-infra) and [Scabot repo](https://github.com/) for full details on PR validation. One tip you should know is that commenting `/rebuild` on a PR asks validation to be run again on the same commits. This is only necessary when a spurious failure occurred.
See the [scala-jenkins-infra repo](https://github.com/scala/scala-jenkins-infra) and [Scabot repo](https://github.com/scala/scabot) for full details on PR validation. One tip you should know is that commenting `/rebuild` on a PR asks validation to be run again on the same commits. This is only necessary when a spurious failure occurred.

### Pass code review

Expand Down
76 changes: 41 additions & 35 deletions README.md
Expand Up @@ -25,13 +25,14 @@ If you need some help with your PR at any time, please feel free to @-mention an
<img src="https://avatars.githubusercontent.com/dickwall" height="50px" title="Dick Wall"/> | [`@dickwall`](https://github.com/dickwall) | process & community, documentation |
<img src="https://avatars.githubusercontent.com/dragos" height="50px" title="Iulian Dragos"/> | [`@dragos`](https://github.com/dragos) | specialization, back end |
<img src="https://avatars.githubusercontent.com/axel22" height="50px" title="Aleksandr Prokopec"/> | [`@axel22`](https://github.com/axel22) | collections, concurrency, specialization |
<img src="https://avatars.githubusercontent.com/janekdb" height="50px" title="Janek Bogucki"/> | [`@janekdb`](https://github.com/janekdb) | documentation |

P.S.: If you have some spare time to help out around here, we would be delighted to add your name to this list!

# Handy Links
- [A wealth of documentation](http://docs.scala-lang.org)
- [Scala CI](https://scala-ci.typesafe.com/)
- [Download the latest nightly](http://www.scala-lang.org/files/archive/nightly/2.11.x/);
- [Download the latest nightly](http://www.scala-lang.org/files/archive/nightly/2.11.x/)
- [(Deprecated) Scala CI at EPFL](https://scala-webapps.epfl.ch/jenkins/)
- Scala mailing lists:
- [Compiler and standard library development](https://groups.google.com/group/scala-internals)
Expand Down Expand Up @@ -78,7 +79,7 @@ To pinpoint bugs, we often use git bisect, which is only effective when we can c

This facilitates reviewing: a commit that reformats code can be judged quickly not to affect anything, so we can focus on the meat of the PR. It also helps when merging between long-running branches, reducing conflicts (or providing at least a limited scope for each one).

Please do not @mention anyone in the commit message -- that's what the PR description and comments are for. Every time a commit is shuffled through github (in a merge in some fork, say), every @mention results in an email to that person (the core team treats them as personal email, straight to their inbox, so please don't flood us :-)).
Please do not @-mention anyone in the commit message -- that's what the PR description and comments are for. Every time a commit is shuffled through github (in a merge in some fork, say), every @-mention results in an email to that person (the core team treats them as personal email, straight to their inbox, so please don't flood us :-)).


## Reviews
Expand All @@ -91,13 +92,18 @@ To help you plan your contributions, we communicate our plans on a regular basis

## Reviewing

Once you've gained some experience with the code base and the process, the logical next step is to offers reviews for others's contributions. The main goal of this whole process, in the end, is to ensure the health of the Scala project by improving the quality of the code base, the documentation, as well as this process itself. Thank you for doing your part!
Once you've gained some experience with the code base and the process, the next step is to review the contributions of others.

The main goal of this whole process is to ensure the health of the Scala project by improving the quality of the code base, the documentation, as well as this process itself. Thank you for doing your part!

## [Labels](https://github.com/scala/scala/labels)
- `reviewed` automatically added by scabot when a comment prefixed with LGTM is posted
- `welcome` reviewer / queue curator adds to welcome someone's first PR (for highlighting in the release notes)
- `release-notes` reviewer / queue curator adds to make sure this PR is highlighted in the release notes
- `on-hold` added when this PR should not yet be merged, even though CI is green

Label | Description
--------------- | -----------
`reviewed` | automatically added by scabot when a comment prefixed with LGTM is posted
`welcome` | reviewer / queue curator adds to welcome someone's first PR (for highlighting in the release notes)
`release-notes` | reviewer / queue curator adds to make sure this PR is highlighted in the release notes
`on-hold` | added when this PR should not yet be merged, even though CI is green

### Tips & Tricks
Once the `publish-core` task has completed on a commit, you can try it out in sbt as follows:
Expand Down Expand Up @@ -126,14 +132,23 @@ Use the latest IntelliJ IDEA release and install the Scala plugin from within th

The following steps are required to use IntelliJ IDEA on Scala trunk
- Run `ant init`. This will download some JARs to `./build/deps`, which are included in IntelliJ's classpath.
- Run src/intellij/setup.sh
- Open ./src/intellij/scala.ipr in IntelliJ
- File, Project Settings, Project, SDK. Create an SDK entry named "1.6" containing the Java 1.6 SDK.
- Run `./src/intellij/setup.sh`.
- Open `./src/intellij/scala.ipr` in IntelliJ.
- `File``Project Structure``Project``Project SDK`. Create an SDK entry named "1.6" containing the Java 1.6 SDK.
(You may use a later SDK for local development, but the CI will verify against Java 6.)

Compilation within IDEA is performed in "-Dlocker.skip=1" mode: the sources are built
directly using the STARR compiler (which is downloaded from maven, according to `starr.version` in `versions.properties`).
Compilation within IDEA is performed in `-Dlocker.skip=1` mode: the sources are built
directly using the STARR compiler (which is downloaded from [the Central Repository](http://central.sonatype.org/), according to `starr.version` in `versions.properties`).

## Building with sbt (EXPERIMENTAL)

The experimental sbt-based build definition has arrived! Run `sbt package`
to build the compiler. You can run `sbt test` to run unit (JUnit) tests.
Use `sbt test/it:test` to run integration (partest) tests.

We would like to migrate to sbt build as quickly as possible. If you would
like to help please use the scala-internals mailing list to discuss your
ideas and coordinate your effort with others.

## Building with Ant

Expand All @@ -144,25 +159,19 @@ Verify your build using `ant test-opt`.

The Scala build system is based on Apache Ant. Most required pre-compiled
libraries are part of the repository (in 'lib/'). The following however is
assumed to be installed on the build machine:
assumed to be installed on the build machine: TODO

## Building with Sbt (EXPERIMENTAL)

The experimental sbt-based build definition has arrived! Run `sbt package`
to build the compiler. You can run `sbt test` to run unit (JUnit) tests.
Use `sbt test/it:test` to run integration (partest) tests.

We would like to migrate to sbt build as quickly as possible. If you would
like to help please use the scala-internals mailing list to discuss your
ideas and coordinate your effort with others.

### Tips and tricks
### Ant Tips and tricks

Here are some common commands. Most ant targets offer a `-opt` variant that runs under `-optimise` (CI runs the -optimize variant).

- `./pull-binary-libs.sh` downloads all binary artifacts associated with this commit.
- `ant -p` prints out information about the commonly used ant targets.
- `ant` or `ant build`: A quick compilation (to build/quick) of your changes using the locker compiler.
Command | Description
----------------------- | -----------
`./pull-binary-libs.sh` | downloads all binary artifacts associated with this commit.
`ant -p` | prints out information about the commonly used ant targets.
`ant` or `ant build` | A quick compilation (to `build/quick`) of your changes using the locker compiler.
`ant dist` | builds a distribution in 'dists/latest'.
`ant all.clean` | removes all build files and all distributions.

A typical debug cycle incrementally builds quick, then uses it to compile and run the file
`sandbox/test.scala` as follows:
Expand All @@ -174,17 +183,14 @@ We typically alias `build/quick/bin/scalac -d sandbox` to `qsc` and `build/quick
`ant test-opt` tests that your code is working and fit to be committed:

- Runs the test suite and bootstrapping test on quick.
- You can run the suite only (skipping strap) with 'ant test.suite'.
- You can run the suite only (skipping strap) with `ant test.suite`.

`ant docs` generates the HTML documentation for the library from the sources using the scaladoc tool in quick.
Note: on most machines this requires more heap than is allocate by default. You can adjust the parameters with ANT_OPTS. Example command line:
Note: on most machines this requires more heap than is allocated by default. You can adjust the parameters with `ANT_OPTS`. Example command line:

```sh
ANT_OPTS="-Xms512M -Xmx2048M -Xss1M" ant docs
```
ANT_OPTS = "-Xms512M -Xmx2048M -Xss1M" ant docs
```

- `ant dist` builds a distribution in 'dists/latest'.
- `ant all.clean` Removes all build files and all distributions.

### Bootstrapping concepts
NOTE: This is somewhat outdated, but the ideas still hold.
Expand All @@ -194,7 +200,7 @@ compiles Scala in layers. Each layer is a complete compiled Scala compiler and l
A superior layer is always compiled by the layer just below it. Here is a short
description of the four layers that the build uses, from bottom to top:

- `starr`: the stable reference Scala release. We use an official version of Scala (specified by `starr.version` in `versions.properties`), downloaded from maven central.
- `starr`: the stable reference Scala release. We use an official version of Scala (specified by `starr.version` in `versions.properties`), downloaded from the Central Repository.
- `locker`: the local reference which is compiled by starr and is the work compiler in a typical development cycle. Add `locker.skip=true` to `build.properties` to skip this step and speed up development when you're not changing code generation. In any case, after it has been built once, it is “frozen” in this state. Updating it to fit the current source code must be explicitly requested (`ant locker.unlock`).
- `quick`: the layer which is incrementally built when testing changes in the compiler or library. This is considered an actual new version when locker is up-to-date in relation to the source code.
- `strap`: a test layer used to check stability of the build.
Expand Down
9 changes: 9 additions & 0 deletions bincompat-forward.whitelist.conf
Expand Up @@ -469,6 +469,15 @@ filter {
{
matchName="scala.util.Sorting.scala$util$Sorting$$booleanSort"
problemName=MissingMethodProblem
},
// SI-8362: AbstractPromise extends AtomicReference
// It's ok to change a package-protected class in an impl package,
// even though it's not clear why it changed -- bug in generic signature generation?
// -public class scala.concurrent.impl.Promise$DefaultPromise<T> extends scala.concurrent.impl.AbstractPromise implements scala.concurrent.impl.Promise<T>
// +public class scala.concurrent.impl.Promise$DefaultPromise<T extends java.lang.Object> extends scala.concurrent.impl.AbstractPromise implements scala.concurrent.impl.Promise<T>
{
matchName="scala.concurrent.impl.Promise$DefaultPromise"
problemName=MissingTypesProblem
}
]
}
2 changes: 1 addition & 1 deletion docs/TODO
Expand Up @@ -53,7 +53,7 @@

The process is about the same for symbols in PolyTypes. The main
difference is that type parameters may be referenced and thus we
need something like De Bruijn indicies to represent these
need something like De Bruijn indices to represent these
references.


Expand Down
6 changes: 3 additions & 3 deletions scripts/jobs/integrate/bootstrap
Expand Up @@ -33,7 +33,7 @@
# - Set <MODULE>_VER to override the default, e.g. XML_VER="1.0.4".
# - The git revision is set to <MODULE>_REF="v$<MODULE>_VER". Make sure the tag exists (you can't override <MODULE>_REF).
#
# - Otherwise (moduleVersioning has some other value): in this mode we use nightly version nubmers for modules.
# - Otherwise (moduleVersioning has some other value): in this mode we use nightly version numbers for modules.
# - By default the script sets all <MODULE>_REF to "HEAD", override to build a specific revision.
# - The <MODULE>_VER is set to a nightly version, for example "1.0.3-7-g14888a2-nightly" (you can't override <MODULE>_VER)

Expand Down Expand Up @@ -311,7 +311,7 @@ scalaVerToBinary() {
# - the suffix starts with "-bin": 2.12.0-bin-M1
# - the patch version is > 0 : 2.12.1-M1, 1.12.3-RC2, 2.12.1-sha-nightly, 2.12.2-SNAPSHOT
#
# Othwersise, the binary version is the full version: 2.12.0-M1, 2.12.0-RC2, 2.12.0-sha-nightly, 2.12.0-SNAPSHOT
# Otherwise, the binary version is the full version: 2.12.0-M1, 2.12.0-RC2, 2.12.0-sha-nightly, 2.12.0-SNAPSHOT
#
# Adapted from sbt: https://github.com/sbt/sbt/blob/0.13.8/util/cross/src/main/input_sources/CrossVersionUtil.scala#L39
#
Expand Down Expand Up @@ -513,7 +513,7 @@ bootstrap() {

echo "### Bootstrapping Scala using locker"

# # TODO: close all open staging repos so that we can be reaonably sure the only open one we see after publishing below is ours
# # TODO: close all open staging repos so that we can be reasonably sure the only open one we see after publishing below is ours
# # the ant call will create a new one
#
# Rebuild Scala with these modules so that all binary versions are consistent.
Expand Down
42 changes: 24 additions & 18 deletions spec/01-lexical-syntax.md
Expand Up @@ -398,40 +398,46 @@ members of type `Boolean`.
### Character Literals

```ebnf
characterLiteral ::= ‘'’ (printableChar | charEscapeSeq) ‘'’
characterLiteral ::= ‘'’ (charNoQuoteOrNewline | UnicodeEscape | charEscapeSeq) ‘'’
```

A character literal is a single character enclosed in quotes.
The character is either a printable unicode character or is described
by an [escape sequence](#escape-sequences).
The character can be any Unicode character except the single quote
delimiter or `\u000A` (LF) or `\u000D` (CR);
or any Unicode character represented by either a
[Unicode escape](01-lexical-syntax.html) or by an [escape sequence](#escape-sequences).

> ```scala
> 'a' '\u0041' '\n' '\t'
> ```
Note that `'\u000A'` is _not_ a valid character literal because
Unicode conversion is done before literal parsing and the Unicode
character `\u000A` (line feed) is not a printable
character. One can use instead the escape sequence `'\n'` or
the octal escape `'\12'` ([see here](#escape-sequences)).
Note that although Unicode conversion is done early during parsing,
so that Unicode characters are generally equivalent to their escaped
expansion in the source text, literal parsing accepts arbitrary
Unicode escapes, including the character literal `'\u000A'`,
which can also be written using the escape sequence `'\n'`.

### String Literals

```ebnf
stringLiteral ::= ‘"’ {stringElement} ‘"’
stringElement ::= printableCharNoDoubleQuote | charEscapeSeq
stringElement ::= charNoDoubleQuoteOrNewline | UnicodeEscape | charEscapeSeq
```

A string literal is a sequence of characters in double quotes. The
characters are either printable unicode character or are described by
[escape sequences](#escape-sequences). If the string literal
contains a double quote character, it must be escaped,
i.e. `"\""`. The value of a string literal is an instance of
class `String`.
A string literal is a sequence of characters in double quotes.
The characters can be any Unicode character except the double quote
delimiter or `\u000A` (LF) or `\u000D` (CR);
or any Unicode character represented by either a
[Unicode escape](01-lexical-syntax.html) or by an [escape sequence](#escape-sequences).

If the string literal contains a double quote character, it must be escaped using
`"\""`.

The value of a string literal is an instance of class `String`.

> ```scala
> "Hello,\nWorld!"
> "This string contains a \" character."
> "Hello, world!\n"
> "\"Hello,\" replied the world."
> ```
#### Multi-Line String Literals
Expand All @@ -443,7 +449,7 @@ multiLineChars ::= {[‘"’] [‘"’] charNoDoubleQuote} {‘"’}

A multi-line string literal is a sequence of characters enclosed in
triple quotes `""" ... """`. The sequence of characters is
arbitrary, except that it may contain three or more consuctive quote characters
arbitrary, except that it may contain three or more consecutive quote characters
only at the very end. Characters
must not necessarily be printable; newlines or other
control characters are also permitted. Unicode escapes work as everywhere else, but none
Expand Down
2 changes: 1 addition & 1 deletion spec/05-classes-and-objects.md
Expand Up @@ -631,7 +631,7 @@ class Outer {
```

Here, accesses to the method `f` can appear anywhere within
`OuterClass`, but not outside it. Accesses to method
`Outer`, but not outside it. Accesses to method
`g` can appear anywhere within the package
`outerpkg.innerpkg`, as would be the case for
package-private methods in Java. Finally, accesses to method
Expand Down
2 changes: 1 addition & 1 deletion spec/06-expressions.md
Expand Up @@ -1736,7 +1736,7 @@ so `scala.Any` is the type inferred for `a`.
_Eta-expansion_ converts an expression of method type to an
equivalent expression of function type. It proceeds in two steps.

First, one identifes the maximal sub-expressions of $e$; let's
First, one identifies the maximal sub-expressions of $e$; let's
say these are $e_1 , \ldots , e_m$. For each of these, one creates a
fresh name $x_i$. Let $e'$ be the expression resulting from
replacing every maximal subexpression $e_i$ in $e$ by the
Expand Down
2 changes: 1 addition & 1 deletion spec/07-implicits.md
Expand Up @@ -84,7 +84,7 @@ The _parts_ of a type $T$ are:
- if $T$ is an abstract type, the parts of its upper bound;
- if $T$ denotes an implicit conversion to a type with a method with argument types $T_1 , \ldots , T_n$ and result type $U$,
the union of the parts of $T_1 , \ldots , T_n$ and $U$;
- the parts of quantified (existential or univeral) and annotated types are defined as the parts of the underlying types (e.g., the parts of `T forSome { ... }` are the parts of `T`);
- the parts of quantified (existential or universal) and annotated types are defined as the parts of the underlying types (e.g., the parts of `T forSome { ... }` are the parts of `T`);
- in all other cases, just $T$ itself.

Note that packages are internally represented as classes with companion modules to hold the package members.
Expand Down

0 comments on commit 133e7d0

Please sign in to comment.