Add a compile-fail test for attempts to extend non-objects.
This commit is contained in:
parent
8e585e7008
commit
6bd80d0121
13
src/test/compile-fail/extend-non-object.rs
Normal file
13
src/test/compile-fail/extend-non-object.rs
Normal file
@ -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
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user