Opened 8 years ago

Closed 8 years ago

#393 closed defect (worksforme)

Fix type casting issue in requirements

Reported by: ibboard Owned by: ibboard
Priority: blocker Milestone: WarFoundry API 0.2
Component: WarFoundry-API Version: Trunk
Keywords: requirement Cc:
Blocked By: Blocking:


Despite all of the unit tests passing, we currently get an error when trying to add units to armies in both UIs. The issue comes from the use of a custom extension of the ICollection class. We need to create a test to recreate it and then fix it.

(System.Reflection.TargetInvocationException) Exception has been thrown by the target of an invocation.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Cannot cast from source type to destination type.
  at IBBoard.WarFoundry.API.Objects.Army.GetAddingUnitRequirements (IBBoard.WarFoundry.API.Objects.UnitType addingType) [0x00000] in <filename unknown>:0 
  at IBBoard.WarFoundry.API.Objects.Requirement.RequirementHandler.AllowsAdding (IBBoard.WarFoundry.API.Objects.UnitType unitType, IBBoard.WarFoundry.API.Objects.Army army, ICollection`1& failureMessages) [0x00000] in <filename unknown>:0 
  at IBBoard.WarFoundry.GUI.GTK.FrmNewUnit.SetSelectUnitEnabledVal () [0x00019] in /home/ibboard/Projects/dev/IBBoard.WarFoundry.GUI.GTK/FrmNewUnit.cs:109 
  at IBBoard.WarFoundry.GUI.GTK.FrmNewUnit.OnSelectionChanged (System.Object o, System.EventArgs e) [0x00000] in /home/ibboard/Projects/dev/IBBoard.WarFoundry.GUI.GTK/FrmNewUnit.cs:78 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x000d0] in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/corlib/System.Reflection/MonoMethod.cs:226 

Change History (2)

comment:1 Changed 8 years ago by ibboard

Owner: set to ibboard
Status: newaccepted

comment:2 Changed 8 years ago by ibboard

Resolution: worksforme
Status: acceptedclosed

Can't recreate now (tried Windows, VS.Net debug build, MonoDevelop, Linux build in Windows, nightly in Windows). SimpleSet changed its class definition recently, so suspecting it was an old library that didn't get rebuilt.

Note: See TracTickets for help on using tickets.