summaryrefslogtreecommitdiffstats
path: root/src/vim9type.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2023-01-12 17:06:27 +0000
committerBram Moolenaar <Bram@vim.org>2023-01-12 17:06:27 +0000
commita86655af84f1596f0f3ef22813724fe06f1e4809 (patch)
treebbf962d3a9b0597e34be6cecc9657241bb3346f3 /src/vim9type.c
parenta94bd9d9396183eb7781f8d6a5a0e6e97442e9ed (diff)
patch 9.0.1185: using class from imported script not testedv9.0.1185
Problem: Using class from imported script not tested. Solution: Add tests. Implement what is missing.
Diffstat (limited to 'src/vim9type.c')
-rw-r--r--src/vim9type.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/vim9type.c b/src/vim9type.c
index 02b674d23c..9f95a8261c 100644
--- a/src/vim9type.c
+++ b/src/vim9type.c
@@ -982,7 +982,9 @@ skip_type(char_u *start, int optional)
if (optional && *p == '?')
++p;
- while (ASCII_ISALNUM(*p) || *p == '_')
+
+ // Also skip over "." for imported classes: "import.ClassName".
+ while (ASCII_ISALNUM(*p) || *p == '_' || *p == '.')
++p;
// Skip over "<type>"; this is permissive about white space.
@@ -1091,7 +1093,7 @@ parse_type(char_u **arg, garray_T *type_gap, int give_error)
char_u *p = *arg;
size_t len;
- // skip over the first word
+ // Skip over the first word.
while (ASCII_ISALNUM(*p) || *p == '_')
++p;
len = p - *arg;
@@ -1293,10 +1295,10 @@ parse_type(char_u **arg, garray_T *type_gap, int give_error)
break;
}
- // It can be a class or interface name.
+ // It can be a class or interface name, possibly imported.
typval_T tv;
tv.v_type = VAR_UNKNOWN;
- if (eval_variable(*arg, (int)len, 0, &tv, NULL, EVAL_VAR_IMPORT) == OK)
+ if (eval_variable_import(*arg, &tv) == OK)
{
if (tv.v_type == VAR_CLASS && tv.vval.v_class != NULL)
{