Files
swift-mirror/test/Constraints/sr10324.swift
Holly Borla 423d6bdff0 [ConstraintSystem] Re-instate the operator type variable merging
hacks for now.

There's some more disjunction pruning work to be done before we can
remove this.
2020-10-29 19:49:47 -07:00

22 lines
470 B
Swift

// RUN: %target-swift-frontend -typecheck -verify %s
// REQUIRES: rdar65007946
struct A {
static func * (lhs: A, rhs: A) -> B { return B() }
static func * (lhs: B, rhs: A) -> B { return B() }
static func * (lhs: A, rhs: B) -> B { return B() }
}
struct B {}
let (x, y, z) = (A(), A(), A())
let w = A() * A() * A() // works
// Should all work
let a = x * y * z
let b = x * (y * z)
let c = (x * y) * z
let d = x * (y * z as B)
let e = (x * y as B) * z