operator overload doesn't respect a NEW-type type alias
## Summary ``` please read chapter "3.8 Type aliases" in the fp ref.guide 3.2.2 or the following lines: | 3.8 Type aliases | .... | Type MyInteger = Type Integer; | actually creates a new different type. | .... | There are three consequences of having DIFFERENT types: | 1. .... | 2. They can be used in function overloads, that is | Procedure MyProc(A : MyInteger); overload; | Procedure MyProc(A : Integer); overload; | will work. This will not work with a simple type alias. | 3. They can be used in operator overloads, that is | Operator +(A,B : MyInteger) : MyInteger; | will work too. I tested 2+3, 2 works, 3 not. ``` ## System Information - **Operating system:** openSUSE Leap 15.6 - **Processor architecture:** x86-64 - **Compiler version:** 3.2.2 - **Device:** computer ## Steps to reproduce compile (mode fpc) (and run) the example below, with both values of the 'define'. ## Example Project ``` {$define p1} // p1 or p2 {$ifdef p1} type myinteger = type integer; operator +( a,b: myinteger ) c: myinteger; // --> 'Impossible operator begin // overload' c:=3 end; var i: integer; m: myinteger; begin i:=0; m:=0; writeln( 'i+i: ', i+i ); // should be 'i+i: 0' writeln( 'm+m: ', m+m ) // should be 'm+m: 3' end . {$endif} // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {$ifdef p2} type myinteger = type integer; procedure myproc( a: integer); overload; begin writeln( 'myproc int' ) end; procedure myproc( a: myinteger); overload; begin writeln( 'myproc myint' ) end; var i: integer; m: myinteger; begin i:=0; m:=0; myproc(i); // --> 'myproc int' (ok) myproc(m); // --> 'myproc myint' (ok) end . {$endif} ``` ## What is the current bug behavior? in case 'p1' a compile time error message 'Impossible operator overload'. i think there is a clear contradiction to the fp reference, mentioned above. ## What is the expected (correct) behavior? no error message (compile+run time).
issue