-
Notifications
You must be signed in to change notification settings - Fork 830
Closed
Labels
Feature RequestImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.
Description
Constructor constraints with more than 0 arguments and member constraints with or clauses containing at least one concrete type can be generated by F# programs, but passing the --sig option to the F# compiler results in a malformed signature file because these constructs aren't part of the grammar for signatures.
For example, given this file:
let inline f() = (^t : (new : int -> ^t) 5)
let inline g t u = ((^t or ^u) : (static member (^*^) : ^t * ^u -> ^v)(t, u)) // ok
let inline h u = g 1 u // static-typars portion of inferred constraint is (int or ^u)--sig results in a signature file like this:
//error FS0010: Unexpected symbol '(' in member signature
val inline f : unit -> ^t when ^t : (( .ctor ) : int -> ^t)
val inline g :
t: ^t -> u: ^u -> ^v
when ( ^t or ^u) : (static member ( ^*^ ) : ^t * ^u -> ^v)
// error FS0010: Unexpected identifier in type constraint. Expected infix operator, quote symbol or other token.
val inline h :
u: ^a -> ^b when (int or ^a) : (static member ( ^*^ ) : int * ^a -> ^b)but this isn't a valid signature file because the definitions of f and h have invalid syntax.
Metadata
Metadata
Assignees
Labels
Feature RequestImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.