Skip to content

Update error span for call argument type mismatch#3287

Draft
amcasey wants to merge 10 commits into
mainfrom
amcasey/ErrorSpan
Draft

Update error span for call argument type mismatch#3287
amcasey wants to merge 10 commits into
mainfrom
amcasey/ErrorSpan

Conversation

@amcasey

@amcasey amcasey commented Jun 3, 2026

Copy link
Copy Markdown
Member

It should be just the argument with the problem. Hopefully, this will make it easy to add quick fixes to some scenarios.

It should be just the argument with the problem.  Hopefully, this will make it easy to add quick fixes to some scenarios.
@amcasey

amcasey commented Jun 3, 2026

Copy link
Copy Markdown
Member Author

The approach seems plausible, but I've only partially reviewed it. Posting to get feedback on the approach.

expected: param.clone(),
actual: arg.clone(),
span,
span: *arg_span,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing that might help me read this is if you renamed the span argument to this function (can't highlight the line since it's outside the diff) to reflect whose span it is. Now that we have two spans getting passed around, it'd be good to disambiguate.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I genuinely can't tell what that span is. I'm pretty sure it's the span of the whole call. I think it effectively means "here's the span where you should report an error if you find one".

// However, we do know that the type of Arg must be Eq to the type of Param, so we
// add that to the constraints.
(Self::Given(arg), _) => App {
(Self::Given(arg, arg_span), _) => App {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think a Given is the same as a Hole but the comment and implementation seem to be the same as above?

"},
"Microsoft.Quantum.Convert.IntAsDouble(false)",
&expect![[r#"
&expect![[r##"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the baseline update might have done this because I didn't and it wasn't in the list of files copilot had touched.

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.

2 participants