You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<source>:7:5: error: function redeclaration differs in contract specifier sequence
7 | int f() post(r: r > 0);
| ^ ~~~~~~~~~~~~~
<source>:7:9: note: in contract specified here
7 | int f() post(r: r > 0);
| ^ ~~~~~
<source>:6:9: note: contract previously specified with a non-equivalent condition
6 | int f() post(r: r > 0);
| ^ ~~~~~```
Contracts may be redeclared according to P2900 if they specify the same contract (https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2900r8.pdf page 68, quote "A declaration E of a function f that is not a first declaration shall have either no function-contract-specifier-seq or the same function-contract-specifier-seq as any first declaration D reachable from E.")
The text was updated successfully, but these errors were encountered:
Yeah, so the bug here is that the compiler is seeing two different declarations of r and then assuming they're not equivalent because they're not the exact same declaration.
The fix is to compare them like parameters, which means checking the type and the function scope depth to establish equality. Fix incoming shortly.
or even
the compiler claims
Contracts may be redeclared according to P2900 if they specify the same contract (https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2900r8.pdf page 68, quote "A declaration E of a function f that is not a first declaration shall have either no function-contract-specifier-seq or the same function-contract-specifier-seq as any first declaration D reachable from E.")
The text was updated successfully, but these errors were encountered: