make maps work with structs defined in different modules

pull/1177/head
Alexander Medvednikov 2019-07-16 12:18:52 +02:00
parent 0a4a9a35c3
commit 830f63e86a
1 changed files with 2 additions and 3 deletions

View File

@ -537,9 +537,9 @@ fn type_default(typ string) string {
if typ.ends_with('*') { if typ.ends_with('*') {
return '0' return '0'
} }
// ? // User struct defined in another module.
if typ.contains('__') { if typ.contains('__') {
return '' return '{}'
} }
// Default values for other types are not needed because of mandatory initialization // Default values for other types are not needed because of mandatory initialization
switch typ { switch typ {
@ -560,7 +560,6 @@ fn type_default(typ string) string {
case 'voidptr': return '0' case 'voidptr': return '0'
} }
return '{}' return '{}'
return ''
} }
// TODO PERF O(n) // TODO PERF O(n)