error(E0050): cannot pass `os.IOError` to parameter with `string` type
--> xml.sp:7:45:48
|
7 | file := os.read_file("foo.xml") or { panic(err) }
| ^^^ expected: string, got: os.IOError
note: parameter has `string` type
--> /home/yuart/Projects/spawn/y/builtin/panic.sp:24:14:22
|
24 | pub fn panic(s string) -> never {
| ^^^^^^^^ (1) parameter declared here as `string`
help: `os.IOError` can be converted to `string` with `.str()`
--> xml.sp:7:48:48
|
7 | file := os.read_file("foo.xml") or { panic(err.str()) }
| ++++++ add `.str()` call to convert `os.IOError` to `string`
Help proposes to use .str() but it should propose to use .msg(), since err doesn't have a method .str() implemented
Help proposes to use
.str()but it should propose to use.msg(), sinceerrdoesn't have a method.str()implemented