Skip to content

NativeAOT questions #98112

Answered by eerhardt
tmds asked this question in Q&A
Feb 7, 2024 · 5 comments · 8 replies
Discussion options

You must be logged in to vote

If the call to the empty method at //1 is reachable, then the type can be instantiated anywhere (like is done here at //2)?

The type can be instantiated, yes. But there is no strong guarantee. You will still get AOT warnings in the CreateFor<T> method. The tools can't statically guarantee it will work.

If anywhere in the app there is a reachable user of an interface member (like //3) then the implementation of that member is preserved on all types that implement it?

The implementation of that member is preserved on all instantiable types that implement it. If a type implements that interface, but nothing creates that type, the type can be trimmed.

Replies: 5 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by tmds
Comment options

tmds
Feb 7, 2024
Collaborator Author

You must be logged in to vote
3 replies
@eerhardt
Comment options

@tmds
Comment options

tmds Feb 7, 2024
Collaborator Author

@vitek-karas
Comment options

Comment options

You must be logged in to vote
2 replies
@tmds
Comment options

tmds Feb 8, 2024
Collaborator Author

@MichalStrehovsky
Comment options

Comment options

tmds
Feb 10, 2024
Collaborator Author

You must be logged in to vote
3 replies
@vitek-karas
Comment options

@tmds
Comment options

tmds Feb 10, 2024
Collaborator Author

@vitek-karas
Comment options

Comment options

tmds
Feb 13, 2024
Collaborator Author

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants