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:
parent
0a4a9a35c3
commit
830f63e86a
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user