@@ -478,6 +478,9 @@ func convertJsonOption(
478478 return convertJsonOption (opt .Elements (), value , basePath , propertyAssignment , valueExpression , sourceFile )
479479 }
480480 case CommandLineOptionTypeEnum :
481+ if value == nil {
482+ return nil , nil
483+ }
481484 return convertJsonOptionOfEnumType (opt , value .(string ), valueExpression , sourceFile )
482485 }
483486
@@ -633,9 +636,16 @@ func convertOptionsFromJson[O optionParser](optionsNameMap CommandLineOptionName
633636
634637 commandLineOptionEnumMapVal := opt .EnumMap ()
635638 if commandLineOptionEnumMapVal != nil {
636- val , ok := commandLineOptionEnumMapVal .Get (strings .ToLower (value .(string )))
637- if ok {
638- errors = result .ParseOption (key , val )
639+ if value , ok := value .(string ); ok {
640+ val , ok := commandLineOptionEnumMapVal .Get (strings .ToLower (value ))
641+ if ok {
642+ errors = result .ParseOption (key , val )
643+ }
644+ } else {
645+ convertJson , err := convertJsonOption (opt , value , basePath , nil , nil , nil )
646+ errors = append (errors , err ... )
647+ compilerOptionsErr := result .ParseOption (key , convertJson )
648+ errors = append (errors , compilerOptionsErr ... )
639649 }
640650 } else {
641651 convertJson , err := convertJsonOption (opt , value , basePath , nil , nil , nil )
0 commit comments