Type Example
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)
Output Being Generated
contents: [string, string[], TExtraInputPrompt[]]
Expected Output
contents: [string, string[], TExtraInputPrompt[] | null]
or
contents: [string, string[], TExtraInputPrompt[] | undefined]
Testing
I tried to write a new test case for this to help replicate the issue (#48):
1) Generic instances TestMaybeTuple should handle Maybe in tuples correctly
expected: [TSTypeAlternatives {
typeName = "IConWithMaybe",
typeGenericVariables = [],
alternativeTypes = ["[string, number[], string[]]"],
typeDoc = Nothing
}, TSTypeAlternatives {
typeName = "ISimpleConstructor",
typeGenericVariables = [],
alternativeTypes = ["string"],
typeDoc = Nothing
}, TSInterfaceDeclaration {
interfaceName = "IConWithMaybe",
interfaceGenericVariables = [],
interfaceMembers = [TSField {
@@ 4 lines omitted @@
}, TSField {
fieldOptional = False,
fieldName = "contents",
fieldType = "IConWithMaybe",
fieldDoc = Nothing
}],
interfaceDoc = Nothing
@@ 21 lines omitted @@
but got: [TSInterfaceDeclaration {
interfaceName = "IConWithMaybe",
interfaceGenericVariables = [],
interfaceMembers = [TSField {
@@ 4 lines omitted @@
}, TSField {
fieldOptional = False,
fieldName = "contents",
fieldType = "[string, number[], string[]]",
fieldDoc = Nothing
}],
interfaceDoc = Nothing
@@ 21 lines omitted @@
Type Example
Output Being Generated
Expected Output
or
Testing
I tried to write a new test case for this to help replicate the issue (#48):