mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: make sure is
is only used with interfaces and sum types
This commit is contained in:
parent
4b362862ad
commit
1c11ac9fdf
@ -538,6 +538,9 @@ pub fn (mut c Checker) infix_expr(mut infix_expr ast.InfixExpr) table.Type {
|
||||
if typ_sym.kind == .placeholder {
|
||||
c.error('is: type `${typ_sym.name}` does not exist', type_expr.pos)
|
||||
}
|
||||
if left.kind != .interface_ && left.kind != .sum_type {
|
||||
c.error('`is` can only be used with interfaces and sum types', type_expr.pos)
|
||||
}
|
||||
return table.bool_type
|
||||
}
|
||||
else {}
|
||||
|
Loading…
Reference in New Issue
Block a user