| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Go back to using globalError to report when a stub's info is referenced,
and only throw the MissingRequirementError when compilation really
must abort due to having a StubTermSymbol in a place where a
StubClassSymbol would have been a better choice.
This situation arises when an entire package is missing from the
classpath, as was the case in the reported bug.
Adds `StoreReporterDirectTest`, which buffers messages issued
during compilation for more structured interrogation. Use this
in two test for manifests -- these tests were using a crude means
of grepping compiler console output to focus on the relevant output,
but this approach was insufficient with the new multi-line error
message emitted as part of this change.
Also used that base test class to add two new tests: one for
the reported error (package missing), and another for a simpler
error (class missing). The latter test shows how stub symbols
allow code to compile if it doesn't the subset of signatures
in some type that refer to a missing class.
Gave the INFO/WARNING/ERROR members of Reporter sensible
toString implementations; they inherit from Enumeration#Value
in an unusual manner (why?) that means the built in toString of
Enumeration printed `Severity@0`.
|
|
|
|
|
|
| |
Only exclude hashCode and equals from being overridden in
value classes, not other synthetics which may turn up such
as case class methods.
|
|
|
|
|
| |
Don't prohibit equals and hashCode in universal traits;
instead, always override them in value classes.
|
|\
| |
| | |
SI-6526 Tail call elimination should descend deeper.
|
| | |
|
| |
| |
| |
| |
| | |
It wasn't traversing into Select nodes nor into the receiver of
a tail call.
|
|/
|
|
|
|
|
|
| |
I found a more direct expression of the unchecked logic,
which should be much easier for others to verify. But the
bug being fixed here is that the unchecked checking happens
too early, and the sealed children of a symbol are not yet
visible if it is being simultaneously compiled.
|
|
|
|
| |
This seems the safest course of action for 2.10.0.
|
|\
| |
| | |
undeprecates manifests for 2.10.0
|
| |
| |
| |
| |
| |
| |
| |
| | |
Since scala-reflect.jar is going to be declared experimental for 2.10.0,
it doesn't make sense to deprecate manifests in favor of type tags.
Class manifests, however, ARE deprecated for class tags, because class tags
don't require scala-reflect.jar and are generated independently of type tags.
|
|\ \
| |/
|/| |
SI-6451: Rename classes in `unchecked-abstract.scala` test.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As reported Miguel, `Con` is problematic name of a class on Windows
and makes this test to fail. Renamed classes to something else which
hopefully make Windows build happy again.
Closes SI-6451.
Review by @magarciaEPFL or @paulp.
|
|\ \
| | |
| | | |
AnyVal/value classes restrictions
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Nested objects, classes and lazy vals are disallowed at any
nesting level in value classes; e.g. lazy vals local to a
method defined in a value class. There are still allowed in
universal traits.
This is a temporary, implementation restriction that is planned
to be addressed in future releases of Scala. Error messages has
been updated to communicate that intent.
Moved tests for SI-5582 and SI-6408 to pending folder. They have
to stay there until implementation restrictions are addressed.
Closes SI-6408 and SI-6432.
Review by @odersky, @harrah and @adriaanm.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
and brought compiler in line with them. One thing we can accept IMO are nested
classes (nested objects are still a problem). In fact, it makes no sense to
exclude nested classes from value classes but not from universal traits. A class
nested in universal trait will becomes a class nested in a value class by
inheritance. Note that the reflection library already contains a universal trait
with a nested class (IndexedSeqLike), so we should accept them if we can.
|
|\ \
| |/
|/| |
SI-6436 Handle ambiguous string processors
|
| |
| |
| |
| |
| |
| |
| |
| | |
Before, we got in an inifinite loop by chasing
the error typed result of adaptToMemberWithArgs.
One point of befuddlement remains: why did t6436 and t6436b
behave differently before this change?
|
|/
|
|
| |
This reverts commit 5c5e8d4dcd151a6e2bf9e7c259c618b9b4eff00f.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I will again defer to a comment.
/** Given classes A and B, can it be shown that nothing which is
* an A will ever be a subclass of something which is a B? This
* entails not only showing that !(A isSubClass B) but that the
* same is true of all their subclasses. Restated for symmetry:
* the same value cannot be a member of both A and B.
*
* 1) A must not be a subclass of B, nor B of A (the trivial check)
* 2) One of A or B must be completely knowable (see isKnowable)
* 3) Assuming A is knowable, the proposition is true if
* !(A' isSubClass B) for all A', where A' is a subclass of A.
*
* Due to symmetry, the last condition applies as well in reverse.
*/
|
|
|
|
|
|
|
|
|
|
|
| |
I had this in before, then removed it since it is sometimes
redundant with an error message later issued by the pattern
matcher (e.g. scrutinee is incompatible with pattern type.)
However it also catches a lot of cases which are not errors,
so I think the modest redundancy is tolerable for now.
I also enhanced the logic for recognizing impossible
type tests, taking sealedness into account.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Closes SI-6275, SI-5762.
The comment says is better than I can.
/** On pattern matcher checkability:
*
* Consider a pattern match of this form: (x: X) match { case _: P => }
*
* There are four possibilities to consider:
* [P1] X will always conform to P
* [P2] x will never conform to P
* [P3] X <: P if some runtime test is true
* [P4] X cannot be checked against P
*
* The first two cases correspond to those when there is enough static
* information to say X <: P or that !(X <: P) for all X and P.
* The fourth case includes unknown abstract types or structural
* refinements appearing within a pattern.
*
* The third case is the interesting one. We designate another type, XR,
* which is essentially the intersection of X and |P|, where |P| is
* the erasure of P. If XR <: P, then no warning is emitted.
*
* Examples of how this info is put to use:
* sealed trait A[T] ; class B[T] extends A[T]
* def f(x: B[Int]) = x match { case _: A[Int] if true => }
* def g(x: A[Int]) = x match { case _: B[Int] => }
*
* `f` requires no warning because X=B[Int], P=A[Int], and B[Int] <:< A[Int].
* `g` requires no warning because X=A[Int], P=B[Int], XR=B[Int], and B[Int] <:< B[Int].
* XR=B[Int] because a value of type A[Int] which is tested to be a B can
* only be a B[Int], due to the definition of B (B[T] extends A[T].)
*
* This is something like asSeenFrom, only rather than asking what a type looks
* like from the point of view of one of its base classes, we ask what it looks
* like from the point of view of one of its subclasses.
*/
|
|\ |
|
| |
| |
| |
| |
| |
| | |
This brings all the files into line with the .gitattributes
settings, which should henceforth be automatically maintained
by git.
|
|\ \
| | |
| | | |
Fixes SI-6337 by disallowing nested value classes.
|
| | |
| | |
| | |
| | | |
It seems for the moment too hard to allow this, and the functionality to have value classes wrap other value classes does not seem essential.
|
|\ \ \
| | | |
| | | | |
Pullreq 1342
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Position error messages about structural type members at the
problematic parameter or type.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
As Mark's comments on SI-6336 shows, we also need to disallow value classes
as return types of structural types.
|
|\ \ \ \
| |_|_|/
|/| | | |
enable integer multiplication/divison on FiniteDuration, see SI-6389
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
so that the full package can be imported naturally:
import scala.concurrent.duration._
will give you all the types (Duration, FiniteDuration, Deadline) and the
DSL for constructing these.
|
| | |
| | |
| | |
| | |
| | | |
The fixes for SI-6260 + elimination of hlaf-boxing also solve
SI-6385
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We now apply erasure of value classes everywhere. previously,
erasure was disabled in the value class itself. This led to
irregegularities and bugs. See test run/valueclasses-pavlov.scala
for something that led to a ClassCastException before.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Guards against bridge methods that clash with other methods. Two
tests: The neg test is the original ticket. The run test tweaks
things slightly so that the generated bridge method does not clash,
and tests that the necessary unboxings are indeed performed at
runtime.
|
|\ \ \
| | | |
| | | | |
merges scala.reflect.base into scala.reflect.api
|
| | | |
| | | |
| | | |
| | | |
| | | | |
As the experience has shown, there's no need for a separate layer of reflection
in scala-library.jar. Therefore I'm putting an end to it.
|
|/ / /
| | |
| | |
| | |
| | |
| | | |
If an error occurs afer a Dynamic rewriting, augment the error message
with the rewritten tree and a hint to check the Dynamic method
signature.
|
|\ \ \
| |_|/
|/| | |
Revert `@static` annotation
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit 892ee3df93a10ffe24fb11b37ad7c3a9cb93d5de with
exception of keeping `@static` annotation in the library so we
can deploy a new starr that does not depend on it before removing
it completely.
Conflicts:
src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
src/compiler/scala/tools/nsc/transform/CleanUp.scala
|
| | |
| | |
| | |
| | | |
This reverts commit 227239018b38ab7218ee6b30493c9c8e1836c8c9.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit 5a8dfad583b825158cf0abdae5d73a4a7f8cd997.
Conflicts:
src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
|
| |/
| |
| |
| | |
This reverts commit 373f22a2022519ab894c1ea77460e6460d7c2ee4.
|
|/
|
|
|
|
| |
Doesn't fix the underlying issue with macros and type inference,
but at least now the error message says exactly what needs to be done
to make the error go away.
|
|
|
|
|
| |
Structural refinements already have a number of restrictions, e.g. cannot refer to
type parameters of enclosing classes. We need to disallow value classes as well.
|
|\
| |
| | |
cleaning up reflection
|
| |
| |
| |
| |
| |
| | |
1) parseExpr => parse
2) runExpr => eval
3) Introduces compile(Tree): () => Any, since it has frequent uses
|
|\ \
| | |
| | | |
A little cleanup along the Any to AnyRef trail.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Followup to 35316be and d3f879a.
- Remove obsolete comments and replace them with a test.
- Don't emit error addendum unless we know we're dealing
with a value class.
|