aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Better printing of type variablesMartin Odersky2014-05-081-1/+1
| | | | | Will now print the full chain of instances using ? for uninstantiated and ' for instantiated.
* Avoid -Ycheck after errorsMartin Odersky2014-05-081-2/+4
|
* isAfterTyper testMartin Odersky2014-05-083-2/+8
| | | | | Add test whether we are after typer. Use it to assert that eta expansion and implicit search do not happen after typer.
* Some more debug info.Martin Odersky2014-05-082-2/+4
|
* Added a unique identifier to trees.Martin Odersky2014-05-081-0/+10
| | | | Used for debugging purposes for now. Might be used for replaying IDE interactions later.
* Fixing stillValid codeMartin Odersky2014-05-081-2/+3
| | | | | | | | | | | We need to take into account that symbols can can have non-class owners yet still be valid. Previously such symbols were treated as invalid. Now they are valid if their owners are valid. The commit supersedes 29976d7922c5c3e99f0469e3db1 which got reverted.
* Removing duplication between Any and Object methodsMartin Odersky2014-05-087-89/+92
| | | | | | | | | | | | | | | | | | | | We cannot have same named methods defined in Object and Any because after erasure the Any references get remapped to the Object methods which would result in a double binding assertion failure. Instead we do the following: - Have some methods exist only in Any, and remap them with the Erasure denotation transformer to be owned by Object. - Have other methods exist only in Object. To achieve this, we synthesize all Any and Object methods; Objetc methods no longer get loaded from a classfile. There's a complication with getClass. We need to reconsider what the best treatment of getClass is. Right now there's too much magic going on for my taste. It might be better to leave getClass on Object only as it is in Java, forget about the special treatement of its type, and have another getClass like method in an decorator on class Any. That could produce the right types and could also work for primitive types.
* Fix withSymAndNameMartin Odersky2014-05-082-7/+8
| | | | There was a mismatch between symbol and signature before.
* Erasure of term refs without symbolsMartin Odersky2014-05-081-1/+1
| | | | | Need to allow for possibility that term ref does not have a symbol (e.g. termrefs with union prefixes do not always have symbols).
* Better error message if position of tree isn't set.Dmitry Petrashko2014-05-061-1/+1
|
* Fix invalid flags in lazy vals.Dmitry Petrashko2014-05-061-10/+15
|
* Definitions used by backend.Dmitry Petrashko2014-05-061-0/+23
|
* Fix TailRec to use Label flag.Dmitry Petrashko2014-05-061-6/+16
| | | | | | Conflicts: src/dotty/tools/dotc/backend/jvm/BCodeBodyBuilder.scala src/dotty/tools/dotc/core/Definitions.scala
* Fix error in box\unbox logic.Dmitry Petrashko2014-05-061-1/+1
| | | | TermRef's for primitive types are of primitive-type.
* Helper method to get all members of type.Dmitry Petrashko2014-05-061-1/+1
|
* CollectEntryPoints.Dmitry Petrashko2014-05-063-2/+135
| | | | | Collect entry points for backend. Previously this was done by cleanup.
* Constructors stubDmitry Petrashko2014-05-062-0/+28
|
* Merge pull request #119 from DarkDimius/leaksDmitry Petrashko2014-05-062-5/+5
|\ | | | | Context escape detection.
| * Allow to provide parent Context for Driver.processDmitry Petrashko2014-04-112-5/+5
| |
* | Add support for specifying 'all' for -Xprint, -Yskip, etcGuillaume Martres2014-04-211-2/+3
| |
* | Fix Nullarify treating all 'apply' methods as Function0Dmitry Petrashko2014-04-151-1/+1
| |
* | New phase: NullarifyMartin Odersky2014-04-155-6/+161
| | | | | | | | Eliminates ExprTypes and PolyTypes over value types.
* | Fix to Select(Tree, Symbol)Martin Odersky2014-04-141-1/+1
| | | | | | | | | | As a denotation need to take the symbol's info *as seen from the qualifier type*.
* | ByNameTypeTree is a TypTree.Martin Odersky2014-04-141-1/+1
| | | | | | | | Was an oversight before.
* | InfoTransformers as specific DenotTransformersMartin Odersky2014-04-145-13/+20
| | | | | | | | | | Factored out denot transformer behavior where the we transform types in a uniform way into InfoTransformers.
* | Members of stable methodsMartin Odersky2014-04-142-4/+10
| | | | | | | | | | | | | | | | | | Stable methods are introduced from getters by inserting () parameters. This change makes sure that adding () does not lose the members of an ExprType. Also, avoid spurious stale symbol errors in loadDenot. When something is not a SymDenotation, no use retrying in first phase; current would fail immediately.
* | Fixing prefix of implicit membersMartin Odersky2014-04-142-4/+5
| | | | | | | | | | | | | | Implicit members are TermRefs that should have a prefix corresponding to the object of which they are a member. They used to have the ThisType of their owner before. `implicits2` provides a way to verify that the change works. It would be good to turn this into a more robust test at some point. But it's not high preiority, so I prefer no test to a fragile test.
* | Fix mkArityArray not producing last arityDmitry Petrashko2014-04-111-3/+3
| |
* | Fix error in bridges.Dmitry Petrashko2014-04-111-1/+1
| | | | | | | | Do not discard non-bridge methods
* | Make mkArityArray work for classes outside "scala" packageDmitry Petrashko2014-04-111-4/+5
| |
* | Merge pull request #111 from DarkDimius/phase-reqDmitry Petrashko2014-04-114-1/+40
|\ \ | | | | | | Allow phases to give restrictions on pipeline position.
| * | Allow phases to give restrictions on pipeline position.Dmitry Petrashko2014-04-094-1/+40
| | | | | | | | | | | | | | | | | | Phases can now specify which phases should it follow. Tree transforms can additionally specify which TreeTransforms should have finished their processing of compilation units entirely.
* | | TailRec phase and tests for it.Dmitry Petrashko2014-04-113-3/+347
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ported tailcall phase from scalac with such changes: - all transformation is done in the phase itself (previously half of the work was done in backend) - it is now able to run before uncurry - it is now a treeTransform - renamed to tailrec to make it more obvious that this phase transforms only recursive calls. For now this is a single phase which speculatively transforms DefDefs. Speculation can be potentially removed by splitting into 2 phases: one detecting which methods should be transformed second performing transformation. But, as transformation requires as same amount of work as detection, I believe it will be simpler to maintain it as a single phase. Conflicts: tests/pos/typers.scala
* | | Allow closures to take type parameters.Dmitry Petrashko2014-04-112-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | | SymDenotation.isEffectivelyFinalDmitry Petrashko2014-04-112-0/+15
| | | | | | | | | | | | | | | | | | Helper method that tests weather this particular SymDenotation cant have overrides: eg if it's defined in module class, if it is inner method, if it is method of anonymous class, etc.
* | | Merge pull request #118 from dotty-staging/fix/annotationsDmitry Petrashko2014-04-093-8/+11
|\ \ \ | |_|/ |/| | Fixing annotations
| * | Port LazyVals to use hasAnnotation.Dmitry Petrashko2014-04-091-2/+2
| | | | | | | | | | | | Instead of by-hand testing of modifier type.
| * | Fixing annotationsMartin Odersky2014-04-092-6/+9
| | | | | | | | | | | | | | | | | | | | | Two fixes: 1) Annotation#symbol now returns the correct annotations for classes as well as traits. 2) Typer copies annotations from Modifiers to Symbols
* | | Shadowed referencesMartin Odersky2014-04-086-17/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In TypeAssigner#ensureAccible we sometimes pick an inherited public member as the denotation of a NamedType instead of an inaccessible private one. The problem is that both are denotations for the same type, which caused a noDoubleBindings assert failure. We now solve this problem by creating a "shadowed" named type to hold the inherited member. The shadowed named type is distinguished by its name, which reads (inherited)originalName In the future, we should make this more robust by using a general tagging scheme to create shadowed names. Another fix is about import symbols. They are now referenced with NonMemberTermRefs. With this fix, the test suite passes with no double def violations.
* | | CleanupsMartin Odersky2014-04-082-2/+2
| | | | | | | | | | | | | | | Conflicts: src/dotty/tools/dotc/transform/Splitter.scala
* | | Option for testing for double bindingsMartin Odersky2014-04-082-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A double binding is if a named type gets assigned two denotations in the same period. This is a side-effect and also a race condition, so it's very bad. I am trying to eliminate all causes of this. But one cause which will likely remain are double defitions in a prgram, if a user writes class C { val x: Int val x: Int } Then it's really hard to avoid setting two meanings of C.this.x! That's why the testing against double bindings is enabled by a -YnoDoubleBindings option. The understanding is that -YnoDoubleBindings should be set only if there are no double def errors anticipated. Otherwise the program might fail with an assertion error before the double def error is reported.
* | | Flag self names that conflict with parameters or membersMartin Odersky2014-04-082-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | A self name may no longer have the same name as a parameterless class member (or param accessor). The restriction makes sense because otherwise scoping is confusing. It's needed because otherwise we get TermRefs that have the same name and prefix but denote different things. Moved some code which exercises this from pos/typers to neg/typers
* | | Reworked TermRef handlingMartin Odersky2014-04-087-27/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main problem with TermRef handling was that signatures were not always tracked correctly. New invariant: A TermRef that points to a symbol is always a TermRefWithSig, and the signature is the one of the corresponding member. We achieve this by sometimes generating a new TermRefWithSig if a TermRef gets a denotation. One possible simplification would be to always store a signature in a TermRef. There's still a problem in TermRefWithSig#newLikeThis, which currently works only if the previously stored denotation references a symbol. We will need to generalize JointRefDenotation to contain multiple symbols for a complete fix.
* | | Avoid creating a local dummy when retyping.Martin Odersky2014-04-082-4/+9
| | | | | | | | | | | | Retyping should not create new symbols and that includes local dummys.
* | | TreeCheckers use re-typing...Martin Odersky2014-04-081-6/+31
| | | | | | | | | | | | ... to check whether tree types make sense. Still produces errors when enabled.
* | | Better printing of denotations.Martin Odersky2014-04-082-4/+8
| | | | | | | | | | | | | | | Used to print <none> for denotations with a symbol, now prints "some I" where I is the denotation's info.Reworked phases.
* | | Fleshed out Splitter phaseMartin Odersky2014-04-082-4/+104
| | | | | | | | | | | | | | | | | | | | | Implemented splitting operations As a side effect, this contains a test ruling out structural term member dispatch. Tests 0586 and 0625 which used structural dispatch got moved to neg.
* | | Corrected computations of union denotations.Martin Odersky2014-04-082-28/+27
| | | | | | | | | | | | | | | | | | Cannot discard a symbol simply because the other side's type is weaker. If in (A | B)#m A and B resolve to different symbols `m`, the resulting denotation cannot have either `m` as symbol; it must be NoSymbol instead.
* | | Merge pull request #116 from dotty-staging/add/Denotation-updateSébastien Doeraene2014-04-052-1/+29
|\ \ \ | | | | | | | | Install method for SymDenotations
| * | | Install method for SymDenotationsMartin Odersky2014-04-042-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | Add a new method to install a SymDenotation after a specific phase has run. The new denotation replaces the current denotation of the symbol starting with the period after the given phase.