[Mono-bugs] [Bug 507733] New: vbnc crashes with use of template type in class inheriting Generic.List(of T)

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu May 28 05:29:57 EDT 2009


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


           Summary: vbnc crashes with use of template type in class
                    inheriting Generic.List(of T)
    Classification: Mono
           Product: Mono: Compilers
           Version: 2.4.x
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Basic
        AssignedTo: rkvinge at novell.com
        ReportedBy: novell.com at nanonanonano.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.0.9)
Gecko/2009050519 Iceweasel/3.0.6 (Debian-3.0.6-1)

In a generic class that inherits from System.Collections.Generic.List(Of T),
use of the template type causes vbnc to crash.

Shortest reproduce code that I could come up with is below. Strangely, both the
use of the type T and then the use of p.x seem to be necessary.


Reproducible: Always

Steps to Reproduce:
Code snippet:
---------8<-------------
Public Class L(Of T As P)

    Inherits System.Collections.Generic.List(Of T)

    Public Sub test()
        Dim p As T = Me.Item(0)
        Dim d As Double = p.x
    End Sub

End Class

Public Class P
    Public x As Double
End Class
------------>8--------------
Actual Results:  
vbnc -t:library generic.vb
Visual Basic.Net Compiler version 0.0.0.5914 (Mono 2.4 - r)
Copyright (C) 2004-2008 Rolf Bjarne Kvinge. All rights reserved.


/tmp/sid-i386/<MyGenerator> (1,1) : Error VBNC99999: Unexpected error: Object
reference not set to an instance of an object
  at vbnc.TypeParameterDescriptor.GetAttributeFlagsImpl () [0x00000]
  at System.Type.get_Attributes () [0x00000]
  at System.Type.get_IsInterface () [0x00000]
  at System.Type.get_IsClass () [0x00000]
  at vbnc.MemberAccessExpression.ResolveExpressionInternal (vbnc.ResolveInfo
Info) [0x00000]
  at vbnc.Expression.ResolveExpression (vbnc.ResolveInfo ResolveInfo) [0x00000]
  at vbnc.Expression.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
  at vbnc.VariableInitializer.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
  at vbnc.VariableDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
  at vbnc.CodeBlock.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
  at vbnc.MethodBaseDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
  at vbnc.MethodDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
  at vbnc.SubDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
  at vbnc.Helper.ResolveCodeCollection (IEnumerable Collection,
vbnc.ResolveInfo Info) [0x00000]
  at vbnc.BaseObjects`1[T].ResolveCode (vbnc.ResolveInfo Info) [0x00000]
  at vbnc.TypeDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
  at vbnc.ClassDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
  at vbnc.AssemblyDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
  at vbnc.Compiler.Compile_Resolve () [0x00000]
  at vbnc.Compiler.Compile () [0x00000]
Compilation took 00:00:01.9305670


Expected Results:  
The code compiles cleanly under the VS.NET 2005 vb compiler.

Changing the line "Dim p As T = Me.Item(0)" to "Dim p As P = Me.Item(0)" allows
the code to compile.

vbnc -t:library generic.vb
Visual Basic.Net Compiler version 0.0.0.5914 (Mono 2.4 - r)
Copyright (C) 2004-2008 Rolf Bjarne Kvinge. All rights reserved.


Assembly 'generic, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' saved
successfully to '/tmp/sid-i386/generic.dll'.
Compilation successful
Compilation took 00:00:02.2610170

Tested with Debian sid packages (2.4-1) for mono-vbnc in a clean chroot. 

(BTW the bugzilla could do with some more recent debian releases in the list of
platforms... the most recent listed is Debian Woody which was released in 2002
and even Debian has had 3 releases since then.)

-- 
Configure bugmail: http://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