Files
swift-mirror/validation-test/compiler_crashers_fixed/0207-issue-49919.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

39 lines
1.1 KiB
Swift

// RUN: %target-swift-frontend -emit-ir %s
// https://github.com/apple/swift/issues/49919
public protocol TypedParserResultTransferType {
// Remove type constraint
associatedtype Result: ParserResult
}
public struct AnyTypedParserResultTransferType<P: ParserResult>: TypedParserResultTransferType {
public typealias Result = P
// Remove property
public let result: P
}
public protocol ParserResult {}
public protocol StaticParser: ParserResult {}
// Change comformance to ParserResult
public protocol TypedStaticParser: StaticParser {
// Remove type constraint
associatedtype ResultTransferType: TypedParserResultTransferType
}
// Remove where clause
public protocol MutableSelfStaticParser: TypedStaticParser where ResultTransferType == AnyTypedParserResultTransferType<Self> {
func parseTypeVar() -> AnyTypedParserResultTransferType<Self>
}
extension MutableSelfStaticParser {
public func anyFunction() -> () {
let t = self.parseTypeVar
// Remove this and below
_ = t()
_ = self.parseTypeVar()
}
}