aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Restore state when detecting a baseTypeRef cycle.Martin Odersky2015-10-011-0/+1
|
* underlyingChain -> underlyingIteratorMartin Odersky2015-10-011-4/+10
| | | | | make successive underlying values an iterator (so that we do not run into a stackoverflow in case of cycles).
* Don't log when in Printing mode.Martin Odersky2015-10-011-1/+2
| | | | Logging while printing messes up the recursion counts.
* Fix compilation error.Martin Odersky2015-10-011-1/+1
|
* Replace withMode by addModeMartin Odersky2015-10-014-8/+8
| | | | | | withMode sets the whole mode, nit an individual bits. This was used wrongly in several places. Make this less of a trap by renaming withMode -> withModeBits.
* Change some occurrences of <:< to frozen_<:<Martin Odersky2015-10-013-10/+15
| | | | | Some subtype tests should not instantiate type variables, in particular those having to do with & and |.
* Generalize rules for isSubType between NamedTypes.Martin Odersky2015-10-011-16/+2
| | | | | Can assume P#T <: Q#T if P <: Q. This follows from the rules how we expand # to existentials.
* Replace `containsSig` with `matches`.Martin Odersky2015-09-301-12/+9
| | | | | | containsSig still used param-only matching, which is incorrect in the new system, because different overloaded methods may have the same parameter signature.
* Refinements to signature matchingMartin Odersky2015-09-303-57/+62
| | | | | | | 1) Matching after erasure also takes wildcards into account (before it didn't). 2) Combine all signature matching operations into a single matchDegree method.
* Fix a long sleeper bugMartin Odersky2015-09-301-0/+1
| | | | | | | | When setting the denotation we did not change the checked period. This can lead to a situation where a denotation is set to NoDenotation, yet the checked period is something else. This means in effect the denotation will vanish at the checked period. This bug caused the junit test failure about "non-member exception" for sourceFile in DottyBackendInterface.
* Refine atSignatureMartin Odersky2015-09-292-6/+20
| | | | | | atSignature should also check result type names, except - if one of the result is a wildcard - a boolean flag relaxed is explicitly set
* Fix problem with avoid.Martin Odersky2015-09-291-3/+4
| | | | | When determining what to refine we should not rely only on signatures but we need full denotation matching.
* Eliminate Config.newMatch optionMartin Odersky2015-09-293-43/+4
| | | | | With the new approach to matching it is no longer sound. We always have to match infos anyway to be sure.
* Matching denotations should take infos into accountMartin Odersky2015-09-293-38/+44
| | | | | | | | Whenchecking whether two denotations match it is not enough to look at the signatures. The signatures might match (on the parameters) but the actual parametre types might be different. The change always tests infos after signatures, effectively turning the signature test into a pre-filter.
* remove unused codeSarunas Valaskevicius2015-09-251-7/+0
|
* Merge pull request #802 from dotty-staging/change-hk-1odersky2015-09-2517-236/+427
|\ | | | | Change hk take 2
| * 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-214-16/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Avoid orphan RefinedThis types in glb/lub.Martin Odersky2015-09-182-3/+3
| |
| * 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.
| * Disallow wildcard arguments to higher-kinded types...Martin Odersky2015-09-181-1/+28
| | | | | | | | ...unless the HK type can be eta-reduced to a class type.
| * Generalize eta reduction to partially applied types.Martin Odersky2015-09-182-2/+13
| | | | | | | | | | | | | | | | | | | | Now also allows to reduce something like ([T] => Map[T, String]) to Map[_, String]
| * Fix problem in typeParamsMartin Odersky2015-09-182-13/+8
| | | | | | | | | | 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-182-9/+13
| |
| * Replace isLambda with ifHKMartin Odersky2015-09-185-52/+21
| | | | | | | | | | Replace occurrences of isLambda with isHK, because isHK is a bit faster and simplier.
| * Remove magic from derivedRefinedType.Martin Odersky2015-09-181-17/+3
| | | | | | | | It's no longer needed with new hk scheme.
| * Rename of hk args HK$x -> hk$xMartin Odersky2015-09-185-82/+27
| | | | | | | | | | | | | | | | 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-189-22/+27
| | | | | | | | Want to have a unique name for Apply, so that tests for higher-kinded types become cheaper.
| * Add missing position to errorMartin Odersky2015-09-181-1/+1
| |
| * Adapt type arguments in typedAppliedTypeTreeMartin Odersky2015-09-181-11/+13
| | | | | | | | | | | | Previously, only pattern bound arguments were adapated. This was an oversight. Also, change logix so that we survive empty type parameter lists. This was also an oversight before.
| * Better error reporting in TreePicklerMartin Odersky2015-09-181-1/+3
| | | | | | | | | | | | Turn a possible NPE into an AssertionError. The latter are caught in pickleTree, so an error leaves a trace about what was pickled.
| * Project all high-kinded types with #ApplyMartin Odersky2015-09-182-4/+13
| | | | | | | | | | | | 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.
| * Temporary fix to testLiftedMartin Odersky2015-09-181-3/+9
| | | | | | | | | | | | | | | | Discrepancies between numbers of formal and actual type arguments were observed when typing partialFunctions.scala under new scheme. Should come back to this when subtyping is rewrittem/simplified to work with new hk-scheme. Maybe testLifted is no longer needed at all.
| * Don't lambda abstract derived typesMartin Odersky2015-09-181-1/+1
| | | | | | | | | | Derived types already contain the lambda abstractoion; lambda abstracting them again would cause a double lambda.
| * Avoid cycles when eliminating existentials in unpicklingMartin Odersky2015-09-181-4/+23
| | | | | | | | | | New hk-scheme caused cycles in elimExistentials which are fixed by this patch.
| * Use EtaExpand instead of LambdaAbstract when unpickling typerefsMartin Odersky2015-09-181-5/+1
| | | | | | | | | | | | When unpickling from Scala2 TypeRefs with arguments which do not refer to classes, use EtaExpand instead of LambdaAbstract. Lambda Abstrct is wrong since it drops type arguments.
| * Allow to use safe substitution in LambdaAbstractMartin Odersky2015-09-184-4/+39
| | | | | | | | | | Needed to avoid cycles involving F-boundes hk-types when reading Scala2 collection classes with new hk-scheme.
| * Drop parameterizeWithMartin Odersky2015-09-182-6/+6
| | | | | | | | | | parameterizeWith picked between simple hk types and lambda abstraction. No longer needed because now we always lambda abstract.
| * A non-class typeref has type parameters only if subtype of a lambda class.Martin Odersky2015-09-181-2/+5
| |
| * Lambda abstract all TypeRefs when unpickling.Martin Odersky2015-09-181-0/+5
| |
| * Always lambda abstract TempPolyTypes representing types.Martin Odersky2015-09-181-12/+3
| |
| * Don't eta expand in appliedToMartin Odersky2015-09-181-1/+1
| |
| * Add comment.Martin Odersky2015-09-181-1/+4
| |
| * Add EtaReduce method.Martin Odersky2015-09-181-0/+33
| | | | | | | | EtaReduce will be used to keep applications on eta expanded methods small.
| * Avoid generating companion-methods for non-class types.Martin Odersky2015-09-181-3/+5
| | | | | | | | | | | | | | This would lead to a crash. Example is in Predef: object Pair type Pair
| * Adapt arguments in all type applicationsMartin Odersky2015-09-182-8/+8
| | | | | | | | | | Previously, we did this only in applications in rhs of type definitions. Need to do it everywhere.
| * Strenghten condition in EtaExpandIfLambdaMartin Odersky2015-09-181-1/+3
| | | | | | | | | | Without the additional `typeParams.nonEmpty` condition we got a crash in t1439.scala