File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -285,17 +285,15 @@ void AttributeChecker::visitNoImplicitCopyAttr(NoImplicitCopyAttr *attr) {
285
285
return ;
286
286
}
287
287
288
- if (vd->hasStorage ()) {
289
- // We do not support fields of nominal types now.
290
- if (isa<NominalTypeDecl>(dc)) {
291
- auto error = diag::noimplicitcopy_attr_valid_only_on_local_let;
292
- diagnoseAndRemoveAttr (attr, error);
293
- return ;
294
- }
288
+ // We only support local lets.
289
+ if (!dc->isLocalContext ()) {
290
+ auto error = diag::noimplicitcopy_attr_valid_only_on_local_let;
291
+ diagnoseAndRemoveAttr (attr, error);
292
+ return ;
295
293
}
296
294
297
- // We do not support static or global vars either yet.
298
- if (dc->isModuleScopeContext () || (dc-> isTypeContext () && vd->isStatic () )) {
295
+ // We do not support static vars either yet.
296
+ if (dc->isTypeContext () && vd->isStatic ()) {
299
297
auto error = diag::noimplicitcopy_attr_valid_only_on_local_let;
300
298
diagnoseAndRemoveAttr (attr, error);
301
299
return ;
You can’t perform that action at this time.
0 commit comments