cog icon indicating copy to clipboard operation
cog copied to clipboard

Override parent values with a struct, extends its values.

Open spinillos opened this issue 1 year ago • 0 comments

When we have a struct that extend from another one and it overrides one of its fields with another struct, it extends its fields instead of used the new value. It happens in Go and TS.

Given:

#Base: {
  field: string,
  any?: _
} 

#Struct: {
  Base
  any?: #Any
}

#Any: {
  val: string
}

Generates:

type Struct struct {
  ...
  any: *struct{
    val string
  }
}

Expectation:

type Struct struct {
  ...
  any: *Any
}

spinillos avatar Nov 23 '23 13:11 spinillos