Sfoglia il codice sorgente

* don't allow overloading enum/int operations, because they should be
interpreted as internally define operations in case of enum type
definitions in {$mode delphi} (mantis #22860)

git-svn-id: trunk@22377 -

Jonas Maebe 13 anni fa
parent
commit
3b968b4b35
3 ha cambiato i file con 49 aggiunte e 0 eliminazioni
  1. 1 0
      .gitattributes
  2. 5 0
      compiler/htypechk.pas
  3. 43 0
      tests/webtbs/tw22860.pp

+ 1 - 0
.gitattributes

@@ -12824,6 +12824,7 @@ tests/webtbs/tw22741.pp svneol=native#text/plain
 tests/webtbs/tw22744.pp svneol=native#text/pascal
 tests/webtbs/tw2277.pp svneol=native#text/plain
 tests/webtbs/tw2280.pp svneol=native#text/plain
+tests/webtbs/tw22860.pp svneol=native#text/plain
 tests/webtbs/tw2289.pp svneol=native#text/plain
 tests/webtbs/tw2291.pp svneol=native#text/plain
 tests/webtbs/tw2294.pp svneol=native#text/plain

+ 5 - 0
compiler/htypechk.pas

@@ -255,6 +255,11 @@ implementation
                            (
                              is_enum(rd) and
                              (treetyp in (order_theoretic_operators+[addn, subn]))
+                           ) or
+                           (
+                             { for enum definitions, see webtbs/tw22860.pp }
+                             is_integer(rd) and
+                             (treetyp in (order_theoretic_operators+bit_manipulation_operators+arithmetic_operators))
                            )
                          );
               end;

+ 43 - 0
tests/webtbs/tw22860.pp

@@ -0,0 +1,43 @@
+{ %norun }
+
+program tw22860;
+
+{$ifdef fpc}
+{$mode delphi}
+{$endif}
+
+type
+  TZoneID=(
+    zNone=-1,
+    zSystem=zNone, // LC system parameters
+    zOven=0, // GC or LC column temperature
+    zInj=$10000,
+    zInjA=zInj,
+    zInjB=zInj + 1,
+    zInjC=zInj + 2,
+    zInjD=zInj + 3,
+    zDet=$20000, // GC and LC detectors
+    zDetA=zDet,
+    zDetB=zDet + 1,
+    zDetC=zDet + 2,
+    zDetD=zDet + 3,
+    zAux=$30000,
+    zAux1=zAux,
+    zAux2=zAux + 1,
+    zAux3=zAux + 2,
+    //LC
+    zPump=zInj,
+    zPumpA=zInjA,
+    zPumpB=zInjB,
+    zPumpC=zInjC,
+    zPumpD=zInjD,
+
+    zEvents  = $00040000, //events manager zone
+    zSampler = $00050000,  // autosampler
+    zDevice  = $40000000,  // the device itself
+    zBlock   = $20000000  // the block of device
+  ); 
+  
+begin
+end.
+