//TEST:INTERPRET(filecheck=CHECK): interface IGen { associatedtype TB; TB getVal(); } struct Foo1 : IGen { typealias TB = int; int val = 0; TB getVal() { return val; } } struct Foo2 : IGen { typealias TB = int; int val = 0; TB getVal() { return val; } } struct Logic, C2 : IGen> { int val = 0; } extension Logic where C1 : IGen where C2 : IGen where C1.TB == C2.TB { [mutating] void setVal(int dataIn) { val = dataIn; } } void main() { Logic, Foo2> logic; logic.setVal(42); int result = logic.val; printf("Result: %d\n", result); // CHECK: Result: 42 }