hylo
hylo copied to clipboard
Detect and diagnose multiple yields in subscripts
The following program incorrectly compiles and possibly has UB:
subscript s(x: Int): Int {
yield x
yield x
}
public fun main() {
print(s[x: 1])
}
The compiler should detect that there are two yield
statements on the same execution path and report a diagnostic.