parent
692a718428
commit
a97ed55a09
|
@ -511,6 +511,9 @@ pub fn (mut c Checker) struct_init(mut struct_init ast.StructInit) table.Type {
|
|||
struct_init.pos)
|
||||
}
|
||||
}
|
||||
if type_sym.name.len == 1 && !c.cur_fn.is_generic {
|
||||
c.error('unknown struct `$type_sym.name`', struct_init.pos)
|
||||
}
|
||||
match type_sym.kind {
|
||||
.placeholder {
|
||||
c.error('unknown struct: $type_sym.name', struct_init.pos)
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
vlib/v/checker/tests/unknown_struct_name.vv:4:7: error: unknown struct `F`
|
||||
2 |
|
||||
3 | fn main() {
|
||||
4 | _ := F{}
|
||||
| ~~~
|
||||
5 | }
|
|
@ -0,0 +1,5 @@
|
|||
module main
|
||||
|
||||
fn main() {
|
||||
_ := F{}
|
||||
}
|
Loading…
Reference in New Issue