Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Models assigned where constraint is mix of "value unknown" and "unknown" throws deprecation warning #3576

Closed
4 tasks done
chrisradek opened this issue Jun 13, 2024 · 0 comments · Fixed by #3824
Closed
4 tasks done
Assignees
Labels
bug Something isn't working compiler:core Issues for @typespec/compiler triaged:core
Milestone

Comments

@chrisradek
Copy link
Member

Describe the bug

With the introduction of the new values syntax, parameters are treated as values over types if a constraint supports both.
This was done intentionally for scalar literal values.

However, this change also causes model expressions and tuples to show a deprecation warning when passed somewhere (model template parameter/decorator) where they can be interpreted as either a Type or a Value. TypeSpec should still allow using tuples/model expressions as types when constraints are mixed.

Reproduction

playground link

Checklist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler:core Issues for @typespec/compiler triaged:core
Projects
None yet
3 participants