2 implementations of ExplicitDefaultValue
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\ParameterSymbol.cs (1)
79object IParameterSymbol.ExplicitDefaultValue => _underlying.ExplicitDefaultValue;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\ParameterSymbol.vb (1)
366Private ReadOnly Property IParameterSymbol_DefaultValue As Object Implements IParameterSymbol.ExplicitDefaultValue
64 references to ExplicitDefaultValue
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Specs\Members\ParameterSpec.cs (1)
20DefaultValueExpr = CSharpSyntaxUtilities.FormatLiteral(parameter.ExplicitDefaultValue, TypeRef);
Microsoft.AspNetCore.App.Analyzers (1)
src\Shared\RoslynUtils\SymbolExtensions.cs (1)
180: InnerGetDefaultValueString(parameterSymbol.ExplicitDefaultValue);
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
src\Shared\RoslynUtils\SymbolExtensions.cs (1)
180: InnerGetDefaultValueString(parameterSymbol.ExplicitDefaultValue);
Microsoft.CodeAnalysis (1)
Symbols\IParameterSymbol.cs (1)
89/// can be obtained with the <see cref="ExplicitDefaultValue"/> property.
Microsoft.CodeAnalysis.CodeStyle (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (6)
1175if (!object.Equals(parameter2.ExplicitDefaultValue, parameter1.ExplicitDefaultValue)) 1180if (object.Equals(parameter1.ExplicitDefaultValue, 0.0)) 1182RoslynDebug.Assert(object.Equals(parameter2.ExplicitDefaultValue, 0.0)); 1184var isParam1DefaultValueNegativeZero = double.IsNegativeInfinity(1.0 / (double)parameter1.ExplicitDefaultValue); 1185var isParam2DefaultValueNegativeZero = double.IsNegativeInfinity(1.0 / (double)parameter2.ExplicitDefaultValue);
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
313? parameter.ExplicitDefaultValue
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IParameterSymbolExtensions.cs (2)
34parameter.HasExplicitDefaultValue ? parameter.ExplicitDefaultValue : null); 49parameter.HasExplicitDefaultValue ? parameter.ExplicitDefaultValue : null);
Microsoft.CodeAnalysis.CSharp (2)
SymbolDisplay\SymbolDisplayVisitor.Members.cs (2)
804CanAddConstant(symbol.Type, symbol.ExplicitDefaultValue); 870AddConstantValue(symbol.Type, symbol.ExplicitDefaultValue);
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
1474!Equals(originalParameter.ExplicitDefaultValue, rewrittenParameter.ExplicitDefaultValue) &&
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
316=> EqualsValueClause(ExpressionGenerator.GenerateExpression(generator, parameter.Type, parameter.ExplicitDefaultValue, canUseFieldReference: true));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ParameterGenerator.cs (1)
100var defaultValue = parameter.HasExplicitDefaultValue ? parameter.ExplicitDefaultValue : null;
Microsoft.CodeAnalysis.CSharp.Features (4)
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (2)
173return Equals(parameterSymbol1.ExplicitDefaultValue, parameterSymbol2.ExplicitDefaultValue);
IntroduceParameter\CSharpIntroduceParameterCodeRefactoringProvider.cs (1)
30return ExpressionGenerator.GenerateExpression(CSharpSyntaxGenerator.Instance, parameterSymbol.Type, parameterSymbol.ExplicitDefaultValue, canUseFieldReference: true);
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
316=> EqualsValueClause(ExpressionGenerator.GenerateExpression(generator, parameter.Type, parameter.ExplicitDefaultValue, canUseFieldReference: true));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (6)
Semantics\LambdaTests.cs (6)
8021Assert.Throws<InvalidOperationException>(() => lambdas[0].Symbol.Parameters[0].ExplicitDefaultValue); 8024Assert.Equal(1, lambdas[0].Symbol.Parameters[1].ExplicitDefaultValue); 8031Assert.Throws<InvalidOperationException>(() => lambdas[1].Symbol.Parameters[0].ExplicitDefaultValue); 8038Assert.Throws<InvalidOperationException>(() => lambdas[2].Symbol.Parameters[0].ExplicitDefaultValue); 8045Assert.Equal(3, lambdas[3].Symbol.Parameters[0].ExplicitDefaultValue); 8091Assert.Null(newParam.ExplicitDefaultValue);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Compilation\GetSemanticInfoTests.cs (4)
1855Assert.Equal(1, parameters[0].ExplicitDefaultValue); 1858Assert.Equal("hello", parameters[1].ExplicitDefaultValue); 1861Assert.Null(parameters[2].ExplicitDefaultValue); 1864Assert.Null(parameters[3].ExplicitDefaultValue);
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
1474!Equals(originalParameter.ExplicitDefaultValue, rewrittenParameter.ExplicitDefaultValue) &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ParameterGenerator.cs (1)
100var defaultValue = parameter.HasExplicitDefaultValue ? parameter.ExplicitDefaultValue : null;
Microsoft.CodeAnalysis.Features (1)
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (1)
523return GenerateLiteralExpression(parameterSymbol.Type, parameterSymbol.ExplicitDefaultValue);
Microsoft.CodeAnalysis.VisualBasic (2)
SymbolDisplay\SymbolDisplayVisitor.Members.vb (1)
561AddConstantValue(symbol.Type, symbol.ExplicitDefaultValue)
Symbols\ParameterSymbol.vb (1)
366Private ReadOnly Property IParameterSymbol_DefaultValue As Object Implements IParameterSymbol.ExplicitDefaultValue
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ParameterGenerator.vb (1)
97If(parameter.HasExplicitDefaultValue, parameter.ExplicitDefaultValue, Nothing),
Microsoft.CodeAnalysis.VisualBasic.Features (1)
IntroduceParameter\VisualBasicIntroduceParameterCodeRefactoringProvider.vb (1)
23Return GenerateExpression(VisualBasicSyntaxGenerator.Instance, parameterSymbol.Type, parameterSymbol.ExplicitDefaultValue, canUseFieldReference:=True)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ParameterGenerator.vb (1)
97If(parameter.HasExplicitDefaultValue, parameter.ExplicitDefaultValue, Nothing),
Microsoft.CodeAnalysis.Workspaces (13)
Editing\SyntaxGenerator.cs (1)
327symbol.HasExplicitDefaultValue ? GenerateExpression(symbol.Type, symbol.ExplicitDefaultValue, canUseFieldReference: true) : null,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (6)
1175if (!object.Equals(parameter2.ExplicitDefaultValue, parameter1.ExplicitDefaultValue)) 1180if (object.Equals(parameter1.ExplicitDefaultValue, 0.0)) 1182RoslynDebug.Assert(object.Equals(parameter2.ExplicitDefaultValue, 0.0)); 1184var isParam1DefaultValueNegativeZero = double.IsNegativeInfinity(1.0 / (double)parameter1.ExplicitDefaultValue); 1185var isParam2DefaultValueNegativeZero = double.IsNegativeInfinity(1.0 / (double)parameter2.ExplicitDefaultValue);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
313? parameter.ExplicitDefaultValue
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (2)
74p.HasExplicitDefaultValue, p.HasExplicitDefaultValue ? p.ExplicitDefaultValue : null))); 171p.HasExplicitDefaultValue, p.HasExplicitDefaultValue ? p.ExplicitDefaultValue : null), arg),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IParameterSymbolExtensions.cs (2)
34parameter.HasExplicitDefaultValue ? parameter.ExplicitDefaultValue : null); 49parameter.HasExplicitDefaultValue ? parameter.ExplicitDefaultValue : null);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IPropertySymbolExtensions.cs (1)
64p.HasExplicitDefaultValue, p.HasExplicitDefaultValue ? p.ExplicitDefaultValue : null), arg),
Microsoft.VisualStudio.LanguageServices (4)
ChangeSignature\ChangeSignatureDialogViewModel.ParameterViewModels.cs (4)
243return ParameterSymbol.ExplicitDefaultValue == null ? (ParameterSymbol.Type.IsReferenceType ? @null : @default) : 244ParameterSymbol.ExplicitDefaultValue is string ? "\"" + ParameterSymbol.ExplicitDefaultValue.ToString() + "\"" : 245ParameterSymbol.ExplicitDefaultValue.ToString();
Microsoft.VisualStudio.LanguageServices.CSharp (2)
ObjectBrowser\DescriptionBuilder.cs (2)
448if (current.ExplicitDefaultValue == null) 454AddText(current.ExplicitDefaultValue.ToString());
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
ObjectBrowser\DescriptionBuilder.vb (2)
432If current.ExplicitDefaultValue Is Nothing Then 435AddText(current.ExplicitDefaultValue.ToString())
System.Text.Json.SourceGeneration (1)
JsonSourceGenerator.Parser.cs (1)
1484DefaultValue = parameterInfo.HasExplicitDefaultValue ? parameterInfo.ExplicitDefaultValue : null,