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

Multi-line compiler messages truncated by MSBuild #1473

Open
@swernli

Description

@swernli

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtracking

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions