Skip to content

Maybe NonEmpty types in a multi-field tuple do not generate the expected null / undefined values in corresponding Typescript list #51

@kallevmercury

Description

@kallevmercury

Follow-up to: #49

Thanks for the prompt patch for the previous issue. Unfortunately, I'm still replicating the issue in my project.

I'm still seeing a type like this:

data WidgetActionPayload
  = Activate (Maybe SparkLevel)
  | Reject Text [PromptKey]
  | Defer Text [PromptKey]
  | InfoRequest Text [PromptKey] (Maybe (NonEmpty ExtraInputPrompt))
  | UnknownResult Model.VoidData
  deriving stock (Show, Eq, Data)

Generate:

contents: [string, string[], TExtraInputPrompt[]]

Instead of:

contents: [string, string[], TExtraInputPrompt[] | null] // null or undefined

I tried creating another test case PR to replicate it: #50

Could it be a multi-field tuple related issue? I got the test case to pass by changing tupleEncoding, but it's likely not the correct way to resolve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions