sdk
sdk copied to clipboard
Record type as typedef return type
@jensjoha
typedef ({int j}) R2();
I think this should be parsed as a function type alias with a record type as the return type. But it is parsed as:
[(18..19): A function body must be provided., (22..22): A function body must be provided.]
CompilationUnit
declarations
FunctionDeclaration
name: typedef
functionExpression: FunctionExpression
parameters: FormalParameterList
leftParenthesis: (
leftDelimiter: {
parameter: DefaultFormalParameter
parameter: SimpleFormalParameter
type: NamedType
name: SimpleIdentifier
token: int
name: j
rightDelimiter: }
rightParenthesis: )
body: BlockFunctionBody
block: Block
leftBracket: { <synthetic>
rightBracket: } <synthetic>
FunctionDeclaration
name: R2
functionExpression: FunctionExpression
parameters: FormalParameterList
leftParenthesis: (
rightParenthesis: )
body: EmptyFunctionBody
semicolon: ;
See co19/LanguageFeatures/Records/record_type_annotations_A04_t06
Also co19/LanguageFeatures/Records/record_type_annotations_A01_t04