Skip to content

Commit

Permalink
Fix compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
theunrepentantgeek committed May 30, 2021
1 parent 1a3aae5 commit ef912b4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions hack/generator/pkg/codegen/storage/storage_type_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,16 @@ func (f *StorageTypeFactory) injectConversions(definition astmodel.TypeDefinitio
knownTypes := make(astmodel.Types)
knownTypes.AddTypes(f.inputTypes)
knownTypes.AddTypes(f.outputTypes)
conversionContext := conversions.NewStorageConversionContext(knownTypes, f.idFactory)
conversionFromContext := conversions.NewStorageConversionContext(knownTypes, conversions.ConvertFrom, f.idFactory)

convertFromFn, err := conversions.NewPropertyAssignmentFromFunction(definition, nextDef, f.idFactory, conversionContext)
convertFromFn, err := conversions.NewPropertyAssignmentFromFunction(definition, nextDef, f.idFactory, conversionFromContext)
if err != nil {
return nil, errors.Wrapf(err, "creating ConvertFrom() function for %q", name)
}

convertToFn, err := conversions.NewPropertyAssignmentToFunction(definition, nextDef, f.idFactory, conversionContext)
conversionToContext := conversions.NewStorageConversionContext(knownTypes, conversions.ConvertTo, f.idFactory)

convertToFn, err := conversions.NewPropertyAssignmentToFunction(definition, nextDef, f.idFactory, conversionToContext)
if err != nil {
return nil, errors.Wrapf(err, "creating ConvertTo() function for %q", name)
}
Expand Down

0 comments on commit ef912b4

Please sign in to comment.