Avatar
swiftbot BOT 7/3/2019 11:56 AM
Author icon
freddi
protocol Protocol { associatedtype T1 func myFunc<Bar>(_: Bar) -> Class<Bar.T1> where Bar: Class<T1> } class Class<T2> : Protocol { func myFunc<Bar>(_: Bar) -> Class<Bar.T1> where Bar: Class<T2> { } }
Version:
swift-4.2.1-RELEASE
Output:
Error:
/usercode/main.swift:4:43: error: reference to invalid associated type 'T1' of type 'Bar' func myFunc<Bar>(_: Bar) -> Class<Bar.T1> where Bar: Class<T1> ^ /usercode/main.swift:7:7: error: type 'Class<T2>' does not conform to protocol 'Protocol' class Class<T2> : Protocol { ^ /usercode/main.swift:2:20: note: protocol requires nested type 'T1'; do you want to add it? associatedtype T1 ^