Last active
March 4, 2017 15:30
-
-
Save hoelzro/e2eb3efc2f09948fce67508e09fdae55 to your computer and use it in GitHub Desktop.
Possible Idris compiler bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Example | |
| import Data.Nat.DivMod | |
| nextBlockSize : Nat -> Nat | |
| nextBlockSize k with (divMod k 511) | |
| nextBlockSize (remainder + (quotient * 512)) | (MkDivMod quotient remainder remainderSmall) = ?nextBlockSize_rhs_1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- this time with explicit "the Nat 512" | |
| module Example | |
| import Data.Nat.DivMod | |
| nextBlockSize : Nat -> Nat | |
| nextBlockSize k with (divMod k 511) | |
| nextBlockSize (remainder + (quotient * (the Nat 512))) | (MkDivMod quotient remainder remainderSmall) = ?nextBlockSize_rhs_1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| */tmp/Example> :r | |
| Type checking /tmp/Example.idr | |
| /tmp/Example.idr:7:40-41:When checking left hand side of with block in Example.nextBlockSize: | |
| When checking an application of function Prelude.Interfaces.*: | |
| Type mismatch between | |
| Integer (Type of 512) | |
| and | |
| Nat (Expected type) | |
| Holes: Example.nextBlockSize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| */tmp/Example> :r | |
| Type checking /tmp/Example.idr | |
| /tmp/Example.idr:7:17:When checking left hand side of with block in Example.nextBlockSize: | |
| Type mismatch between | |
| remainder + quotient * 512 (Inferred value) | |
| and | |
| remainder + quotient * the Nat 512 (Given value) | |
| Specifically: | |
| Type mismatch between | |
| plus | |
| and | |
| (+) | |
| Holes: Example.nextBlockSize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment