carbon-lang
carbon-lang copied to clipboard
errors during template instantiation should explain that they were produced by instantiating a template
Description of the bug:
When template instantiation fails, the error that is produced doesn't mention that instantiation was being performed, nor what the template argument values were, nor why the template was instantiated (for example, the source location at which instantiation was required). It should.
What did you do, or what's a simple way to reproduce the bug?
This can be observed by running the test explorer/testdata/template/fail_no_member.carbon, which contains this:
interface GetX {
fn DoIt[self: Self]() -> i32;
}
impl forall [template T:! type] T as GetX {
// Error appears on this line.
fn DoIt[self: Self]() -> i32 { return self.x; }
}
fn Main() -> i32 {
// It would be useful to point out this line.
return 0.(GetX.DoIt)();
}
What did you expect to happen?
Ideally the error would instead say something like:
COMPILATION ERROR: fail_no_member.carbon:17: member access into unexpected type `i32` in `self.x`
NOTE: fail_no_member.carbon:21: in instantiation of `impl T as GetX` with `T = i32` required here
What actually happened?
The current error message is:
COMPILATION ERROR: testdata/template/fail_no_member.carbon:17: member access, unexpected i32 in self.x
Any other information, logs, or outputs that you want to share?
No response
Hello, I'd like to start working on this issue.
Hey @Pixep sir, I would like to contribute to this issue.
Hi and welcome @S007sayer , @thepandeyop ! Feel free to work on the issue if you wish, good first issue are generally not assigned, see https://github.com/carbon-language/carbon-lang/blob/trunk/CONTRIBUTING.md#implement-carbons-design for some explanation. For context, note that a PR was created to close the issue.
I really feel good to work on this issue
Thankyou for giving this opportunity to me. I really feel good to work on this issue thank you very much sir
On Sun, 26 Mar 2023, 7:45 am Adrien Leravat, @.***> wrote:
Hi and welcome @S007sayer https://github.com/S007sayer , @thepandeyop https://github.com/thepandeyop ! Feel free to work on the issue if you wish, good first issue are generally not assigned, see https://github.com/carbon-language/carbon-lang/blob/trunk/CONTRIBUTING.md#implement-carbons-design for some explanation.
— Reply to this email directly, view it on GitHub https://github.com/carbon-language/carbon-lang/issues/2705#issuecomment-1483974013, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3VZM5METJLRQK333HGN7G3W56RDVANCNFSM6AAAAAAWELQ5NM . You are receiving this because you were mentioned.Message ID: @.***>
@thepandeyop Just to avoid surprises if you haven't seen (as I haven't explicitly mentioned it) @notfilippo has also started working on it (details visible on the issue).
Thanks for your quick response
On Sun, 26 Mar 2023, 9:36 am Adrien Leravat, @.***> wrote:
@thepandeyop https://github.com/thepandeyop Just to avoid surprises if you haven't seen (as I haven't explicitly mentioned it) @notfilipo has also started working on it (details visible on the issue).
— Reply to this email directly, view it on GitHub https://github.com/carbon-language/carbon-lang/issues/2705#issuecomment-1483988742, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3VZM5JJPYIW2HEL3YGW653W566DBANCNFSM6AAAAAAWELQ5NM . You are receiving this because you were mentioned.Message ID: @.***>
Thankyou
Hello
Hey anyone still working on this issue ?!
#2710 has an in-progress fix, but zygoloid had a few comments that @notfilippo would still need to address. I think it's close to a merge-ready state, judging by the last round of comments.
@Pixep sir please assign me this task I want to work on this error
@shankkyy Sorry to repeat myself. You can feel free to work on this, but we don't assign issues to new contributors because some people have different time constraints. We want new contributors to feel welcome to pick the issue up when it may not be making progress. (as noted here)
@jonmeow I totally understand and thanks to permit me to work on this issue
Hello sir I would like to work on this issue
To keep this issue uncluttered, I've gone through and hidden a bunch of requests to be assigned this issue, and similar off-topic comments. To reiterate what @jonmeow and @Pixep said: we do not assign issues to new contributors, but you're welcome to work on an issue even if it hasn't been assigned to you. If you're concerned that you might be duplicating someone else's work, feel free to ask on our Discord server.
Hi i want to work on this issue
Removing "good first issue" here since we're talking about archiving the explorer.
Closing explorer-specific issues as not-planned for now due to our decision to prioritize working on the toolchain over other implementation work in the near term: https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p3532.md