aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
Commit message (Collapse)AuthorAgeFilesLines
* desugar Java repeated parms into an Array instead of SeqOndrej Lhotak2014-11-221-1/+3
|
* Rename PolyType.copy method. It clashes with generated one.Dmitry Petrashko2014-11-221-2/+2
| | | | See #209 for explanation.
* Add Id's to types.Dmitry Petrashko2014-11-221-0/+9
| | | | Helps to track where erroneous type was created.
* Add the right constructor to Java annotationsMartin Odersky2014-11-221-1/+1
|
* Merge pull request #228 from dotty-staging/fix/overridingodersky2014-11-181-0/+16
|\ | | | | Fix/overriding
| * Check that overriding members refine the types of overridden ones.Martin Odersky2014-11-181-0/+16
| | | | | | | | | | Somehow this was lost in porting (or was this done somewhere else in scalac?).
* | Moved pending tests that work into pos and neg.Martin Odersky2014-11-171-1/+1
| | | | | | | | | | | | | | One test (t2613) required lifting a hard recursion limit in findMember (used for debug only, will be removed in the future). The same test also requires -Yno-deep-subtypes to be reset, so it's in pos_special instead of pos.
* | Avoid computing info of TypeRefs for Object <-> Any comversions in ↵Martin Odersky2014-11-131-4/+9
|/ | | | | | ClassfileParser Another bit to help avoid CyclicReferences when reading Java classes
* Generalize symbolic refsMartin Odersky2014-11-101-5/+5
| | | | | | | Previously, there was a switch in SymDenotation#termRef to create a WithFixedSym ref when after erasure. This was done to fix a broken test, but it's clearly incomplete. The scheme is now replaced by one which always creates WithFixedSym Termrefs after erasure.
* Retract of optimization in computeDenotMartin Odersky2014-11-091-2/+9
| | | | Needs a weakening of an assertion in assertErased
* Small polishings in docs and code.Martin Odersky2014-11-091-1/+1
|
* Fix of computeDenot.Martin Odersky2014-11-091-4/+10
| | | | | Since we demand that after erasure all TermRefs are SymDenotations we need to assure this when computing the denotations of term refs in new phases.
* Implement findMember for JavaArraysMartin Odersky2014-10-261-0/+2
| | | | ... by forwarding to Object. Without this, LambdaLift fails for core/Contexts.scala.
* TreeTypeMap needs to map declarations of mapped classesMartin Odersky2014-10-261-0/+2
| | | | | | | | ... 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.
* Avoid caching NoDenotations in NamedTypesMartin Odersky2014-10-121-1/+6
|
* Take environment into account when typing a closure.Martin Odersky2014-10-111-2/+6
| | | | Environment parameters do not count in th eresult type.
* Make widening ops more systematic & completeMartin Odersky2014-10-111-7/+14
| | | | | 1) strip TypeVars wehere necessary before widening 2) allow the combination of widening and dealiasing, in any order.
* TypeTestsCasts now handles casts to constant types.Dmitry Petrashko2014-09-241-0/+2
|
* Fix errorneus equality between TermRef and WithFixedSymDmitry Petrashko2014-09-231-1/+2
|
* Better TreeTypeMapsMartin Odersky2014-09-131-22/+31
| | | | | | | | | | | | | | | | 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.
* Erasure should keep prefixes in TermRefsMartin Odersky2014-09-121-17/+10
| | | | | Bring TermRefs in line with TypeRefs. Prefixes need to be kept so that termrefs can be re-loaded in subsequent runs.
* Keep SuperTypes around after erasure.Martin Odersky2014-09-101-2/+1
| | | | | The reason is that otherwise the non-private member super.x gets merged with the private member this.x and that causes a double binding violation.
* CyclicError messages now go to printerMartin Odersky2014-09-051-1/+5
| | | | Have a configurable printer to which cyclic error messages are sent.
* Partially reverting of 08c6eacaMartin Odersky2014-09-051-5/+13
| | | | | | | | | | | | | | | Partial revert of 08c6eaca "this type is a term ref to the source module". The problem with doing this is that it introduces spurious outer references. An inner module that contains self referenves always needs the directly enclosing class. The revert avoids this dependency by making ThisTypes always point to TypeRefs. Several other changes were necessary to make the builds pass: TypeRefs had to get prefixes after erasure so that they can be reloaded. Symbols of such typerefs had to be retrieved without forcing a denotation. One test (blockescapes.scala) fails and is moved to pending, awaiting further resolution. Also two other new tests in pending which currently fail (and have failed before).
* Avoid reloading NonMemberSyms.Martin Odersky2014-08-311-2/+4
| | | | Non member symbols should not be reloaded in any case.
* Ensure that after erasure all types are erased.Martin Odersky2014-08-301-3/+7
| | | | | Defines a predicate isErasedTypes and checks that all tree types and their widened underlying types are erased.
* Shorten "if denotation is current the symbol" to "currentSymbol".Martin Odersky2014-08-291-1/+16
| | | | And make its usage more systematic on all substitutions where it makes sense.
* Avoid cyclic reference errors in ShowScalaMartin Odersky2014-08-291-2/+3
| | | | | | | | | This is done by predicating some shortcuts on tp.symbol.isStatic where tp is a NamedType with the condition tp.denotationIsCurrent, i.e. we avoid forcing the denotation. This safe because the branches taken on isStatic are optimizations. This commit contains the minimum set of changes to make showScala pass.
* Added todo commentMartin Odersky2014-08-291-1/+1
|
* Fix in underlyingClassRefMartin Odersky2014-08-281-1/+21
| | | | Made implementation conform to doc comment.
* Make ThisTypes take TypeRefs instead of ClassSymbolsMartin Odersky2014-08-271-24/+15
| | | | | This avoids stale symbol errors and does not need the somewhat unsystematic symbol rebinding of the last commit.
* Rebinding ThisTypesMartin Odersky2014-08-271-4/+19
| | | | | | | | | | | ThisTypes do escape. It seems that Scala 2 pickling produces ThisTypes that refer to base classes of the class being compiled. If the base class is in a separate compilation unit, this can lead to a stale class symbol in the ThisType. We solve this here by rebinding the class symbol in the ThisType. We should also explore the alternative: class ThisType(tref: TypeRef) ... That would do the rebinding as part of the generation denotation resolution mechanism.
* thisType of a module class is a term ref to the source module.Martin Odersky2014-08-261-5/+5
| | | | | | | | Module classes now always get the sourceModule term ref as their this type. We would like to eliminate ThisType() of a module class completely, as this hangs on to a symbol which might become stale for globally accessible modules. This commit is the first step. It contains the change to thisType and the necessary fixes to make the test suite pass.
* Fixes to erasureMartin Odersky2014-08-251-13/+13
| | | | | | | | | | Makes erasure pass the test suite. Erasure is not yet turned turned on by default, because TestNonCyclic fails with a stale symbol error. The problem is that This types are coupled to Symbols and therefore don't reload. This is a problem is This types refer to static symbols that get recompiled. We either have to drop using This types for static references, or redefine thme so that can be reloaded.
* Make type creators work for erased types.Martin Odersky2014-08-241-34/+108
| | | | | | | | - Some types are different when erased (e.g. prefixes are NoPrefix) - Some types are forbidden when erased. Put in assertions to check that fact. Also, some renaming and doc comments to make creation of TermRefs and TypeRefs clearer.
* Comments about phase orderings and shadowed references.Martin Odersky2014-08-241-1/+22
| | | | ... try to explain two tricky consequences of the denotation and signature model.
* Refactored TreeTypeMapMartin Odersky2014-08-181-5/+7
| | | | Goes into a separate source files. Several simplifying refactorings.
* Fixes to TreeTypeMapMartin Odersky2014-08-181-2/+2
| | | | | | | | | (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.
* Fixing handling of self in DeepTypeMap#mapClassInfoMartin Odersky2014-08-181-5/+5
| | | | | | The previous version used `self` which referred to the `val` in the implicit TypeOps value class (duh!). We really should make value classes not require to have public fields.
* Add matchesLooselyMartin Odersky2014-08-121-0/+10
| | | | | For overriding checks we need a concept where a val can match a def. Normal matches does not provide this.
* Add SyntheticMethods miniphaseMartin Odersky2014-08-111-1/+5
| | | | | New phase for Synthetic Method generation. Scala 2.x did it in Typer, but it's cleaner to do it in a separate phase.
* LazyRefs break cycles for unpickled typesMartin Odersky2014-08-081-4/+11
| | | | | Insert LazyRefs to break cycles for F-bounded types that are unpickled or read from Java signatures.
* Detect cycles and protected legal ones with LazyRefsMartin Odersky2014-08-081-2/+29
| | | | | | | | | | Cycles are now detected early, when an info is first completed. Legal, f-bounded cycles are broken by a LazyRef, which will construct its type lazily. This makes checkBounds validation of AppliedTypeTrees work (in FirstTransform). Formerly, this stackoverflowed despite the laziness precautions in findMember. Todo: Do the same for class files coming from Java and Scala 2.x.
* Type#foreachPartMartin Odersky2014-08-031-3/+9
| | | | Added method to traverse all parts of a type.
* Enabled variance checkingMartin Odersky2014-08-031-0/+1
| | | | | | | Variance checking is now run as part of type-checking. Fixed tests that exhibited variance errors. Added tests where some classes of variance errors should be detected.
* Fixed underlyingIfRepeated.Martin Odersky2014-08-031-12/+0
| | | | ... and moved to TypeApplications.
* Add varargs bridge methodsMartin Odersky2014-08-031-0/+9
| | | | | Distinguish translations between Java and Scala varargs methods and add bridges where needed.
* Eliminate JavaRepeatedParamClassMartin Odersky2014-08-031-6/+8
| | | | | | | Having two repeated param classes (and two types) does not work, because we need to maintain an overriding relationship between Scala repeated param methods and Java repeated param methods (this will be resolved later by bridges).
* Defined substitution which follows aliasesMartin Odersky2014-07-221-3/+10
| | | | | Used in FullParameterization to substitute type parameters. Fixes test failure for t2399.scala
* Merge pull request #152 from dotty-staging/fux/substThisDmitry Petrashko2014-07-211-0/+4
|\ | | | | Fix of FullParameterization