Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 15876 [details]
This file should compile but does not.
When calling generic methods whose signatures contain generic types, VBNC gives an 'overload resolution failed' error although all actual parameters' types meet the corresponding formal parameters' types. The error message suggests that VBNC substitutes the generic type parameter of the method for the type arguments of the generic types that appear in the formal parameter list.
Trying to compile the attached code (vbnc Test.vb) results in the following error message (VBNC version 0.0.0.5943, Mono 3.8 - tarball):
/home/.../Test.vb (16,16) : error VBNC30518: Overload resolution failed because no accessible 'GenericTwo' can be called with these arguments:
'Private Sub GenericTwo(Arg As Long?)': Value of type 'Long?' cannot be converted to 'Test?'.
/home/.../Test.vb (17,18) : error VBNC30518: Overload resolution failed because no accessible 'GenericThree' can be called with these arguments:
'Private Sub GenericThree(Arg As System.Collections.Generic.List`1<System.String>)': Value of type 'System.Collections.Generic.List`1<System.String>' cannot be converted to 'System.Collections.Generic.List`1<Test>'.
Same VBNC version, but Mono version 4.0.1, gives the same error codes, but the error message is 'CHANGEME' then.
Expected behaviour: successful compilation.
Note that the call to GenericOne, whose signature doesn't contain any generic types, is accepted by the compiler as expected, while the calls to GenericTwo and GenericThree are only accepted if the argument given is Nothing. The error messages seem to indicate that the actual parameters in lines 16 and 17 (of type Nullable(Of Long) and List(Of String), respectively) have to be converted to Nullable(Of Test) and List(Of Test), respectively, which are the parameter types of the formal parameters of GenericTwo and GenericThree with the actual generic type argument of the method (Test) substituted for Long or String, respectively, instead for the formal generic type parameter T (which does not even appear among the formal parameters).
Operating system: Debian 8.4 (jessie) x86_64 Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz
With VBNC 0.0.0.5917 and Mono 2.6.7 under Debian 6.0.5, the file compiles successfully.
Moved to: https://github.com/mono/mono-basic/issues/43