I’m having trouble adding event handlers to overloaded events in 2018 R1.1 and I think it’s some sort of weird code-caching compiler issue.
I have something like this:
ClassA
Event SomeEvent(x as ClassD)
ClassB
Event SomeEvent(x as ClassE)
Class Foo
Method Foobar(parm as classA, x as ClassD)
Method Foobar(parm as classB, x as ClassE)
...
Constructor
dim a as new ClassA
AddHandler a.SomeEvent, WeekAddressOf Foobar
The compiler is giving me the error “There is more than one item with this name and it’s not clear to which this refers” with Foobar highlighted.
I can work around it by renaming my methods to FoobarA and FoobarB, but what’s weird is that it’s inconsistent - in some places in my code I can use overloaded Methods just fine, and in other cases I can’t.
[quote=389755:@Michael Diehr]I’m having trouble adding event handlers to overloaded events in 2018 R1.1 and I think it’s some sort of weird code-caching compiler issue.
I have something like this:
ClassA
Event SomeEvent(x as ClassD)
ClassB
Event SomeEvent(x as ClassE)
Class Foo
Method Foobar(parm as classA, x as ClassD)
Method Foobar(parm as classB, x as ClassE)
...
Constructor
dim a as new ClassA
AddHandler a.SomeEvent, WeekAddressOf Foobar
The compiler is giving me the error “There is more than one item with this name and it’s not clear to which this refers” with Foobar highlighted.
I can work around it by renaming my methods to FoobarA and FoobarB, but what’s weird is that it’s inconsistent - in some places in my code I can use overloaded Methods just fine, and in other cases I can’t.
Anyone else seeing this?[/quote]
Whats are relationships between ClassA & Class B, and Class D & E.
The compiler is good about handling overloaded methods in other scenarios, so it seems like this should work fine here. If it’s not a bug, then please consider it a feature request.