Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tranlate c and compilation failed #19557

Closed
zuosixiaoxiongmao opened this issue Oct 12, 2023 · 1 comment
Closed

tranlate c and compilation failed #19557

zuosixiaoxiongmao opened this issue Oct 12, 2023 · 1 comment
Labels
Bug This tag is applied to issues which reports bugs. Build V build error on any OS/CPU architecture. Generics[T] Bugs/feature requests, that are related to the V generics. Unit: cgen Bugs/feature requests, that are related to the default C generating backend.

Comments

@zuosixiaoxiongmao
Copy link

zuosixiaoxiongmao commented Oct 12, 2023

Describe the bug

tranlate c and compilation failed


import eventbus {EventBus, EventHandlerFn}

fn on_test_with_receiver(receiver &FakeReceiver, ev &EventData, sender voidptr) {
	println('11111111111')
}

struct FakeReceiver {}



fn send<T>(eb &EventBus<u64>, name u64, data voidptr) {
	eb.publish(name, eb, data)
}

struct NetCom {}

struct EventData {
	
}

mut eb := eventbus.new[u64]()
r := &FakeReceiver{}
eb.subscriber.subscribe_method(1, on_test_with_receiver, r)
eb.publish(1, eb, &EventData{})
send<NetCom>( eb, 1, &EventData{})

Current Behavior

C:/Users/Administrator/AppData/Local/Temp/v_0/event_bus_error.13090158403344912773.tmp.c:507: warning: WINVER redefined
C:/Users/Administrator/AppData/Local/Temp/v_0/event_bus_error.13090158403344912773.tmp.c:1988: error: ',' expected (got "*")
...

(Use v -cg to print the entire error message)

builder error:

C error. This should never happen.

This is a compiler bug, please report it using v bug file.v.

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.2

Environment details (OS name and version, etc.)

windows 10

Note

You can vote for this issue using the 👍 reaction. More votes increase the issue's priority for developers.

Take into account that only the 👍 reaction counts as a vote.
Only reactions to the issue itself will be counted as votes, not comments.

@zuosixiaoxiongmao zuosixiaoxiongmao added the Bug This tag is applied to issues which reports bugs. label Oct 12, 2023
@ArtemkaKun ArtemkaKun added Unit: cgen Bugs/feature requests, that are related to the default C generating backend. Build V build error on any OS/CPU architecture. labels Oct 12, 2023
@felipensp felipensp added the Generics[T] Bugs/feature requests, that are related to the V generics. label Nov 25, 2023
@MCausc78
Copy link
Contributor

Does not reproduces on latest V:

PS D:\Games\Proekti\V\interactions> type test2.v    
import eventbus { EventBus }

fn on_test_with_receiver(receiver &FakeReceiver, ev &EventData, sender voidptr) {
        println('11111111111')
}

struct FakeReceiver {}

fn send[T](eb &EventBus[u64], name u64, data voidptr) {
        eb.publish(name, eb, data)
}

struct NetCom {}

struct EventData {
}

mut eb := eventbus.new[u64]()
r := &FakeReceiver{}
eb.subscriber.subscribe_method(1, on_test_with_receiver, r)
eb.publish(1, eb, &EventData{})
send[NetCom](eb, 1, &EventData{})
PS D:\Games\Proekti\V\interactions> v version
V 0.4.4 2a68e2b
PS D:\Games\Proekti\V\interactions> v run test2.v
11111111111
11111111111

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs. Build V build error on any OS/CPU architecture. Generics[T] Bugs/feature requests, that are related to the V generics. Unit: cgen Bugs/feature requests, that are related to the default C generating backend.
Projects
None yet
Development

No branches or pull requests

5 participants