io: remove unused Zzz_CoerceInterfaceTableGeneration struct; add test for `x := Enum{}`
parent
995e1c84a2
commit
2002d20249
|
@ -31,19 +31,3 @@ pub fn make_readerwriter(r Reader, w Writer) ReaderWriterImpl {
|
||||||
w: w
|
w: w
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Zzz_CoerceInterfaceTableGeneration {
|
|
||||||
}
|
|
||||||
|
|
||||||
fn (_ Zzz_CoerceInterfaceTableGeneration) write(buf []byte) ?int {
|
|
||||||
return none
|
|
||||||
}
|
|
||||||
|
|
||||||
fn (_ Zzz_CoerceInterfaceTableGeneration) read(mut buf []byte) ?int {
|
|
||||||
return none
|
|
||||||
}
|
|
||||||
|
|
||||||
fn zzz_reader_writer_coerce_compiler() {
|
|
||||||
x := Zzz_CoerceInterfaceTableGeneration{}
|
|
||||||
_ := make_readerwriter(x, x)
|
|
||||||
}
|
|
||||||
|
|
|
@ -5037,11 +5037,9 @@ fn (mut g Gen) struct_init(struct_init ast.StructInit) {
|
||||||
g.indent--
|
g.indent--
|
||||||
}
|
}
|
||||||
|
|
||||||
if g.pref.ccompiler == 'msvc' {
|
|
||||||
if !initialized {
|
if !initialized {
|
||||||
g.write('\n#ifndef __cplusplus\n0\n#endif\n')
|
g.write('\n#ifndef __cplusplus\n0\n#endif\n')
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
g.write('}')
|
g.write('}')
|
||||||
if g.is_shared && !g.inside_opt_data && !g.is_array_set {
|
if g.is_shared && !g.inside_opt_data && !g.is_array_set {
|
||||||
|
|
|
@ -118,3 +118,18 @@ fn test_typed_enum() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
enum FileType {
|
||||||
|
unknown
|
||||||
|
wiki
|
||||||
|
file
|
||||||
|
image
|
||||||
|
html
|
||||||
|
}
|
||||||
|
|
||||||
|
fn test_enum_instance() {
|
||||||
|
mut filetype := FileType{}
|
||||||
|
eprintln(filetype)
|
||||||
|
s := 'x $filetype z'
|
||||||
|
assert s == 'x unknown z'
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue