TP0216
Error: ambiguous enum variant; qualify it
Messages
Section titled “Messages”'<v>' is ambiguous: it is a variant of <E1> and <E2>, with helpqualify it, e.g. '<E1>.<v>'
Example
Section titled “Example”From the golden case tests/cases/m7/tp0216_ambiguous.tpn:
enum Health: Ok Down
enum Result: Ok Failed(reason: str)
let a = Oklet b: Health = Oklet c = Health.Oklet d = Result.Oklet e = Failed("x")def check(h: Health) -> str: match h: Ok: return "fine" Down: return "down"The compiler reports:
tp0216_ambiguous.tpn:9:9: error TP0216: 'Ok' is ambiguous: it is a variant of Health and Result help: qualify it, e.g. 'Health.Ok'tp0216_ambiguous.tpn:10:17: error TP0216: 'Ok' is ambiguous: it is a variant of Health and Result help: qualify it, e.g. 'Health.Ok'The specification lists every code.
© 2026 Discover Edge, LLC · Taipan is released under the MIT License.