Created
August 10, 2011 01:34
-
-
Save catamorphism/1135820 to your computer and use it in GitHub Desktop.
This file contains 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
// -*- rust -*- | |
// error-pattern:Unsatisfied precondition | |
tag list { cons(int, @list); nil; } | |
type bubu = {x: int, y: int}; | |
pred less_than(x: int, y: int) -> bool { ret x < y; } | |
type ordered_range = {low: int, high: int} : less_than(*.low, *.high); | |
fn main() { | |
// Should fail to compile, b/c we're not doing the check | |
// explicitly that a < b | |
let a: int = 1; | |
let b: int = 2; | |
let c: ordered_range = {low: a, high: b}; | |
log c.low; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment