bug fix #2342
This commit is contained in:
parent
1609903b1d
commit
899f0da1bd
|
|
@ -1399,6 +1399,8 @@ namespace PascalABCCompiler.PCU
|
|||
return GetGenericParameterOfFunction();
|
||||
case 11:
|
||||
return GetGenericParameterOfMethod();
|
||||
case 12:
|
||||
return new lambda_any_type_node();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,8 @@ namespace PascalABCCompiler.PCU
|
|||
ShortString = 8,
|
||||
GenericParameterOfType = 9,
|
||||
GenericParameterOfFunction = 10,
|
||||
GenericParameterOfMethod = 11
|
||||
GenericParameterOfMethod = 11,
|
||||
LambdaAnyType = 12
|
||||
}
|
||||
|
||||
public enum GenericParamKind
|
||||
|
|
@ -1418,6 +1419,12 @@ namespace PascalABCCompiler.PCU
|
|||
WriteTemplateInstance(c_t_n);
|
||||
return;
|
||||
}
|
||||
|
||||
if (type is lambda_any_type_node)
|
||||
{
|
||||
bw.Write((byte)TypeKind.LambdaAnyType);
|
||||
return;
|
||||
}
|
||||
|
||||
byte is_def = 0;
|
||||
int offset = GetTypeReference(type, ref is_def);
|
||||
|
|
|
|||
14
TestSuite/units/u_lambda_any.pas
Normal file
14
TestSuite/units/u_lambda_any.pas
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
unit u_lambda_any;
|
||||
{$reference WindowsBase.dll}
|
||||
|
||||
function f: integer;
|
||||
begin
|
||||
var d := System.Windows.Threading.Dispatcher.CurrentDispatcher;
|
||||
var res := d.Invoke(()->
|
||||
begin
|
||||
Result := 1;
|
||||
end);
|
||||
Result := res;
|
||||
end;
|
||||
|
||||
end.
|
||||
5
TestSuite/usesunits/use_lambda_any.pas
Normal file
5
TestSuite/usesunits/use_lambda_any.pas
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
uses u_lambda_any;
|
||||
|
||||
begin
|
||||
assert(f = 1);
|
||||
end.
|
||||
Loading…
Reference in a new issue