This commit is contained in:
parent
ccbf5c8d5b
commit
72fe2f7b5e
19
TestSuite/attributes4.pas
Normal file
19
TestSuite/attributes4.pas
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
uses System;
|
||||
|
||||
type
|
||||
attrAttribute = class(Attribute)
|
||||
constructor (params p1: array of System.Activator);
|
||||
begin end;
|
||||
end;
|
||||
|
||||
c1 = class
|
||||
[attr]
|
||||
f1: integer;
|
||||
end;
|
||||
|
||||
begin
|
||||
var v1:= new c1;
|
||||
// ---> Операция '+=' не применима к типам array of Activator и integer <---
|
||||
v1.f1 += 1;
|
||||
assert(v1.f1 = 1);
|
||||
end.
|
||||
|
|
@ -12499,8 +12499,9 @@ namespace PascalABCCompiler.TreeConverter
|
|||
check_for_strong_constant(cn, get_location(cnstr_args.expressions[i]));
|
||||
args.AddElement(cn);
|
||||
}
|
||||
|
||||
context.save_var_definitions();
|
||||
base_function_call bfc = create_constructor_call(tn, args, get_location(attr));
|
||||
context.restore_var_definitions();
|
||||
if (ctn is common_type_node && tn == SystemLibrary.SystemLibrary.struct_layout_attribute_type)
|
||||
{
|
||||
if ((System.Runtime.InteropServices.LayoutKind)Convert.ToInt32((args[0] as constant_node).get_object_value()) == System.Runtime.InteropServices.LayoutKind.Explicit)
|
||||
|
|
|
|||
Loading…
Reference in a new issue