Commit Graph

59 Commits

Author SHA1 Message Date
Kavon Farvardin
d5eb76e2fb NCGenerics: remove optimistic assertion
I thought it might be impossible to recursively lookupConformance of
Copyable, unlike for Sendable. Turns out there are still situations
where it can happen, that aren't invalid.

This alone fixes `ClangImporter/objc_bridging_generics.swift` and will
help reveal any invalid request cycles.
2024-02-11 20:40:03 -08:00
Kavon Farvardin
5b36a5f724 NCGenerics: back-out @noescape being ~Escapable
I thought this would be simple to add a check for this, but it turns out
that a more complete refactoring that eliminates `isNoEscape` in favor
of `isEscapable` is most likely needed.
2024-02-11 12:54:35 -08:00
Slava Pestov
6027bf46a6 AST: Simplify collectExistentialConformances() 2024-02-10 09:36:37 -05:00
Kavon Farvardin
70266b589a NCGenerics: avoid UGT's in queries
An unbound generic type is not something that should end up in
`isNoncopyable` or `isEscapable` queries because there are no
conformances for such a type; it's unbound!

fixes test/Constraints/closures.swift
2024-02-06 08:15:26 -08:00
Slava Pestov
d7372396cb AST: Move TypeBase::isSendableType() to ConformanceLookup.cpp 2024-02-05 11:25:57 -05:00
Slava Pestov
d981cf3b77 Sema: De-requestify TypeBase::isNoncopyable() and TypeBase::isEscapable()
And consolidate the logic in ConformanceLookup.cpp.
2024-02-05 11:25:57 -05:00
Kavon Farvardin
b4985f7fde [NFC] replace canBeNoncopyable
First, "can have an absence of Copyable" is a rather confusing notion,
so the query is flipped to "can be Copyable". Next, it's more robust to
ask if a conformance exists for the TypeDecl to answer that question,
rather than trying to replicate what happens within that conformance
lookup.

Also renames `TypeDecl::isEscapable` to match.
2024-01-23 22:42:38 -08:00
Slava Pestov
9835a6f0ba AST: Assert that checkConformance() receives a fully-substituted type 2024-01-18 16:15:02 -05:00
Slava Pestov
f9e7181d46 AST: Split off ConformanceLookup.cpp from Module.cpp 2024-01-18 12:32:04 -05:00