error on unknown generic struct init. closes #7085
parent
d8b8aca51e
commit
ca7692c839
|
@ -2,6 +2,9 @@ module builder
|
||||||
|
|
||||||
import v.table
|
import v.table
|
||||||
|
|
||||||
|
// NOTE: Think about generic struct implementation
|
||||||
|
// this might not be the best strategy. - joe-c
|
||||||
|
//
|
||||||
// generic struct instantiations to concrete types
|
// generic struct instantiations to concrete types
|
||||||
pub fn (b &Builder) generic_struct_insts_to_concrete() {
|
pub fn (b &Builder) generic_struct_insts_to_concrete() {
|
||||||
for idx, _ in b.table.types {
|
for idx, _ in b.table.types {
|
||||||
|
@ -9,6 +12,10 @@ pub fn (b &Builder) generic_struct_insts_to_concrete() {
|
||||||
if typ.kind == .generic_struct_inst {
|
if typ.kind == .generic_struct_inst {
|
||||||
info := typ.info as table.GenericStructInst
|
info := typ.info as table.GenericStructInst
|
||||||
parent := b.table.types[info.parent_idx]
|
parent := b.table.types[info.parent_idx]
|
||||||
|
if parent.kind == .placeholder {
|
||||||
|
typ.kind = .placeholder
|
||||||
|
continue
|
||||||
|
}
|
||||||
mut parent_info := parent.info as table.Struct
|
mut parent_info := parent.info as table.Struct
|
||||||
mut fields := parent_info.fields.clone()
|
mut fields := parent_info.fields.clone()
|
||||||
for i, _ in fields {
|
for i, _ in fields {
|
||||||
|
|
Loading…
Reference in New Issue