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

34 lines
730 B
Swift

// RUN: %target-swift-frontend %s -emit-silgen
// https://github.com/apple/swift/issues/45761
protocol P: Equatable, ExpressibleByStringLiteral {
var uid: String { get }
init(uid: String)
}
extension P {
// Equatable
public static func ==(lhs: Self, rhs: Self) -> Bool {
return lhs.uid == rhs.uid
}
// ExpressibleByStringLiteral
public init(stringLiteral value: String) {
self.init(uid: value)
}
public init(unicodeScalarLiteral value: String) {
self.init(uid: value)
}
public init(extendedGraphemeClusterLiteral value: String) {
self.init(uid: value)
}
}
struct Test: P {
var uid: String
static let s1: Test = "s1"
}
Test.s1 == "test"