https://bugzilla.novell.com/show_bug.cgi?id=401101
Summary: (Almost) no error when instantiating generic types with
wrong number of arguments
Product: Mono: Runtime
Version: 1.9.0
Platform: x86-64
OS/Version: Linux
Status: NEW
Severity: Minor
Priority: P5 - None
Component: generics
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
QAContact: [email protected]
Found By: ---
Description of Problem:
Mono can instantiate (and construct, use...) invalid generic types with m
generic arguments, while n != m arguments are expected. As long as n > 0 and m
!= 0, it works all the time. If n > 0 and m = 0, mono SIGABRTs.
Steps to reproduce the problem:
Run and compile:
object o = typeof(List<>).MakeGenericType(typeof(int),
typeof(int)).GetConstructor(Type.EmptyTypes).Invoke(null);
Console.WriteLine(o);
o.GetType().GetMethod("Add").Invoke(o, new object[] { 42 });
Console.WriteLine("Done!");
Actual Results:
It works just fine:
System.Collections.Generic.List`1[System.Int32,System.Int32]
Done!
Expected Results:
An exception at about every call in the whole sample.
How often does this happen?
Every time.
Additional Information:
While this is not critical - actually, it's rather curious than dangerous -
mono should throw exceptions instead of simply aborting or working just fine.
--
Configure bugmail: https://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.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs