| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
He's a good kid, even if not the most hygenic.
|
|
|
|
|
|
|
| |
Yes checkAccessible, you patiently waited your turn.
Do you like your new clothes? Oh, still not clean enough?
I understand, but we must leave time for the other methods.
Now run along and check something.
|
|
|
|
| |
To streamline the essential logic.
|
|
|
|
| |
It has been hardcoded to return false for a long while anyway.
|
|
|
|
|
|
| |
Because nobody should have to guess a return type like
(List[Type], Array[Int], Boolean). In fact nobody should
ever experience such a return type at all.
|
| |
|
|
|
|
| |
It's not exactly 2006-era code but it's still a little ripe.
|
|
|
|
|
|
| |
Yes, 2006. Perhaps we should have a "sunset provision"
which removes commented-out code after seven years. Or even
slightly sooner.
|
|
|
|
| |
Now you can take inferPolyAlternatives home to meet your mother.
|
|
|
|
| |
So much dust and debris, so little time.
|
|
|
|
|
|
|
| |
Swabbing the decks of isAsSpecific and isApplicableSafe.
Wow isApplicableSafe, you don't really need to declare and
allocate a two-argument case class in order to manage a
second method call.
|
|
|
|
|
| |
I'd really like these methods to receive greater scrutiny.
To that end I'm scrutinizing them.
|
|\
| |
| | |
Merge 2.10.x
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
bincompat-forward.whitelist.conf
src/compiler/scala/tools/nsc/matching/Patterns.scala
src/compiler/scala/tools/nsc/transform/patmat/Logic.scala
src/compiler/scala/tools/nsc/typechecker/Infer.scala
src/scaladoc/scala/tools/nsc/doc/model/ModelFactory.scala
test/files/neg/t5663-badwarneq.check
|
| | |\
| | | |
| | | | |
SI-6675 Avoid spurious warning about pattern bind arity.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
In 692372ce, we added a warning (under -Xlint) when binding
a `TupleN` in to a single pattern binder, which wasn't allowed
before 2.10.0, and more often than not represents a bug.
However, that warning overstretched, and warned even when
using a Tuple Pattern to bind to the elements of such a value.
This commit checks for this case, and avoids the spurious warnings.
A new test case is added for this case to go with the existing
test for SI-6675:
$ ./tools/partest-ack 6675
% tests-with-matching-paths ... 3
% tests-with-matching-code ... 2
# 3 tests to run.
test/partest --show-diff --show-log \
test/files/neg/t6675-old-patmat.scala \
test/files/neg/t6675.scala \
test/files/pos/t6675.scala \
""
Testing individual files
testing: [...]/files/pos/t6675.scala [ OK ]
Testing individual files
testing: [...]/files/neg/t6675-old-patmat.scala [ OK ]
testing: [...]/files/neg/t6675.scala [ OK ]
All of 3 tests were successful (elapsed time: 00:00:03)
|
|\ \ \ \
| |/ / /
|/| | | |
Created utility function for dropping by-name-ness.
|
| | | |
| | | |
| | | |
| | | | |
And applied it in three locations.
|
|\ \ \ \
| |/ / /
|/| | | |
Minor overhaul of lub-producing typer methods.
|
| | | |
| | | |
| | | |
| | | | |
Obvious fusion of "isFullyDefined" and "makeFullyDefined".
|
|\| | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Contexts.scala
src/compiler/scala/tools/nsc/typechecker/Typers.scala
|
| |\| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
merge/v2.10.1-245-g5147bb2-to-master
Conflicts:
src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
src/compiler/scala/tools/nsc/typechecker/Typers.scala
|
| | |/
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
`Symbol#toString` was triggering `CyclicReferenceError` (specifically,
`accurateKindString` which calls `owner.primaryConstructor`.)
The `toString` output is used when creating an error symbol to
assign to the tree after an error (in this case, a non-existent
access qualifier.)
This commit catches the error, and falls back to just using the
symbol's name.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When we are using a throwaway silent context, we can just let it drift out of
scope and over the horizon, rather than ceremoniously flushing its buffers
on completion.
- Applied to Scaladoc.
- Applied to Infer#isApplicableSafe. Less manual error buffer management
affords greater opportunity to cleanly express the logic.
- Applied to `typerReportAnyContextErrors`.
The reasoning for the last case is as follows:
- There were only two callers to `typerReportAnyContextErrors`, and
they both passed in as `c` a child context of `context`.
- That child context must share the error reporting mode and buffer
with `context`.
- Therefore, extracting an error from `c` and issuing it into `context`
is a no-op. Because the error buffer is Set, it was harmless.
This part will probably textually conflict with the same change made in
SI-7319, but the end results are identical.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Use `firstError match {}` rather than `if (c.hasErrors) c.firstError ..`
- Convert implementation comments to doc comments
- Add new doc comments
- Refactor `Context#make` for better readability.
- Note a few TODOs.
- Roughly delineate the internal structure of Contexts with comments.
- Combine `mode` and `state` methods into `contextMode`.
- Move `isNameInScope` closer to its compadres.
- Improving alignment, tightening access.
|
| |
| |
| |
| |
| |
| |
| | |
This commit shortens expressions of the form `if (settings.debug.value)` to
`if (settings.debug)` for various settings. Rarely, the setting is supplied
as a method argument. The conversion is not employed in simple definitions
where the Boolean type would have to be specified.
|
|\ \
| | |
| | | |
Remove unrecognized doc comments
|
| | |
| | |
| | |
| | |
| | | |
unmoored doc comment" warning when building distribution for
scala itself.
|
|\ \ \
| | | |
| | | | |
SI-6123: -explaintypes should not explain errors which won't be reported, new attempt
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
-explainTypes means that only type tests which *fail* should be reported in more
detail by using explainTypes. Hence, callers of explainTypes should check if
type errors are being ignored, by checking context.reportErrors. Hence, this
check is added to Inferencer, and another call site is redirected to that
method.
Moreover, explainTypes should only be called if an error exists. Enforce that in
checkSubType, and remove spurious home-made explainTypes output.
Finally, in ContextErrors, stop checking `settings.explaintypes.value` before
calling `explainTypes` which will check it again.
Note that this patch does not fix all occurrences, but only the ones which
showed up during debugging. The other ones never cause problems, maybe because
they occur when contextErrors is in fact guaranteed to be true. We might want to
fix those ones anyway.
This fixes regressions in c800d1fec5241ed8c29e5af30465856f9b583246 and
78f9ef3906c78413ff8835fdad3849bfe5516be2.
Thanks to hubertp (Hubert Plociniczak) for the first round of review.
Refs #6123
backport to _2.10.x_
|
|/ /
| |
| |
| |
| |
| | |
Mostly unused private code, unused imports, and points where
an extra pair of parentheses is necessary for scalac to have
confidence in our intentions.
|
| |
| |
| |
| |
| |
| | |
This is a non-behaviorally-changing setup commit which
re-routes bits of code through avenues which can more easily
be influenced by subclasses of Global.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
What would you prefer?
adaptToMemberWithArgs(tree, qual, name, mode, false, false)
Or:
adaptToMemberWithArgs(tree, qual, name, mode, reportAmbiguous = false, saveErrors = false)
|
| |
| |
| |
| |
| |
| |
| | |
These super-mutation-oriented methods should enthusiastically
communicate what they are doing, especially when they encounter
anything unexpected. None of this work should be taken as an
endorsement of any of the worked-upon code.
|
| |
| |
| |
| |
| |
| | |
- @param tags whose name drifted from the corresponding parameter
- Remove or complete a few stray stub comments (@param foo ...)
- Use @tparam where appropriate.
|
| |
| |
| |
| | |
With the exception of toString and the odd JavaBean getter.
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 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
|
| |\
| | |
| | | |
SI-7039 unapplySeq result type independent of subpattern count
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Fixes a bug in the implementation of the `unapplySeq` part of the spec below.
An `unapply` method with result type `R` in an object `x` matches the
pattern `x(p_1, ..., p_n)` if it takes exactly one argument and, either:
- `n = 0` and `R =:= Boolean`, or
- `n = 1` and `R <:< Option[T]`, for some type `T`.
The argument pattern `p1` is typed in turn with expected type `T`.
- Or, `n > 1` and `R <:< Option[Product_n[T_1, ..., T_n]]`, for some
types `T_1, ..., T_n`. The argument patterns `p_1, ..., p_n` are
typed with expected types `T_1, ..., T_n`.
An `unapplySeq` method in an object `x` matches the pattern `x(p_1, ..., p_n)`
if it takes exactly one argument and its result type is of the form `Option[S]`,
where either:
- `S` is a subtype of `Seq[U]` for some element type `U`, (set `m = 0`)
- or `S` is a `ProductX[T_1, ..., T_m]` and `T_m <: Seq[U]` (`m <= n`).
The argument patterns `p_1, ..., p_n` are typed with expected types
`T_1, ..., T_m, U, ..., U`. Here, `U` is repeated `n-m` times.
|
| |\ \
| | | |
| | | | |
Analyzer Plugins
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Squashed commit of the following:
commit 5c156185306ba797c0443d9dccae0ae7ce462a1f
Author: Paul Phillips <paulp@improving.org>
Date: Sat Oct 6 15:42:50 2012 -0700
A little more housecleaning in ExtensionMethods.
The only real contribution is readability.
(cherry picked from commit 61f12faacaaccf366f9211ba6493fb042a91f1d2)
Conflicts:
src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala
commit 79f443edf584745d614e24fb9ca6644c6b18d439
Author: Paul Phillips <paulp@improving.org>
Date: Sat Oct 6 14:22:19 2012 -0700
Incorporated pull request feedback.
(cherry picked from commit 153ccb4757718cceb219988f30381f73362e6075)
commit 707f580b0cdcb01e27ca4c76991dea427945b5bd
Author: Paul Phillips <paulp@improving.org>
Date: Sat Oct 6 10:20:45 2012 -0700
Fix for SI-6482, lost bounds in extension methods.
That was a good one. How to create a new method with type
parameters from multiple sources, herein.
(cherry picked from commit ff9f60f420c090b6716c927ab0359b082f2299de)
commit 8889c7a13f74bc175e48aa2209549089a974c2af
Author: Paul Phillips <paulp@improving.org>
Date: Fri Oct 5 22:19:52 2012 -0700
Responded to comment about how many isCoercibles there are.
I make the case that there is only one.
(cherry picked from commit 883f1ac88dd7cec5882d42d6b48d7f267d1f6e00)
|
|\ \ \
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Contexts.scala
src/compiler/scala/tools/nsc/typechecker/Namers.scala
src/compiler/scala/tools/nsc/typechecker/Typers.scala
src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala
src/reflect/scala/reflect/internal/AnnotationCheckers.scala
src/reflect/scala/reflect/internal/Symbols.scala
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
AnnotationCheckers are insufficient because they live outside the
compiler cake and it's not possible to pass a Typer into an annotation
checker.
Analyzer plugins hook into important places of the compiler:
- when the namer assigns a type to a symbol (plus a special hook for
accessors)
- before typing a tree, to modify the expected type
- after typing a tree, to modify the type assigned to the tree
Analyzer plugins and annotation checker can be activated only during
selected phases of the compiler.
Refactored the CPS plugin to use an analyzer plugin (since
adaptToAnnotations is now part of analyzer plugins, no longer
annotation checkers).
|
| |
| |
| |
| |
| | |
[backport]
And other polishing related to varargs handling.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It arises when inferring the type of an overloaded call:
def g(s: String): String = s
def f: String = ???
def f[C](c: C): String = g(f)
Also refined warning when isHKSubType is called with
arguments which very likely were never meant to be compared.
|
| |
| |
| |
| | |
Incorporates feedback from dealias/widen PR.
|
| |
| |
| |
| |
| |
| |
| |
| | |
isNamed => isNamedArg
isIdentity => allArgsArePositional
nameOf => nameOfNamedArg
Moved mkNamedArg into TreeGen.
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/compiler/scala/tools/nsc/doc/Settings.scala
src/compiler/scala/tools/nsc/interpreter/CompletionOutput.scala
src/compiler/scala/tools/nsc/matching/Patterns.scala
src/compiler/scala/tools/nsc/transform/UnCurry.scala
src/compiler/scala/tools/nsc/typechecker/Infer.scala
src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala
src/compiler/scala/tools/nsc/typechecker/Typers.scala
src/reflect/scala/reflect/internal/settings/MutableSettings.scala
src/reflect/scala/reflect/runtime/Settings.scala
src/swing/scala/swing/SwingActor.scala
src/swing/scala/swing/SwingWorker.scala
test/files/run/t6955.scala
|
| |\
| | |
| | | |
SI-6675 -Xlint arity enforcement for extractors
|