Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Avoid instantiating abstract class #27589

Merged

Conversation

cshung
Copy link
Member

@cshung cshung commented Oct 31, 2019

It is possible for crossgen2 to encounter code trying to instantiate an abstract class, and we should refuse to generate code in those cases so that the JIT will throw InvalidOperationException at runtime.

This is not possible in C#, but it is possible to in IL, for example, the code is instantiating the abstract class Gen<T> here and the assembler produced the IL for it.

@dotnet/crossgen-contrib

@cshung cshung changed the title [WIP] Avoid instantiating abstract class Avoid instantiating abstract class Nov 1, 2019
@cshung cshung force-pushed the dev/andrewau/avoid-instantiate-abstract-class branch from efd602c to d767f30 Compare November 4, 2019 20:00
@cshung cshung merged commit 0b44119 into dotnet:master Nov 4, 2019
@cshung cshung deleted the dev/andrewau/avoid-instantiate-abstract-class branch November 4, 2019 23:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants