-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Test Plan for Function Pointers feature #43321
Comments
Notes from test plan meeting: Additional Tests:
Required:
|
Added a checkbox for EnC. |
Note: I'm not checking off the parsing box yet as we're going to be updating the syntax, but parsing as proposed today works. |
Note: there is support for exact type inference for type parameters. The full rules need to be added to the spec and then implemented. It will likely be very similar to the rules for delegates. |
Just want to link to list of supported calling conventions in BCL for future reference. |
This is a placeholder for a test plan for the set of changes related to Function Pointers C# 9.0 feature.
The feature specification is here https://github.com/dotnet/csharplang/blob/master/proposals/csharp-9.0/function-pointers.md
Language version tests.
Use-site diagnostics are properly calculated for a function pointer type symbol and bubble up to fields, methods and properties as appropriate.
Generic substitution
Retargeting, all constituent types (including custom modifiers) are properly re-targeted
Parsing of types follows https://github.com/dotnet/csharplang/blob/master/proposals/function-pointers.md#function-pointer-syntax
Binding of function pointer types
Cannot use static type within a function pointer type as return type or parameter type.
Function pointer types are properly encoded within signatures in metadata
Function pointer types are properly decoded within signatures in metadata
Use of function pointer types results in an error outside of unsafe context.
A function pointer can be invoked by supplying an argument list.
Can construct an array of function pointer types
Test constants of a function pointer type
Test default parameter values
Conversions
null
literalvoid*
void*
to a function pointerS[]
toSystem.Collections.Generic.IList<T>
and its generic base interfaces never apply to function pointer arrays, since pointer types cannot be used as type argumentsOperators
->
is disallowed[ ]
is disallowed&
is allowed++
,--
,+
,-
are disallowed==
,!=
,<
,>
,<=
,=>
are allowed.Overload resolution
void*
https://github.com/dotnet/csharplang/blob/master/proposals/function-pointers.md#better-function-memberOverloading
Common type inference
Overriding
Implementing an interface
Tuples
void M<T, U>(delegate* [ ]<(T, U)> parameter)
Dynamic
Nullability
Native Int
A function pointer type cannot be a
this
parameter of an extension methodA function pointer type cannot be used as a type of a constituent expression of a dynamically bound operation
A function pointer type may be used as the type of a volatile field
A special expansion is used to iterate over a multi-dimensional array of function pointers (https://github.com/dotnet/csharplang/blob/master/spec/unsafe-code.md#pointer-arrays)
Review existing checks for TypeKind.Pointer and adjust for function pointers as appropriate
Review existing checks for SymbolKind.PointerType and adjust for function pointers as appropriate
Restricted type safety (span)
Using aliases
Address of partial method
Usage in anonymous types
Tests for public symbol model
SemanticModel
IOperation support
IDE Test pass
delegate*
Edit and Continue
Other IDE scenarios
APIs
CreateFunctionPointerTypeSymbol
(issue Test Plan for Function Pointers feature #43321)The text was updated successfully, but these errors were encountered: