0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 9.0.1265: using an interface method may give a compilation error

Problem:    Using an interface method may give a compilation error.
Solution:   Do not try to compile the body of a method of an interface.
            (closes #11885)
This commit is contained in:
Bram Moolenaar
2023-01-30 20:24:23 +00:00
parent eb45ad25ab
commit b8bebd0cd7
3 changed files with 30 additions and 1 deletions

View File

@@ -3181,6 +3181,16 @@ compile_def_function(
}
ufunc->uf_args_visible = ufunc->uf_args.ga_len;
// Compiling a function in an interface is done to get the function type.
// No code is actually compiled.
if (ufunc->uf_class != NULL
&& (ufunc->uf_class->class_flags & CLASS_INTERFACE))
{
ufunc->uf_def_status = UF_NOT_COMPILED;
ret = OK;
goto erret;
}
/*
* Loop over all the lines of the function and generate instructions.
*/
@@ -3705,7 +3715,7 @@ nextline:
iemsg("Type stack underflow");
goto erret;
}
}
} // END of the loop over all the function body lines.
if (cctx.ctx_scope != NULL)
{