0
Cannot Reproduce

Adding out parameter to method - run time error

Lesha.VH 3 years ago updated by Lazlo Bonin (Lead Developer) 3 years ago 5

I change method signature from 

public bool SetValue(float val) 

to

public bool SetValue(float value, out bool result)


Press Tools->"Build Unit Options" to completely rebuild database, and got run-time error:


MissingValuePortInputException: Missing input value for 'a'.
Bolt.ValueInput.GetValue (Ludiq.Recursion recursion)
Bolt.XUnitValuePort.GetValue (IUnitValuePort gettable, Ludiq.Recursion recursion, System.Type type)
Bolt.XUnitValuePort.GetValue[Object] (IUnitValuePort gettable, Ludiq.Recursion recursion)
Bolt.BinaryComparisonUnit.<Definition>b__19_1 (Ludiq.Recursion recursion)
Bolt.Unit+<>c__DisplayClass56_0`1[System.Boolean].<ValueOutput>b__0 (Ludiq.Recursion recursion)
Bolt.ValueOutput.GetValue (Ludiq.Recursion recursion)

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):

out bool result is not used In Graph Flow (pink circle without any connections)

Well, may be its my mistake - however I can not extract information in what BLOCK this error occured...

I found my mistake on BIG graph - however get another


InvalidConversionException: Cannot convert from 'System.Boolean' to 'System.Single'.
Ludiq.ConversionUtility.Convert (System.Object value, System.Type type, ConversionType conversionType) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:466)
Ludiq.ConversionUtility.Convert (System.Object value, System.Type type) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:215)
Bolt.XUnitValuePort.GetValue (IUnitValuePort gettable, Ludiq.Recursion recursion, System.Type type)
Bolt.XUnitValuePort.GetValue[Single] (IUnitValuePort gettable, Ludiq.Recursion recursion)
Bolt.Add`1[System.Single].Operation (Ludiq.Recursion recursion)
Bolt.Unit+<>c__DisplayClass56_0`1[System.Single].<ValueOutput>b__0 (Ludiq.Recursion recursion)
Bolt.ValueOutput.GetValue (Ludiq.Recursion recursion)

Well - there is no information about in what block mistake take place - NO CHANGE TO DEBUG logic)

Such inforamation must be added - how to find run-time mistake...


And after refactoring method that are used in Graph, its very hard to find all mistakes - because lots of connections get lost...

Pending Review

Can you send screenshots of the graphs in which these errors occur? It's hard to guess what is happening from just the stack trace.