| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The advent of the named based pattern matcher brought with it
a change in the way we determine the type of the value in the
"match monad". We used to take the base type to `Option` or `Seq`
(guided by the method name in `unapply` vs `unapplySeq`), and
simply use the type argument.
Name-based patmat, instead, uses the result type of methods in the
type. For example, the element type of an Option-like extractor
result is given by the result type of the no-args `get` method.
This approach, however, swiftly runs aground when navigating the
existential atolls. Here's why:
scala> class F[_]
defined class F
scala> val tp = typeOf[Some[F[X]] forSome { type X }]
warning: there were 1 feature warning(s); re-run with -feature for details
tp: $r.intp.global.Type = scala.this.Some[F[X]] forSome { type X }
scala> tp.baseType(typeOf[Option[_]].typeSymbol).typeArgs.head
res10: $r.intp.global.Type = F[X] forSome { type X }
scala> tp.memberType(tp.member(nme.get)).finalResultType
res11: $r.intp.global.Type = F[X]
`res10` corresponds to 2.10.x approach in `matchMonadResult`.
`res11` corresponds to the new approach in `resultOfMatchingMethod`.
The last result is not wrapped by the existential type. This results
in errors like (shown under -Ydebug to turn un accurate printing of
skolems):
error: error during expansion of this match (this is a scalac bug).
The underlying error was: type mismatch;
found : _$1&0 where type _$1&0
required: _$1
(0: Any) match {
^
one error found
This commit addresses the regression in 2.10.x compatible extractors
by using the 2.10 approach for them.
The residual problem is shown in the enclosed pending test.
|
|
|
|
| |
Test case for SI-8045, fixed by the preceding commits.
|
|
|
|
|
|
|
|
| |
Name-based pattern matcher needed some hardening against
unapply methods with the right name but wrong types. Only
isEmpty methods which return Boolean are acceptable.
Catching it directly rather than indirectly also allowed
for better error messages.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This emerges from a recent attempt to eliminate pattern matcher
related duplication and to bake the scalac-independent logic
out of it. I had in mind something a lot cleaner, but it was
a whole lot of work to get it here and I can take it no further.
Key file to admire is PatternExpander.scala, which should
provide a basis for some separation of concerns.
The bugs addressed are a CCE involving Tuple1 and an imprecise
warning regarding multiple pattern crushing.
Editorial: auto-tupling unapply results was a terrible idea which
should never have escaped from the crib. It is tantamount to
purposely throwing type safety down the toilet in the very place
where people need type safety the most. See SI-6111 and SI-6675 for
some other comments.
|
|
|
|
|
| |
The continuations plugin and library will still ship with 2.11 (albeit unsupported).
They now reside at https://github.com/scala/scala-continuations.
|
|\
| |
| |
| |
| | |
jrudolph/w/fix-typo-that-that-occurs-twice-in-error-messages
fix typo in error messages
|
| | |
|
|\ \
| | |
| | | |
SI-7618 Remove octal number literals
|
| | |
| | |
| | |
| | |
| | |
| | | |
This also fixes a spurious detection of octal literals in floating
point literals: Literals like 01.23 are neither deprecated nor planned
for removal.
|
|\ \ \
| | | |
| | | | |
SI-8030 force symbols on presentation compiler initialization
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit forces a number of built-in symbols in presentation
compiler to prevent them from being entered during parsing.
The property “parsing doesn’t enter new symbols” is tested on
a rich source file that contains significant number of variations
of Scala syntax.
|
|\ \ \
| | | |
| | | | |
SI-8059 Override immutable.Queue#{+:,:+} for performance
|
| |/ /
| | |
| | |
| | | |
Without those overrides, all elements are unnecessarily copied.
|
|\ \ \
| | | |
| | | | |
Test case for recently improved unchecked warning
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Prior to https://github.com/scala/scala/pull/2848, the enclosed
test compiled without warning and printed:
true
false
Features interacting:
- implicit class tags to enable type patterns on abstract types
- type tests on compound types.
I think the unchecked warning is acceptable for now.
|
|\ \ \ \
| | | | |
| | | | | |
SI-8024 Fix inaccurate message on overloaded ambiguous ident
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
We were outputing a the unattractive `package package`;
now we opt for `package object pack`.
Under `-Ydebug`, we still go to the "accurate" mode of the
old `toString` implementation, which differentiates package objects
vs package object classes.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
`Symbol#owner` of an overloaded symbol doesn't necessarily correspond
to the owner of any of the alternatives, and as such it shouldn't
be used in error message.
neg/t8024.scala actually represents a progression since 2.10.3;
the ambiguity was not reported. I bisected the change to
https://github.com/scala/scala/pull/1554.
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The error is new in 2.11, but actually seems correct. It appeared
in 2.11.0-M4, more specifically, after
https://github.com/scala/scala/pull/1554
But, the error message itself is wrong, and suggests that a method
symbol has latched itself to an incorrect owner.
|
|\ \ \ \
| | | | |
| | | | | |
SI-6780 Better handling of cycles in in-scope implicit search
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Implicit searches in the body of implicit members with inferred
types were leading to cycles. Before we used to resolve that
by saying there were no implicits in scope at all; now we just
skip the current context and still include the enclosing implicits.
Care is taken not to cache results under these circumstances.
This entails reworking `Context#implicitss` so that:
- the implicit info cache only contains implicits from the current
level. The List[List[_]] is now contructed on demand;
- we can detect cycles by setting `implicitsCacheRunId` to -1 during
the computation. The outer implicits when we encounter that.
- we avoid caching when we hit a cycle or when the owner is uninitialized.
|
|\ \ \ \
| | | | |
| | | | | |
Merge 2.10.x to master
|
| |\ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Conflicts:
build.examples.xml
build.xml
docs/examples/actors/pingpong.scala
docs/examples/fors.scala
docs/examples/iterators.scala
docs/examples/jolib/Ref.scala
docs/examples/jolib/parallelOr.scala
docs/examples/monads/callccInterpreter.scala
docs/examples/monads/directInterpreter.scala
docs/examples/monads/errorInterpreter.scala
docs/examples/monads/simpleInterpreter.scala
docs/examples/monads/stateInterpreter.scala
docs/examples/parsing/ArithmeticParser.scala
docs/examples/patterns.scala
docs/examples/pilib/elasticBuffer.scala
docs/examples/pilib/handover.scala
docs/examples/pilib/piNat.scala
docs/examples/typeinf.scala
src/build/pack.xml
|
| | |\ \ \ \
| | | | | | |
| | | | | | | |
SI-7912 Be defensive calling `toString` in `MatchError#getMessage`
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Otherwise, objects with exception-throwing `toString` lead to a
cascading error far removed from the originally failed match.
|
| | |\ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-8060 Avoid infinite loop with higher kinded type alias
|
| | | |/ / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
The `dealiasLocals` map was assuming that:
tp.isAliasType implies (tp.dealias ne tp)
This isn't true if `!typeParamsMatchArgs`.
This commit avoids the infinite loop by checking whether or not
dealiasing progresses.
|
| | |\ \ \ \ \
| | | |/ / / /
| | |/| | | | |
Clean up Scala distribution a bit.
|
| | | | | | | |
|
| |\| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Conflicts:
bincompat-forward.whitelist.conf
src/interactive/scala/tools/nsc/interactive/Global.scala
test/files/presentation/scope-completion-2.check
test/files/presentation/scope-completion-3.check
test/files/presentation/scope-completion-import.check
Conflicts in the scope completion tests handled with the help
of @skyluc in https://github.com/scala/scala/pull/3264
|
| | |\ \ \ \ \
| | | |/ / / /
| | |/| | | | |
SI-7995 completion imported vars and vals
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Imported member vals and vars were always marked inaccessible, even
if referencing them at the location of the completion is valid in code.
The accessible flag is now set accordingly to the accessibility of the getter.
|
| | |\ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-8029 Avoid multi-run cyclic error with companions, package object
|
| | | |/ / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
The bug report suggests this problem only became visible in the
IDE *after* 2.10.3, but I tested an IDE with exactly 2.10.3 and
saw the same problem.
In fact, my test case fails as far back as 2.10.0. I suspect the
problem showed up after 816cecf9a9, which checks that pairs of
companion symbols are codefined eagerly in Namers.
This commit modifies the check of `rawInfo ne NoType`
in `isCoDefinedWith` to avoid triggering adaptation of types from
the previous run. I'm not sure of the precise intent of that check.
I looked at c9861cd198 (genesis of isCoDefinedWith). Before that we
get back to 3761cb4b3a1 (the dawn of Subversion.)
|
| | |\ \ \ \ \
| | | | | | | |
| | | | | | | | |
[backport] SI-7439 Avoid NPE in `isMonomorphicType` with stub symbols.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
`originalInfo` can return null for stub symbols; deal with that
as we used to before a regression in 016bc3db.
After this change, we can once again delete A_1.class and still compile
code instantiating B_1. (A_1 is only referred to in a method signature
of B_1 which is not called from our code.)
scala> new B_1
warning: Class A_1 not found - continuing with a stub.
res0: B_1 = B_1@5284b8f9
In practice, this situation arises when someone uses a third
party class that was compiled against other libraries not avaialable
on the current compilation classpath.
(cherry picked from commit a95432168204964e4f6c4571e781559c1640f2d8)
|
| |\| | | | | |
| | |_|_|/ / /
| |/| | | | |
| | | | | | |
| | | | | | | |
Conflicts:
src/compiler/scala/tools/nsc/transform/Erasure.scala
|
| | |\ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-8010 Fix regression in erasure double definition checks
|
| | | | |/ / /
| | | |/| | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Calls to `Symbol#info` during scope iteration considered harmful.
Looks like calling `info` during this Scope iteration is triggering
the ExplicitOuter info transformer, which "makes all super accessors
and modules in traits non-private, mangling their names.". This name
change necessitates a rehashing of the owning scope, which I suspect
is enough to corrupt the ScopeEntry-s being traversed in
`checkNoDeclaredDoubleDefs`.
The upshot was that we encountered the same symbol twice, which was
reported as being a double-definition.
This problem only showed up after 086702d8a74, which did nothing
worse then change the order in which `{e, e1}.sym.info` were
forced.
I inspected SymbolPairs/OverridingPairs which *appear* to be immune
as they only test flags during scope iteration; infos are not used
until later, at which point we're iterating a temporary scope that
isn't part of the type of the owner of the symbols.
|
| | | |/ / /
| | |/| | |
| | | | | |
| | | | | | |
backport of 1d3ec4e708154ec05554f540d7d68ed55dc12426
|
| | |\ \ \ \
| | | | | | |
| | | | | | | |
make askLoadedType unload arguments out of the PC by default,
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-8050 [Avian] Skip instrumented tests
|
| | |_|_|_|_|/
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Instrumentation is (currently) not supported on Avian.
This causes
- tests instrumented/InstrumentationTest.scala and
- instrumented/inline-in-constructors
to fail.
Let's skip these tests on Avian.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-8027 REPL double tab regression
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Where did double tab go? "The shadow knows."
The regression was introduced by the last flurry
before we were left to wallow in whatever white
space remained.
Some xs put other xs under erasure.
It's clear that somebody's daughter walked into
the room and asked for a story, because, shockingly,
the case arrows don't line up.
We need a plug-in for Jenkins, or I guess Travis, to
fail the build if arrows and equals don't align,
because it clearly indicates a lapse of some kind.
|
|\ \ \ \ \ \ \ \
| |_|_|_|_|_|_|/
|/| | | | | | | |
Plugins get a class path
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Let -Xplugin specify a class path (or multiple of them).
Each entry can be a jar or dir, and the first entry to supply
a plugin descriptor defines the plugin to load.
If no plugin is found on the path, then issue a warning if `-Xdev`.
This honors the legacy silent treatment (which scala-ide tests for).
In the proposed scheme, each plugin gets a class loader so that
plugins are isolated from each other.
Presumably, if compiler plugins were a rich ecosystem, in which
shared dependencies were required in incompatible versions, this
would have become a requirement by now.
(Updated with a `DirectTest` that uses two plugins, but keeping
the following as documentation.)
Partest can't do multiple plugins yet, but this is what it looks like:
```
skalac -Xplugin:sample.jar:useful.jar:util,needful.jar:another.jar:util,needful.jar:util:exploded -Xplugin-require:sample,another,other foo.scala
skalac -Xplugin:sample.jar:useful.jar:util,needful.jar:another.jar:util,needful.jar:util:exploded -Xplugin-require:sample,other -Xplugin-disable:another foo.scala
skalac -Xplugin:sample.jar:useful.jar:util,sample.jar:useful.jar:util -Xplugin-require:sample foo.scala
```
The manual test shows three plugins with various permutations of jars and dirs.
The manual test demonstrates that plugins only see classes on their class path:
```
Initializing test.plugins.SamplePlugin
needful.Needful? Failure(java.lang.ClassNotFoundException: needful.Needful)
useful.Useful? Success(class useful.Useful)
Initializing more.plugins.AnotherPlugin
needful.Needful? Success(class needful.Needful)
useful.Useful? Failure(java.lang.ClassNotFoundException: useful.Useful)
Initializing other.plugins.OtherPlugin
```
Disabling a plugin results in a message instead of silent suppression:
```
Disabling plugin another
```
The duplicate plugin class test must still be honored:
```
Ignoring duplicate plugin sample (test.plugins.SamplePlugin)
Initializing test.plugins.SamplePlugin
needful.Needful? Failure(java.lang.ClassNotFoundException: needful.Needful)
useful.Useful? Success(class useful.Useful)
```
If the path is bad, then missing classes will report which plugin induced
the error:
```
Error: class not found: util/Probe required by test.plugins.SamplePlugin
Error: class not found: util/Probe required by more.plugins.AnotherPlugin
Initializing other.plugins.OtherPlugin
needful.Needful? Success(class needful.Needful)
useful.Useful? Failure(java.lang.ClassNotFoundException: useful.Useful)
error: Missing required plugin: sample
error: Missing required plugin: another
two errors found
```
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-8054 Fix regression in TypeRef rebind with val overriding object
|
| |/ / / / / / /
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Regressed in 80767383fd / SI-7928
The condition added in that commit are necessary after refchecks but
poisonous before.
This still seems rather fragile: I wonder if `eliminateModuleDefs`
in `RefChecks` ought to flag the module symbol as `ARTIFACT` after
creating the accessor, so as to signal that it shouldn't be bound
anymore?
|
| | | | | | | | |
|