File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
test/Interop/Cxx/foreign-reference Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -4409,6 +4409,12 @@ bool Type::findIf(llvm::function_ref<bool(Type)> pred) const {
4409
4409
}
4410
4410
4411
4411
TypeTraitResult TypeBase::canBeClass () {
4412
+ // Foreign reference types are represented as Swift classes in the AST,
4413
+ // however, they use custom retain/release operations, and therefore aren't
4414
+ // AnyObjects.
4415
+ if (isForeignReferenceType ())
4416
+ return TypeTraitResult::IsNot;
4417
+
4412
4418
// Any bridgeable object type can be a class.
4413
4419
if (isBridgeableObjectType ())
4414
4420
return TypeTraitResult::Is;
Original file line number Diff line number Diff line change @@ -58,6 +58,15 @@ func go() {
58
58
y. append ( x)
59
59
// CHECK: 1
60
60
print ( y. count)
61
+
62
+ var loopCount = 0
63
+ for it in y {
64
+ // CHECK: RefType()
65
+ print ( it)
66
+ loopCount += 1
67
+ }
68
+ // CHECK: 1
69
+ print ( loopCount)
61
70
}
62
71
63
72
go ( )
You can’t perform that action at this time.
0 commit comments