dotnet / dotnet/fsharp

Strange error messages - Units-of-measure

Open
#1,361 0 comments 0 reactions 0 assignees View on GitHub
Feature Improvement
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

Unhelpful/strange error message on incorrect option type icon placement.
#### Repro steps

`let f (on:option int) = Option.bind (fun n -> Some(n+1) ) on`
#### Expected behavior

An error message like `option type expects the format of option<'a> or 'a option`
#### Actual behavior

Generates the error `error FS0706: Units-of-measure cannot be used as prefix arguments to a type. Rewrite as postfix arguments in angle brackets.`

edit: fixed error in code (ty @cloudRoutine)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.