| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follow-up to fb061f22d4c35df626d9651e017820a11f8fe56e
which allowed the type param only.
Reported:
```
scala> object Test {
| def a[R](implicit s: List[R]):Int = 0
| def a_=[R](v: Int)(implicit s: List[R]) = ()
| }
```
|
|\
| |
| | |
Avoid compiler crash with missing transitive dependencies
|
| |
| |
| |
| |
| | |
Given that we correctly setup the flags on the stub symbol,
we no longer trip an assertion in ModuleTypeRef's constructor.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In this test case, the backend forces the specialization
info transform of `Sub` during computation of its
inner class metadata. This in turn runs the info transforms
of the `Base`. This leads to the uncurry info tranform
transforming a signature that has a type alias as a
method parameter type. Subsequent substution of the new
method symbol into the result type, which includes a
stub symbol for an absent class, tripped an assertion:
```
requirement failed: package b
java.lang.IllegalArgumentException: requirement failed: package b
at scala.Predef$.require(Predef.scala:277)
at scala.reflect.internal.Types$ModuleTypeRef.<init>(Types.scala:1879)
at scala.reflect.internal.Types$PackageTypeRef.<init>(Types.scala:1897)
at scala.reflect.internal.Types$TypeRef$.apply(Types.scala:2401)
at scala.reflect.internal.Types.typeRef(Types.scala:3553)
at scala.reflect.internal.Types.typeRef$(Types.scala:3536)
at scala.reflect.internal.SymbolTable.typeRef(SymbolTable.scala:16)
at scala.reflect.internal.Symbols$TypeSymbol.newTypeRef(Symbols.scala:3026)
at scala.reflect.internal.Symbols$TypeSymbol.updateTypeCache(Symbols.scala:3079)
at scala.reflect.internal.Symbols$TypeSymbol.maybeUpdateTypeCache(Symbols.scala:3065)
at scala.reflect.internal.Symbols$TypeSymbol.tpe_$times(Symbols.scala:3043)
at scala.reflect.internal.Symbols$Symbol.typeOfThis(Symbols.scala:2020)
at scala.reflect.internal.Types$ThisType.underlying(Types.scala:1184)
at scala.reflect.internal.Types$SimpleTypeProxy.boundSyms(Types.scala:150)
at scala.reflect.internal.Types$SimpleTypeProxy.boundSyms$(Types.scala:150)
at scala.reflect.internal.Types$SingletonType.boundSyms(Types.scala:1088)
at scala.reflect.internal.tpe.TypeMaps$SubstMap.apply(TypeMaps.scala:726)
at scala.reflect.internal.tpe.TypeMaps$SubstSymMap.apply(TypeMaps.scala:789)
at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:102)
at scala.reflect.internal.tpe.TypeMaps$SubstSymMap.apply(TypeMaps.scala:783)
at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:102)
at scala.reflect.internal.tpe.TypeMaps$SubstSymMap.apply(TypeMaps.scala:783)
at scala.reflect.internal.Types$Type.substSym(Types.scala:727)
at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:123)
at scala.reflect.internal.transform.UnCurry$$anon$1.apply(UnCurry.scala:53)
at scala.reflect.internal.transform.UnCurry.transformInfo(UnCurry.scala:154)
```
This commit address the direct failure above by setting coherent flags on
the stub package class symbol (it also needs the MODULE flag).
|
|\ \
| | |
| | | |
Improved error messages for identically named, differently prefixed types
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
`scala.color` now has 3 states: `true`, `false` and `auto`
(the default). `auto` allows colors if not on windows and if the shell
is interactive (as in, both stdin and stdout are a tty).
The autodetect works as expected when run via SBT too, and it can always
be overriden on the CLI or via JAVA_OPTS.
|
|\ \ \
| | | |
| | | | |
Refactor lookupCompanion
|
| | |/
| |/|
| | |
| | |
| | | |
- Check for module class up front to use sourceModule
- Consolidate most of the logic in Contexts
|
|\ \ \
| | | |
| | | | |
SI-9881 Fix ImportHandler's reporting of importedNames and importedSymbols
|
| | |/
| |/| |
|
|\ \ \
| | | |
| | | | |
SI-10026 Fix endless cycle in runtime reflection
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
56f23af introduced a call to `baseTypeSeq` of `scala.collection.mutable.ArrayOps.ofRef[?T]{}`
in `findMember`. This exposed a latent bug in the synchronized wrapper of `BaseTypeSeq`,
demonstrated below with an older version of Scala:
```
Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_112).
Type in expressions for evaluation. Or try :help.
scala> val symtab = reflect.runtime.universe.asInstanceOf[scala.reflect.internal.SymbolTable]
symtab: scala.reflect.internal.SymbolTable = scala.reflect.runtime.JavaUniverse@458544e0
scala> import symtab._
import symtab._
scala> val ArrayOps_ofRef_Class = symtab.symbolOf[scala.collection.mutable.ArrayOps.ofRef[AnyRef]]
ArrayOps_ofRef_Class: symtab.TypeSymbol = class ofRef
scala> appliedType(symbolOf[Set[Any]], symbolOf[Set[Any]].typeParams.map(TypeVar(_)))
res2: symtab.Type = Set[?A]
scala> .narrow
res3: symtab.Type = <none>.<refinement>.type
scala> .baseTypeSeq
java.lang.StackOverflowError
at scala.reflect.runtime.Gil$class.gilSynchronized(Gil.scala:21)
at scala.reflect.runtime.JavaUniverse.gilSynchronized(JavaUniverse.scala:16)
at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$class.map(SynchronizedOps.scala:27)
at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anon$2.map(SynchronizedOps.scala:34)
at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$class.lateMap(SynchronizedOps.scala:34)
at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anon$2.lateMap(SynchronizedOps.scala:34)
at scala.reflect.internal.BaseTypeSeqs$MappedBaseTypeSeq.map(BaseTypeSeqs.scala:235)
at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anon$2.scala$reflect$runtime$SynchronizedOps$SynchronizedBaseTypeSeq$$super$map(SynchronizedOps.scala:34)
at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anonfun$map$1.apply(SynchronizedOps.scala:27)
at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anonfun$map$1.apply(SynchronizedOps.scala:27)
at scala.reflect.runtime.Gil$class.gilSynchronized(Gil.scala:19)
at scala.reflect.runtime.JavaUniverse.gilSynchronized(JavaUniverse.scala:16)
at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$class.map(SynchronizedOps.scala:27)
at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anon$2.map(SynchronizedOps.scala:34)
at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$class.lateMap(SynchronizedOps.scala:34)
at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anon$2.lateMap(SynchronizedOps.scala:34)
at scala.reflect.internal.BaseTypeSeqs$MappedBaseTypeSeq.map(BaseTypeSeqs.scala:235)
```
The infinite cycle involves:
```
class MappedBaseTypeSeq(orig: BaseTypeSeq, f: Type => Type) extends BaseTypeSeq(orig.parents map f, orig.elems) {
...
override def map(g: Type => Type) = lateMap(g)
override def lateMap(g: Type => Type) = orig.lateMap(x => g(f(x)))
}
trait SynchronizedBaseTypeSeq extends BaseTypeSeq {
...
override def map(f: Type => Type): BaseTypeSeq = gilSynchronized { super.map(f) }
override def lateMap(f: Type => Type): BaseTypeSeq =
// only need to synchronize BaseTypeSeqs if they contain refined types
if (map(f).toList.exists(_.isInstanceOf[RefinedType])) new MappedBaseTypeSeq(this, f) with SynchronizedBaseTypeSeq
else new MappedBaseTypeSeq(this, f)
}
```
This commit creates a new factory method for `MappedBaseTypeSeq`-s to break the cycle.
As an independent change, I have also removed the attempt to conditionally synchronize them,
as the condition was eagerly applying the map function (and throwing away the result!).
I've appeased MiMa with new whitelist entries, but I'm confident that this is deep enough
in the bowels of our runtime reflection implementation that there is no way that user code
will be calling these methods directly.
|
|\ \ \
| | | |
| | | | |
More groundwork for JDK 9 support
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
A package protected method was added:
Stream<Package> packages()
The private accessor method for `val package` in our subclass
now violates the "cannot tighten access" rule.
Making it `private[this]` avoids creating an accessor.
|
| |/ /
|/| |
| | |
| | | |
This case can be triggered as illustrated in the test.
|
|\ \ \
| | | |
| | | | |
fix recent regression: macro paradise + Java sources = MatchError
|
| | | |
| | | |
| | | |
| | | |
| | | | |
fixes https://github.com/scala/scala-dev/issues/303 ;
the regression was in https://github.com/scala/scala/pull/5585
|
|\| | | |
|
| |\ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
janekdb/topic/2.12.x-scaladoc-spelling-corrections-2
Fix typos in compiler and reflect
|
| | |/ /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Miscellania:
Miscellania is a small island off the northernmost part
of the Fremennik Isles - RunScape Wiki
Miscellanea:
A collection of miscellaneous objects or writings - Merriam-Webster
|
| |\ \ \
| | | | |
| | | | | |
SI-4700 The thrilling continuation to the infix type printing saga.
|
| | | | |
| | | | |
| | | | |
| | | | | |
Add ability to disable this via the @showAsInfix annotation.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
```
scala> import scala.annotation.infix
import scala.annotation.infix
scala> @infix class &&[T, U]
defined class $amp$amp
scala> def foo: Int && Boolean = ???
foo: Int && Boolean
```
|
|\ \ \ \ \ |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
A Scala method that implements a generic, Java-defined
varargs method, needs two bridges:
- to convert the collections for the repeated parameters (VBRIDGE)
- to bridge the generics gap (BRIDGE)
Refchecks emits the varargs "bridges", and erasure takes care
of the other gap. Because a VBRIDGE was also an ARTIFACT,
it was wrongly considered inert with respect to erasure,
because `OverridingPairs` by default excluded artifacts.
Removed the artifact flag from those VBRIDGES, so that they
qualify for a real bridge. It would also work to include
VBRIDGE methods that are artifacts in BridgesCursor.
|
| |\ \ \ \ \
| | | | | | |
| | | | | | | |
[backport] SI-10071 SI-8786 varargs methods
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Cloning the original symbol in its entirety, rather than cloning
its type/value parameters individually. `cloneSymbol` takes care of
all the tricky substitutions for us!
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Make sure that methods annotated with varargs are properly mixed-in. This commit
splits the transformation into an info transformer (that works on all symbols, whether
they come from source or binary) and a tree transformer.
The gist of this is that the symbol-creation part of the code was moved to the UnCurry
info transformer, while tree operations remained in the tree transformer. The newly
created symbol is attached to the original method so that the tree transformer can still
retrieve the symbol.
A few fall outs:
- I removed a local map that was identical to TypeParamsVarargsAttachment
- moved the said attachment to StdAttachments so it’s visible between reflect.internal
and nsc.transform
- a couple more comments in UnCurry to honour the boy-scout rule
|
|\| | | | | |
| |_|/ / / /
|/| | | | | |
|
| |\ \ \ \ \
| | | | | | |
| | | | | | | |
SI-9114 Fix crasher in pattern matcher with type aliases
|
| | |/ / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
When determining whether or not a pattern match requires an equality
check of the outer instance of a type in addition to a type test,
`needsOuterTest` determines if the intersection of the selector and
the pattern types could be populated. Both type arrive at
`isPopulated` dealised.
However, `isPopulated` recurs when it encounters an existential,
and, as seen in thest case, a failure to dealias the quantified
type can lead to an assertion failure as we try to relate a
typeref to an alias and a typeref to a class.
See also SI-7214, which added deliasing of the pattern type
before calling `isPopulated`.
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Time for the courage of our convictions: follow the advice of my
TODO comment from SI-8244 / f62e280825 and fix `classExistentialType`
once and for all.
This is the change in the generated `canEquals` method in the test
case; we no longer get a kind conformance error.
```
--- sandbox/old.log 2015-05-27 14:31:27.000000000 +1000
+++ sandbox/new.log 2015-05-27 14:31:29.000000000 +1000
@@ -15,7 +15,7 @@
case _ => throw new IndexOutOfBoundsException(x$1.toString())
};
override <synthetic> def productIterator: Iterator[Any] = runtime.this.ScalaRunTime.typedProductIterator[Any](Stuff.this);
- <synthetic> def canEqual(x$1: Any): Boolean = x$1.$isInstanceOf[Stuff[Proxy[PP]]]();
+ <synthetic> def canEqual(x$1: Any): Boolean = x$1.$isInstanceOf[Stuff[_ <: [PP]Proxy[PP]]]();
override <synthetic> def hashCode(): Int = ScalaRunTime.this._hashCode(Stuff.this);
override <synthetic> def toString(): String = ScalaRunTime.this._toString(Stuff.this);
override <synthetic> def equals(x$1: Any): Boolean = x$1 match {
@@ -38,9 +38,3 @@
}
}
```
I also heeded my own advice to pass in a prefix to this method.
|
| |_|/ /
|/| | |
| | | |
| | | |
| | | |
| | | | |
The old EOL is EOL. Use `println()` when feasible and obvious.
Minor cleanup of surrounding code.
|
|\ \ \ \
| | | | |
| | | | | |
fix doc for walkfilter and walk
|
| | |_|/
| |/| | |
|
|\ \ \ \
| | | | |
| | | | | |
SI-10097 Error if no non-implicit case class param
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Case class must have a non-implicit param list.
Error early, error often.
Also update spec to say that class implicitly gets
a non-implicit parameter section if it doesn't
have one, and that a case class must have one.
|
| |/ / /
|/| | | |
|
|\ \ \ \
| | | | |
| | | | | |
SI-10093 don't move member traits to constructor body in constructors
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Fixes a regression introduced in c8e6050. Member traits with only
abstract definitions (`isInterface`) were moved into the primary
constructor by mistake. (Flatten moved the classes back.)
The member trait was duplicated into the constructor of specialized
subclasses, causing it to be generated multiple times.
Also removes some unnecessary `isMixinConstructor` checks: the mixin
constructor is always the primary constructor.
This commit also clarifies (and tests) what `isInterface` means: for
scala-defined traits, it means there are only abstract members. For
java-defined interfaces, it is always true.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
"sbt" is not an acronym (it used to be, but it isn't any longer).
It's a proper name, like "iPhone" or "eBay".
So, just like you wouldn't write "Get Started With EBay" or
"How To Reset Your IPhone", we don't write "Using the Sbt Build".
|
|\ \ \ \ \
| |_|/ / /
|/| | / /
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | | |
merge/2.11.x-to-2.12.x-20161220
Conflicts:
bincompat-backward.whitelist.conf
build.xml
src/compiler/scala/tools/nsc/typechecker/Typers.scala
src/library/scala/collection/immutable/NumericRange.scala
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Since we don't parse Java expressions, fields of Java classes coming
from source files never have constant types. This prevents using
static java fields in annotation arguments in mixed compilation
This PR assigns constant types to final static java fields if the
initializer is a simple literal.
|
| |\ \ \
| | | | |
| | | | | |
SI-2712 Add support for higher order unification
|
| | | | | |
|
| |\ \ \ \
| | | | | |
| | | | | | |
[nomerge] Partial fix for SI-7046
|