Skip to content

🐛 BUG: export type Props with generic #1110

@remchoi

Description

@remchoi

What version of @astrojs/compiler are you using?

2.2.1

What package manager are you using?

pnpm

What operating system are you using?

Linux

Describe the Bug

Tested on the latest version.

type Generic<T> = T & {foo:string};
export type Props = Generic<{baz: string}>;

it's working okay if Props type is not exported, otherwise compiler throws Expected ">" but found "const"\n.

wrapping in exported value in brackets fixes it.

export type Props = (Generic<{baz: string}>);

Link to Minimal Reproducible Example

https://astro.new

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageIssue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions