Skip to content

Improve error message for: "The type 'int' does not support the operator 'DivideByInt'" #83

@KevinRansom

Description

@KevinRansom

This was originally opened on CodePlex by latkin

Today this happened to me:

Microsoft (R) F# Interactive version 12.0.20809.1
Copyright (c) Microsoft Corporation. All Rights Reserved.

For help type #help;;

> [|2;4;6;8|] |> Seq.average;; 

> [|2;4;6;8|] |> Seq.average;;
  ---------------^^^^^^^^^^^

stdin(1,16): error FS0001: The type 'int' does not support the operator 'DivideByInt'

I was surprised to discover that int does not support DivideByInt. Since many times I have successfully divided ints by other ints.

I think we should either:

  • Make all numeric types that are divisible by int support DivideByInt
    or
  • improve the error message so that it’s not quite so head scratching.

comments
dsyme wrote Jun 3, 2014 at 6:02 AM
+1 for a better error message

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Diagnosticsmistakes and possible improvements to diagnosticsFeature ImprovementImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions