✓
Passing Passing: the compiler rejects this program as expected.
Code
// 698_005 — extension cycles refuse: `A <: B` with `B <: A` would expand
// forever. Refused like the compound-cycle gate, naming the chain.
import std/proto
std/proto(A <: B) {
x: i64
}
std/proto(B <: A) {
y: i64
}
Actual compiler output
error[KORU173]: std/proto(A): extension cycle detected: A <: B <: A — '<:' unions field sets; a cycle would expand forever
--> tests/regression/600_STDLIB/698_OOP/698_005_proto_extends_cycle_refused/input.k:5:0
error[KORU173]: std/proto(B): '<:' names unknown proto 'A' — extension composes declared field sets; declare the parent first
--> tests/regression/600_STDLIB/698_OOP/698_005_proto_extends_cycle_refused/input.k:9:0Compiler must reject:
Compilation must fail with a diagnostic.
Flows
flow ~std/proto click a branch to expand · @labels scroll to their anchor
std/proto (A <: B, source: x: i64)
flow ~std/proto click a branch to expand · @labels scroll to their anchor
std/proto (B <: A, source: y: i64)
Test Configuration
MUST_ERROR