Files
swift-mirror/validation-test/compiler_crashers_fixed/0196-issue-52357.swift
Hamish Knight 4e811c3a88 [test] Merge crasher directories
There is no longer much of a good reason to keep these separate,
merge them.
2025-10-18 12:51:30 +01:00

31 lines
646 B
Swift

// RUN: %target-swift-frontend %s -emit-ir
// rdar://problem/48223824
// https://github.com/apple/swift/issues/52357
// Compiler rejects well-formed code that triggered a fallback diagnostic due
// to a bad substitution
struct GenericThing <Param1, Param2> {
init (closure: (String)->()) {
}
}
struct ThingHolder <Param1> {
func acceptThing <Param2> (thingGenerator: ()->GenericThing<Param1, Param2>) {
}
}
struct A { }
func demo <Param1> (thingHolder: ThingHolder<Param1>) {
typealias Thing <Param2> = GenericThing<Param1, Param2>
thingHolder.acceptThing {
Thing<A> { string in
}
}
}