aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/core/TypeApplications.scala
Commit message (Collapse)AuthorAgeFilesLines
* Fix #2219: Fix type applications on WildcardTypeGuillaume Martres2017-04-111-1/+1
| | | | | | | Previously we just returned the unapplied WildcardType which is incorrect if the WildcardType is bounded. The proper thing to do is to do the type application on the bounds of the WildcardType and wrap the result in a WildcardType.
* Rename NameExtractor -> NameKindMartin Odersky2017-04-111-1/+1
|
* Get rid of ExpandedName flagMartin Odersky2017-04-111-6/+3
|
* Fix #2201: Less aggressive type application reduction for better inferenceGuillaume Martres2017-04-081-3/+6
| | | | | | | | | | | | | | | | | | | | | | | Previously we believed that reducing type applications did not affect type inference as long as the reduced type constructor had the same arity as the unreduced one, for example reducing `Foo[X, Y]` is fine when `Foo` is defined as: type Foo[A, B] = Bar[A, B] but not when it's defined as: type Foo[A] = Bar[A, A] But this is not a sufficient condition: the bounds of the type constructor arguments also matter for type inference, so we need to be more strict and disallow reductions in cases like: type Foo[A, B] = Bar[B, A] and: type Foo[A, B] = Bar[A, Int]
* Narrow matches from TypeLambda to HKTypeLambda where appropriateMartin Odersky2017-04-061-2/+4
|
* Split HKTypeLambda from PolyTypeMartin Odersky2017-04-061-4/+4
|
* Eliminate LambdaAbstractMartin Odersky2017-04-061-20/+1
| | | | Use fromParams instead.
* Further refactoringsMartin Odersky2017-04-061-22/+17
| | | | | - Use TypeLambda instead of PolyType. - Further harmonize factory operations
* replace derived{Method,Poly}Type with derivedLambdaTypeMartin Odersky2017-04-061-1/+1
|
* Rename PolyParam --> TypeParamRefMartin Odersky2017-04-061-4/+4
|
* Harmonize paramTypes and paramBoundsMartin Odersky2017-04-061-1/+1
| | | | | | 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-12/+12
| | | | | and generalize MethodParam to ParamRef, and TypeParamInfo to ParamInfo
* Encode variances in parameter namesMartin Odersky2017-04-061-3/+6
| | | | | | | | | | 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.
* Reduce type lambdas even if variance changesGuillaume Martres2017-03-161-3/+4
| | | | | | | | | | | | | | | Previously, the added testcase failed with (when running with -Ydebug-alias): 2 | def foo = Seq(a) | ^ |covariant type A occurs in invariant position in type => Seq.CC[Cov.this.A] of method foo Because the type parameter of `CC` is invariant. Of course, this is fine because `CC[A]` can be reduced to `Seq[A]`, but before this commit, `TypeApplications#appliedTo` used to disallow reductions that replaced an invariant type parameter with a variant one. I believe that for type inference, only preserving the arity is important, so I removed this restriction.
* Drop named type parameters in classesMartin Odersky2017-03-041-61/+0
| | | | | | | | | | | | | Drop the [type T] syntax, and what's associated to make it work. Motivation: It's an alternative way of doing things for which there seems to be little need. The implementation was provisional and bitrotted during the various iterations to introduce higher-kinded types. So in the end the complxity-cost for language and compiler was not worth the added benefit that [type T] parameters provide. Noe that we still accept _named arguments_ [A = T] in expressions; these are useful for specifying some parameters and letting others be inferred.
* Move compiler and compiler tests to compiler dirFelix Mulder2016-11-221-0/+688