-
Notifications
You must be signed in to change notification settings - Fork 0
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
Support calling generic methods #679
Labels
Comments
This was referenced Dec 29, 2020
degory
added a commit
that referenced
this issue
Dec 30, 2020
- Support calling generic methods (see #679) Bug fixes: - Anonymous functions defined in for loop expressions generate invalid IL (closes #683) Technical: - Migrate references to concrete NAMED type to base Type where possible - Split type classes out into separate files - Remove dead code for looking up built in types
degory
added a commit
that referenced
this issue
Dec 30, 2020
Enhancements: - Support calling generic methods (see #679) Bug fixes: - Anonymous functions defined in for loop expressions generate invalid IL (closes #683) Technical: - Migrate references to concrete NAMED type to base Type where possible - Split type classes out into separate files - Remove dead code for looking up built in types
degory
added a commit
that referenced
this issue
Dec 30, 2020
Enhancements: - Support calling generic methods (see #679) Bug fixes: - Anonymous functions defined in for loop expressions generate invalid IL (closes #683) Technical: - Migrate references to concrete NAMED class to abstract base class Type where possible - Split type classes out into separate files - Remove dead code for looking up built in types
degory
added a commit
that referenced
this issue
Dec 17, 2021
Enhancements: - Tactical solution for explicit generic specialization (closes #884) (see #883, #679, #731) Technical: - Defeat NuGet cache when bootstrapping locally - Be more defensive against log stack being corrupted - Fix issue where diagnostic messages including an instance of the UNDEFINED type could cause an exception - Update to latest ghul.targets and ghul.test - When running integration tests locally, use published compiler because installing as local tool requires version bump or NuGet cache clean on every rebuild.
degory
added a commit
that referenced
this issue
Dec 17, 2021
Enhancements: - Tactical solution for explicit generic specialization (closes #884) (see #883, #679, #731) Technical: - Defeat NuGet cache when bootstrapping locally - Be more defensive against log stack being corrupted - Fix issue where diagnostic messages including an instance of the UNDEFINED type could cause an exception - Update to latest ghul.targets and ghul.test - When running integration tests locally, use published compiler because installing as local tool requires version bump or NuGet cache clean on every rebuild.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Generic methods are quite common in the .NET libraries, and not being able to call them renders significant useful functionality inaccessible to ghūl code - it should be possible to call these methods.
Providing support for explicit actual type arguments when calling generic functions is a bit awkward because ghūl generic type expressions cannot be parsed from an expression context without either some syntax to introduce the type expression (e.g. as in
new
orcast
) or else adding more sophisticated backtracking to the parser.However, it actually looks relatively simple to infer correct types for generic type arguments (at least whilst we don't yet have type inference for anonymous functions see #497 #498)
The process is:
Iterable[T] ref
matches an actual function argument type ofIterable[int[]] ref
, binding actual typeint[]
to type variableT
object
then assign a low match score for that argument!!N
positional notationThe text was updated successfully, but these errors were encountered: