Theo69
(Theo)
1
The code to reproduce: Module 1.bugreport.zip (1.4 MB)
The build log: Module 1.bugreport.txt (32.3 KB)
When you wire an event from an aspect, it looks for a method with 0 parameters (that does not exist), causing the error
No overloaded method "MyEventHandler" with 0 parameters on type "Test"
Followed by the hint:
Best matching overload is "MyEventHandler(p: String)"
The one mentioned in the hint IS the one that was assigned as eventhandler.
Theo69
(Theo)
2
Update:
When you change the code in program.vb - remove the parameter on the event and on the method in class Test, the error changes in:
Cannot get address of value
Thanks, logged as bugs://85255
ck
(Carlo Kok)
4
The aspect itself isn’t in this zip file.
bugs://85255 got closed with status testcaseerr.
Theo69
(Theo)
6
Test project with the aspect: Aspectproblem.zip (2.1 MB)
bugs://85255 got reopened.
bugs://85255 got closed with status fixed.
ck
(Carlo Kok)
9
@Theo69:
try this:
b.Add(new StandaloneStatement(new ProcValue(new SelfValue, evt.AddMethod, new ProcPtrValue(new SelfValue, aMethod.Name))))
UnaryValue tries to actually take the address of the pointer, while ProcPtr does do what you want.
1 Like