-
Notifications
You must be signed in to change notification settings - Fork 70
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
Fuzz: Panic: 'path should be resolved'. #174
Comments
Confirmed, the panic is resolved. I'm unblocked. But the Q# code comment still changes the behavior between the commands qsc.exe t3.qs
× `i` not found in this scope
╭─[t3.qs:1:1]
1 │ //
2 │ namespace N{operation P(a:i):D{}}
· ┬
· ╰── not found
╰────
× `D` not found in this scope
╭─[t3.qs:1:1]
1 │ //
2 │ namespace N{operation P(a:i):D{}}
· ┬
· ╰── not found
╰────
× mismatched types
╭─[t3.qs:1:1]
1 │ //
2 │ namespace N{operation P(a:i):D{}}
· ─┬
· ╰── expected ?, found ()
╰────
qsc.exe - < t3.qs
× entry point not found
help: a single callable with the `@EntryPoint()` attribute must be present if no entry expression is provided Also the following bug reporting seems misleading to me:
Complains that Also the following fragment seems misleading to me in all the cases |
I think this is a separate bug with how
The error is correct, although possibly confusing. The type of
This is how Miette renders errors. It shows the position of the start of the excerpt. Since the excerpt shows the entire file, it starts at line 1, column 1. |
FYI: This is really confusing that the function/operation body (or a block starting with |
I think the confusion comes from the fact that blocks are expressions. The type of the body block is equal to the return type of the function or operation. The return value of a function or operation is the value that comes from evaluating the body block as an expression. For example: function AddOne(x : Int) : Int {
let y = x + 1;
y
} When you call |
(Fuzzer found)
The input file with contents
namespace N{operation P(a:i):D{}}
causes a panicthread 'main' panicked at 'path should be resolved', compiler\qsc_frontend\src\typeck\rules.rs:126:22
Looks like the reason is the parameter type. If the type is anything other than
Int
orDouble
orQubit
(or array of them) then there is a panic.Repro:
However! Related or not, the comment affects the panic:
Stack:
Stack trace for "t.qs" in fuzzer run (click the triangle on the left):
System information
The text was updated successfully, but these errors were encountered: