[Mono-bugs] [Bug 519336] New: Generic sharing causes cctor on parent class to be called only once for multiple generic instances

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Jul 5 09:09:16 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=519336


           Summary: Generic sharing causes cctor on parent class to be
                    called only once for multiple generic instances
    Classification: Mono
           Product: Mono: Runtime
           Version: SVN
          Platform: x86-64
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: generics
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: tobias at ntlabs.org
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=302998)
 --> (http://bugzilla.novell.com/attachment.cgi?id=302998)
Test case

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; nl; rv:1.9.0.11)
Gecko/2009060309 Ubuntu/9.04 (jaunty) Firefox/3.0.11

We have two classes, the second inherits from the first. Both have a generic
parameter. Only the first generic instantiation causes the static constructor
of the parent class to be invoked, although the second generic instantiation
features a different generic parameter and should therefore cause the cctor to
run again, as described in ECMA-334 25.1.5 [1]

[1]
http://en.csharp-online.net/ECMA-334:_25.1.5_Static_constructors_in_generic_classes

Reproducible: Always

Steps to Reproduce:
1. Compile attachment
2. Run with mono
3. Observe the console output
Actual Results:  
Static constructor 1 StaticConstructorBug.A
Static constructor 2 StaticConstructorBug.A
Static constructor 1 StaticConstructorBug.B

Expected Results:  
Static constructor 1 StaticConstructorBug.A
Static constructor 2 StaticConstructorBug.A
Static constructor 1 StaticConstructorBug.B
Static constructor 2 StaticConstructorBug.B

Running with mono -O=-gshared gives the correct output.

Microsoft .NET gives the correct output.

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


More information about the mono-bugs mailing list