
Almost a feature :) "Go on punk.... click me...."
:smile:
While I see the problem and it is a bug, I'm going to close this as "won't fix", at least until we find some more major ramification of the problem.
@dsyme it's a trivial bug, but it's a bug
:(
Instead of closing it, why not just label it as minor and up-for-grabs?
OK, reopening
Perhaps related, and making this but a trifle more relevant: if the computation expression name is function / constructor call, it is not colored as a computation expression name at all.
Example code to repro (VS2015, F# 4.0):
type MaybeBuilder1() =
member __.Bind(x, f) = match x with None -> None | Some a -> f a
member __.Return(x) = Some x
type MaybeBuilder2(rt) =
member __.Bind(x, f) = match x with None -> rt, None | Some a -> rt, f (a)
member __.Return(x) = rt, Some x
[<AutoOpen>]
module TBuilders =
let may = MaybeBuilder1
let may2 = MaybeBuilder2
let may2a = new MaybeBuilder2(42)
let test1 =
may() {
return 1
}
let test2 =
may2(42) {
return "test"
}
let test2a =
may2a {
return "test"
}

An addition to this: F# files do not "previewable" in VS 2017, so we cannot even verify if this bug is still reproducible (however, as we use Roslyn API for syntax highlighting in VS 2017, it's likely to be fixed).
This bug has never reproduced in VS 2017.
Most helpful comment
Fixed in https://github.com/Microsoft/visualfsharp/pull/2417