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

make maps work with structs defined in different modules

This commit is contained in:
Alexander Medvednikov 2019-07-16 12:18:52 +02:00
parent 0a4a9a35c3
commit 830f63e86a

View File

@ -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)