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

Allow is and extends of a template parameter #675

Closed
wants to merge 4 commits into from

Conversation

bterlson
Copy link
Member

No description provided.

@azure-pipelines
Copy link

You can try these changes at https://cadlplayground.z22.web.core.windows.net/prs/675/

@nguerrera
Copy link
Contributor

This has the problem still where the error occurs on the template rather than the instantiation:

https://cadlplayground.z22.web.core.windows.net/prs/675/?c=bW9kZWwgVGVtcGxhdGU8VD4gZXh0ZW5kcyBUIHt9DQoNCsgic3Qgew0KICBwcm9wOsoyIsQaIj47DQp9

On #423, we said this would be needed for this feature.

@nguerrera
Copy link
Contributor

Mind you this is pre-existing for other cases:

https://cadlplayground.z22.web.core.windows.net/?c=bW9kZWwgVGVtcGxhdGU8VD4gew0KICBwcm9wOiBUICYge30NCn0NCg0KxipNzSDINyJ0ZXN0Ij4NCn0%3D

And another bug, that error doesn't give a good location at all.

I'm not sure if we need to gate this change on it, but it adds more pressure to get this right. The experience is really confusing when we don't squiggle the root cause.

@nguerrera
Copy link
Contributor

Filed #676 for "another bug"

@bterlson
Copy link
Member Author

I agree the error experience is poor but I don't think this needs to be gated - this pattern will likely be rarely used and but is still quite useful in some cases so I'd rather unblock writing that cadl and fix up the error experience as part of the error elaboration work which, as you say, will improve many other cases besides.

But, I can also wait for error elaboration to do this if anyone feels strongly.

@nguerrera
Copy link
Contributor

My only real concern is if we're tracking the elaboration work somewhere. I was sort of mentally mapping it to this feature as that's where I remembered discussing it. So I would say this can go in and we should have a distinct elaboration work item.

@markcowl
Copy link
Contributor

@bterlson What do we need to do to get this incorporated or closed?

@bterlson
Copy link
Member Author

bterlson commented Dec 6, 2022

I seem to recall that I became less convicned this was a good idea. Let me dig out the rationale as I did a bad job surfacing that info here.

@nguerrera
Copy link
Contributor

Elaboration work item: #1321

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

Successfully merging this pull request may close these issues.

4 participants