Skip to content

Commit b343cdf

Browse files
committed
[AutoDiff] Re-enable a reflection test.
rdar://75916878 is no longer reproducible.
1 parent fb293cb commit b343cdf

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

test/AutoDiff/validation-test/function_type_metadata.swift

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,18 @@ if #available(macOS 11.3, iOS 14.5, tvOS 14.5, watchOS 7.4, *) {
6161
}
6262
}
6363

64-
// FIXME(rdar://75916878): Investigate why reflecting differentiable function
65-
// types that contain generic parameters will lose '@differentiable' annotation.
66-
// FunctionTypeMetadataTests.test("Reflect generic differentiable function type") {
67-
// func testGeneric<T: Differentiable>(_ type: T.Type) {
68-
// expectEqual(
69-
// """
70-
// @differentiable(reverse) (\(String(reflecting: type))) -> \
71-
// \(String(reflecting: type))
72-
// """,
73-
// String(reflecting: (@differentiable(reverse) (T) -> T).self))
74-
// }
75-
// testGeneric(Double.self)
76-
// testGeneric([Float].self)
77-
// testGeneric(Float?.self)
78-
// }
64+
FunctionTypeMetadataTests.test("Reflect generic differentiable function type") {
65+
func testGeneric<T: Differentiable>(_ type: T.Type) {
66+
expectEqual(
67+
"""
68+
@differentiable(reverse) (\(String(reflecting: type))) -> \
69+
\(String(reflecting: type))
70+
""",
71+
String(reflecting: (@differentiable(reverse) (T) -> T).self))
72+
}
73+
testGeneric(Double.self)
74+
testGeneric([Float].self)
75+
testGeneric(Float?.self)
76+
}
7977

8078
runAllTests()

0 commit comments

Comments
 (0)