1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: check for illegal use of any type (fix #15003) (#15020)

This commit is contained in:
yuyi
2022-07-11 20:29:25 +08:00
committed by GitHub
parent 5498a6c263
commit 9231697966
5 changed files with 17 additions and 5 deletions

View File

@@ -35,10 +35,6 @@ pub fn (mut c Checker) struct_decl(mut node ast.StructDecl) {
}
}
for i, field in node.fields {
if field.typ == ast.any_type {
c.error('struct field cannot be the `any` type, use generics instead',
field.type_pos)
}
c.ensure_type_exists(field.typ, field.type_pos) or { return }
if field.typ.has_flag(.generic) {
has_generic_types = true