mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 02:48:07 +02:00
* don't bother finding the correct constructor if the attribute isn't a TCustomAttribute descendant anyway; simply skip the parameters in that case
+ added tests git-svn-id: trunk@42470 -
This commit is contained in:
parent
6cde8ab4cb
commit
c282f21b1b
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -13218,6 +13218,8 @@ tests/test/tcustomattr17.pp svneol=native#text/pascal
|
||||
tests/test/tcustomattr18.pp svneol=native#text/pascal
|
||||
tests/test/tcustomattr19.pp svneol=native#text/pascal
|
||||
tests/test/tcustomattr2.pp svneol=native#text/pascal
|
||||
tests/test/tcustomattr20.pp svneol=native#text/pascal
|
||||
tests/test/tcustomattr21.pp svneol=native#text/pascal
|
||||
tests/test/tcustomattr3.pp svneol=native#text/pascal
|
||||
tests/test/tcustomattr4.pp svneol=native#text/pascal
|
||||
tests/test/tcustomattr5.pp svneol=native#text/pascal
|
||||
|
@ -447,7 +447,11 @@ implementation
|
||||
|
||||
{ Check if the attribute class is related to TCustomAttribute }
|
||||
if not is_system_custom_attribute_descendant(od) then
|
||||
incompatibletypes(od,class_tcustomattribute);
|
||||
begin
|
||||
incompatibletypes(od,class_tcustomattribute);
|
||||
read_attr_paras.free;
|
||||
continue;
|
||||
end;
|
||||
|
||||
paran:=read_attr_paras;
|
||||
|
||||
|
15
tests/test/tcustomattr20.pp
Normal file
15
tests/test/tcustomattr20.pp
Normal file
@ -0,0 +1,15 @@
|
||||
{ %FAIL }
|
||||
program tcustomattr20;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
{$modeswitch prefixedattributes}
|
||||
|
||||
type
|
||||
{ ensure that arguments of non existing attributes are skipped correctly }
|
||||
[TMyAttributeDoesNotExist('Alpha', 42)]
|
||||
TMyObject = class(TObject)
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
||||
|
26
tests/test/tcustomattr21.pp
Normal file
26
tests/test/tcustomattr21.pp
Normal file
@ -0,0 +1,26 @@
|
||||
{ %fail }
|
||||
program tcustomattr21;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
{$modeswitch prefixedattributes}
|
||||
|
||||
type
|
||||
|
||||
{ tmyt }
|
||||
|
||||
tmyt = class
|
||||
constructor create;
|
||||
end;
|
||||
|
||||
{ ensure that arguments are skipped correctly }
|
||||
[tmyt('Alpha', 42)]
|
||||
TMyObject = class(TObject)
|
||||
end;
|
||||
|
||||
constructor tmyt.create;
|
||||
begin
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user