Compilation.CreateBuiltinOperator Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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 |
CreateBuiltinOperator(String, ITypeSymbol, ITypeSymbol) |
Creates an IMethodSymbol whose MethodKind is BuiltinOperator for a unary operator. Built-in operators are commonly created for
symbols like |
- 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
- 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
.NET feedback
.NET is an open source project. Select a link to provide feedback: