bug fix #2154
This commit is contained in:
parent
2dcce333d0
commit
b800461c6c
14
TestSuite/errors/err0359_deduce_without_brackets.pas
Normal file
14
TestSuite/errors/err0359_deduce_without_brackets.pas
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
type
|
||||
t0<T> = class
|
||||
procedure p1 := exit;
|
||||
end;
|
||||
|
||||
t1 = class
|
||||
function f1<T>: t0<T> := nil;
|
||||
end;
|
||||
|
||||
begin
|
||||
var b := new t1;
|
||||
b.f1.p1;
|
||||
|
||||
end.
|
||||
|
|
@ -1434,6 +1434,7 @@ namespace PascalABCCompiler.TreeConverter
|
|||
{
|
||||
if (obj == null)
|
||||
obj = GetCurrentObjectReference(cmn.cont_type.Scope, cmn, loc);//new this_node(context.converted_type, loc);
|
||||
|
||||
common_method_call cmc = new common_method_call(cmn, obj, loc);
|
||||
cmc.virtual_call = !inherited_ident_processing;
|
||||
bfc = cmc;
|
||||
|
|
@ -9372,6 +9373,15 @@ namespace PascalABCCompiler.TreeConverter
|
|||
bfc = create_static_method_call_with_params(fn, bfc.location, fn.return_value_type, true, bfc.parameters);
|
||||
}
|
||||
}
|
||||
if (bfc is common_method_call)
|
||||
{
|
||||
common_method_node cmn = (bfc as common_method_call).function_node;
|
||||
if (cmn != null && cmn.is_generic_function && !cmn.is_generic_function_instance && cmn.parameters.Count == 0)
|
||||
{
|
||||
cmn = (common_method_node)generic_convertions.DeduceFunction(cmn, new expressions_list(), true, context, bfc.location);
|
||||
bfc = new common_method_call(cmn, (bfc as common_method_call).obj, bfc.location);
|
||||
}
|
||||
}
|
||||
return bfc;
|
||||
}
|
||||
|
||||
|
|
@ -9756,7 +9766,6 @@ namespace PascalABCCompiler.TreeConverter
|
|||
}
|
||||
|
||||
try_convert_typed_expression_to_function_call(ref en);
|
||||
|
||||
switch (mot)
|
||||
{
|
||||
case motivation.address_receiving:
|
||||
|
|
|
|||
Loading…
Reference in a new issue