View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0037939 | FPC | Compiler | public | 2020-10-17 03:48 | 2020-10-20 22:56 |
Reporter | Danny Milosavljevic | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | confirmed | Resolution | open | ||
Product Version | 3.2.0 | ||||
Summary | 0037939: Generic type checking messes up and does not fail | ||||
Description | With the program below, I unexpectedly do not get a compilation error. Worse, at runtime, the weirdest values are printed. | ||||
Steps To Reproduce | {$MODE DELPHI} {$modeswitch advancedrecords} type TMatrix<T, R, C> = record fCoordinates: array[R, C] of Double; end; function mul<T, R, X, C>(A: TMatrix<T, R, X>; B: TMatrix<T, X, C>): TMatrix<T, R, C>; begin Writeln('yep'); Writeln(High(R)); // 3 Writeln(High(X)); // 4 Writeln(High(C)); // 3 end; type R1 = 1..3; R2 = 1..4; var A: TMatrix<Double, R1, R2>; B: TMatrix<Double, R1, R1>; begin mul<Double, R1, R2, R1>(A,B); // should fail //mul(A,B); // does not work end. | ||||
Tags | generics | ||||
Fixed in Revision | |||||
FPCOldBugId | |||||
FPCTarget | - | ||||
Attached Files |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2020-10-17 03:48 | Danny Milosavljevic | New Issue | |
2020-10-20 22:56 | Sven Barth | Tag Attached: generics | |
2020-10-20 22:56 | Sven Barth | Status | new => confirmed |
2020-10-20 22:56 | Sven Barth | FPCTarget | => - |