mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v.parser: prohibit redeclaration of builtin types (#10563)
This commit is contained in:
@@ -85,18 +85,22 @@ fn on_error(receiver voidptr, e &Error, work &Work) {
|
||||
```v oksyntax
|
||||
module main
|
||||
|
||||
import eventbus
|
||||
|
||||
const eb = eventbus.new()
|
||||
|
||||
struct Work {
|
||||
hours int
|
||||
}
|
||||
|
||||
struct Error {
|
||||
struct AnError {
|
||||
message string
|
||||
}
|
||||
|
||||
fn do_work() {
|
||||
work := Work{20}
|
||||
// get a mutable Params instance & put some data into it
|
||||
error := &Error{'Error: no internet connection.'}
|
||||
error := &AnError{'Error: no internet connection.'}
|
||||
// publish the event
|
||||
eb.publish('error', work, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user