Add LDM notes for Jan 23, 2019
This commit is contained in:
parent
9db8a141ba
commit
66a949f7ab
63
meetings/2019/LDM-2019-01-23.md
Normal file
63
meetings/2019/LDM-2019-01-23.md
Normal file
|
@ -0,0 +1,63 @@
|
|||
|
||||
# C# Language Design Meeting for Jan 23, 2019
|
||||
|
||||
## Agenda
|
||||
|
||||
Function pointers ([Updated proposal](https://github.com/dotnet/csharplang/blob/master/proposals/function-pointers.md))
|
||||
|
||||
## Discussion
|
||||
|
||||
### Creation of a function pointer to a managed method
|
||||
|
||||
The proposal is `&Class.Method` to produce a function pointer. The question
|
||||
is whether `&Class.Method` is target-typed, whether it has a natural type
|
||||
when there's only one member in the method group, or both.
|
||||
|
||||
Target-typing is useful because, like with delegates, it allows you to select
|
||||
a unique method out of a method group with multiple incompatible overloads.
|
||||
|
||||
Natural type is useful because it allows things like `var` and `void*`.
|
||||
|
||||
**Conclusion**
|
||||
|
||||
Let's start by only doing target-typing. Also, the section "better function
|
||||
member" is not necessary without the natural typing.
|
||||
|
||||
### DllImport CallingConvention?
|
||||
|
||||
There is actually a stub that the compiler calls for P/Invoke with DllImport
|
||||
that is always done using the managed calling convention, so there's no
|
||||
reason for function pointers to use the DllImportAttribute.
|
||||
|
||||
NativeCallback is intended for the scenario where you want to avoid the stub
|
||||
overhead.
|
||||
|
||||
### NativeCallableAttribute
|
||||
|
||||
Let's look at this in more detail.
|
||||
|
||||
### Syntax
|
||||
|
||||
```C#
|
||||
1. func* managed int(string)
|
||||
2. func*(string)->int
|
||||
3. func* managed (string)->int
|
||||
4. func* managed (string)=>int
|
||||
5. managed int(string)*
|
||||
5a. int(string)*
|
||||
6. managed int(string)
|
||||
7. managed (string)->int
|
||||
8. delegate* int(string)
|
||||
9. func int(string)*
|
||||
10. delegate int(string)*
|
||||
```
|
||||
|
||||
**Conclusion**
|
||||
|
||||
We're not sure about all the potential ambiguities here. Let's look at (5a),
|
||||
possibly disambiguating with the calling convention.
|
||||
|
||||
### Things to clarify in spec
|
||||
|
||||
* What does the CLR do if you try to call a method that has a modreq/modopt in
|
||||
the signature, but the `calli` has the signature without the modreq/modopt?
|
|
@ -22,15 +22,16 @@
|
|||
|
||||
## Feb 11, 2019
|
||||
|
||||
## Jan 23, 2019
|
||||
|
||||
- Function pointers (Jared, Alexandre)
|
||||
- Any urgent outstanding topics before two week break
|
||||
|
||||
# C# Language Design Notes for 2019
|
||||
|
||||
Overview of meetings and agendas for 2019
|
||||
|
||||
## Jan 23, 2019
|
||||
|
||||
[C# Language Design Notes for Jan 23, 2019](LDM-2019-01-23.md)
|
||||
|
||||
Function pointers ([Updated proposal](https://github.com/dotnet/csharplang/blob/master/proposals/function-pointers.md))
|
||||
|
||||
## Jan 16, 2019
|
||||
|
||||
[C# Language Design Notes for Jan 16, 2019](LDM-2019-01-16.md)
|
||||
|
|
Loading…
Reference in a new issue