Skip to content

[Bug]: @example transitive type check failure #5850

@allenjzhang

Description

@allenjzhang

Describe the bug

#5835

Looks like transitive type check failed to check against source type

@example(#{
  field: "foo",
})
model X {
  field: string;
}

@example(#{
  ref: "foo",                             <-- Failed to recognize X.field is of type string.
})
model Y {
  ref: X.field;
}

Reproduction

https://typespec.io/playground/?c=QGV4YW1wbGUoI3sKICBmaWVsZDogImZvbyIsCn0pCm1vZGVsIFggyx1zdHJpbmc7Cn0KCs49cmVm0jtZxTvFG1guxULEOg%3D%3D&e=%40typespec%2Fopenapi3&options=%7B%7D

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions