Case of compiler bug on checking if the type passed to a procedure matches with the expected:
Example (the line 16 'test(u2(), u1(0))' should induce a compiler error):
Type UDT1
Dim As Integer I1
End Type
Type UDT2
Dim As Integer I2
End Type
Sub test (array() As UDT1, Byref u As UDT1)
End Sub
Dim As UDT1 u1(10)
Dim As UDT2 u2(10)
test(u1(), u1(0)) '' => OK
test(u2(), u1(0)) '' should be NOK
test(u1(), u2(0)) '' error 57: Type mismatch, at parameter 2 => OK
test(u2(), u2(0)) '' error 57: Type mismatch, at parameter 2 => OK
This is not a recent bug or a regression.
Already present since fbc version 0.12b!
Fixed / changed in fbc 1.10.0
commit: [3eef323cdc9a866a0c9bbc130f88950d35363f00]
fbc will now error on the mismatch which seems like should be the right thing to do.
Related
Commit: [3eef32]
Related [#911]
Related
Bugs: #911