You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes: #543
In commit 262743b we began stripping the arity from Cecil imported
types so that we wouldn't write invalid types like
``System.Collections.Generic.IList`1<string>``, in order to correctly
emit `System.Collections.Generic.IList<string>`.
However when we try to resolve these types in the `SymbolTable` we
only look at the type name, ignoring the generic type parameters. In
this case we are looking for `System.Collections.Generic.IList` but
the type is stored in the symbol table with the arity to disambiguate
types like ``Action`1`` and ``Action`2``. Therefore our lookup fails
because the table key is ``System.Collections.Generic.IList`1``.
For example, if we have `LibraryA.dll` with:
public class Foo : Java.Lang.Object {
public virtual void Bar (IList<string> p0) {…}
}
And we attempt to bind a `LibraryB.jar` which references
`LibraryA.dll`, overriding `Foo.Bar()`:
public class Foo2 : Foo {
public override void Bar (IList<string> p0) {…}
}
Then `Foo2.Bar()` would elicit a BG8800 warning:
warning BG8800: Unknown parameter type System.Collections.Generic.IList<System.String> in method Bar in managed type Foo2.
Fix type lookup so that if the type is not found in the `SymbolTable`
and there are generic type parameters, calculate the arity from the
generic type parameters and look in the table again.
That is, `System.Collections.Generic.IList<string>` is rechecked as
``System.Collections.Generic.IList`1``, which allows the type to be
found.
0 commit comments