diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 40330893af..80e7d5b411 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -293,6 +293,8 @@ pub fn (mut c Checker) type_decl(node ast.TypeDecl) { typ_sym := c.table.get_type_symbol(typ) if typ_sym.kind == .placeholder { c.error("type `$typ_sym.source_name` doesn't exist", node.pos) + } else if typ_sym.kind == .interface_ { + c.error("sum type cannot hold an interface", node.pos) } } }