| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The outer check was not being generated when the prefix was a
top level module. The enclosed test shows that we in fact must
synthesize the outer check in that case.
Perhaps the bug was introduced by neglecting to consider that
a module can inherit member classes.
|
| |\ \ \ \
| | |/ / /
| |/| | /
| | | |/
| | |/| |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Fix a batch of code inspection recommendations generated by IntelliJ 14.1.5.
Categories of fix,
Unnecessary public modifier in interface
Replace filter+size with count
Replace filter+nonEmpty with exists
Replace filter+headOption with find
Replace `if (x != null) Some(x) else None` with Option(x)
Replace getOrElse null with orNull
Drop redundant semicolons
Replace anon fun with PF
Replace anon fun with method
|
| |\| | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
- Don't normalize existentials during the `contain`-s type map;
`ExistentialType#normalize' calls contains internally and
an exponential blowup ensues.
- Ensure that the type map used in variance validation never
returns modified types in order to avoid needless cloning of
symbols.
The enclosed test case still gets stuck in Uncurry, thanks to
the way that `TypeMap#mapOver(List[Symbol])` recurses through the
type first to check whether the type map would be an no-op or not.
If not, it repeats the type map with cloned symbols. Doing the work
twice at each level of recursion blows up the complexity.
Removing that "fast path" allows the enclosed test to compile
completely. As at this commit, it gets stuck in uncurry, which
dealiases `s.List` to `s.c.i.List` within the type.
Some more background on the troublesome part of `TypeMap`:
http://lrytz.github.io/scala-aladdin-bugtracker/displayItem.do%3Fid=1210.html
https://github.com/scala/scala/commit/f8b2b21050e7a2ca0f537ef70e3e0c8eead43abc
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Comment about my poor naming choice in Types.
NullaryMethodType sounds like the method has one empty argument list,
whereas it really has no argument lists at all.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
sbt's [API extraction phase](https://github.com/sbt/sbt/blob/0.13/compile/interface/src/main/scala/xsbt/API.scala#L25)
extends `scala.reflect.internal.Phase`, which implements a bunch of methods,
such as `erasedTypes` as `false`, which are then overridden by scalac
in `GlobalPhase` (nested in scala.tools.nsc.Global).
(`erasedTypes` in particular is again overridden in the back-end -- for performance?)
However, since sbt's compiler phases extend `reflect.internal.Phase`,
the logic for detecting the current phase does not work,
as the default implementation is called (simply returning `false`),
when chasing the `prev` pointers hits an sbt-injected phase,
as its implementation is `reflect.internal`'s constant `false`.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
This logic was scattered all over the hierarchy,
even though it's only needed in one spot, and is unlikely to evolve.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Keep owner for module (symbol of the tree) and module class (holds the members)
in synch while moving trees between owners (e.g., while duplicating them in specialization)
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
All class internal names that are referenced from a class being
compiled should be referenced through their ClassBType. This makes
sure that the ClassBType is cached in `classBTypeFromInternalName`,
which is required during classfile writing: when ASM computes stack
map frames, we need to answer subtyping queries, for which we need
to look up the ClassBTypes.
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The previous methods to identify method invocations that can be
optimized, such as `isPredefAutoBox`, were String-based. Now we
obtain class and method signatures from symbols through the
BTypes infrastructure.
We also piggy-back on specialization's type transformer to create
all specialized subclasses of Tuple1/Tuple2. We'll do the same in
the future for FunctionN, but the current JFunctionN are written
in Java and specialized artisanally.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
For @throws[E] where E is not a class type, GenASM incorrectly writes
the non-class type to the classfile. GenBCode used to crash before
this commit. Now GenBCode correctly emits the erased type (like
javac) and adds a generic signature.
|
| |/
|/|
| |
| |
| |
| |
| | |
Allow annotating individual callsites @inline / @noinline using an
annotation ascription
c.foo(): @inline
|
|\| |
|
| |\
| | |
| | | |
get test suite passing on Windows
|
| | | |
|
| |\ \
| | |/
| |/| |
fix indentation
|
| | |
| | |
| | |
| | | |
this sneaked into 2d025fe2d0c9cd0e01e390055b0531166988f901
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A trio of problems were hampering autocompletion of annotations.
First, given that that annotation is written before the annotated
member, it is very common to end parse incomplete code that has a
floating annotation without an anotatee.
The parser was discarding the annotations (ie, the modifiers) and
emitting an `EmptyTree`.
Second, the presetation compiler was only looking for annotations
in the Modifiers of a member def, but after typechecking annotations
are moved into the symbol.
Third, if an annotation failed to typecheck, it was being discarded
in place of `ErroneousAnnotation`.
This commit:
- modifies the parser to uses a dummy class- or type-def tree,
instead of EmptyTree, which can carry the annotations.
- updates the locator to look in the symbol annotations of the
modifiers contains no annotations.
- uses a separate instance of `ErroneousAnnotation` for each
erroneous annotation, and stores the original tree in its
`original` tree.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I found another spot where I had previously needed to manually
invalidate a TypeRef cache, and modified that to route through
the newly added `invalidatedCaches`.
`invalidatedCaches` now invalidates all the other caches I could
find in our types of types. I opted for a non-OO approach here,
as we've got a fairly intricate lattice of traits in place that
define caches, and I didn't have the stomach for adding a polymorphic
`Type::invalidatedCaches` with the the right sprinkling over overrides
and super calls.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Typechecking a pattern that defines a pattern type variable
initially assigns abstract type symbol with open type bounds.
Later on, pattern type inference kicks in to sharpen the type
of the variable based on constraints imposed by the expected
type (ie, the type of scrutinee of the pattern.)
However, before inference does this, a `TypeRef` to the abstract
type symbol can be queried for its base type with respect to some
class, which leads to it populating an internal cache. This cache
becomes stale when the underlying symbol has its type mutated.
The repercussions of this meant that a subsequent call to `baseType`
gave the wrong result (`NoType`), which lead to an `asSeenFrom`
operation to miss out of substitution of a type variable. Note the
appearance of `A` in the old type errors in the enclosed test case.
This commit takes an approach similar to 286dafbd to invalidate
caches after the mutation. I've routed both bandaids through the
same first aid kit: I'm sure over time we'll add additional calls
to this method, and additional cache invalidations within it.
|
|\| |
|
| |\
| | |
| | | |
Topic/completely 2.11
|
| | |\ |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
val and var members of classes are split into getter/setter and field
symbols. However, we can't call `defString` on any of these and see
what existed in source code.
Example:
```
scala> class X { protected var x: Int = 0 }
defined class X
scala> val xField = typeOf[X].member(TermName("x "))
xField: $r.intp.global.Symbol = variable x
scala> xField.defString
res10: String = private[this] var x: Int
scala> xField.getterIn(xField.owner).defString
res11: String = protected def x: Int
scala> xField.setterIn(xField.owner).defString
res12: String = protected def x_=(x$1: Int): Unit
```
This commit introduces a new method on `Symbol` that pieces together
the information from these symbols to create an artificial symbol
that has the `defString` we're after:
```
scala> xField.sugaredSymbolOrSelf.defString
res14: String = protected var x: Int
```
|
| | | |
| | | |
| | | |
| | | | |
This should be particularly helpful for synthetic field names like `evidence$21`.
|
|\| | | |
|
| | |/
| |/|
| | |
| | | |
Such that uncurry can correctly un-dependify them.
|
| |\ \
| | | |
| | | | |
Improve drifted URLs
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
- Any.scala: Link to the guide instead of the SIP.
- AnyVal.scala: Remove SIP link and align guide link to Any.scala.
- Commands.scala: Use a less out of date team link.
- Logic.scala: Link was broken. Substitute found.
- Process.scala: Links were 403 & 404. Fixed as this is a code sample.
- TypeMaps.scala: Move old EPFL Trac to JIRA.
- RedBlackTree.scala: Replaced broken link with substitutes based on site maintainer input [1].
[1] When asked where Data-Set-RBTree.html had gone Don@UNSW advised
"I think it's on the Haskell wiki now. It was Chris Okazaki's version".
The closest I could find to what this document probably was is this
paper by Hinze edited by Okasaki,
http://www.cs.ox.ac.uk/ralf.hinze/publications/WAAAPL99b.ps.gz
The paper cites the Okasaki document so I included a link to that as
well.
The Haskell Wiki does have a link to a RB document but that's broken
too,
https://wiki.haskell.org/Research_papers/Data_structures >
Constructing red-black trees
|
| |\ \ \
| | |/ /
| |/| | |
Update links to docs, codehaus and citeseer
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
docs.scala-lang.org
- Align some links to new layout for docs.scala-lang.org
- Include link to concrete parallel collection performance characteristics
codehaus
- Subsitute a link to a JIRA email for the 404 JRUBY-3576 JIRA link
in Codec.scala. jira.codehaus.org is not redirecting this.
citeseer
- Replace the citeseer link with a direct link to a PDF which is not
behind a login challenge.
|
| |\ \ \
| | | | |
| | | | | |
fix typos/spelling
|
| | | |/
| | |/| |
|
| |\ \ \
| | |_|/
| |/| | |
SI-9442 Fix the uncurry-erasure types
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Using the "uncurry-erased" type (the one after the uncurry phase) can
lead to incorrect tree transformations. For example, compiling:
```
def foo(c: Ctx)(l: c.Tree): Unit = {
val l2: c.Tree = l
}
```
Results in the following AST:
```
def foo(c: Ctx, l: Ctx#Tree): Unit = {
val l$1: Ctx#Tree = l.asInstanceOf[Ctx#Tree]
val l2: c.Tree = l$1 // no, not really, it's not.
}
```
Of course, this is incorrect, since `l$1` has type `Ctx#Tree`, which is
not a subtype of `c.Tree`.
So what we need to do is to use the pre-uncurry type when creating
`l$1`, which is `c.Tree` and is correct. Now, there are two
additional problems:
1. when varargs and byname params are involved, the uncurry
transformation desugares these special cases to actual
typerefs, eg:
```
T* ~> Seq[T] (Scala-defined varargs)
T* ~> Array[T] (Java-defined varargs)
=>T ~> Function0[T] (by name params)
```
we use the DesugaredParameterType object (defined in
scala.reflect.internal.transform.UnCurry) to redo this desugaring
manually here
2. the type needs to be normalized, since `gen.mkCast` checks this
(no HK here, just aliases have to be expanded before handing the
type to `gen.mkAttributedCast`, which calls `gen.mkCast`)
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | | |
For each URL
- Where it redirected the target of the redirection was used
- Where is no longer existed a replacement was selected
|
| |/ |
|
|\ \
| | |
| | | |
Inliner heuristic for higher-order methods
|
| |\ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
If a class (trait) is a SAM type, store the name and descriptor of the
SAM in the ClassBType's InlineInfo.
|
|\ \ \ \
| | | | |
| | | | | |
SI-9473 Cleaner references to statically owned symbols
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Ever wonder why `identity("")` typechecks to
`scala.this.Predef.identity("")`?
It turns out that `mkAttributedRef` was importing
`q"$scalaPackageClass.this.Predef._"` for all these years,
rather than `q"$scalaModule.Predef._"`.
This commit makes `mkAttributedRef` special case static owners
by referring the the corresponding module, instead.
|
|\ \ \ \
| |/ / /
|/| | | |
Include owner in ErrorNonExistentField message
|
| |/ /
| | |
| | |
| | | |
This should be particularly helpful for synthetic field names like `evidence$21`.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
only trivial merge conflicts here.
not dealing with PR #4333 in this merge because there is a substantial
conflict there -- so that's why I stopped at
63daba33ae99471175e9d7b20792324615f5999b for now
|
|\ \ \
| | | |
| | | | |
Streamline logic related to accessor derivation in MethodSynthesis & Namers
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Give Getter control over whether a setter is needed. For now,
only mutable ValDefs entail setters. In the new trait encoding,
a trait val will also receive a setter from the start.
Similarly, distinguish whether to derive a field from deferredness of the val.
(Later, fields will not be emitted for traits, deferred or not.)
|
|\ \ \
| |/ /
|/| | |
SI-6806 Add an @implicitAmbiguous annotation
|