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) {
285285 return ;
286286 }
287287
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 ;
295293 }
296294
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 ()) {
299297 auto error = diag::noimplicitcopy_attr_valid_only_on_local_let;
300298 diagnoseAndRemoveAttr (attr, error);
301299 return ;
You can’t perform that action at this time.
0 commit comments