Skip to content

Can't add doc comment for a type definition using and #6844

Description

@DZakh

For the code:

type pathItem = {}
/**
Describes a single API operation on a path.
 */
and operation =  {}

I get

Did you forget to attach `res.doc` to an item?
  Standalone attributes start with `@@` like: `@@res.doc`

https://rescript-lang.org/try?version=v11.1.2&code=FAFwngDgpgBBCGIAWBJEUC2MC8MDeAvsAPQBUpwAIlAM4DGATgJYBGtM8MNTAdgOYAbWAEEACihgB7aA0RNJPKYs4JkAOmAxSxYPB4ATKTLkKcMfASA

Putting it in another place returns different, but still weird error:

type pathItem = {}
and /**
Describes a single API operation on a path.
 */ operation =  {}
I'm expecting a lowercase name like `user or `age`

https://rescript-lang.org/try?version=v11.1.2&code=FAFwngDgpgBBCGIAWBJEUC2MC8MDeAvsMPAHYAmMA9AFQ3AAiUAzgMYBOAlgEYszwxmnUgHMANrACCABRQwA9tHaJO80gvUCEyAHTAYNKgqUq1OGPgJA

And a third error for another case:

type pathItem = {}
and operation = /**
Describes a single API operation on a path.
*/ {a: string}
 An inline record type declaration is only allowed in a variant constructor's declaration

https://rescript-lang.org/try?version=v11.1.2&code=C4TwDgpgBGCGwAsCSwIFsoF4oG8C+AULAHYAmUA9pAE7wCWFxWUA9AFRsEAiEAzgMbU6AIz5RYUXnWIBzADbQAggAUklGvUaUmEuIgB0BKGxa5YALknAhswkA

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions