Skip to content

CompiledSignature

module CompiledSignature
AssemblyXantham.Generator

Signatures as .NET overload resolution compares them: abbreviations expanded at every depth and a signature's own type variables renamed by position.

Functions and values

ambiguousCall (abbrevs: Map<string,FsTypeRef>) (FsTypeParam list, FsParam list) (FsTypeParam list, FsParam list) : bool

Whether one signature's parameters are a typed prefix of the other's and some call selects either, which F# reports as FS0041: the call supplies an argument count both accept and leaves an optional parameter unsupplied in both or in neither, and likewise a ParamArray. (x) beside (x, ?y) resolves to (x) at every call; (x, ?y) beside (x, ?y, ?z) is ambiguous at the call supplying x alone, and (x, ?y) beside (x, y) at the call supplying both. Generic arity separates otherwise equal signatures.

compiled (abbrevs: Map<string,FsTypeRef>) (typeParameters: FsTypeParam list) (reference: FsTypeRef) : FsTypeRef

The reference as the compiler sees it inside a signature declaring typeParameters: the signature's own type variables are renamed by position, then abbreviations expand.

normalize (abbrevs: Map<string,FsTypeRef>) (visited: Set<string>) (reference: FsTypeRef) : FsTypeRef

The reference with every abbreviation expanded, at any depth. A cycle stops at its first repeated name.

overlaps (abbrevs: Map<string,FsTypeRef>) (FsTypeParam list, FsParam list) (FsTypeParam list, FsParam list) : bool

Whether a call can select either signature: one compiled parameter signature, or an ambiguousCall.

parameterKey (abbrevs: Map<string,FsTypeRef>) (typeParameters: FsTypeParam list) (parameters: FsParam list) : int * (bool * FsTypeRef) list

The compiled parameter signature: generic arity, optionality and type per position. ParamArray is call-site metadata and contributes nothing to overload identity.