1
0
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:
shadowninja55
2021-06-25 06:08:56 -04:00
committed by GitHub
parent e9de30373f
commit be8be3d319
4 changed files with 59 additions and 34 deletions

View File

@@ -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)
}