-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
NativeAOT support for TypeIdentifier #79941
Comments
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsI trying to implemet WebView2 ComWrappers and they are working fine, except issue cause by this breakign change I manage to produce workaround which works in CoreCLR without trimming. If I use NativeAOT or use R2R with following settings.
then "something" is broken, for NativeAOT and R2R it's different kind of issues. Would be good if both variants supports
|
|
Without
If I add
and
I have exact same method defined here https://github.com/kant2002/WinFormsComInterop/blob/1af9bfadcae4a519ff609e58fa3cdc153adc7b33/WinFormsComInterop/WebView2/ICoreWebView2PrivatePartial.cs#L13-L17 I assume that Unmanaged stack trace
|
and until resolution for dotnet/runtime#79941 happens, I cannot do anything except supporting only latest WebView2
The |
Cannot insist on that too much because my problem from WebView2 being aggressive in renaming, but items number 4 and 5 was also not planned, but we have something else instead. So maybe that's doable. I really don't know. Also what about R2R? I think R2R is almost like regular CoreCLR. |
I think the general philosophy of R2R is that it should be a transparent optimization (aka behavior should not differ other than performance). If this is causing R2R-generated code to throw an exception that regular non-R2R code doesn't throw for a supported scenario, then I think that's a bug we should fix. If you turn off PublishTrimmed but leave PublishReadyToRun on, do you see a difference in the behavior between R2R and non-R2R code? |
I think for r2r this is tracked in #67855. For NativeAOT this looks by design. |
Just Unrelated, I hit issue that if I remove For NativeAOT, is there chance that this is something that is relatively easy to have? |
This allows stuff like the following: (new Bar()).Blah(default);
[TypeIdentifier("foo", "bar")]
struct Fun { }
[TypeIdentifier("foo", "bar")]
struct Times { }
class Foo
{
public virtual void Blah(Fun f) { }
}
class Bar : Foo
{
public override void Blah(Times t) { }
} The AOT compiler relies on referential identity between types for comparisons. Type equivalence adds a ton of confusing things into the compiler and might even leak out into runtime. There would need to be an extremely compelling reason to add it. |
I have only one case with WebView2 where I need this to account for their breaking change, so that's not important probably. If this happens in the future I always can release new package. But would it make sense to keep issue open, so it can collect cases specifically on TypeIdenfier suppor, if such issues arise? if not, you can close, I have my answers mostly. |
We're not likely to do anything here. |
I trying to implemet WebView2 ComWrappers and they are working fine, except issue cause by this breakign change
https://www.fuget.org/packages/Microsoft.Web.WebView2/1.0.1462.37/lib/netcoreapp3.0/diff/1.0.1418.22/
I manage to produce workaround which works in CoreCLR without trimming.
I have two types withing single assembly which has same
GuidAttribute
and marked withTypeIdentifierAttribute
. I implement both types in the class, so depending on which version of WebView2 nuget package I'm using, application use one interface or another.If I use NativeAOT or use R2R with following settings.
then "something" is broken, for NativeAOT and R2R it's different kind of issues. Would be good if both variants supports
TypeIdentifier
(I assume that's problem with it.)The text was updated successfully, but these errors were encountered: