| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
SI-6089 test file for pt2
|
|/
|
|
| |
test that matchEnd that's an argument of || that's in tail position is in tail position
|
|\
| |
| | |
SI-1832 consistent symbols in casedef's pattern&body
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
the only change to typedBind in this commit (beyond refactoring to keep my eyes from bleeding),
is explained by the added comment:
have to imperatively set the symbol for this bind to keep it in sync with the symbols used in the body of a case
when type checking a case we imperatively update the symbols in the body of the case
those symbols are bound by the symbols in the Binds in the pattern of the case,
so, if we set the symbols in the case body, but not in the patterns,
then re-type check the casedef (for a second try in typedApply for example -- SI-1832),
we are no longer in sync: the body has symbols set that do not appear in the patterns
since body1 is not necessarily equal to body, we must return a copied tree,
but we must still mutate the original bind
|
| | |
|
|\ \
| | |
| | | |
SI-6089 pt2: _ is tailpos in `_ || _` and `_ && _`
|
| | |
| | |
| | |
| | |
| | | |
pull #939 made tail position detection for matches more strict to fix SI-6089,
but became too strict: need to include the tail positions `_` in `_ || _` and `_ && _`.
|
|\ \ \
| | | |
| | | | |
Scaladoc: Removing forgotten debugging info
|
| | | |
| | | |
| | | |
| | | | |
(blush)
|
|\ \ \ \
| | | | |
| | | | | |
Add link to the PR policy in the README
|
|/ / / / |
|
|\ \ \ \
| |_|/ /
|/| | | |
address "this would catch all throwables" warnings
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
original patch by @odersky in #955 -- criterion for the refactor:
"catch Throwable as long as there's no obvious control flow exception going through the catch
and the caught exception is processed further"
rebased & updated with review comments in #955 and #954
|
|\ \ \ \
| | | | |
| | | | | |
Removes redundant outers
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Widens the criterion when outer fields can be omitted. It used to be that sub- and superclass had to be enclosed by the same outer class. Only in that case was the outer field of the class omitted. We now omit if subclass is contained in an outer class that is itself a subclass of the superclasses outer class.
See test case "outertest.scala" for an example.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Fix for SI-5385.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Nodes which hit EOF with no whitespace afterward had
wrong position.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Deprecate all JVM 1.5 targets and make 1.6 default.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Switch to 1.6 target for all javac invocations
we perform in build.xml. This way we do not
emit java 1.5 byte-code either from scalac
or javac. This commit should complete the move
off java 1.5 byte-code.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Add a check if deprecated target is being used. I put
that check into `checkDeprecatedSettings`. I tried to
invent some general mechanism for deprecating choices
in ChoiceSetting but I gave up eventually. It wasn't
worth it the complexity. Also, with current approach
I'm able to provide nice, customized deprecation
warning.
Make `jvm-1.6` a default backend.
Altered test for SI-5957 because it crashes the backend.
However, the problem is not with backend but with symbol
creation. We get two different symbols with the same
internal name and both are used in trees that reach
GenASM. See SI-6109 for details.
Review by @magarciaEPFL and @paulp.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
When assertion fails, let's provide
the context.
|
| | |/ / / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
It looks like scala.tools.ant.Scalac class had
a stale list of allowed targets. Made it in sync
with what compiler supports.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Implement @static annotation on singleton object fields.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
The upcoming `findMember` optimizations should ensure that this
is fast enough.
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This commit introduces the `@static` annotation on fields of static singleton objects.
A static singleton object is a top-level singleton object or an object nested within
a static singleton object.
The field annotated with `@static` is generated as a true static field in the companion
class of the object. The initialization of the field is done in the static initializer of the
companion class, instead of the object itself.
Here's an example. This:
object Foo {
@static val FIELD = 123
}
class Foo
generates :
object Foo {
def FIELD(): Int = Foo.FIELD
}
class Foo {
<static> val FIELD = 123
}
The accessor in `object Foo` is changed to return the static
field in `class Foo` (the companion class is generated if it is
not already present, and the same is done for getters if `FIELD`
is a `var`).
Furthermore, all the callsites to accessor `Foo.FIELD` are rewritten
to access the static field directly.
It is illegal to annotate a field in the singleton object as `@static` if there is
already a member of the same name in `class Foo`.
This allows better Java interoperability with frameworks which rely on static fields being
present in the class.
The `AtomicReferenceFieldUpdater`s are one such example. Instead of having
a Java base class holding the `volatile` mutable field `f` and a static field containing
a reference to the `AtomicReferenceFieldUpdater` that mutates `f` atomically,
and extending this Java base class from Scala, we can now simply do:
object Foo {
@static val arfu = AtomicReferenceUpdater.newUpdater(
classOf[Foo], classOf[String], "f"
)
}
class Foo {
@volatile var f = null
import Foo._
def CAS(ov: String, nv: String) = arfu.compareAndSet(this, null, "")
}
In summary, this commit introduces the following:
- adds the `@static` annotation
- for objects without a companion class and `@static` members, creates a companion class
(this is done in `CleanUp`)
- checks for conflicting names and if `@static` is used on static singleton object member
- creates the `static` field in the companion class for `@static` members
- moves the field initialization from the companion object to the static initializer of
the class (the initialization of `@static` members is bypassed in the `Constructors` phase,
and added to static ctors in `CleanUp`)
- all callsites to the accessors of `@static` are rewritten to access the static fields directly
(this is done in `GenICode`)
- getters and setters to `@static` fields access the static field directly, and the field in the
singleton object is not emitted (this is done in `GenICode`)
- changes in `GenJVM`, `GenASM` - now computing local var indices in static initializers
as well - this was an oversight before, now is necessary
Future work: allow the `@static` annotation on methods as well - this will
be added in a future commit.
Review by @odersky, @dragos, @paulp, @heathermiller.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SIP-14 - Fix critical Java compatibility issue in scala.concurrent.Await
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Patch contributed by @viktorklang
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-6031 customizable budget for patmat analyses
|
| | |_|_|_|_|_|/
| |/| | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
read the scalac.patmat.analysisBudget system property to decide how much time to spend on unreachability/exhaustivity
the default value is 256, and you can turn it off entirely using -Dscalac.patmat.analysisBudget=off
when the budget is exhausted, an unchecked warning is emitted
stack overflows in CNF conversion are caught and treated as analysis budget violations
|
|\ \ \ \ \ \ \ \
| |_|_|_|_|_|/ /
|/| | | | | | | |
SI-6104 support This pattern
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This(name) is treated just like Ident(name)
apparently this pattern was used in 2.9 code,
though I'm not sure it's spec'ed
|
|\ \ \ \ \ \ \ \
| | |_|_|_|_|_|/
| |/| | | | | | |
Fix a bunch of scaladoc issues: SI-3314 SI-4888 SI-5235 SI-5558 SI-4324 SI-5780 SI-4887 SI-3695 SI-4224 SI-4497 SI-5079 SI-6073 SI-5533 SI-5784
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
And relaxed the groups name/description/priority search algorithm to
work for types.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
@template and @documentable are now synomims.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Group class members based on their semantic relationship. To do this:
- @group on members, only need to do it for the non-overridden members
- -groups flag passes to scaladoc, groups="on" in ant
- @groupdesc Group Group Description to add descriptions
- @groupname Group New name for group
- @groupprio Group <int> (lower is better)
See test/scaladoc/run/groups.scala for a top-to-bottom example
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
as requested by @adriaanm on pull request #925
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Normally scaladoc won't generate template pages for anything other than
packages, classes, traits and objects. But using the @template
annotation on {abstract,alias} types, they get their own page and take
part as full members in the diagrams. Furthermore, when looking for the
companion object, if a value of type T is in scope, T will be taken as
the companion object (even though it might be a class)
All templates, including types are listed on the left navigation pane,
so now adding @template to String can get scaladoc to generate (a
no-comments) page for java.lang.String.
The {abstract, alias} type icons need to be updated -- I just took the
class icons and added a small x to them -- but they shoud be something
else (maybe an underscore?)i
TO USE THIS PATCH:
<pre>
/** @contentDiagram */ // tells scaladoc to create a diagram of the
// templates contained in trait Base
trait Base {
/** @template */ // tells scaladoc to create a page for Foo
type T < Foo
trait Foo { def foo: Int }
}
/** @contentDiagram */
trait Api extends Base {
/** @template */
override type T <: FooApi
trait FooApi extends Foo { def bar: String }
}
</pre>
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
for SI-5784. This commit has been checked with tools/scaladoc-compare
and the only difference is that the containing entities in the index
are not duplicate anymore, which solves yet another bug we did not
know about. :)
|
| | | | | | | | |
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
The known type class descriptions give you a humanly-understandable
explanation for [T: TypeClass] in the implicit conversions. For
example [T: Integral] will tell you that T must be an integral type
such as Integer and co.
Now that the reflection dust settled, I can actually add the test to
make sure the well-known type classes are intercepted and explanations
are given instead of the usual "the type T is context-bounded by
TypeClass"
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
- got rid of references to WikiParser when creating EntityLinks
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
- diagrams are not stored because they create many TypeEntities, nodes
and edges -- now they are created on demand, so make sure you don't
demand them twice!
- eliminated the type entity cache, which was nearly useless (6s gain)
but was preventing the GC from eliminating TypeEntities
- an unsuccessful attempt at reducing the tons of :: garbage we're
generating - there's 200MB-250MB of ::s during a typical 'ant docs.lib'
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Adds the ability to link to members, classes and objects in scaladoc.
The links can now be either qualified names or relative names, they
both work. See the test/scaladoc/resources/links.scala for a usage
example. Also introduced -no-link-warnings scaladoc flag, in case the
build output gets swamped with link warnings.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Based on an inital patch by Nada Amin. Rewrote some of the code to
compress it a bit.
Also fixed a problem that was affecting the prefix printing for
typerefs: type parameter and existentials won't get prefixes. While
I can imagine cases where you'd want to see where they come from,
you can always hover over them and see their origin.
Also added support for pretty-printing ThisTypes, SuperTypes and
SingleTypes (with links)
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
As suggested by Heather in pull request #816.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This was a long-standing issue in scaladoc: It was unable to
disambiguate between entries with the same name. One example is:
immutable.Seq:
trait Seq[+A] extends Iterable[A] with Seq[A] ...
What's that? Seq extends Seq? No, immutable.Seq extends collection.Seq,
but scaladoc was unable to show that. Now it does, depending on the
template you're in. Prefixes are relative and can go back:
-scala.collection.Seq has subclasses *immutable.Seq* and *mutable.Seq*
-scala.immutable.Seq extends *collection.Seq*
Unfortunately the price we pay for this is high, a 20% slowdown in
scaladoc. This is why there is a new flag called -no-prefixes that
disables the prefixes in front of types.
Btw, it also fixes the notorious "booleanValue: This member is added by
an implicit conversion from Boolean to Boolean ...". That's now
java.lang.Boolean, so it becomes clear.
Conflicts:
src/compiler/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
SI-3448 partial fix:
This enables a workaround for the fact that Map takes two type params
while $Coll takes only one. But it doesn't fix the problem though,
as there's one more piece missing from the puzzle - we need to adjust
the `Coll`s in {immutable, mutable, concurrent}.Map to something that
makes sense for the usecase. And that's not possible. But I'm
committing this nevertheless, maybe other projects can benefit from it.
And for SI-3448, the solution lies in automatic usecase generation,
whenever that will be ready.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
case class C(i: Int)(b: Boolean) would appear uncurried in scaladoc:
case class C(i: Int, b: Boolean)
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This bug was fixed by the model upgrade in c11427c1. Test case confirmation.
|