From 6bd80d01217c621b754f669188c0826c01af8fda Mon Sep 17 00:00:00 2001 From: Lindsey Kuper Date: Wed, 6 Jul 2011 10:47:36 -0700 Subject: [PATCH] Add a compile-fail test for attempts to extend non-objects. --- src/test/compile-fail/extend-non-object.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/test/compile-fail/extend-non-object.rs diff --git a/src/test/compile-fail/extend-non-object.rs b/src/test/compile-fail/extend-non-object.rs new file mode 100644 index 00000000000..3d232db2dc6 --- /dev/null +++ b/src/test/compile-fail/extend-non-object.rs @@ -0,0 +1,13 @@ +//error-pattern:x does not have object type +use std; + +fn main() { + auto x = 3; + + auto anon_obj = obj { + fn foo() -> int { + ret 3; + } + with x + }; +}