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

Diagnostics stacktrace #1321

Open
timotheeguerin opened this issue Nov 28, 2022 · 3 comments
Open

Diagnostics stacktrace #1321

timotheeguerin opened this issue Nov 28, 2022 · 3 comments
Milestone

Comments

@timotheeguerin
Copy link
Member

timotheeguerin commented Nov 28, 2022

We should find a way to show the diagnostics happening in template instance at a better location

There is a lot of validation that cannot be represented right now as template constraints and even if we supported most there is probably still some things that are out of control.

model Foo<T> {
  @format("uri")
  foo: T;
          ^ error shows up here saying `int32`is not valid for `@format`
}

op test(): Foo<int32>;

https://cadlplayground.z22.web.core.windows.net/?c=bW9kZWwgRm9vPFQ%2BIHsKICBAZm9ybWF0KCJ1cmkiKQogIGZvbzogVDsKfQoKb3AgdGVzdCgpOsUyaW50MzI%2BOw%3D%3D

Some options could be tracing back to out of the template instance to where the template was instantiated.

@timotheeguerin timotheeguerin added the design:needed A design request has been raised that needs a proposal label Nov 28, 2022
@ghost ghost added the Needs Triage label Nov 28, 2022
@nguerrera
Copy link
Contributor

See also #423 (comment) for example from other compiler.

@markcowl
Copy link
Contributor

markcowl commented Dec 5, 2022

@timotheeguerin Add implementation sketch and estimate

@markcowl
Copy link
Contributor

markcowl commented Dec 5, 2022

pri: 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants