From 830f63e86a659bf7bb435ed2ae2a0ce34258145b Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Tue, 16 Jul 2019 12:18:52 +0200 Subject: [PATCH] make maps work with structs defined in different modules --- compiler/table.v | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/compiler/table.v b/compiler/table.v index aeb88df0db..a7c6f2081c 100644 --- a/compiler/table.v +++ b/compiler/table.v @@ -537,9 +537,9 @@ fn type_default(typ string) string { if typ.ends_with('*') { return '0' } - // ? + // User struct defined in another module. if typ.contains('__') { - return '' + return '{}' } // Default values for other types are not needed because of mandatory initialization switch typ { @@ -560,7 +560,6 @@ fn type_default(typ string) string { case 'voidptr': return '0' } return '{}' - return '' } // TODO PERF O(n)