bug fix #2340
This commit is contained in:
parent
80384a89dd
commit
c9f409869a
8
TestSuite/errors/err0379.pas
Normal file
8
TestSuite/errors/err0379.pas
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
function operator or<T2,T1>(f: byte -> T2; g: real -> T1); extensionmethod := 0;
|
||||
function operator or<T1,T2>(f: byte -> T2; g: real -> T1); extensionmethod := 0;
|
||||
|
||||
begin
|
||||
var f: byte->word;
|
||||
var g: real->byte;
|
||||
var fg := f or g;
|
||||
end.
|
||||
|
|
@ -2437,13 +2437,16 @@ namespace PascalABCCompiler.TreeConverter
|
|||
|
||||
//if (funcs[0].is_extension_method)
|
||||
Type fldiResType = null;
|
||||
if (funcs[0].is_extension_method)
|
||||
if (syntax_nodes_parameters != null)
|
||||
{
|
||||
fldiResType = ((syntax_nodes_parameters[i - 1] as SyntaxTree.function_lambda_definition)?.RealSemTypeOfResult as compiled_type_node)?.compiled_type;
|
||||
}
|
||||
else
|
||||
{
|
||||
fldiResType = ((syntax_nodes_parameters[i] as SyntaxTree.function_lambda_definition)?.RealSemTypeOfResult as compiled_type_node)?.compiled_type;
|
||||
if (funcs[0].is_extension_method)
|
||||
{
|
||||
fldiResType = ((syntax_nodes_parameters[i - 1] as SyntaxTree.function_lambda_definition)?.RealSemTypeOfResult as compiled_type_node)?.compiled_type;
|
||||
}
|
||||
else
|
||||
{
|
||||
fldiResType = ((syntax_nodes_parameters[i] as SyntaxTree.function_lambda_definition)?.RealSemTypeOfResult as compiled_type_node)?.compiled_type;
|
||||
}
|
||||
}
|
||||
// странно, но всегда кво параметров в syntax_nodes_parameters на 1 меньше. Иначе падает
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue