Commit Graph

11 Commits

Author SHA1 Message Date
Alexis Laferrière
fe9c48cc8c Serialization: Protect getType for params and classes 2025-03-19 16:25:48 -07:00
Alexis Laferrière
06d2d4cb50 Serialization: Recover from missing raw types on an enum
Recover from a raw type hidden behind an internal or implementation-only
import by dropping the whole enum when the raw type is unavailable. This
scenario should happen only when looking at non-public decl for indexing or
debugging, or if dependencies somehow changed and left behind a stale
swiftmodule file.

rdar://147091863
2025-03-19 14:10:57 -07:00
Alexis Laferrière
6358cb9024 Serialization: Update style of the test implementation-only-missing 2025-03-19 14:10:56 -07:00
Alexis Laferrière
0ce8b48e0d [Serialization] Expect missing custom attribute in deserializeDeclCommon
Attr can be null here if it was a custom attribute from an
implementation-only dependency.

rdar://102525437
2022-11-30 16:48:13 -08:00
Alexis Laferrière
3097919398 [Serialization] Write ProtocolComposition as dependencies
A type dependencies are used at deserialization to drop a protocol early
when a dependency is not deserializable. Dependencies on protocols via a
protocol composition were not taken into account. This lead to the
deserialization process failing later. Fix the serialization process to
write protocol dependencies too.

rdar://78631465
2021-08-19 11:01:05 -07:00
Alexis Laferrière
4f0c57a2d3 [Serialization] Recover from failures in ModuleFile::lookupClassMembers
Access to a missing member on an AnyObject triggers a typo correction
that looks at all class members in imported modules. Make sure it
recovers from deserializing members referencing implementation-only
imported types.

rdar://79427805
2021-06-22 18:36:46 -07:00
Harlan Haskins
d67d7ebc0a [Serialization] Look for cross-ref errors inside type errors (#33271)
In #30614, we started consuming XRefNonLoadedModuleErrors while loading
conformances, since a conformance to a type we cannot load usually
indicates we're trying to load a protocol that was declared in an
@_implementationOnly imported module.

We should also consume TypeErrors that we see where the underlying reason
is an XRefNonLoadedModuleError, since they're likely indicators of the
same thing.
2020-08-04 13:04:14 -07:00
Artem Chikin
efdfceeb9b [Sema] Diagnose use of implementation-only property wrappers
We already ban all structs from declaring storage that comes from implementation-only imports. Until now we missed property wrappers, they were just dropped in deserialization.

Resolves rdar://problem/59403617
2020-04-10 11:19:42 -07:00
Alexis Laferrière
4e0038f0df [Serialization] Recover from conformances with missing decls
Components of a requirement may be hidden behind an implementation-only
import. Attempts at deserializing them would fail on a 'module not
loaded' error. We only see failures in non-compilation paths, either in
indexing or with tools like ide-test as they try to deserialize
things that are private.
2020-03-24 10:25:02 -07:00
Alexis Laferrière
ac28905926 [serialization] Recover from missing custom attribute
rdar://problem/56599179
2019-10-30 12:55:34 -07:00
Alexis Laferrière
7ce86145c8 serialization: recover from missing modules when reading SubstitutionMaps
Harden more of the serialization functions to propagate errors for
the caller to handle these errors gracefully. This fixes a crash in
finishNormalConformance when indexing a system module with an
implementation-only import.

rdar://problem/52837313
2019-09-10 10:13:15 -07:00