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

properly add submodule to type

This commit is contained in:
joe-conigliaro 2019-08-08 17:59:00 +10:00 committed by Alexander Medvednikov
parent 27fad0f19b
commit b8d37e0d53

View File

@ -931,6 +931,15 @@ fn (p mut Parser) get_type() string {
// "typ" not found? try "mod__typ"
if t.name == '' && !p.builtin_mod {
// && !p.first_pass() {
// we are a module
if typ.contains('__') {
// so try resolve full submodule
mod := p.import_table.resolve_alias(p.lit).replace('.', '_dot_')
if mod != '' {
typ = prepend_mod(mod, typ)
}
}
t = p.table.find_type(typ)
if !typ.contains('array_') && p.mod != 'main' && !typ.contains('__') &&
!typ.starts_with('[') {
typ = p.prepend_mod(typ)