Prechádzať zdrojové kódy

* indexed interface properties are allowed

florian 2 týždňov pred
rodič
commit
0fb946f7d9
3 zmenil súbory, kde vykonal 4 pridanie a 21 odobranie
  1. 3 4
      compiler/pdecvar.pas
  2. 0 16
      tests/webtbf/tw3583.pp
  3. 1 1
      tests/webtbs/tw3583.pp

+ 3 - 4
compiler/pdecvar.pas

@@ -391,10 +391,9 @@ implementation
          { property parameters ? }
          if try_to_consume(_LECKKLAMMER) then
            begin
-              // Published indexed properties are allowed in Delphi in interfaces compiled with {$M+}.
-              if (p.visibility=vis_published)
-                  and (astruct is tobjectdef)
-                  and not (tobjectdef(aStruct).objecttype in [odt_interfacecom,odt_dispinterface]) then
+              { Published indexed properties are allowed in Delphi in interfaces compiled with $M+. }
+              if (p.visibility=vis_published) and
+                not(is_interfacecom_or_dispinterface(astruct)) then
                 Message(parser_e_cant_publish_that_property);
               { create a list of the parameters }
               p.parast:=tparasymtable.create(nil,0);

+ 0 - 16
tests/webtbf/tw3583.pp

@@ -1,16 +0,0 @@
-{ %FAIL }
-{$mode objfpc}
-type
-  IGUserData = interface(IInvokable)
-    ['{35377B66-6B1B-11D9-8827-00055DDDEA00}']
-    (* userdata *)
-    function GetUserData(key: UTF8String): IInterface;
-    procedure SetUserData(key: UTF8String; const v: IInterface);
-
-    function GetUserDataVariant(key: UTF8String): Variant;
-    procedure SetUserDataVariant(key: UTF8String; const v: Variant);
-
-    property UserData[key: UTF8String]: IInterface read GetUserData write SetUserData;
-  end;
-begin
-end.

+ 1 - 1
tests/webtbs/tw3583.pp

@@ -1,4 +1,4 @@
-{$mode delphi}
+{$mode objfpc}
 type
   IGUserData = interface(IInvokable)
     ['{35377B66-6B1B-11D9-8827-00055DDDEA00}']