jrossignol / ContractConfigurator

A config file based solution for creating new contracts for Kerbal Space Program.
https://forum.kerbalspaceprogram.com/index.php?/topic/91625-1
Other
64 stars 67 forks source link

Error casting between ExperienceTrait and String #661

Open jrossignol opened 6 years ago

jrossignol commented 6 years ago

This is an issue with the current version of Kerbal Academy due to a change in Contract Configurator 1.25.0. Raised by warezcrawler:

[ERR 19:50:51.316] ContractConfigurator.ContractType: CONTRACT_TYPE 'KerbalAcademyBootCamp': Error parsing engineers

[EXC 19:50:51.317] NotSupportedException: Can't parse identifier for type System.String in class ContractConfigurator.ExpressionParser.StringExpressionParser - not supported!
    ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseIdentifier (ContractConfigurator.ExpressionParser.Token token)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseVarOrIdentifier (ContractConfigurator.ExpressionParser.Token token)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[System.String].ParseSimpleStatement[String] ()
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[T].GetRval ()
    Rethrow as NotSupportedException: Can't parse identifier for type System.String in class ContractConfigurator.ExpressionParser.StringExpressionParser - not supported!
    ContractConfigurator.ExceptionUtil.UnwrapTargetInvokationException (System.Reflection.TargetInvocationException tie)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[T].GetRval ()
    ContractConfigurator.ExpressionParser.ExpressionParser`1[Experience.ExperienceTrait].ParseOperation[Boolean] (Experience.ExperienceTrait lval, System.String op)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[ContractConfigurator.Kerbal].ParseStatement[Boolean] ()
    Rethrow as NotSupportedException: Can't parse identifier for type System.String in class ContractConfigurator.ExpressionParser.StringExpressionParser - not supported!
    ContractConfigurator.ExceptionUtil.UnwrapTargetInvokationException (System.Reflection.TargetInvocationException tie)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[ContractConfigurator.Kerbal].ParseStatement[Boolean] ()
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[ContractConfigurator.Kerbal].ParseMethod[Kerbal] (ContractConfigurator.ExpressionParser.Token token, ContractConfigurator.Kerbal obj, Boolean isFunction)
    Rethrow as NotSupportedException: Can't parse identifier for type System.String in class ContractConfigurator.ExpressionParser.StringExpressionParser - not supported!
    ContractConfigurator.ExceptionUtil.UnwrapTargetInvokationException (System.Reflection.TargetInvocationException tie)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[ContractConfigurator.Kerbal].ParseMethod[Kerbal] (ContractConfigurator.ExpressionParser.Token token, ContractConfigurator.Kerbal obj, Boolean isFunction)
    Rethrow as Exception: Error parsing statement.
    Error occurred near '*':
    AllKerbals().Where(k => k.ExperienceTrait() == "Engineer" && k.RosterStatus() == Available && k.Type() == Crew)
    ................................................................................* <-- HERE