Skip to content

[Tests] Fix a couple of type round trip test problems. #38935

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions stdlib/public/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,8 @@ if(SWIFT_BUILD_STDLIB OR SWIFT_BUILD_REMOTE_MIRROR)
"${SWIFT_SOURCE_DIR}/lib/Demangling/OldDemangler.cpp"
"${SWIFT_SOURCE_DIR}/lib/Demangling/OldRemangler.cpp"
"${SWIFT_SOURCE_DIR}/lib/Demangling/Punycode.cpp"
"${SWIFT_SOURCE_DIR}/lib/Demangling/Remangler.cpp")

# When we're building with assertions, include the demangle node dumper to aid
# in debugging.
if(LLVM_ENABLE_ASSERTIONS)
list(APPEND swiftDemanglingSources
"${SWIFT_SOURCE_DIR}/lib/Demangling/NodeDumper.cpp")
endif()
"${SWIFT_SOURCE_DIR}/lib/Demangling/Remangler.cpp"
"${SWIFT_SOURCE_DIR}/lib/Demangling/NodeDumper.cpp")

add_swift_target_library(swiftDemangling OBJECT_LIBRARY
${swiftDemanglingSources}
Expand Down
8 changes: 8 additions & 0 deletions test/TypeRoundTrip/Inputs/testcases/structural_types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ public func test() {
roundTripType((x: Int, Float, y: Int.Type).self)
roundTripType(((@escaping () -> ()) -> ()).self)
roundTripType(Array<@convention(c) () -> ()>.self)

// @convention(block) requires Objective-C support
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
roundTripType(Array<(@escaping @convention(block) () -> (), @convention(block) () -> ()) -> ()>.self)
#endif

roundTripType(Int.Type.self)
roundTripType(((inout String) -> ()).Type.self)
Expand All @@ -39,7 +43,11 @@ public func test() {
roundTripType((x: Int, Float, y: Int.Type).Type.self)
roundTripType(((@escaping () -> ()) -> ()).Type.self)
roundTripType(Array<@convention(c) () -> ()>.Type.self)

// @convention(block) requires Objective-C support
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
roundTripType(Array<(@escaping @convention(block) () -> (), @convention(block) () -> ()) -> ()>.Type.self)
#endif

// rdar://81587763: [SR-15025]: Function type syntax doesn't accept variadics
// or __owned
Expand Down