test: "tag" -> "enum" in compile-fail

This commit is contained in:
Patrick Walton 2012-01-19 16:01:47 -08:00
parent 97ed871fc1
commit d97783e3e5
19 changed files with 22 additions and 22 deletions

View File

@ -1,7 +1,7 @@
// error-pattern: mismatched types
tag a { A; }
tag b { B; }
enum a { A; }
enum b { B; }
fn main() { let x: a = A; alt x { B { } } }

View File

@ -1,7 +1,7 @@
// error-pattern: mismatched types
tag a { A(int); }
tag b { B(int); }
enum a { A(int); }
enum b { B(int); }
fn main() { let x: a = A(0); alt x { B(y) { } } }

View File

@ -2,7 +2,7 @@
// error-pattern: unresolved
tag color { rgb(int, int, int); rgba(int, int, int, int); }
enum color { rgb(int, int, int); rgba(int, int, int, int); }
fn main() {
let red: color = rgb(255, 0, 0);

View File

@ -6,7 +6,7 @@
mod foo {
export t;
tag t { t1; }
enum t { t1; }
}
fn main() { let x = foo::t1; }

View File

@ -5,7 +5,7 @@ mod foo {
fn x() { }
tag y { y1; }
enum y { y1; }
}
fn main() { let z = foo::y1; }

View File

@ -1,8 +1,8 @@
// xfail-test
// -*- rust -*-
// error-pattern: tag of infinite size
// error-pattern: enum of infinite size
tag mlist { cons(int, mlist); nil; }
enum mlist { cons(int, mlist); nil; }
fn main() { let a = cons(10, cons(11, nil)); }

View File

@ -1,6 +1,6 @@
// error-pattern:refutable pattern
tag xx { xx(int); yy; }
enum xx { xx(int); yy; }
fn main() {
let @{x: xx(x), y: y} = @{x: xx(10), y: 20};

View File

@ -1,5 +1,5 @@
// error-pattern:Declaration of thpppt shadows
tag ack { thpppt; ffff; }
enum ack { thpppt; ffff; }
fn main() {
let thpppt: int = 42;

View File

@ -1,4 +1,4 @@
// error-pattern:mismatched types
// From Issue #778
tag clam<T> { a(T); }
enum clam<T> { a(T); }
fn main() { let c; c = a(c); alt c { a::<int>(_) { } } }

View File

@ -1,5 +1,5 @@
// error-pattern: mismatched types
tag blah { a(int, int, uint); b(int, int); }
enum blah { a(int, int, uint); b(int, int); }
fn main() { alt a(1, 1, 2u) { a(_, x, y) | b(x, y) { } } }

View File

@ -6,7 +6,7 @@ import option::some;
// error-pattern: mismatched types
tag bar { t1((), option::t<[int]>); t2; }
enum bar { t1((), option::t<[int]>); t2; }
fn foo(t: bar) -> int { alt t { t1(_, some(x)) { ret x * 3; } _ { fail; } } }

View File

@ -5,7 +5,7 @@ import option::some;
// error-pattern: mismatched types
tag bar { t1((), option::t<[int]>); t2; }
enum bar { t1((), option::t<[int]>); t2; }
fn foo(t: bar) {
alt t {

View File

@ -1,6 +1,6 @@
// error-pattern: Wrong number of type arguments
tag quux<T> { bar }
enum quux<T> { bar }
fn foo(c: quux) { assert (false); }

View File

@ -1,7 +1,7 @@
//error-pattern: non-scalar cast
// black and white have the same discriminator value ...
tag non_nullary {
enum non_nullary {
nullary;
other(int);
}

View File

@ -2,7 +2,7 @@
// black and white have the same discriminator value ...
tag color {
enum color {
red = 0xff0000;
green = 0x00ff00;
blue = 0x0000ff;

View File

@ -1,7 +1,7 @@
//error-pattern: discriminator values can only be used with a c-like enum
// black and white have the same discriminator value ...
tag color {
enum color {
red = 0xff0000;
green = 0x00ff00;
blue = 0x0000ff;

View File

@ -1,6 +1,6 @@
//error-pattern: mismatched types
tag color {
enum color {
red = 1u;
blue = 2;
}

View File

@ -1,5 +1,5 @@
// error-pattern:unreachable pattern
tag foo { a(@foo, int); b(uint); }
enum foo { a(@foo, int); b(uint); }
fn main() { alt b(1u) { b(_) | a(@_, 1) { } a(_, 1) { } } }

View File

@ -1,6 +1,6 @@
// error-pattern:invalidate reference i
tag foo { left({mutable x: int}); right(bool); }
enum foo { left({mutable x: int}); right(bool); }
fn main() {
let x = left({mutable x: 10});