aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeApplications.scala
Commit message (Collapse)AuthorAgeFilesLines
* Compute type params in namer without completing the whole infoMartin Odersky2016-01-161-9/+16
| | | | | | | | | Type params should be computed before computing the whole info of a type. Without the patch we get a cyclic reference in the compileMixed test. Note that compileIndexedSeq does not pass with this commit (it passed before), this is fixed in the next commit.
* Merge pull request #1006 from dotty-staging/more-testsGuillaume Martres2015-12-261-7/+3
|\ | | | | More tests
| * Don't do eta expansion on bottom typesMartin Odersky2015-12-201-7/+3
| |
* | Add precondition to doc comment.Martin Odersky2015-12-211-0/+1
| |
* | PolishingMartin Odersky2015-12-211-1/+1
|/
* Fix higher-kinded unions and intersectionsMartin Odersky2015-12-181-0/+45
| | | | | | Since And/Or type themselves are parameterless, their the union and intersection of hgiher-kinded types has to be treated specially: The types have to be pulled under a common lambda.
* Better explanation for adaptHkVariancesMartin Odersky2015-12-131-13/+19
|
* Perform variance adaptation only when needed in isSubTypeMartin Odersky2015-12-131-24/+35
| | | | | | Previously adaptIfHK was performed on every type application. This made t3152 fail. We now do this only on demand, in isSubType. t3152 now passes again. But the change unmasked another error, which makes Iter2 fail to compile.
* Allow bottom types as hk type argumentsMartin Odersky2015-12-111-3/+7
| | | | Fixes problem raised in #966.
* Fix TypeLambda extractor.Martin Odersky2015-12-101-3/+11
| | | | | As remarked by @smarter, argInfos does not work for type lambdas, so argBoundss is always Nil.
* Code and documentation cleanupsMartin Odersky2015-12-061-300/+107
|
* Avoid false positives when extracting AppliedTypeMartin Odersky2015-12-061-1/+7
|
* Be DRY betweeen EtaExpand and LambdaAbstractMartin Odersky2015-12-061-15/+7
| | | | | | All Lambda abstractions, not just eta expansions, should use actual parameter bounds, not the one retrieved from the parameter symbols.
* Allow for F-bounded bounds in TypeLambdaMartin Odersky2015-12-061-8/+16
|
* Switch to new hk scheme.Martin Odersky2015-12-061-155/+148
|
* Fixes to TypeLambda and EtaExpansion extractors.Martin Odersky2015-12-061-5/+13
| | | | Makes i815 compile.
* Fix to TypeLambda over with a TypeBounds bodyMartin Odersky2015-12-061-1/+1
| | | | Taking typeAlias is illegal in that case.
* Fix bug computing typeParams for hk typesMartin Odersky2015-12-061-1/+1
| | | | | | Arg bounds do not count is bindings. Also: TypeLambda's $Apply binding should be covariant, because the parameter is (not sure it matters though).
* Fix bug computing typeParams for hk typesMartin Odersky2015-12-061-1/+3
| | | | Arg bounds do not count is bindings.
* Don't recognize type bounds as lambda abstractionsMartin Odersky2015-12-061-2/+0
| | | | Printing bounds omits the "<:" otherwise.
* Base Application extractor on classSymbolsMartin Odersky2015-12-061-2/+2
| | | | typeSymbols always have empty type parameter list.
* More uses of adaptIfHKMartin Odersky2015-12-061-2/+1
| | | | | Also: fix EtaExpansion. Also: Add some debug code to Applications, awaiting further fixes.
* Use new adaptArgs for Scala2UnpicklerMartin Odersky2015-12-061-13/+9
| | | | Also: fix adaptArgs and LambdaTrait to make it work.
* Fix adaptIfHK and drop rawTypeParamsMartin Odersky2015-12-061-23/+11
|
* Use typeapp extractors for printingMartin Odersky2015-12-061-1/+4
|
* Extractors and other new functionality for type applicationsMartin Odersky2015-12-061-0/+205
|
* Add missing type params in testMartin Odersky2015-12-061-4/+4
|
* Disallow existentially bound parameters as type parametersMartin Odersky2015-12-061-12/+1
| | | | | | | Done in order to keep the basics as simple as possible. Treating existentially bound parameters as still instantiatable type parameters does not seem to add anything fundamental, and makes the type system less regular.
* Don't count partial applications as applications.Martin Odersky2015-12-061-1/+1
|
* Update the comment of TypeApplications#argInfoGuillaume Martres2015-11-301-2/+2
|
* Fixed commentsMartin Odersky2015-11-301-11/+0
|
* Drop argumnt interpolation.Martin Odersky2015-11-301-17/+7
| | | | | | | It turns out it's not needed because now all type arguments are expressed as aliases. Interestingly dropping this feature shaved 20% off the time off junit tests. Which seems to indicate that the handling of type application is really performance critical.
* Eta expand according to expected type parameter varianceMartin Odersky2015-11-171-9/+16
| | | | | | | When eta expanding a type `C` to `[vX] => C[X]` the variance `v` is now the variance of the expected type, not the variance of the type constructor `C`, as long as the variance of the expected type is compatible with the variance of `C`.
* Renamings in DefinitionsMartin Odersky2015-11-091-1/+1
| | | | | | TypeRef becomes Type, thus removing duplicates. Where ...Type was used in an extraction (e.g. ArrayType(...), FunctionType(...)), we now use ...Of.
* Don't drop $apply when eliminating existentials in unpicklerMartin Odersky2015-10-241-1/+1
|
* Revise typeParams to account for existential hk typesMartin Odersky2015-10-241-27/+37
|
* Change some occurrences of <:< to frozen_<:<Martin Odersky2015-10-011-2/+2
| | | | | Some subtype tests should not instantiate type variables, in particular those having to do with & and |.
* Fixes to comments suggested by reviewerMartin Odersky2015-09-211-6/+6
| | | | Fixes suggested by @marter when reviewing previous hk PR.
* Eta expand $apply projected types if neededMartin Odersky2015-09-211-0/+29
| | | | | | | | | | | | | | | | It turns out that asSeenFrom can produce types that get projected with $apply but that are not higher-kinded. An exampple failure is in Iter3, andother in scala.collection.immutable.Map (which is now part of the test suite). We now detect that situation, and eta expand the projected type in `derivedSelect`, this will force a subssequent `lookupRefined` which will give the desired normalized type. Also added is a configurable test that checks that $apply projected tyeps are in fact higher-kinded.
* Keep track of parameter bounds in LambdaAbstract and EtaReduceMartin Odersky2015-09-181-11/+66
| | | | | | 1) Lambda abstract now records bounds of abstracted type parameters in TypeLambda 2) Eta-reduce likewise keeps the bounds it finds in the TypeLambda 3) Eta-reduce now also translates hk$i references to type parameters of the reduced type.
* Generalize eta reduction to partially applied types.Martin Odersky2015-09-181-2/+6
| | | | | | | | | | Now also allows to reduce something like ([T] => Map[T, String]) to Map[_, String]
* Fix problem in typeParamsMartin Odersky2015-09-181-12/+7
| | | | | Accidentally forwarded to rawTypeParams. This solved the problem with mismatching type params in appliedTo that was caught in testLifted.
* Rewrite compareHK to be kind-correctMartin Odersky2015-09-181-0/+6
|
* Replace isLambda with ifHKMartin Odersky2015-09-181-40/+15
| | | | | Replace occurrences of isLambda with isHK, because isHK is a bit faster and simplier.
* Rename of hk args HK$x -> hk$xMartin Odersky2015-09-181-69/+14
| | | | | | | | 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.
* Simplify EtaReduceMartin Odersky2015-09-181-4/+1
| | | | by removing dead case.
* Rename Apply -> hkApplyMartin Odersky2015-09-181-6/+6
| | | | Want to have a unique name for Apply, so that tests for higher-kinded types become cheaper.
* Project all high-kinded types with #ApplyMartin Odersky2015-09-181-3/+12
| | | | | | Used to be just instantiated lambdas. With the new scheme every type with a kind higher than * needs to be projected with #Apply.
* Try to eta reduce type applications.Martin Odersky2015-09-181-1/+3
| | | | | | | | Rewrite a type application like ([HK$0] => C[HK$0])(T) to C[T] Avoids application cahins to become unnecessarly large.
* Follow alias types when computing type params.Martin Odersky2015-09-181-2/+3
| | | | This aligns typeParams and rawTypeParams. It's not strictly to necessary, though.