| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
If you'd rather depend on all Scala has to offer, module-wise,
depend on scala-library-all. This dependency determines the
jars that ship with the Scala distribution. To achieve parity
via maven resolution, this is the artifact to depend on.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now publish a scala-dist artifact every time we publish to maven.
It captures everything needed to build a Scala distribution.
The packager should resolve all transitive dependencies of scala-dist,
put the class-file jars in the lib/ directory,
the scaladoc jars in the api/ directory,
and the source jars in the src/ directory,
in addition to unpacking the scala-dist jar itself,
which contains the bin/, doc/ and man/ directories,
which previously weren't available on maven.
This also removes the `@{dir}` abstraction, which was used to
package the continuations plugin. Since it's moved out,
we can go back to hard-coding it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
NOTE: `maven/latest/build.xml` is now deprecated.
To publish a Scala build, simply call `ant publish` or `ant publish-local`.
`maven/latest/build.xml` will soon disappear from `dists/`
The idea is that a Scala distribution is a simple
repackaging of artifacts already available on maven.
Already available: typical jars for the artifacts (classes, sources, scaladoc).
To add: the bin/, doc/, and man/ directories.
Thus, move the contents that should end up in the distribution
from docs/ to doc/, create the man/ directory with the manpages,
and include the scripts in bin/.
Next up: package these directories in a jar and publish to maven,
with a dependency on scala-library-all, scala-reflect and scala-compiler,
for the jars that should end up in the distribution.
Refactorings:
- Pull filter-pom out from deploy-one.
- Rename maven-base to dist.maven.
- Set all properties in the init target (dist.maven)
|
| |
|
|\
| |
| | |
SI-7971 Handle static field initializers correctly
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Before this fix, static fields where erroneously treated like instance
fields and the initialization was moved into the constructor.
With this fix, the static initializer statements go into the static
initializer of the class (called “<STATIC> def init” in Scala,
<clinit> in Java). The statements are added to an existing
static initializer method or, if no such method exists, a new static
initializer method is created and added to the class.
|
|\ \
| | |
| | | |
(2.11.0-M8) whitebox macros are now first typechecked against outerPt
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
While fixing the problem with the order of typechecks for whitebox expansions,
I realized that we’re doing redundant work when expanding blackbox macros.
Concretely, typechecking blackbox expansions looked as follows:
val expanded1 = atPos(enclosingMacroPosition.focus)(Typed(expanded0, TypeTree(innerPt)))
val expanded2 = typecheck("blackbox typecheck #1", expanded1, innerPt)
typecheck("blackbox typecheck #2", expanded1, outerPt)
Or, if we reformulate it using quasiquotes (temporarily not taking
positions into account, since they aren’t important here):
val expanded2 = typed(q”$expanded: $innerPt”, innerPt)
typed(expanded2, outerPt)
In this formulation, it becomes apparent that the first typecheck is
redundant. If something is ascribed with some type, then typechecking
the ascription against that type does nothing useful.
This is also highlights one of the reasons why it would be really nice
to have quasiquotes used in the compiler. With them, it’s easy to notice
things that would otherwise remain buried behind swaths of boilerplate.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Even though whitebox macros are supposed to be used to produce expansions
that refine advertised return types of their macro definitions, sometimes
those more precise types aren’t picked up by the typechecker.
It all started with Travis generating structural types with macros
and noticing that typer needs an extra nudge in order to make generated
members accessible to the outside world. I didn’t understand the mechanism
of the phenomenon back then, and after some time I just gave up.
Afterwards, when this issue had been brought up again in a different
StackOverflow question, we discussed it at reflection meeting, figured out
that typedBlock provides some special treatment to anonymous classes,
and it became clear that the first macro typecheck (the one that types
the expansion against the return type of the corresponding macro def)
is at fault here.
The thing is that if we have a block that stands for a desugard anonymous
class instantiation, and we typecheck it with expected type different from
WildcardType, then typer isn’t going to include decls of the anonymous class
in the resulting structural type: https://github.com/scala/scala/blob/master/src/compiler/scala/tools/nsc/typechecker/Typers.scala#L2350.
I tried to figure it out at https://groups.google.com/forum/#!topic/scala-internals/eXQt-BPm4i8,
but couldn’t dispel the mystery, so again I just gave up.
But today I had a profound WAT experience that finally tipped the scales.
It turns out that if we typecheck an if, providing a suitable pt, then
the resulting type of an if is going to be that pt, even though the lub
of the branch types might be more precise. I’m sure that reasons for this
behavior are also beyond my understanding, so I decided to sidestep this problem.
upd. Here’s Jason’s clarification: Doing thing differently would require
us to believe that "'Tis better to have lubbed and lost than never to have
lubbed at all." But the desire for efficiency trumps such sentimentality.
Now expansions of whitebox macros are first typechecked against outerPt,
the expected type that comes from the enclosing context, before being
typechecked against innerPt, the expected type that comes from the return
type of the macro def. This means that now outerPt provides the correct
expected type for the initial, most important typecheck, which makes
types more precise.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Moves some code around to clearly define the concepts that the method
operates on: 1) `innerPt`, which is expected type provided by the macro
def return type, 2) `outerPt`, which is expected type provided by the
enclosing context.
Once everything is clearly defined, the gist of the expander fits in
a few lines in its end. If blackbox, do this. If whitebox, do that.
Note that unlike the subsequent commit, this commit doesn’t change
the way how macro expansion works. It just clears everything out, so that
the upcoming changes can be applied in a concise and comprehensible manner.
|
| | | |
|
|\ \ \
| | | |
| | | | |
Final library modularization for 2.11
|
| | | |
| | | |
| | | |
| | | |
| | | | |
The Scala Swing library will still ship with 2.11 (albeit unsupported).
It now resides at https://github.com/scala/scala-swing.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
The continuations plugin and library will still ship with 2.11 (albeit unsupported).
They now reside at https://github.com/scala/scala-continuations.
|
|\ \ \ \
| |/ / /
|/| | | |
SI-7546 Use likely monotonic clock source for durations
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
System.currentTimeMillis is affected by wall-clock time, which means
things can appear to jump back in time.
Use System.nanoTime which is more likely¹ to be monotonic instead.
¹ See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6458294
"nanoTime affected by system clock change on Linux (RH9) or in
general lacks monotonicity".
|
|\ \ \
| | | |
| | | | |
Use Serialization Proxy Pattern in List
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Modify List to use the Serialization Proxy Pattern instead of
directly mutating its state during deserialization.
Use the proxy at the List level for both Nil and :: for simplicity.
Change one member variable (hd) to val from var as a result. The
other member variable (tl) cannot yet be changed to val because
it is mutated by ListBuffer in the library and Types in reflection.
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
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.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-6780 Better handling of cycles in in-scope implicit search
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
- split out a method for the part concernted with implicits from
the current context
- leaving the outer code to handle caching, cycle detection,
and recursion up the context chain.
|
| | |/ / / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Forgot to run `ant distpack` to verify, only did `dist.done`.
Implemented the rename of `doc/scala-devel-docs` to `api`.
|
| | |\ \ \ \ \
| | | | | | | |
| | | | | | | | |
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.
|
| | |/ / / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
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.
|
| |\| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
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.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Reactions are PartialFunctions, so if events come through
indiscriminately that the listener is not defined for, errors occur. Eg:
--
Exception in thread "AWT-EventQueue-0" scala.MatchError: FocusGained(scala.swing wrapper scala.swing.TextField
--
A Coursera thread with people affected by this issue:
https://class.coursera.org/reactive-001/forum/thread?thread_id=1315
|
| | |\ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
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.
|