Commit Graph

60 Commits

Author SHA1 Message Date
Slava Pestov
3376372b7d RequirementMachine: Fix getCanonicalTypeInContext() to handle member types of superclass bounds
If you have

    protocol P {
      associatedtype T
    }

    class C<T> : P {}

Then substituting the type parameter T.T from the generic signature
<T where T : P> into the generic signature <T, U where T : C<U>>
is the identity operation, and also returns T.T, because subst()
isn't smart enough to replace T.T with U.

So getCanonicalTypeInContext() has to do the concrete conformance
lookup here, just like it does for the analogous situation where
you have a concrete type requirement.

This could be solved in a more principled way by better book-keeping
elsewhere, but the GSB supported the old behavior, so we can
simulate it easily enough in the RequirementMachine also.
2021-08-04 01:21:21 -04:00
Slava Pestov
1d7eae7bfb RequirementMachine: lexshort => shortlex 2021-07-23 17:21:58 -04:00
Slava Pestov
2d636955c6 RequirementMachine: Collapse RequirementMachine::Implementation down into RequirementMachine 2021-07-23 17:21:58 -04:00
Slava Pestov
27cf1cc4c2 RequirementMachine: Merge RequirementMachineImpl.h into RequirementMachine.h 2021-07-23 17:21:58 -04:00
Slava Pestov
379359c08e RequirementMachine: Move RequirementMachine.h to lib/AST/RequirementMachine 2021-07-23 17:21:57 -04:00
Slava Pestov
d3db1b6753 RequirementMachine: EquivalenceClassMap => PropertyMap
EquivalenceClass is now PropertyBag.
2021-07-23 17:21:57 -04:00
Slava Pestov
0533b78ed8 RequirementMachine: Remove bogus copy-and-pasted comment 2021-07-23 15:58:50 -04:00
Slava Pestov
cfb1595ec5 RequirementMachine: Rename Atom => Symbol 2021-07-23 15:58:50 -04:00
Robert Widmann
1329f3cfbd [NFC] Lift getGenericEnvironment() into GenericSignature 2021-07-22 23:33:02 -07:00
Slava Pestov
b718663719 RequirementMachine: Tri-state enable flag, and move queries to GenericSignatureQueries.cpp
The -enable-requirement-machine and -disable-requirement-machine flags are now
replaced by a new flag -requirement-machine={on,off,verify}.
2021-07-17 00:05:05 -04:00