aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/NameOps.scala
Commit message (Collapse)AuthorAgeFilesLines
* Add accessors for non-public members accessed from inline methodsMartin Odersky2016-10-021-0/+3
| | | | | | | | This makes existsing uses of inline mostly compile. Todo: Verify that stdlib can be compiled. Todo: Implement accessors for assignments to priavte variables Todo: Figure out what to do with accesses to private types.
* Handle outer this in InlinerMartin Odersky2016-10-021-0/+1
| | | | Also, do some refactorings and fix some bugs in Inliner.
* First version of inline schemeMartin Odersky2016-10-021-1/+1
| | | | | To be done: outer accessors To be done: error positions
* Remove refinement encoding of hk typesMartin Odersky2016-07-111-15/+0
| | | | | | | | | | Remove the code that implemented the encoding of hk types using refinements. Drop the notion that RefinedTypes can be type parameters. This is no longer true under the new representation. Also, refactoring MemberBinding -> TypeParamInfo
* Start new, direct HK schemeMartin Odersky2016-07-111-6/+6
| | | | | - Re-introduce newHK option. Label some things that will be removed with OLD.
* Remove old hk schemeMartin Odersky2016-07-111-8/+0
| | | | | | | | | | | | - Simplify RefinedType - Drop recursive definition of RefinedThis - this is now taken over by RecType. - Drop RefinedThis. - Simplify typeParams The logic avoiding forcing is no longer needed. - Remove unused code and out of date comments.
* Turn on new hk schemeMartin Odersky2016-07-111-5/+5
| | | | | | | For the moment under newHK flag. - avoid crasher in derivedTypeParams (NamedTypes don't always have symbols) - Revise logic in type comparer for new HK scheme
* Fix Ycheck: allow assigning fields in static constructors.Dmitry Petrashko2016-06-071-0/+1
|
* Tweak in NameOpsMartin Odersky2016-04-151-1/+1
| | | | | The previous version seemed to fail non-deterministaically, but after a while I could not reproduce it anymore. Anyway, leaving the change in.
* Fix #765 for super accessorsMartin Odersky2016-04-151-1/+10
| | | | | Partial fix of #765. Hack to make sure unexpandedName works for super accessor names.
* Create LambdaTraits referred to from UnpicklerMartin Odersky2016-04-151-1/+6
| | | | | LambdaTraits are created on demand; we need to make sure they exist when referred to from Tasty.
* Abstract out lazy local names somewhatMartin Odersky2016-02-111-0/+7
| | | | | | | | Add operations to NameOps to detect and produce names for lazy locals. @darkdimius Maybe there is already another way to do this? I could not find it.
* Generalize overriding checking from isDefinedMartin Odersky2015-12-141-0/+1
| | | | | | | | Generalize overriding checking from isDefined to all methods added by desugar to a case class. None of these methods has an override so we need to add one in case they do override another method (previously we would flag this as an error).
* Change hk naming schemeMartin Odersky2015-12-061-6/+9
|
* Rename of hk args HK$x -> hk$xMartin Odersky2015-09-181-1/+1
| | | | | | | | These are not user-accessible types, so no need to follow type convention and write in upper case. Also, rename occurrences of lambda to Lambda, to make clear we mean a type lambda.
* Mixin: support trait setters.Dmitry Petrashko2015-09-141-1/+9
| | | | Used to create a separate field from trait setter, as the field name wasn't deconstructed.
* Workaround for #765Martin Odersky2015-08-211-0/+5
| | | | | Avoid using unexpanded name because it can give wrong results for super accessors of symbolic names. See #765. Without this commit t2183.scala crashes the compiler.
* Merge pull request #735 from dotty-staging/ycheck-methodsodersky2015-08-041-3/+6
|\ | | | | Ycheck that methods defined in ClassInfo exist in tree.
| * SpecializeNames: Duplicate scalac behaviour, sort tparamsDmitry Petrashko2015-07-131-3/+6
| |
* | New name utility method: freshenedMartin Odersky2015-07-091-2/+7
|/ | | | | Creates a fresh name by appending a $N suffix. Takes care of unwrapping/rewrapping module class suffixes.
* Drop TraitConstructors phaseMartin Odersky2015-06-271-1/+1
| | | | | | | | It did not do enough to carry its own weight, in particular because DenotationTransformers do have a price - every encountered denotation in the whole program is passed through them. The name change from <init> to $init$ was all it did, that is now rolled into Mixin. Also renamed IMPLCLASS_CONSTRUCTOR to TRAIT_CONSTRUCTOR.
* New NameOps methods for Scala2 traitsMartin Odersky2015-06-011-4/+10
| | | | Also: generalize expandedName so that it can cater for trait setters.
* Harden isLambdaArgNameMartin Odersky2015-05-211-2/+8
| | | | | | Previously we could have returned true here yet a subsequent lambdaArgIndex would fail with a Numberformat error. This scenario is prevented now.
* Fix #560 - refactor flatNameMartin Odersky2015-05-131-1/+1
| | | | | | - Merge flatName and fullNameSeparated - Treat nested members of modules specially, to conform to scalac conventions - Use `~` as separator for term members.
* Specialization-specific names.Dmitry Petrashko2015-04-201-2/+24
|
* Remove trailing spaces in Dotty source.Dmitry Petrashko2015-04-091-2/+2
|
* Make all Dotty source files end in newline.Dmitry Petrashko2015-04-091-1/+1
|
* Produce expanded names.Martin Odersky2015-04-071-2/+8
| | | | | In the absence of semantic names, this is kludgey. But we need to do it because otherwise the ExpandedName flag is not correctly set.
* Drop choice of separator in expanded name.Martin Odersky2015-03-181-9/+12
| | | | | It's not used and is too low-level anyway. Expanded names should be a semantic concept, the choice of separator is irrelevant.
* Rename inheritedName -> shadowedNameMartin Odersky2015-03-181-3/+3
| | | | The new name is more consistent with the usage (e.g. NamedType#shadowed).
* Refacttored skolemization logicMartin Odersky2015-01-081-1/+1
| | | | ... into a new trait "Skolemization".
* Avoid name clashes when generating synthetic companion objects.Martin Odersky2014-12-191-3/+12
|
* Previous scheme was buggy; leaked Array types to backend.Martin Odersky2014-11-281-1/+0
| | | | | | Now: All new Array[T] methods are translated to calls of the form dotty.Arrays.newXYZArray ...
* More systematic handling of Scala2LocalSuffix.Martin Odersky2014-11-091-2/+2
| | | | Separate test instead of inline.
* Avoid getting confused because of Scala2 local suffixesMartin Odersky2014-11-091-0/+3
| | | | | When inheriting from Scala2 traits we sometimes encounter names with a space at the end, denoting a local variable. Drop the space because our translation scheme has no room for it.
* Adapt GettersSetters to new Mixin scheme.Martin Odersky2014-11-091-11/+2
| | | | Trait getters are no longer needed.
* First version of mixin transform.Martin Odersky2014-11-091-2/+4
| | | | Needs adaptations in getters/setters before it can be tested.
* rename AddGetters -> GettersSettersMartin Odersky2014-10-121-9/+23
| | | | ... and add a gettersSettersPhase to Context.
* Fix handling of Array#clone in ErasureMartin Odersky2014-09-121-0/+1
| | | | | Treat clone like the other primitive array operations, ensure it returns a JavaArray.
* Fixes to erasure to make -Ycheck:all work.Martin Odersky2014-08-281-0/+8
| | | | | | | | Main change: Introduce JavaArrayType as a new type constructor for Java erased array. Translate all methods of Array class during erasure to primitive operations on arrays. Some other small fixes for more localized problems.
* Two variance-related fixes in DesugarMartin Odersky2014-08-031-0/+1
| | | | | | 1) Type parameter accessors inherit their variance from the type parameter 2) Copy method parameter defaults are annotated @uncheckedVariance. This is necessary because default methods will be checked for variance.
* Preparation for intgeration of RefChecksMartin Odersky2014-08-031-3/+6
| | | | | Added OverridingPairs Small tweaks here and there.
* Added phase: SuperAccessorsMartin Odersky2014-07-171-3/+6
| | | | | Rewrote SuperAccessors (more to be done; see comments), and added stuff here and there to make it work smoother.
* Make SuperAccessorName and extractor.Martin Odersky2014-07-171-5/+7
| | | | Should do the same with other name-creator/name-test pairs.
* Avoid crashing on name tests when name is empty.Martin Odersky2014-06-261-4/+4
| | | | Guard every occurrence of name.head with a test whether name.length > 0
* Handling higher-kinded types with lambdasMartin Odersky2014-06-181-16/+2
| | | | | Switch to the new scheme where higher-kinded types (and also some polymorphic type aliases) are represented as instances of Lambda traits.
* Names and definitions for LambdasMartin Odersky2014-06-121-5/+7
| | | | | Adding names and definitions for the Lambda scheme to hk types. Also add HigherKinded flag for HK type parameters and abstract types.
* Shadowed referencesMartin Odersky2014-04-081-0/+9
| | | | | | | | | | | | | | | | | | | 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.
* Erasure phase PoCMartin Odersky2014-03-291-0/+8
| | | | | | | | | | | | | | | | | Still missing: bridge method generation, signatures. Other changes - Turned around Checking and NoChecking. Checking is the default, NoChecking disables it. - Refactored Typer#typed to expose typedNamed, so that it can be overridden in erasure. - Made logging more forgiving wrt off-buy-one phase errors. Conflicts: src/dotty/tools/dotc/typer/Typer.scala
* Fix of t1236: higher-kindedMartin Odersky2014-03-211-0/+13
| | | | | | | | | | | | | | | | | (and also of t0625, which reappeared). Several fixes were made. In summary: 1. Naming and representation of KigherKinded traits changed. It's now $HigherKinded$NIP where the letters after the second $ indicate variance (N)egative, (I)nvariant, (P)ositive. The HKtraits themselves are always non-variant in their parameters. 2. When deriving refined types over higher-kinded types, the variance of a type alias is the variance of the new type constructor. 3. isSubTypeHK was changed, as was the position from where it is called. 4. appliedTo also works for PolyTypes.