| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
When typer is running during erasure, must assign erased FunctionType
in typedFunction. This removes a bunch of unneeded casts now we no longer
assign a half-erased FunctionType.
I poked around a bit, and it looks like erasure doesn't want typer
to erase built-in types (like Unit/Any/Nothing).
They are already treated specially during erasure.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By reducing excessive factoring, we can save an extraneous call
to `asSeenFrom`, and hopefully in a following commit figure out
a bigger problem with `baseType` that is causing wrong subtyping results.
This commit is a pure refactoring, save for the dropped ASF call,
which is explained below.
To motivate the following change to `relativeInfo`:
```
private[Types] def relativeInfo = /*trace(s"relativeInfo(${safeToString}})")*/{
if (relativeInfoPeriod != currentPeriod) {
- val memberInfo = pre.memberInfo(sym)
- relativeInfoCache = transformInfo(memberInfo)
+ relativeInfoCache = memberInfoInstantiated
```
Let's consolidate the two removed line in this new method:
```
def memberInfoInstantiated = transformInfo(pre.memberInfo(sym))
```
To understand what `transformInfo` does, take these helpers spread over
various `*TypeRef` traits, and consolidate them:
```
- def asSeenFromOwner(tp: Type) = tp.asSeenFrom(pre, sym.owner)
// regular type refs:
- def transformInfo(tp: Type): Type = appliedType(asSeenFromOwner(tp), args)
// for no-args type refs:
- override def transformInfo(tp: Type): Type = appliedType(asSeenFromOwner(tp), dummyArgs)
```
By removing the dynamic dispatch, we get the following method
(given `require(args0 ne Nil, this)` in `ArgsTypeRef`,
and `args eq Nil` by construction in `NoArgsTypeRef` ):
```
def transformInfo(tp: Type) =
appliedType(tp.asSeenFrom(pre, sym.owner), if (args.isEmpty) dummyArgs else args)
```
Inlining `memberInfo`, which is defined as:
```
def memberInfo(sym: Symbol): Type = {
require(sym ne NoSymbol, this)
sym.info.asSeenFrom(this, sym.owner)
}
```
gives us:
```
def memberInfoInstantiated = transformInfo(sym.info.asSeenFrom(pre, sym.owner))
```
Inlining `transformInfo` as reworked above:
```
def memberInfoInstantiated =
appliedType(sym.info.asSeenFrom(pre, sym.owner).asSeenFrom(pre, sym.owner),
if (args.isEmpty) dummyArgs else args)
```
Whoops! One `asSeenFrom` should do...
```
+ final protected def memberInfoInstantiated: Type =
+ appliedType(sym.info.asSeenFrom(pre, sym.owner), if (args.isEmpty) dummyArgs else args)
```
|
|\
| |
| | |
SI-9349 Fix use of patmat binder as prefix for new x.Inner
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When substituting in references to the synthetic values
representing pattern binders, we were replacing:
Select(Ident(o).setType(o.type), TypeName("Inner"))
with:
Select(Ident(x2).setType(typeOf[Outer]), TypeName("Inner"))
The post transform in uncurry would then run:
else if (tree.isType)
TypeTree(tree.tpe) setPos tree.pos
Which would loses track of the outer term `o` and crashes the
compiler in ExplicitOuter.
This commit generates stable references to the binders.
I made this change in the substitutions for all `TreeMakers`,
however only one of seems like it triggers a crash in the
test variations I tried.
Here's how the trees for the first pattern in the test case
change after this patch:
```
@@ -1,30 +1,30 @@
[[syntax trees at end of patmat]] // test.scala
package <empty>{<empty>.type} {
object Test extends scala.AnyRef {
def <init>(): Test.type = {
Test.super{Test.type}.<init>{()Object}(){Object};
(){Unit}
}{Unit};
def main(args: Array[String]): Unit = {
val o1: Outer = Outer.apply{(i: Int)Outer}(5{Int(5)}){Outer};
{
case <synthetic> val x1: Outer = o1{Outer};
case5(){
if (x1.ne{(x$1: AnyRef)Boolean}(null{Null(null)}){Boolean})
matchEnd4{(x: Unit)Unit}({
- val i: Outer#Inner = new x1.Inner{Outer#Inner}{()Outer#Inner}(){Outer#Inner};
+ val i: x1.Inner = new x1.Inner{x1.Inner}{()x1.Inner}(){x1.Inner};
(){Unit}
}{Unit}){Unit}
else
case6{()Unit}(){Unit}{Unit}
}{Unit};
case6(){
matchEnd4{(x: Unit)Unit}(throw new MatchError{MatchError}{(obj: Any)MatchError}(x1{Outer}){MatchError}{Nothing}){Unit}
}{Unit};
matchEnd4(x: Unit){
x{Unit}
}{Unit}
}{Unit}
}{Unit}
}
```
|
|\ \
| | |
| | | |
SI-9542 Fix regression in value classes (served two ways)
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The new unit test shows failures in transitivity of subtyping
and type equivalence, which boil down the the inconsistent
handling of the semantically equivalent:
ThisType(pre, ModuleClass)
ModuleTypeRef(pre, ModuleClass)
SingleType(pre, Module)
This commit:
- adds a case to `normalizePlus` to unwrap a `ThisType` to
a `ModuleTypeRef`
- Use `normalizePlus` more widely during subtype comparison
- refactor `fourthTry` (part of `isSubType`) to remove code
that becomes obviated by the use of `normalizePlus`.
This fixes the regression in the extension methods phase which
was triggered by https://github.com/scala/scala/pull/4749.
We can also fix that regression by tweaking the extension methods
phase itself to emit the `ThisType` representation of the owner
of the value class, as before.
I plan to demonstrate the two approaches to fixing the regression
on separate branches, and the propose that the merged result of these
two is useds.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In SI-9473 / e2653736, I changed `mkAttributedRef` to avoid prefixing
references to statically owned symbols with a `ThisType`.
Turns out there was one place that depended on the old behaviour.
```
object Outer {
trait T
class C(val value: Any) extends AnyVal {
def foo(t: T) = expr
}
}
```
Is translated to:
```
object Outer {
trait T
class C(val value: Any) extends AnyVal {
def foo(t: T) = Outer.this.C.foo$extension(C.this, t)
}
object C {
def foo$extension($this: C, t: T) = expr
}
}
```
After the change, the forwarder was instead:
```
def foo(t: T) = Outer.C.foo$extension(C.this, t)
```
Note: this change is not actually necessary after the following
commit that makes subtyping unify the different module class
reference, that alone is enough to make the enclosed test
pass.
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
felixmulder/topic/scaladoc-hideImplicitConversions-tag
SI-9620: add doc annotation to hide specific conversions
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit will introduce the doc annotation `@hideImplicitConversion`.
By specifying which conversions to hide, the user can "toggle" which
conversions are kept in the parsed entity.
This implementation is a better workaround than hardcoding which ones to
ignore when running scaladoc.
Review: @VladUreche
|
|\ \ \
| | | |
| | | | |
SI-9574 Prevent illegal overrides of members with module types
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Commit f32a32b1b33c9d7ccd62467e3e10cb69930023c8 introduced the ability
to override objects with other objects. The exception that allows
these overrides (where the usual subtyping check fails) was applied to
all members whose type is a module class. This is too broad, however,
because it not only applies to members of the form `object foo` but
also `def foo: bar.type` (where `bar` is an `object`).
The fix is to restrict the exception to those cases where both
definitions actually are objects.
|
|\ \ \ \
| | | | |
| | | | | |
Scaladoc: fix duplicate implicits in Array
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | | |
Scaladoc: add pan & zoom feature to Type Inheritance graphs
|
|/ / / / |
|
|\ \ \ \
| |/ / /
|/| | | |
Scaladoc: fix stray number in codeblocks for firefox
|
|/ / / |
|
|\ \ \
| | | |
| | | | |
Merge/2.11.x to 2.12.x 20160203 [ci: last-only]
|
| |\ \ \
| |/ / /
|/| | |
| | | | |
merge/2.11.x-to-2.12.x-20160203
|
|\ \ \ \
| | | | |
| | | | | |
Update partest to 1.0.12, test case for reporting invalid flags
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
restore / rewrite various tests
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Rewrite tests for new optimizer
- SI-6941
- SI-2171
- t3430
- t3252
- t4840
- t2171
- t3430
- t3252
- t6157
- t6547
- t8062
- t8306
- t8359
- t9123
- trait-force-info
- private-inline
test cases for bugs fixed in the new optimizer
- SI-9160, the unnecessary boxing mentioned in the ticket is optimzied
since push-pop elimination (#4858).
- SI-8796
- SI-8524
- SI-7807
fix flags file for t3420
remove an empty flags file
remove unnecessary partest filters
explicit inliner warnings in test t7582
Restore the lisp test. Removing the flags file - our build runs with the
(new) optimizer enabled anyway.
The test spent the past few years as an optimizer test in pos/
see https://issues.scala-lang.org/browse/SI-4512. The attempt may fail,
but why not give it a try.
$ git lg -S"lisp"
...
| * | | | f785785 - SI-4579 Yoke the power of lisp.scala as a stress for the optimizer. (3 years, 8 months ago) <Jason Zaugg>
...
* | | | | | | 622cc99 - Revert the lisp test. (3 years, 10 months ago) <Paul Phillips>
...
* | | | | | | 97f0324 - Revived the lisp test. (3 years, 10 months ago) <Paul Phillips>
...
* | 1e0f7dc - Imprison the lisp test, no review. (4 years, 4 months ago) <Paul Phillips>
...
* | 6b09630 - "Freed the lisp test." Tweaked partest defaults... (4 years, 6 months ago) <Paul Phillips>
...
* | fec42c1 - Lisp test wins again, no review. (4 years, 8 months ago) <Paul Phillips>
...
* | 1c2d44d - Restored the lisp.scala test. (4 years, 8 months ago) <Paul Phillips>
...
* | 15ed892 - Temporarily sending lisp.scala to be interprete... (4 years, 8 months ago) <Paul Phillips>
...
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Improve simplifyJumps to rewrite
IFEQ L4
L5
GOTO L6
to
IFNE L6
L5
This rewrite is only correct if L5 is not the target of any jump
instruction (otherwise, removing the GOTO would change semantics).
Previously we did not do the rewrite if there was any label between
the conditional jump and the goto (like L5). Now we track which labels
are jump targets.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-9315 Desugar string concat to java.lang.StringBuilder ...
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
... instead of scala.collection.mutable.StringBuilder to benefit from
JVM optimizations. Unfortunately primitives are already boxed in erasure
when they end up in this part of the backend.
|
|\ \ \ \ \ \
| |_|/ / / /
|/| | | | | |
Clarified and expanded which Builders were reusable
|
| | |_|/ /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This additionally fixes both SI-8648 and SI-9564.
Added documentation to Builder to clarify that in general Builders are NOT reusable.
Altered implementation of GrowingBuilder to use Growable instance's clear (not valid for a reusable builder, but this one isn't reusable).
Added a new marker trait ReusableBuilder that specifies that these builders should be reusable. This trait overrides the clear and result methods while leaving them abstract in order to supply appropriate scaladoc.
Made all Array builders Reusable in all cases (by setting capacity to 0 if the original array is returned). (Fixed a poor implmentation of Array[Unit] builder along the way.)
Documented which other builders were already reusable (maps, sets, Vector, LazyBuilder, StringBuilder, ListBuffer, etc.).
|
| | | |\ \
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Conflicts:
build.sbt
scripts/jobs/integrate/bootstrap
|
| | | | |\ \
| | | | | | |
| | | | | | | |
SI-9572 Check for illegal tuple sizes in the parser
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This commit adds explicit checks with syntax errors for tuple literals
and types of more than 22 elements. An alternative approach to fixing
SI-9572 would be to revert to the old failure mode of Scala 2.10 where
references to arbitrary `scala.TupleXY` would be generated in the
parser, which then leads to “type/object not found” errors in the
typechecker. This fix here is more intrusive but arguably provides a
better user experience.
Methods `stripParens` and `makeBinop` are moved from `TreeBuilder` to
`Parsers` because they can now generate syntax errors. New methods
`makeSafeTupleType` and `makeSafeTupleTerm` implement the error checking
on top of `makeTupleType` and `makeTupleTerm`. They are overridden with
no-op versions in the quasiquotes parser because it also overrides `makeTupleType` and `makeTupleTerm` in a way that supports arbitrary tuple sizes.
|
| | | | |\ \ \
| | | | | | | |
| | | | | | | | |
fix broken links to Scala CLA
|
| | | | | | | | |
|
| | | | |\ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-9534 Use BoxedUnit in all cases for creating Array[Unit]
|
| | | | | | |/ /
| | | | | |/| |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Calling `wrap` or one of the higher-dimension Array factory methods on
the `Manifest` for `Unit` led to an exception because it tried to use
`void` as a primitive type. Unlike all other primitive Scala types,
`Unit` needs to be boxed. The basic `newArray` method was not affected
by this bug because it was already special-cased. The fix is to also
special-case `arrayClass`.
|
| | | | |\ \ \ \
| | | | | | | | |
| | | | | | | | | |
tweak my own entry in the readme
|
| | | | |/ / / / |
|
| | | | |\ \ \ \
| | | | | |/ / /
| | | | |/| | | |
sbt-based PR validation job
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
# Improve version handling in the sbt build:
The new settings `baseVersion` and `baseVersionSuffix` make it easier
to set version numbers for different kinds of builds in a consistent
way without e.g. having to first get a git SHA outside of sbt.
The new task `generateBuildCharacterPropertiesFile` writes the file
`buildcharacter.properties` to the root dir. The format is compatible
with the same file produced by the ANT build but it only contains a
subset of the properties, in particular the Maven version, which is
needed in publishing scripts and passed around between different
Jenkins jobs as `jenkins.properties`.
SHAs in version numbers are consistently shortened to 7 digits (as used
by git and github). Previously we used 7 digits in Maven snapshot
version numbers but 10 digits in canonical and OSGi version numbers.
# Add Jenkins script support to the sbt build:
The new command `setupPublishCore` takes the PR validation snapshot
repository as an argument and changes the required settings for the
`publish-core` build (use SHA-SNAPSHOT versioning, compile with
optimization enabled, do not publish scaladoc sets)
For example, the following command can be used to generate
`buildcharacter.properties` with the version numbers needed for PR
validation builds:
sbt setupPublishCore dummy generateBuildCharacterPropertiesFile
The sbt build will now automatically detect and use a “~/.credentials”
file with the credentials for publishing to a remote repository.
# Call sbt from `publish-core`:
The correct`$SBT_CMD` is set directly in `bootstrap` and used by
`publish-core` to first generate `buildcharacter.properties` and then
build and publish. Parsing the git revision, computing a version
number and getting binary dependencies are no longer required in the
script. This is all done in the sbt build.
|
| | | | |\ \ \ \
| | | | | | | | |
| | | | | | | | | |
Trim complexity in CommentFactoryBase
|
| | | | | | |/ /
| | | | | |/| |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
1. Replace option handling with library call
2. Remove NumberFormatException catch presumed to be copy/paste legacy
3. It's Scaladoc
4. Parse trailing whitespace regex once instead of per line
5. Use string interpolation where it improves readability
6. Add missed alternative to block grammar production rule
7. Add regression test for tag requirement warnings
|
| | | | |\ \ \ \
| | | | | | | | |
| | | | | | | | | |
Some fixes for the sbt build on Windows
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
We now normalize EOLs in `ScalaTool` to LF when reading the templates,
and write them as CRLF or LF depending on the target platform. This
allows the script templates to be stored locally with either LF or CRLF
line endings (which can both happen, depending on the platform and git
configuration).
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Instead of waiting for a Java-8-only build to use
`Files.setPosixPermissions()` we can call `setExecutable` and
`setReadable`, both of which are available on Java 6.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
The generated scripts for "quick" are not portable anyway (neither in
the sbt build nor in the ant build) because they contain absolute
paths. When using the sh versions on Windows in MSYS or Cygwin, the
classpath must be in Windows format because "java" expects it that way.
Note that none of this applies to "pack" (and thus to distribution
builds) where the classpath is constructed dynamically by the launcher
scripts itself.
|
| | | | | | | | | |
|
| | | | |\ \ \ \ \
| | | | | |_|/ / /
| | | | |/| | | | |
Link 'Future' scaladoc to 'Futures and Promises'
|
| | | | |/ / / / |
|