Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Multi-line compiler messages truncated by MSBuild #1473

Open
swernli opened this issue Jun 21, 2022 · 0 comments
Open

Multi-line compiler messages truncated by MSBuild #1473

swernli opened this issue Jun 21, 2022 · 0 comments
Labels
bug Something isn't working tracking

Comments

@swernli
Copy link
Contributor

swernli commented Jun 21, 2022

Some errors reported by the compiler can be multiline, but everything after the first newline gets trimmed by dotnet build in the compilation output. For example, the following Q# produces three type errors on the return line:

    operation TypeError() : (Result, Result, Result) {
        let x = ((One, Zero), "hello", 42);
        return x;
    }

These each have multiple lines when viewed as a tooltip in VSCode:

Couldn't match type (Result, Result) with type Result.
Expected: (Result, Result, Result)
  Actual: ((Result, Result), String, Int) ...(QS0001)
Couldn't match type String with type Result.
Expected: (Result, Result, Result)
  Actual: ((Result, Result), String, Int) ...(QS0001)
Couldn't match type Int with type Result.
Expected: (Result, Result, Result)
  Actual: ((Result, Result), String, Int) ...(QS0001)

But when the file is compiled only the first line of each error is reported:

...(13,18): error QS0001: Expected type Result, but actual type was (Result, Result, Result). 
...
...(13,16): error QS0001: Couldn't match type String with type Result. 
...     
...(13,16): error QS0001: Couldn't match type Int with type Result.

This means cmdline compilation is loosing details that could be helpful to the user.

@swernli swernli added bug Something isn't working needs triage An initial review by a maintainer is needed tracking labels Jun 21, 2022
@bettinaheim bettinaheim removed the needs triage An initial review by a maintainer is needed label Jun 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working tracking
Projects
None yet
Development

No branches or pull requests

2 participants