Partager via


Compilation.CreateBuiltinOperator Method

Definition

Overloads

CreateBuiltinOperator(String, ITypeSymbol, ITypeSymbol, ITypeSymbol)

Creates an IMethodSymbol whose MethodKind is BuiltinOperator for a binary operator. Built-in operators are commonly created for symbols like bool int.operator ==(int v1, int v2) which the language implicitly supports, even if such a symbol is not explicitly defined for that type in either source or metadata.

CreateBuiltinOperator(String, ITypeSymbol, ITypeSymbol)

Creates an IMethodSymbol whose MethodKind is BuiltinOperator for a unary operator. Built-in operators are commonly created for symbols like bool int.operator -(int value) which the language implicitly supports, even if such a symbol is not explicitly defined for that type in either source or metadata.

CreateBuiltinOperator(String, ITypeSymbol, ITypeSymbol, ITypeSymbol)

Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs

Creates an IMethodSymbol whose MethodKind is BuiltinOperator for a binary operator. Built-in operators are commonly created for symbols like bool int.operator ==(int v1, int v2) which the language implicitly supports, even if such a symbol is not explicitly defined for that type in either source or metadata.

public Microsoft.CodeAnalysis.IMethodSymbol CreateBuiltinOperator (string name, Microsoft.CodeAnalysis.ITypeSymbol returnType, Microsoft.CodeAnalysis.ITypeSymbol leftType, Microsoft.CodeAnalysis.ITypeSymbol rightType);
member this.CreateBuiltinOperator : string * Microsoft.CodeAnalysis.ITypeSymbol * Microsoft.CodeAnalysis.ITypeSymbol * Microsoft.CodeAnalysis.ITypeSymbol -> Microsoft.CodeAnalysis.IMethodSymbol
Public Function CreateBuiltinOperator (name As String, returnType As ITypeSymbol, leftType As ITypeSymbol, rightType As ITypeSymbol) As IMethodSymbol

Parameters

name
String

The binary operator name. Should be one of the names from WellKnownMemberNames.

returnType
ITypeSymbol

The return type of the binary operator.

leftType
ITypeSymbol

The type of the left operand of the binary operator.

rightType
ITypeSymbol

The type of the right operand of the binary operator.

Returns

Applies to

CreateBuiltinOperator(String, ITypeSymbol, ITypeSymbol)

Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs

Creates an IMethodSymbol whose MethodKind is BuiltinOperator for a unary operator. Built-in operators are commonly created for symbols like bool int.operator -(int value) which the language implicitly supports, even if such a symbol is not explicitly defined for that type in either source or metadata.

public Microsoft.CodeAnalysis.IMethodSymbol CreateBuiltinOperator (string name, Microsoft.CodeAnalysis.ITypeSymbol returnType, Microsoft.CodeAnalysis.ITypeSymbol operandType);
member this.CreateBuiltinOperator : string * Microsoft.CodeAnalysis.ITypeSymbol * Microsoft.CodeAnalysis.ITypeSymbol -> Microsoft.CodeAnalysis.IMethodSymbol
Public Function CreateBuiltinOperator (name As String, returnType As ITypeSymbol, operandType As ITypeSymbol) As IMethodSymbol

Parameters

name
String

The unary operator name. Should be one of the names from WellKnownMemberNames.

returnType
ITypeSymbol

The return type of the unary operator.

operandType
ITypeSymbol

The type the operator applies to.

Returns

Applies to