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 {
44094409}
44104410
44114411TypeTraitResult 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+
44124418 // Any bridgeable object type can be a class.
44134419 if (isBridgeableObjectType ())
44144420 return TypeTraitResult::Is;
Original file line number Diff line number Diff line change @@ -58,6 +58,15 @@ func go() {
5858 y. append ( x)
5959// CHECK: 1
6060 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)
6170}
6271
6372go ( )
You can’t perform that action at this time.
0 commit comments