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:
parent
27fad0f19b
commit
b8d37e0d53
@ -931,6 +931,15 @@ fn (p mut Parser) get_type() string {
|
|||||||
// "typ" not found? try "mod__typ"
|
// "typ" not found? try "mod__typ"
|
||||||
if t.name == '' && !p.builtin_mod {
|
if t.name == '' && !p.builtin_mod {
|
||||||
// && !p.first_pass() {
|
// && !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('__') &&
|
if !typ.contains('array_') && p.mod != 'main' && !typ.contains('__') &&
|
||||||
!typ.starts_with('[') {
|
!typ.starts_with('[') {
|
||||||
typ = p.prepend_mod(typ)
|
typ = p.prepend_mod(typ)
|
||||||
|
Loading…
Reference in New Issue
Block a user