microsoft / microsoft/typespec

Accessing member of instantiated template does not work. Doing so through an alias does work.

Open
#1,163 9 comments 0 reactions 1 assignee Claimed by @bterlson View on GitHub
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
1d 23h
Merged PRs (30d)
104

Description

```cadl
model M {
x: string;
...T;
}

alias MEmpty = M<{}>;

model D {
d1: MEmpty.x; // <-- works!
d2: M<{}>.x; // <-- error token-expected ';' expected. (squiggly under '.')
}
```

[playground](https://cadlplayground.z22.web.core.windows.net/?c=bW9kZWwgTTxUPiB7CiAgeDogc3RyaW5nOwogIC4uLlQ7Cn0KCmFsaWFzIE1FbXB0eSA9IE08e30%2BOwoKxjxExTlkMTrHIS54xDxkMjrGKMQPfQ%3D%3D)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.