Please sign in to comment.
[Type checker] Teach conformsToProtocol() to check conditional requir…
…ements. conformsToProtocol() is the main way in which we check whether a given type conforms to a given protocol. Extend it to check conditional requirements by default, so that an unmodified caller will get the "does not conform" result (with diagnostics when a location is present) rather than simply ignoring the conditional requirements. Some callers take responsibility for conditional requirements, e.g., to push them into the constraint system. Allow those callers to opt out of this checking, and do so wherever appropriate. Fixes rdar://problem/35518088, where we were ignoring the conditional requirements needed to verify that Equatable synthesis could be performed.
- Loading branch information...
Showing with 227 additions and 125 deletions.
- +0 −14 include/swift/AST/GenericSignature.h
- +0 −39 lib/AST/GenericSignature.cpp
- +15 −23 lib/Sema/CSApply.cpp
- +4 −2 lib/Sema/CSBindings.cpp
- +7 −3 lib/Sema/CSDiag.cpp
- +4 −2 lib/Sema/CSRanking.cpp
- +4 −2 lib/Sema/CSSimplify.cpp
- +5 −3 lib/Sema/TypeCheckDecl.cpp
- +57 −4 lib/Sema/TypeCheckGeneric.cpp
- +2 −0 lib/Sema/TypeCheckNameLookup.cpp
- +66 −27 lib/Sema/TypeCheckProtocol.cpp
- +0 −3 lib/Sema/TypeCheckStmt.cpp
- +3 −1 lib/Sema/TypeCheckType.cpp
- +31 −2 lib/Sema/TypeChecker.h
- +29 −0 test/Sema/enum_equatable_conditional.swift
Oops, something went wrong.