| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In faa5ae6, I changed the pattern matchers code generator to
use stable references (`Ident`-s with the singleton type, rather
than the widened type) to the synthetic vals used to store
intermediate results ("binders").
In the case where the scrutinee matched the unapply parameter
type of some extractor pattern, but the pattern subsequently
failed, this led to an regression.
It turns out that this was due to the way that the type of
the binder was mutated to upcast to the exact type of a subsequent
pattern in `ensureConformsTo`:
https://github.com/scala/scala/blob/953559988/src/compiler/scala/tools/nsc/transform/patmat/MatchTranslation.scala#L165-L174
This was added in 32c57329a as a workaround for the problem caused
in t6664.scala, when the binder type was `KList with KCons`, and
the code generator wasn't able to find the case field accessors
for `KCons` in the decls.
The change to use stable references meant that this mutation was
now observed in another part of the tree, as opposed to the 2.11.8
situation, where we had used the original, sharper type of the binder
eagerly to assign to the `Ident` that referred to it. This led to
a tree:
Assign(Ident(x3), Ident(x1).setType(x1.tpe)
Now that we instead refer generate:
Assign(Ident(x3), Ident(x1).setType(stableTypeFor(x1))
and we don't typecheck this until after the mutation of `x1.symbol.info`,
we can get a type error.
This commit removes this mutation of the binder type altogether, and
instead uses `aligner.wholeType`, which is based on the result type of
the `Apply(TypeTree(MethodType(params, resultType))` that encodes a
typechecked constructor pattern. In `t6624.scala`, this is `KCons`,
the case class that has the extractors as its decls.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than building a cascade of if/elses, push additional conditions
into a conjunction in the condition of a single if/else. This is
possible when emitting conditions for the list of arguments of a
pattern.
Here's an example of the improvement to post-pattern matcher trees:
https://gist.github.com/retronym/0d8f7126157061d72b81
While we could try to rely on the optimizer to coalesce the repeated
else clauses, it seems wasteful to emit the code in that way in
the first place.
|
|
|
|
|
| |
This reverts commit 884e1ce762d98b29594146d37b85384581d9ba96, reversing
changes made to f6fcc4431f272c707d49de68add532c452dd4b0f.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Can't ensure range position points are meaningful when we never
see them. To limit noise, only print the point when it != start.
[x:y] // point=x, start=x, end=y
[p/x:y] // point=p, start=x, end=y
I'm open to a different syntax.
Also prints NoPosition as [X] rather than [NoPosition] because
noise is for construction workers and attenders of rock concerts.
Some range position and parser tests are included so we can see
the checkfile change when the forthcoming fix happens (either an
error message improvement or a positional one.)
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
================================================================
Merge commit 'v2.10.1-326-g4f8c306' into merge/v2.10.1-326-g4f8c306-to-master
Conflicts:
src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala
src/reflect/scala/reflect/runtime/JavaMirrors.scala
================================================================
Merge -s ours 4e64a27 ([nomaster commit range])
================================================================
Merge commit '0ae7e55' into merge/v2.10.1-326-g4f8c306-to-master
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Macros.scala
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* excluded from merge:
[nomerge] SI-6667 Demote a new ambiguity error to a lint warning.
Revert "SI-6422: add missing Fractional and Integral alias in scala package"
[backport] SI-6482, lost bounds in extension methods.
* commit '81d8f9d3da': (31 commits)
reflecting @throws defined in Scala code
pullrequest feedback
SI-5833 Fixes tail-of-Nil problem in RefinedType#normalizeImpl
SI-6017 Scaladoc: Show all letters without dangling links
SI-6017 Generate Scaladoc's index links in Scala side
SI-5313 Minor code cleanup for store clobbering
SI-5313 Test clobbers on the back edge of a loop
SI-7033 Be symful when creating factory methods.
SI-7022 Additional test case for value class w. bounds
SI-7039 unapplySeq result type independent of subpattern count
evicts javac-artifacts.jar
SI-7008 @throws annotations are now populated in reflect
Fix SI-6578. Deprecated `askType` because of possible race conditions in type checker.
SI-7029 - Make test more robust
SI-7029 - Makes sure that uncaught exceptions are propagated to the UEH for the global ExecutionContext
SI-6941 tests
SI-6686 drop valdef unused in flatMapCond's block
...
Conflicts:
src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala
src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala
src/reflect/scala/reflect/internal/Definitions.scala
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* origin/2.10.x: (31 commits)
Implicit vars should have non-implicit setters.
Deprecate `scala.tools.nsc.Phases` because it's dead-code.
scaladoc Template: remove duplicate code and several usages of Option.get.
adds scala-reflect.jar to MIMA in ant
Test showing the absence of a forward reference
update mailmap
Remove dead code from `Global`.
Cleanup MemberLookup. Better explain ambiguous link targets.
typedIdent no longer destroys attachments
fixes incorrect handling of Annotated in lazy copier
simplifies checkBounds
Recurse into instantiations when stripping type vars.
Extract base scaladoc functionality for the IDE.
Expand pattern match position tests.
SI-6288 Remedy ill-positioned extractor binding.
SI-6288 Fix positioning of label jumps
SI-6288 Position argument of unapply
Fixes SI-6758: force LazyAnnnotationInfo for DefDef and TypeDef
SI-6795 Simplify errors related to "abstract override" on type members
SI-6795 Adds negative check for "abstract override" on types in traits
...
Conflicts:
.mailmap
src/compiler/scala/tools/nsc/Global.scala
src/compiler/scala/tools/nsc/ast/DocComments.scala
src/compiler/scala/tools/nsc/doc/base/CommentFactoryBase.scala
src/compiler/scala/tools/nsc/doc/html/page/Source.scala
src/compiler/scala/tools/nsc/doc/html/page/Template.scala
src/compiler/scala/tools/nsc/doc/model/LinkTo.scala
src/compiler/scala/tools/nsc/doc/model/MemberLookup.scala
src/compiler/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala
src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
src/compiler/scala/tools/nsc/typechecker/Typers.scala
src/reflect/scala/reflect/runtime/JavaMirrors.scala
test/scaladoc/run/links.scala
|
| | |
| | |
| | |
| | |
| | | |
There was no way to make a java compilation unit.
Now there is.
|
| |/
|/|
| |
| |
| |
| |
| |
| | |
This reverts commit 0ebf72b9498108e67c2133c6522c436af50a18e8.
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Typers.scala
src/reflect/scala/reflect/internal/Trees.scala
|
|/
|
|
|
|
|
| |
also, tweak fix in place for SI-5158 to appease SI-6941
don't store mutable fields from scala.* as we can assume
these classes are well-behaved and do not mutate their
case class fields
|
|
|
|
|
|
| |
- Adds tests for unapplySeq and unapply: Boolean.
Both seem to be well positioned after the previous
changes.
|
|
|
|
|
|
| |
The call to `Option#get` on the result of the
unapply method was unpositioned and ended up
with the position of the `match`.
|
|
`atPos(pos) { ... }` doesn't descend into children of
already positioned trees, we need to manually set the
position of `CODE.REF(binder)` to that of the stunt double
`Ident(nme.SELECTOR_DUMMY)`.
|