| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
If a file was loaded from TASTY, it can not still have a non-null source file,
since the source file is unpickled into the annotation of a top-level class.
Also, fix typo in previous commit.
|
|
|
|
|
|
|
| |
Analogous to the previous situation where we do not report a data race
if the previous symbol comes from a superclass, we now do the same if
the previous symbol comes from a given self type. Makes overrideDataRace.scala pass,
and finally enables stdlib test with TraverableViewLike.scala added.
|
|
|
|
|
| |
Remve versions in Symbols, always go through version in
Denotations. Avoids having two equivalent ways to do the same thing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Symbols are not stable between runs, so if some symbol referred
to from Definitions gets recompiled, there are then two Symbols
that are both visible, one referenced from Definitions, the other
the one that got compiled.
Thos led to a crash when e.g. compiling scala.Short, because the
newly compiled symbol was not recognized as a primitive value
class.
The present commit tries to make systematic changes without regard
to simplicity or aesthetics. This will be polished in future commits.
// ### comments signal areas that need further attention.
|
| |
|
|
|
|
| |
Added suggested changes by myself and @smarter.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
_nextId is used to set Symbol's id fields. That field is actually used for more
than priunting. In LambdaLift, it determines Symbol ordering when constructing
(tree-) sets of symbols.
Instead of a thread-unsafe global counter, we not use existing infrastructure
in ConetxtState.
|
|
|
|
|
|
|
| |
Refinement classes and their members could give spurious stale symbol errors if the
symbol is loaded in a different run than the classfile containing it. The problem
is that refinement classes do not form part of the scope of their owners. The fix
assumes that refinement classes are always "stillValid".
|
|
|
|
|
| |
I scanned the main sources with IntellIJ's spell checker and
corrected what showed up.
|
|
|
|
| |
See discussion in #544
|
|
|
|
|
|
| |
Symbols never change betwene terms and types. So we do not need to the current
denotation to decide what they are. Less forcing -> less potential for cyclic
references.
|
|
|
|
|
|
| |
It's common that one wants to create class symbols with arbitary parent types,
not just TypeRefs. But for the casual user it's non-obvious how to do it.
Hence the new creation method.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are three ways to erase a value class:
- In most case, it should be semi-erased to an ErasedValueType, which will be
fully erased to its underlying type in ElimErasedValueType.
This corresponds to semiEraseVCs = true in TypeErasure.
- In a few cases, it should be erased like a normal class, so far this
seems to be necessary for:
* The return type of a constructor
* The underlying type of a ThisType
* TypeTree nodes inside New nodes
* TypeApply nodes
* Arrays
In these cases, we set semiEraseVCs = false
- When calling `sigName` it should be erased to its underlying type.
This commit implements all these cases. Note that this breaks most tests
because ElimErasedValueType has not been implemented yet, it is part of
the next commit.
|
|\
| |
| | |
Refactor/super accessors
|
| |
| |
| |
| |
| | |
I have figured out how to make this the default in Eclipse, so hopefully
we won't see many repeats of this.
|
| |
| |
| |
| |
| | |
Needed to harmonize behavior of Typer/Namer and tpd. This is needed
for making pickling, then unpickling the identity.
|
| |
| |
| |
| |
| |
| |
| |
| | |
It's needed beyond MacroTransform, and its definition
is independent.
Also, make `defn` in Symbols not implicit. (I think its
implicitness was an oversight).
|
|/ |
|
| |
|
| |
|
| |
|
|\
| |
| | |
use methods to find companion class
|
| | |
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
|
|
| |
Without this fix the duplicated classes and the original ones share the same reference to a scope,
instead of having each a separate one.
@alexsikia this should fix your problems
|
|
|
|
|
|
| |
Fixes #412, by calling derivesFrom in isDerivedValueClass
at initial phase. Rewrite of 789dc0c070bde6ce8634aa89e73e31ec1233a6f8
by @smarter. Does the same thing in Symbol#isDerivedValueClass.
|
|\
| |
| | |
Fix/refined subtyping
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There seems to be no reason why we should not merge
a class and an abstract type that has the class within
its bounds. I.e. Assume
class A { type T }
class B { class T }
Then (A | B) # T should be legal and refer to type T,
and (A & B) # T should be legal and refer to class T.
|
| |
| |
| |
| | |
Otherwise, associatedFile calls topLevelClass, which fails for NoSymbol.
|
|\ \
| |/
|/| |
Fix/#305 annot bootstrap
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
1) Rename `decls` to `unforcedDecls` to make it clear that
it is danegrous to use.
2) Prefer `info.decls` over `unforcedDecls`.
This fixes the problem reported in #305 where the primary
constructor was not found.
|
|/
|
|
|
|
|
|
|
|
|
|
| |
The previous scheme derived the right bounds, but then failed to use them
because a TypeRef already has a set info (its bounds). Changing the bounds in
the symbol by a side effect does not affect that. This is good! But it showed
that the previous scheme was too fragile because it used a sneaky side effect
when updating the symbol info which failed to propgate into the cached
info in TypeRef.
We now keep GADT computed bounds separate form the symbol info
in a map `gadt` in the current context.
|
|
|
|
|
| |
This makes it more consistent with related methods ensureFreshScopeAfter,
installAfter.
|
|
|
|
|
|
|
| |
Now handles the case where a class symbol itself is not changed by the map,
but one of its declarations is. In this case we need to back out, and create
new symbols for the class and all other symbols that are defined in the same scope as
the class.
|
|
|
|
|
|
|
|
| |
... and these mappings have to be part of the applied substitutions.
Without the patch, the postCondition of FirstTransform fails for TreeInfo.scala and others,
because it selects symbols which are not defined in the mapped class.
Unrelated bugfix: JavaArray derives from Object.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. They now keep track of changed constructors in templates, updating
the class scope as for other members.
2. Any changed members are now entered into the new class scope at exactly
the same position as the old one. That ensures that things like caseAccessors
still work.
3. ChangeOwners now is reflected in the prefixes of any named types.
4. Newly created classes now get their own ClassInfo type.
5. TreeTypeMaps always crete "fresh" symbols. Fresh symbols do not share
a NamedType reference with an existing reference to some other symbol.
This obviates b2e0e7b4, which will be reverted.
To make it work, the interface of TreeMap changed from an ownerMap function
to a substitution-like data structure working with two lists.
|
|
|
|
| |
Goes into a separate source files. Several simplifying refactorings.
|
|
|
|
|
|
|
|
|
| |
(1) Template nodes have to be treated specially. They contain
primary constructors, self definitions and local dummys,
all of which have to be properly mapped and re-integrated.
(2) Symbol substitutions have ot be done all together instead of
one after the other.
(3) When creating new symbols, need to create ClassSymbols for ClassSymbols.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Packages should always have a single denotation, which is invariant for all transformations.
Package members should always be entered in the first phase, and should never be entered
after a given phase.
This reflects the fact that package members correspond to classfiles. Once you create a classfile, it
stays around and is available from the start of the next run. Also, we need to prevent multiple
denotation versions of packages from hanging on to stale symbols. It would not be enough to replace
a package member by a newly compiled one; if packages had multiple denotations we'd have to do this
for all of them.
|
|
|
|
| |
Problem was reported by @darkdimius. Test case will come in next commit.
|
|
|
|
|
|
| |
Type params should have different flags, depending on whether they are
owned by a method or a class. Only class type parameters are marked Deferred,
protected, and Local.
|
| |
|
|
|
|
|
|
|
| |
- Some new functionality in tpd and in Symbols.
- Added `sm` interpolator to print nicely.
- Make use of nestedMap where possible.
- Add IdentityDenotTransformer as a convencience class
|
|
|
|
|
| |
Rewrote SuperAccessors (more to be done; see comments), and
added stuff here and there to make it work smoother.
|
|
|
|
|
|
|
|
| |
This shouldn't require any changes to backend,
as all type parameters will be erased in erasure
Conflicts:
src/dotty/tools/dotc/core/Symbols.scala
|