-
Notifications
You must be signed in to change notification settings - Fork 851
Open
Open
Copy link
Labels
Milestone
Description
Repro steps
open System.Runtime.CompilerServices
// -------------------------
// "View engine" bits
// -------------------------
type HtmlContainer() = class end
type HtmlContainerFun = HtmlContainer -> unit
[<Extension>]
type HtmlContainerExtensions =
[<Extension>]
static member inline Run(this: #HtmlContainer, [<InlineIfLambda>] runExpr: HtmlContainerFun) =
runExpr this
this
// -------------------------
// "AsyncSeq-like" CE builder bits
// -------------------------
type AsyncSeq<'T> = private AsyncSeq of 'T list
type AsyncSeqBuilder() =
member _.Yield(x: 'T) : AsyncSeq<'T> =
AsyncSeq [x]
let asyncSeq = AsyncSeqBuilder()
let xs : AsyncSeq<int> =
asyncSeq {
yield 1
}From Don's comment:
This could be onsidered an F# compiler bug but we'd have to check the spec - the compiler commits to using this Run before it knows the constraint check #HtmlContainer will fail.
Expected behavior
Code compiles just fine - Run method from HtmlContainerExtensions isn't used for asyncSeq
Actual behavior
error FS0193: The type 'AsyncSeqBuilder' is not compatible with the type 'HtmlContainer'
Known workarounds
No workarounds are known
Related information
Related issues:
Lanayx/Oxpecker#93
fsprojects/FSharp.Control.AsyncSeq#239
.NET SDK 10.0.102
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
New