Skip to content

Check file type better in this verifier. #79586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions lib/SIL/IR/TypeLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3228,19 +3228,17 @@ void TypeConverter::verifyTrivialLowering(const TypeLowering &lowering,

if (auto *nominal = substType.getAnyNominal()) {
auto *module = nominal->getModuleContext();
if (module) {
if (module->isBuiltFromInterface()) {
if (module && module->isBuiltFromInterface()) {
// Don't verify for types in modules built from interfaces; the feature
// may not have been enabled in them.
return;
}
auto *file = dyn_cast_or_null<FileUnit>(module->getModuleScopeContext());
if (file && file->getKind() == FileUnitKind::Source) {
auto sourceFile = nominal->getParentSourceFile();
if (sourceFile && sourceFile->Kind == SourceFileKind::SIL) {
// Don't verify for types in SIL files.
return;
}
}
auto *file = nominal->getParentSourceFile();
if (file && file->getKind() == FileUnitKind::Source) {
auto sourceFile = nominal->getParentSourceFile();
if (sourceFile && sourceFile->Kind == SourceFileKind::SIL) {
// Don't verify for types in SIL files.
return;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions test/IRGen/enum_value_semantics_future.sil
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// UNSUPPORTED: CPU=armv7s && OS=ios

import Builtin
import Swift

enum NoPayload {
case a
Expand Down