Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. protocol P {
  2. associatedtype PType
  3. }
  4.  
  5. public protocol Q {
  6. associatedtype QType: R
  7. }
  8.  
  9. public protocol R {
  10. associatedtype RType
  11. }
  12.  
  13. func f<T: P>(_: T) where T.PType.RType: Q, T.PType.RType.QType == T.PType {}
  14.  
  15. // We get this signature: <T where T : P, T.PType : R, T.PType == T.PType.RType.QType, T.PType.RType : Q>
  16.  
  17. // But we should get this signature: <T where T : P, T.PType == T.PType.RType.QType, T.PType.RType : Q>
  18.  
  19. // The “T.PType: R” requirement is redundant, but pops up when building the canonical generic environment due to the recursion-breaking code being wrong.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement