Files
swift-mirror/test/Interop/SwiftToCxx/class/nested-classes-in-cxx.swift
Gábor Horváth 5f3d5a9fa7 [6.2][cxx-interop] Fix nested structs for non-opaque types
Explanation: Fixes an issue where the generated reverse interop header
would not compile for nested classes when library evolution is turned
off.
Scope: C++ reverse interop for nested classes for non-opaque types.
Issue: rdar://147882976
Risk: Low, the fix is fairly targeted. While it does affect other
(non-nested type) scenarios, those changes are fairly straightforward
making some names fully qualified. Moreover, that is well tested in our
test suite.
Testing: Added tests to test suite
Reviewer: @egorzhdan
2025-04-07 12:02:54 +01:00

39 lines
1.2 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend %s -enable-library-evolution -typecheck -module-name Classes -clang-header-expose-decls=all-public -emit-clang-header-path %t/classes.h
// RUN: %check-interop-cxx-header-in-clang(%t/classes.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY -std=c++17)
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend %s -typecheck -module-name Classes -clang-header-expose-decls=all-public -emit-clang-header-path %t/classes.h
// RUN: %check-interop-cxx-header-in-clang(%t/classes.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY -std=c++17)
public class RecordConfig {
public enum AudioFormat {
case PCM, ALAC, AAC
}
public struct Directory {
public var path: String?
}
public class File {
public var format: AudioFormat = .ALAC
public class Gate {
public init() {}
public var prop: Int32 = 80
public func computeValue() -> Int32 {
return prop * 2
}
}
}
public var directory = Directory()
public var file = File()
public var gate = File.Gate()
}
public func makeRecordConfig() -> RecordConfig {
return RecordConfig()
}