Skip to content

Commit 618cbca

Browse files
committed
Sema: Rename some 'versioned' diagnostics
1 parent fb0233a commit 618cbca

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3736,15 +3736,15 @@ ERROR(fixed_layout_attr_on_internal_type,
37363736
"%select{private|fileprivate|internal|%error|%error}1",
37373737
(DeclName, AccessLevel))
37383738

3739-
ERROR(versioned_attr_with_explicit_access,
3739+
ERROR(usable_from_inline_attr_with_explicit_access,
37403740
none, "'@usableFromInline' attribute can only be applied to internal "
37413741
"declarations, but %0 is %select{private|fileprivate|%error|public|open}1",
37423742
(DeclName, AccessLevel))
37433743

3744-
ERROR(versioned_attr_in_protocol,none,
3744+
ERROR(usable_from_inline_attr_in_protocol,none,
37453745
"'@usableFromInline' attribute cannot be used in protocols", ())
37463746

3747-
ERROR(versioned_dynamic_not_supported,none,
3747+
ERROR(usable_from_inline_dynamic_not_supported,none,
37483748
"'@usableFromInline' attribute cannot be applied to 'dynamic' declarations", ())
37493749

37503750
#define FRAGILE_FUNC_KIND \

lib/Sema/TypeCheckAttr.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,13 +1959,14 @@ void AttributeChecker::visitUsableFromInlineAttr(UsableFromInlineAttr *attr) {
19591959
// FIXME: Once protocols can contain nominal types, do we want to allow
19601960
// these nominal types to have access control (and also @usableFromInline)?
19611961
if (isa<ProtocolDecl>(VD->getDeclContext())) {
1962-
diagnoseAndRemoveAttr(attr, diag::versioned_attr_in_protocol);
1962+
diagnoseAndRemoveAttr(attr, diag::usable_from_inline_attr_in_protocol);
19631963
return;
19641964
}
19651965

19661966
// @usableFromInline can only be applied to internal declarations.
19671967
if (VD->getFormalAccess() != AccessLevel::Internal) {
1968-
diagnoseAndRemoveAttr(attr, diag::versioned_attr_with_explicit_access,
1968+
diagnoseAndRemoveAttr(attr,
1969+
diag::usable_from_inline_attr_with_explicit_access,
19691970
VD->getFullName(),
19701971
VD->getFormalAccess());
19711972
return;
@@ -1974,7 +1975,7 @@ void AttributeChecker::visitUsableFromInlineAttr(UsableFromInlineAttr *attr) {
19741975
// Symbols of dynamically-dispatched declarations are never referenced
19751976
// directly, so marking them as @usableFromInline does not make sense.
19761977
if (VD->isDynamic()) {
1977-
diagnoseAndRemoveAttr(attr, diag::versioned_dynamic_not_supported);
1978+
diagnoseAndRemoveAttr(attr, diag::usable_from_inline_dynamic_not_supported);
19781979
return;
19791980
}
19801981
}

0 commit comments

Comments
 (0)