Closed steveharter closed 9 hours ago
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch See info in area-owners.md if you want to be subscribed.
Closing; wrong repro
Reopened; updated repro
Closing for now; the spec proposes "instance" keyword:
unsafe class Instance {
void Use() {
delegate* instance<Instance, string> f = &ToString;
f(this);
}
}
says that instance methods are not supported (at least initially; not sure what transpired since then).
AFAIR LDM decided they're too nieche too expose in C#, but they should be fully functional in IL.
I assume if they were to be exposed in C#, it'd only be explicitthis
ones since I don't see a way to reasonably handle ones with implicit this.
Calling a managed function pointer on an instance that returns a non-primitive value type (perhaps based on length?) will return random values and causes stack\heap issues later.
_UPDATED:_ I assume calling a function pointer on an instance method is supposed to work, provided the signature is correct for having the first parameter being the correct type (here "object" was used, but "TestClass" has the same result since it is a reference type). However, the function pointer spec says that instance methods are not supported (at least initially; not sure what transpired since then).
Note the IL looks correct, and the method is actually called.
This does not appear to be a regression.
Repro: the
long
property works butGuid
doesn't, and a subsequent call to thelong
property returns a corrupted value.