Skip to content

[WIP] Change HK encoding #1282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 86 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
468b499
Record binding kind in TypeBounds
odersky May 24, 2016
2d8d291
Allow refinements of new types
odersky May 24, 2016
10ef004
Allow general recursion in refined types.
odersky May 25, 2016
3c99610
Refinements to refinement types
odersky May 25, 2016
461fe3d
Add type lambdas
odersky May 26, 2016
3960710
Better printing of skolems
odersky May 26, 2016
a3a6108
New type lambda scheme for hk types
odersky May 26, 2016
e768331
Add mapInfo method to Denotations
odersky May 27, 2016
c7fa021
Introduce recursive types
odersky May 27, 2016
7d3b4de
Use recursive types also when unpickling from Scala 2.x
odersky May 27, 2016
96f6bc6
Abstract type parameters out from type symbols
odersky May 27, 2016
4b912db
Fix toVariance in MemberBinding
odersky May 27, 2016
6b9e7d8
Disable checkInst in RecType
odersky May 27, 2016
67b4917
Simplify RecType.closeOver
odersky May 27, 2016
7c59785
Rename MemberInfo -> MemberBinding
odersky May 27, 2016
7a92cd5
Add printing of type lambda trees
odersky May 27, 2016
c9daca0
Replace MemberBinding # memberInfo by memberBounds
odersky May 27, 2016
ddc3a81
Fix printing of type lambdas
odersky May 27, 2016
eb3f1a6
Remove special case in parser
odersky May 27, 2016
b6f9305
[WIP] Tenantive new HK scheme.
odersky May 30, 2016
444e182
Avoid crasher in derivedTypeParams
odersky May 31, 2016
bc51e63
Fix printing of type lambdas
odersky May 31, 2016
b1ee403
Remove printlns
odersky May 31, 2016
fed3150
Revise logic in type comparer for new HK scheme
odersky May 31, 2016
56d2dd3
Rmove over-zealous check
odersky May 31, 2016
828b231
Turn on new hk scheme
odersky Jun 1, 2016
ec0ce3a
Swap order of tests in lookupRefined
odersky Jun 1, 2016
e17ca87
Change joins of BindingKinds
odersky Jun 1, 2016
a7fb8a7
Fix printing of type lambdas under new hk scheme
odersky Jun 2, 2016
cd51707
refine isRef for hk type
odersky Jun 2, 2016
88f4272
Fix withBindingKind for type aliases
odersky Jun 2, 2016
df73535
Multiple fixes to BetaReduce
odersky Jun 2, 2016
a0afd49
Fix logic for hk subtype tests
odersky Jun 2, 2016
cbf52d1
Make isHK more precise
odersky Jun 2, 2016
e433fe9
Beta-reduce when simplifying
odersky Jun 2, 2016
0de8705
Make etaExpandIfHk work for non-symbol type params
odersky Jun 2, 2016
7d8457d
Avoid stackoverflows for `Rep[T] = T`.
odersky Jun 2, 2016
06f916e
Refinement of cycle avoidance
odersky Jun 3, 2016
194f5d3
Don't map info of SkolemTypes in type maps
odersky Jun 3, 2016
1a656a1
Handle LazyRefs in BetaReduce
odersky Jun 3, 2016
c4fc98b
Fix^2 of asMemberOf
odersky Jun 3, 2016
5ea78e4
Try to beta-reduce bounds before adding to a constraint.
odersky Jun 3, 2016
8fd0e0f
More subtle handling of LazyRefs in BetaReduce
odersky Jun 4, 2016
8eb98a8
Another refinement to asMemberOf
odersky Jun 4, 2016
6068e7a
Drop isSafe test from BetaReduce
odersky Jun 4, 2016
20ebc13
Normalize RecTypes on creation to avoid cycles.
odersky Jun 4, 2016
6afe257
Add a second betaReduce
odersky Jun 4, 2016
1255fb8
Adapt widenForMatchSelector to new HK scheme
odersky Jun 5, 2016
bdf7f3e
Fix typeParams for abstract types under completion
odersky Jun 5, 2016
d5771da
Swap subtype tests
odersky Jun 6, 2016
9e14d74
Make underlyingClassRef work for hk types under new scheme.
odersky Jun 6, 2016
76f7563
Esnure that toAvoid does not creat hk from * types
odersky Jun 6, 2016
2b70615
Let getClass return a * type
odersky Jun 6, 2016
757f117
Generalize typeParamSymbols
odersky Jun 6, 2016
55ff0b5
Eta-expand unapplied types that have type parameters
odersky Jun 6, 2016
ec11b0b
Check kinds of type parameters
odersky Jun 6, 2016
de29cd1
Restrict betaReduce to hk applications
odersky Jun 6, 2016
9b21b46
Handle LazyRefs conservatively in isReferredTo
odersky Jun 7, 2016
226cdb9
Optionally, check kinds match for & and |
odersky Jun 7, 2016
7329957
Avoid infinite recursion when comparing recursive types.
odersky Jun 7, 2016
6fac433
Remove debug println
odersky Jun 7, 2016
6ed6857
Make typeParams more defensive
odersky Jun 7, 2016
7dc3135
Fix condition for lambda abstracting in Namer
odersky Jun 7, 2016
c896a83
Refinement for knownHK for PolyParams
odersky Jun 7, 2016
e38541b
Remove debug println
odersky Jun 7, 2016
db4d934
Make TypeAccumulators follow LazyRefs
odersky Jun 7, 2016
3560e56
Add normalizeHkApply to homogenize
odersky Jun 8, 2016
1844c1d
Avoid creating dependent function types for closures
odersky Jun 8, 2016
a6caf1c
Generalize compareHkApply to types other than PolyParams
odersky Jun 8, 2016
392090a
Homogenize skolem types
odersky Jun 8, 2016
5182a58
Change test to make it pass
odersky Jun 8, 2016
5e448ff
Disable named parameter tests
odersky Jun 8, 2016
5a20984
Fix merge errors
odersky Jun 8, 2016
9887c43
Revert "Generalize compareHkApply to types other than PolyParams"
odersky Jun 9, 2016
b4f21d0
Deal with nested findMember calls over the same RecType
odersky Jun 9, 2016
7cc0308
Add explanation why generizing compreHkApply is not needed.
odersky Jun 9, 2016
b88cfec
Fix comments
odersky Jun 9, 2016
7abd0cc
Add TODO comment in TreePickler
odersky Jun 9, 2016
794bb02
Swap order of subtype tests
odersky Jun 9, 2016
7c99c8a
Cleanups
odersky Jun 10, 2016
4c51505
Smarter handling of LazyRefs in betaReduce
odersky Jun 10, 2016
eb6cfb4
Optimize RecType/RecType comparisons
odersky Jun 10, 2016
6d6afbf
Fi compareHkLambda
odersky Jun 11, 2016
745a718
Remove old hk scheme
odersky Jun 11, 2016
79a7976
Simoplify RefinedType
odersky Jun 11, 2016
57bf237
Simplify typeParams
odersky Jun 12, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions src/dotty/tools/dotc/core/TypeApplications.scala
Original file line number Diff line number Diff line change
Expand Up @@ -264,21 +264,7 @@ class TypeApplications(val self: Type) extends AnyVal {
self.cls.typeParams
case self: TypeRef =>
val tsym = self.symbol
if (tsym.isClass) tsym.typeParams
else tsym.infoOrCompleter match {
case completer: TypeParamsCompleter =>
val tparams = completer.completerTypeParams(tsym)
fallbackTypeParams(tparams.map(_.variance))
case _ =>
if (!tsym.isCompleting || tsym.isAliasType) tsym.info.typeParams
else
// We are facing a problem when computing the type parameters of an uncompleted
// abstract type. We can't access the bounds of the symbol yet because that
// would cause a cause a cyclic reference. So we return `Nil` instead
// and try to make up for it later. The acrobatics in Scala2Unpicker#readType
// for reading a TypeRef show what's needed.
Nil
}
if (tsym.isClass) tsym.typeParams else tsym.info.typeParams
case self: RefinedType =>
val precedingParams = self.parent.typeParams.filterNot(_.memberName == self.refinedName)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So why isn't this needed anymore? Does this mean that the TypeParamsCompleter class can be deleted?

if (self.isTypeParam) precedingParams :+ self else precedingParams
Expand Down