| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Until reflection design is stabilized (i.e. 2.10.0 final is released),
it's a good idea to refrain from using reify in our codebase
(either directly in quasiquotes, or indirectly via materialized type tags).
This increases the percentage of changes to reflection that don't require
rebuilding the starr.
The change to build.xml will expose reifications going on during our build
(by printing out their results to the console, so that they bug everyone),
making it easier to spot and fix them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"""
why use asTypeConstructor for a prefix?
shouldn't that be BaseUniverseClass.thisType?
also, why does the prefix need to be changed at all?
I'm sure there's a valid reason, but it would be good to document it.
if you don't need to change the prefix,
use appliedType(tagType.typeConstructor, List(tpe))
"""
Because we need to look for an implicit of type base.Universe # TypeTag[$tpe].
I figured out that this is exactly the internal representation of that type.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
It is impossible to enforce macro programmers to use this mirror
instead of c.universe.rootMirror, so it has to be let go.
As to packageless symbol loading, which was the sole purpose of
introducing a special mirror for macro contexts, it will be integrated
into the compiler mirror in subsequent commits.
|
| |
|
|
|
|
| |
That doesn't require Context.reify anymore.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently there are discrepancies between the behavior of
c.reify and c.universe.reify.
First step in fixing these problems is removing the duplication in the API.
That's why I'm cutting away the Context.reify shortcut.
Context.reify is a magic macro, hardwired in the fast track mechanism, so
removing it requires redeploying the starr (because an old starr will
crash if launched on sources that don't contain Context.reify).
To cleanly redeploy a starr I've left a Context.reify stub in sources,
but hidden it behind a `protected` modifier. When starr is redeployed
(in a subsequent commit) the stub will be removed.
I've also updated the tests to use c.universe.reify instead of c.reify.
This will break some of them, because c.universe.reify uses a standard
compiler mirror, which unlike a macro mirror doesn't like packageless classes.
That's an annoyance, but I think having clean separation of commits
is more important that being 100% consistent.
|
|\
| |
| | |
fixes field mirrors and also improves docs and exceptions for all mirrors
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Factors out error raising code and introduces a special exception class
for Scala reflection errors.
Also adds membership sanity checks to reflectXXX. Previously
reflectField, reflectMethod, reflectClass and reflectModule
in InstanceMirror didn't check that the symbols being passed to them
actually correspond to some member of the related class.
|
| |
| |
| |
| |
| |
| |
| | |
reflectField now accepts getters and setters along with the field symbols,
it also checks whether a field has a reasonable binary representation
(this is necessary, because ctor parameters that are unused outside of their
declaring constructors don't get compiled down to Java fields/methods).
|
|\ \
| | |
| | | |
SI-4897 derive expected value from single type
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
when the type in a type test is, say, `C.this.A.type`,
must use the corresponding term `C.this.A` to test for equality
if you use the naive REF(<C.this.A.type>.symbol), you'll
get a path like `OwnerOfA.this.A`,
where `OwnerOfA` might be a superclass of `C`, and
explicitouter won't like that
|
|\ \ \
| | | |
| | | | |
Critical bugfixes/leak fixes/API corrections + ScalaDoc for SIP-14
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
We're not completely blind in there, are we.
|
|/ / /
| | |
| | |
| | | |
Sorry, I'm not in practice with java.util.concurrent.
|
|\ \ \
| | | |
| | | | |
SI-6086 magic symbols strike back
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Some of the symbols inside the compiler get created on the fly,
because there are no physical entities in classfiles corresponding to them.
This curious fact needs to be taken into account when loading symbols,
so that the magic symbols get correctly loaded by reflective mirrors.
magicSymbols (as defined in Definitions.scala) include not only
top-level classes, but some other stuff (e.g. String_+ or methods on Any).
Hence a filtering was done to exclude the stuff that's irrelevant
to reflective symbol loading.
Unfortunately a filter was configured to accept only _.isClass,
which consequently ruled out scala.AnyRef (that is a type alias).
|
|\ \ \ \
| | | | |
| | | | | |
Removes Float.Epsilon and Double.Epsilon
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Float.Epsilon and Double.Epsilon contain the wrong value. Epsilon
should be an upper bound on the relative error due to rounding
errors in floating point arithmetic, i.e. it is 1/2 ULP (unit in
the last position) which is 2^(-24) for Float and 2^(-53) for Double.
This was discussed in detail in https://issues.scala-lang.org/browse/SI-3791
and it was decided to deprecate Epsilon for 2.9 and to remove it for 2.10
and to reintroduce it with the correct value for 2.11.
See also the discussion (and comment from Martin) on
https://groups.google.com/forum/?fromgroups#!topic/scala-internals/m763WjBdfyo
|
|\ \ \ \
| | | | |
| | | | | |
SI-5939 resident compilation of sources in empty package
|
| |/ / /
| | | |
| | | |
| | | | |
Empty packages can now be cleanly invalidated.
|
|\ \ \ \
| |/ / /
|/| | | |
Optimize findmember
|
| | | |
| | | |
| | | |
| | | | |
Undoing the memberType caching. This seems to make it slower rather than faster. Also, comparing new vs old statistics shows that only very few asSeenFrom operations are saved by the caching.
|
| | | |
| | | |
| | | |
| | | | |
Also avoid recomputation of memberType in findMembers
|
| | | |
| | | |
| | | |
| | | | |
Only consider DEFERRED members in 2nd pass.
|
| | | |
| | | |
| | | |
| | | | |
memberType operations are not cached, so that at most one memberType is taken per found symbol.
|
| | | |
| | | |
| | | |
| | | | |
Also fixed test case that failed when moving to findMembers. Avoids similar problems in the future by renaming nme.ANYNAME
|
| | | |
| | | |
| | | |
| | | | |
Replace scope by ::-list, where new elements are added at the end.
|
| | | |
| | | |
| | | |
| | | | |
Specific optimizations to findMember that have become possible because findMembers is its own function now.
|
| | | |
| | | |
| | | |
| | | | |
broke out findMembers as a separate operation to streamline the code. findMember itself still needs to be optimized.
|
| | | |
| | | |
| | | |
| | | | |
Fixed fingerPrinting scheme to work with rehashes, also added finger prints to typedIdent searches.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
Keeps fingerprints in scopes which are bitsets telling you what the last 6 bits of each hashcode of the names stored in the scope are. findMember will avoid looking in a scope if inferprints do not match.
|
|\ \ \ \
| | | | |
| | | | | |
SI-6092 don't leak in LazyAnnotationInfo, don't lift try{}finally{}
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
which a try-catch is lifted
out to an inner method.
Less known fact: lazy values null-out their dependent values is their accessed only from
their initializer. The analysis is not context-dependent (meaning the owner where a reference
happens needs to be exactly that lazy value).
* Removed no-op code around positions in `LazyAnnotationInfo`
* Don't lift expressions that have no `catch` clause
The two changes combined fix a memory leak that's been plaguing the IDE: an annotation
(even when forced) would hang on to a namer, through the outer field of its call-by-name
parameter.
The test for the memory leak is in the IDE project (couldn't find a simple way to reproduce it outside
the IDE), but there's a test checking that the field is null after initialization.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-6089 better tail position analysis for matches
|
| | |_|_|/
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | | |
we mistakenly went into apply nodes to look for matchEnd-labeldefs
in tail positions -- only apply nodes that jump to labels in tailpos
should be traversed (this arises for nested matches)
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-5937: Vector updated, +:, and :+ ignore provided builder, breaking type safety
|
| | | | | | |
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-5695 removes Context.enclosingApplication
|
| | |/ / / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Apparently it's impossible to find out the enclosing Apply node
if you're an argument being typechecked (because the arguments
are typechecked separately from the enclosing Apply).
This functionality is by far not a core feature of macros,
so I'm removing it.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-5892 allow implicit views in annotation args
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
the problem was that lazy annotations got completed in phase pickler.
the `inferView` method in Typers bails out if `isPastTyper`. now the
lazy annotations completes `atPhase(typerPhase)`. test case in `pos`.
the second test case in `neg` is for another bug that is discussed in
a comment of SI-5892. when type checking arguments of type parameter
annotations, the class members should not be in scope. this was alreay
fixed in 9129cfe9.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Increase partest timeout and emit warning when it hits.
|
| | |/ / / / /
| |/| | | | | |
|