2
0
Эх сурвалжийг харах

* don't allow implicit type conversions from pointers to c-style blocks in
Delphi mode, because unlike for procvars we need full type information
to be able to generate a block (mantis #30022)

git-svn-id: trunk@33529 -

Jonas Maebe 9 жил өмнө
parent
commit
f50dec5202

+ 1 - 0
.gitattributes

@@ -13569,6 +13569,7 @@ tests/webtbf/tw2972b.pp svneol=native#text/plain
 tests/webtbf/tw2983a.pp svneol=native#text/plain
 tests/webtbf/tw2996.pp svneol=native#text/plain
 tests/webtbf/tw3000.pp svneol=native#text/plain
+tests/webtbf/tw30022.pp svneol=native#text/plain
 tests/webtbf/tw3047.pp svneol=native#text/plain
 tests/webtbf/tw3114.pp svneol=native#text/plain
 tests/webtbf/tw3116.pp svneol=native#text/plain

+ 1 - 0
compiler/symdef.pas

@@ -6355,6 +6355,7 @@ implementation
     function tprocvardef.is_addressonly:boolean;
       begin
         result:=(not(po_methodpointer in procoptions) and
+                 not(po_is_block in procoptions) and
                  not is_nested_pd(self)) or
                 (po_addressonly in procoptions);
       end;

+ 22 - 0
tests/webtbf/tw30022.pp

@@ -0,0 +1,22 @@
+{ %fail }
+
+{ %target=darwin }
+
+{$mode delphi}
+{$modeswitch objectivec1}
+{$modeswitch cblocks}
+
+type
+  treadabilityHandler = reference to procedure (l :longint); cdecl;
+
+procedure setReadabilityHandler(ahandler: treadabilityHandler);
+  begin
+  end;
+
+procedure MyHandler(l: longint);
+begin
+end;
+
+begin
+  setReadabilityHandler(@myhandler)
+end.