File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
test/SIL/ownership-verifier Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -862,6 +862,10 @@ OwnershipCompatibilityUseChecker::visitReturnInst(ReturnInst *RI) {
862
862
Base = MergedValue.getValue ();
863
863
}
864
864
865
+ if (auto *E = getType ().getEnumOrBoundGenericEnum ()) {
866
+ return visitNonTrivialEnum (E, Base);
867
+ }
868
+
865
869
return {compatibleWithOwnership (Base), true };
866
870
}
867
871
Original file line number Diff line number Diff line change @@ -351,6 +351,12 @@ bb0(%0 : @trivial $@thick SuperKlass.Type):
351
351
return %9999 : $()
352
352
}
353
353
354
+ sil @trivial_enum_return_value : $@convention(thin) () -> @owned Optional<Builtin.NativeObject> {
355
+ bb0:
356
+ %0 = enum $Optional<Builtin.NativeObject>, #Optional.none!enumelt
357
+ return %0 : $Optional<Builtin.NativeObject>
358
+ }
359
+
354
360
//////////////////////
355
361
// Terminator Tests //
356
362
//////////////////////
You can’t perform that action at this time.
0 commit comments