소스 검색

* fixed support in macpas mode for anonymous procedure/function types
in parameter lists after r9484 (mantis #11254)

git-svn-id: trunk@10885 -

Jonas Maebe 17 년 전
부모
커밋
85b9c65f51
4개의 변경된 파일39개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 0
      .gitattributes
  2. 5 1
      compiler/defcmp.pas
  3. 17 0
      tests/webtbf/tw11254a.pp
  4. 15 0
      tests/webtbs/tw11254.pp

+ 2 - 0
.gitattributes

@@ -7774,6 +7774,7 @@ tests/webtbf/tw10833a.pp svneol=native#text/plain
 tests/webtbf/tw10849.pp svneol=native#text/plain
 tests/webtbf/tw10890a.pp svneol=native#text/plain
 tests/webtbf/tw10998a.pp svneol=native#text/plain
+tests/webtbf/tw11254a.pp svneol=native#text/plain
 tests/webtbf/tw1157a.pp svneol=native#text/plain
 tests/webtbf/tw1238.pp svneol=native#text/plain
 tests/webtbf/tw1251a.pp svneol=native#text/plain
@@ -8174,6 +8175,7 @@ tests/webtbs/tw11216.pp svneol=native#text/plain
 tests/webtbs/tw1122.pp svneol=native#text/plain
 tests/webtbs/tw1123.pp svneol=native#text/plain
 tests/webtbs/tw1124.pp svneol=native#text/plain
+tests/webtbs/tw11254.pp svneol=native#text/plain
 tests/webtbs/tw1132.pp svneol=native#text/plain
 tests/webtbs/tw1133.pp svneol=native#text/plain
 tests/webtbs/tw1152.pp svneol=native#text/plain

+ 5 - 1
compiler/defcmp.pas

@@ -1579,8 +1579,12 @@ implementation
               { The same goes for array of const. Open arrays are handled     }
               { already (if their element types match exactly, they are       }
               { considered to be an exact match)                              }
+              { And also for "inline defined" function parameter definitions  }
+              { (i.e., function types directly declared in a parameter list)  }
               if (is_array_of_const(currpara1.vardef) or
-                  is_open_string(currpara1.vardef)) and
+                  is_open_string(currpara1.vardef) or
+                  ((currpara1.vardef.typ = procvardef) and
+                   not(assigned(currpara1.vardef.typesym)))) and
                  (eq=te_equal) and
                  (cpo_openequalisexact in cpoptions) then
                 eq:=te_exact;

+ 17 - 0
tests/webtbf/tw11254a.pp

@@ -0,0 +1,17 @@
+{$mode macpas}
+{$calling mwpascal}
+
+unit tw11254a;
+
+interface
+
+type
+  t1 = function ( theDataPtr: Pointer): Integer;
+  t2 = function ( theDataPtr: Pointer): Integer;
+
+procedure Iterate( theCallback: t1);
+
+implementation
+procedure Iterate( theCallback: t2); begin end;
+
+end.

+ 15 - 0
tests/webtbs/tw11254.pp

@@ -0,0 +1,15 @@
+{ %norun }
+
+{$mode macpas}
+{$calling mwpascal}
+
+unit tw11254;
+
+interface
+
+procedure Iterate( function theCallback( theDataPtr: Pointer): Integer);
+
+implementation
+procedure Iterate( function theCallback( theDataPtr: Pointer): Integer); begin end;
+
+end.