public BoundDefaultExpression(SyntaxNode syntax, TypeSymbol type, bool hasErrors = false) : this(syntax, type.GetDefaultValue(), type, hasErrors) { }
private void EmitDefaultValue(TypeSymbol type, bool used, SyntaxNode syntaxNode) { if (used) { // default type parameter values must be emitted as 'initobj' regardless of constraints if (!type.IsTypeParameter()) { var constantValue = type.GetDefaultValue(); if (constantValue != null) { _builder.EmitConstantValue(constantValue); return; } } EmitInitObj(type, true, syntaxNode); } }
public BoundDefaultOperator(CSharpSyntaxNode syntax, TypeSymbol type) : this(syntax, type.GetDefaultValue(), type) { }
private void EmitDefaultValue(TypeSymbol type, bool used, CSharpSyntaxNode syntaxNode) { if (used) { var constantValue = type.GetDefaultValue(); if (constantValue != null) { _builder.EmitConstantValue(constantValue); } else { EmitInitObj(type, true, syntaxNode); } } }
public BoundDefaultOperator(CSharpSyntaxNode syntax, TypeSymbol type) : this(syntax, type.GetDefaultValue(), EraseNullabilityPreservation(type)) { }