aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/core/Types.scala
Commit message (Collapse)AuthorAgeFilesLines
* Fix #2152: Instantiate dependent result type parametersMartin Odersky2017-04-111-1/+1
| | | | | | | #2152 shows that dependent result type parameters can end up in the types of terms, so we have to eliminate them. If we don't we get orphan parameters in pickling. Fix method name and comment
* Rename NameExtractor -> NameKindMartin Odersky2017-04-111-1/+1
|
* Make freshName semanticMartin Odersky2017-04-111-4/+4
|
* Add ShadowedName and AvoidClashNameMartin Odersky2017-04-111-3/+4
|
* Generalize definition of Type#isStableMartin Odersky2017-04-101-2/+3
| | | | | | | | | We now consider a type also as stable if it refers to an ExprType whose result type is stable. The previous commit made pos/z1720.scala break, because it skolemized unstable argument types. This commit makes the test pass again.
* Three fixes wrt handlings of package objectsMartin Odersky2017-04-091-7/+16
| | | | | | | | 1. Invalidate packageObj cache when entering a package object 2. Prefer package object members over same-named package members unless we are in the scala package 3. Exclude package objects from no-double-bindings checks, since package objects may now be visited before indexing them.
* Merge pull request #2193 from dotty-staging/deterministic-testsFelix Mulder2017-04-061-1/+1
|\ | | | | Deterministically randomises test compilation order
| * Deterministically randomises test compilation orderOlivier Blanvillain2017-04-051-1/+1
| | | | | | | | The previous implementation would compile tests in different orders from machine to machine, depending on the order in which *.scala files are listed by the operating system.
* | Update doc comment on HkTypeLambda/PolyTypeMartin Odersky2017-04-061-12/+13
| |
* | PolishingsMartin Odersky2017-04-061-5/+6
| |
* | Refactorings for efficiencyMartin Odersky2017-04-061-40/+53
| | | | | | | | | | | | | | | | | | - split LambdaType.equals into two equals so that tests are more specific (also avoids type testing against a trait) - re-order cases in some pattern matches with the aim to (1) move common cases earlier, (2) move more expensive trait type tests later.
* | Narrow matches from TypeLambda to HKTypeLambda where appropriateMartin Odersky2017-04-061-2/+2
| |
* | Merge MethodType and PolyType functionality where possibleMartin Odersky2017-04-061-38/+23
| | | | | | | | | | | | Two benefits: (1) less code. (2) finding subtle bugs about parameter dependent method types. By merging with PolyTypes we are forced to take parameter dependencies into account.
* | Make PolyType a ground typeMartin Odersky2017-04-061-1/+1
| | | | | | | | | | It's too surprising to leave it as a type proxy. In all circumstances except erasure, it is not true that a PolyType is somehow the same as its result type.
* | Split HKTypeLambda from PolyTypeMartin Odersky2017-04-061-4/+1
| |
* | Eliminate LambdaAbstractMartin Odersky2017-04-061-5/+23
| | | | | | | | Use fromParams instead.
* | Further refactoringsMartin Odersky2017-04-061-50/+58
| | | | | | | | | | - Use TypeLambda instead of PolyType. - Further harmonize factory operations
* | Rename PolyTypeTree -> LambdaTypeTreeMartin Odersky2017-04-061-13/+13
| |
* | Add HKTypeLambdaMartin Odersky2017-04-061-5/+40
| |
* | Eliminate MethodOrPolyMartin Odersky2017-04-061-3/+1
| | | | | | | | Replace with LambdaType
* | Eliminate ParamTypeMartin Odersky2017-04-061-10/+4
| | | | | | | | Replace with ParamRef
* | replace derived{Method,Poly}Type with derivedLambdaTypeMartin Odersky2017-04-061-16/+5
| |
* | Add StarLambda, HKLambda abstractions ...Martin Odersky2017-04-061-70/+79
| | | | | | | | | | ... to distinguish between HK(proxy) and *(ground) types. Also, refactor some more methods to keep it DRY.
* | Make PolyTypes subtypes of LambdaTypesMartin Odersky2017-04-061-59/+50
| | | | | | | | Also, rename LambdaOver{Type,Term}s to {Type,Term}Lambda
* | Rename PolyParam --> TypeParamRefMartin Odersky2017-04-061-20/+13
| |
* | Refactor ParamRef so that no type params are neededMartin Odersky2017-04-061-48/+28
| |
* | Remove parameter from lambda typeMartin Odersky2017-04-061-8/+11
| |
* | Get rid of Name parameter for LambdaType and ParamRefMartin Odersky2017-04-061-21/+29
| | | | | | | | Use an abstract type instead.
* | ParamType refactoringsMartin Odersky2017-04-061-73/+74
| | | | | | | | Trying to bring PolyTypes closer to TypeLambdas
* | Harmonize paramTypes and paramBoundsMartin Odersky2017-04-061-100/+103
| | | | | | | | | | | | MethodTypes have paramTypes whereas PolyTypes have paramBounds. We now harmonize by alling both paramInfos, and parameterizing types that will become common to both.
* | Break out functionality from MethodTypeMartin Odersky2017-04-061-82/+124
| | | | | | | | | | and generalize MethodParam to ParamRef, and TypeParamInfo to ParamInfo
* | Add neg test for illegal parameter namesMartin Odersky2017-04-061-1/+1
| | | | | | | | and fix typo
* | Encode variances in parameter namesMartin Odersky2017-04-061-12/+23
|/ | | | | | | | | | This leads to a slight overall simplification, harmonizes pickle format with internal representation, and makes MethodTypes and PolyTypes more similar to each other. I believe the change is useful as it is, but in particular it is a useful step for an eventual unification of MethodTypes and PolyTypes.
* Handle shadowed for TermRefWithSigMartin Odersky2017-03-201-4/+8
| | | | Making a name shadowed lost the signature before.
* Allow going from non-priv to priv denot when run changesGuillaume Martres2017-03-161-11/+6
|
* Don't force denotations in asMemberOfGuillaume Martres2017-03-161-5/+6
| | | | | | This was introduced in the previous commit and caused unpickling failures, we are now more conservative and only check the Private flag on SymDenotations so we don't have to load any other denotation.
* Fix #2099: avoid loading a private member when recomputing a NamedType denotGuillaume Martres2017-03-161-2/+6
| | | | | | | | | | | | | | | | | | | | ParamForwarding creates the following forwarder in B: private[this] def member: Int = super.member Where the type for `super.member` is `TermRef(SubA, member)` and the symbol is the `val member` in `A`. So far this is correct, but in later phases we might call `loadDenot` on this `TermRef` which will end up calling `asMemberOf`, which before this commit just did: prefix.member(name) This is incorrect in our case because `SubA` also happens to have a private `def member`, which means that our forwarder in B now forwards to a private method in a superclass, this subsequently crashes in `ExpandPrivate`. (Note: in the bytecode, a private method cannot have the same name as an overriden method, but this is already worked around in EnsurePrivate.) The fix is simple: when we recompute a member, we should only look at private members if the previous denotation was private.
* Merge pull request #2096 from dotty-staging/fix-i2051Dmitry Petrashko2017-03-151-3/+4
|\ | | | | Fix #2051: allow override T with => T or ()T
| * fix #2051: allow override T with => T or ()Tliu fengyun2017-03-141-3/+4
| |
* | Merge pull request #2043 from dotty-staging/tailrec-derivesFromDmitry Petrashko2017-03-151-36/+36
|\ \ | | | | | | Tailrec for derivesFrom/lookupRefined/classSymbol/classSymbols
| * | Add @tailrec to avoid regressions.Nicolas Stucki2017-03-011-30/+30
| | |
| * | Make loop in derivesFrom a tailrec loop.Nicolas Stucki2017-03-011-6/+6
| | |
* | | Drop dead method and testMartin Odersky2017-03-141-19/+2
| | | | | | | | | | | | | | | All PolyTypes get variances passed, so isTypeLambda is always true and the deleted assert is never triggered.
* | | Drop mixed MethodType apply methodMartin Odersky2017-03-141-4/+2
| | | | | | | | | | | | | | | | | | The dropped method takes direct parameter types but a result type expression. Since parameter types are now in general dependent as well, that method is mostly redundant.
* | | Add method to track parameter dependency statusMartin Odersky2017-03-141-4/+24
| | |
* | | Construct dependent method types from symbolsMartin Odersky2017-03-141-5/+17
| | | | | | | | | | | | | | | Also: check validity of method types, so that no forward references occur.
* | | Construct MethodTypes from parameter closureMartin Odersky2017-03-141-25/+36
| | | | | | | | | | | | | | | To allow for dependencies between method type parameters, construct MethodTypes from a closure that maps the currently constructed MethodType to its parameter types.
* | | fix #2071: handle HKApply in SAMTypeliu fengyun2017-03-141-0/+2
| |/ |/|
* | Comment ApproximatingTypeMapMartin Odersky2017-03-121-0/+7
| |
* | Merge pull request #2068 from dotty-staging/fix-#2064odersky2017-03-091-8/+7
|\ \ | | | | | | Fix #2064: Avoid illegal types in OrDominator