Better exception when serialized class lacks default constructor
Over DBus I call a method that takes a parameter of type MyClass. This class has no default constructor. I get a NullReferenceException which is not helpful at all!
System.: Object reference not set to an instance of an object at System.Reflection.Emit.ILGenerator.Emit (OpCode opcode, System.Reflection.ConstructorInfo con) [0x0001b] in /home/oskar/mono24/mono-2.6.7/mono-2.6.7/mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs:536 at DBus.TypeImplementer.GenStructReader (System.Reflection.Emit.ILGenerator ilg, System.Type type) [0x00014] in /home/oskar/mono24/mono-2.6.7/dbus-sharp-0.7.0/src/TypeImplementer.cs:298 [... snipped lots of stack frames ...]
I think TypeImplementer.GenStructReader() should check for null return value from GetConstructor() and throw a proper exception with a more helpful error message.
Also, this problem does not show until actually trying to receive a message containing the offending type. It would perhaps be better to check for this already when the object is registered with the connection, to become aware of the problem earlier. Perhaps this is a bit more complex to achieve though.
Issues go stale after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
/lifecycle stale
thank