[Mono-bugs] [Bug 679599] Linker shouldn't remove constructors for types which are used by generic types/methods 'new' constraint

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Mar 15 10:02:39 EDT 2011



--- Comment #2 from Jonathan Pryor <jpryor at novell.com> 2011-03-15 14:02:38 UTC ---
While I agree that calls to Activator.CreateInstance<T>() should preserve the
constructors on the T found via static analysis, that wouldn't actually help in
this case as there are no calls to Activator.CreateInstance() (as determine by
disassembling the unlinked IL).

The problem appears to be due to IL sanity checking at load/runtime, as Bar<TA>
requires that the TA provide a default constructor:

    .class public auto ansi beforefieldinit B`1<.ctor (class
Mono.Samples.Hello.IA) TA>

but there are no calls to Activator.CreateInstance() within the code (as `new
TA()` isn't performed within the body of B<TA>).

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list