Skip to content

Using TailCall diagnostic attribute on non tailcall rec function does not generate warning on Visual Studio Error List pane #16467

@eriawan

Description

@eriawan

Please provide a succinct description of the issue.

Repro steps

Steps required to reproduce the problem:

  1. Use this code on any .fs file and compile it:
[<TailCall>]
let rec private sumListTailRecHelperWithTailcallDiagnostic accumulator xs =
        match xs with
        | []    -> accumulator
        | y::ys -> sumListTailRecHelper (accumulator+y) ys

/// This example computes the sum of a list of integers using recursion.
[<TailCall>]
let rec sumList xs =
    match xs with
    | []    -> 0
    | y::ys -> y + sumList ys
  1. Watch the output pane for Build and the Error List pane.

Is this intentional? As usually compiler warning is also always shown on Error List pane.

Expected behavior

Both Error List pane and the Output pane of Build should show the warning of using TailCall attribute on non tailcall rec function.

Actual behavior

Only Built output show compiler warning, whereas the Error List do not show the warning:

image

Known workarounds

As far as I know, none. I have tried to clear the compiler output folder, and compile again using clean rebuild.

Related information

Provide any related information (optional):

  • Operating system: Windows 11 23H2
  • .NET Runtime kind (.NET Core, .NET Framework, Mono): .NET 8.0
  • Editing Tools (e.g. Visual Studio Version, Visual Studio): VS 2022 v17.8.1 (also reproducible on 17.8.3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions