2 implementations of HasExplicitDefaultValue
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\ParameterSymbol.cs (1)
77bool IParameterSymbol.HasExplicitDefaultValue => _underlying.HasExplicitDefaultValue;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\ParameterSymbol.vb (1)
152Public MustOverride ReadOnly Property HasExplicitDefaultValue As Boolean Implements IParameterSymbol.HasExplicitDefaultValue
74 references to HasExplicitDefaultValue
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Specs\Members\ParameterSpec.cs (1)
18if (parameter.HasExplicitDefaultValue)
Microsoft.AspNetCore.App.Analyzers (2)
src\Shared\RoslynUtils\SymbolExtensions.cs (2)
168} || parameterSymbol.HasExplicitDefaultValue; 178return !parameterSymbol.HasExplicitDefaultValue
Microsoft.AspNetCore.Http.RequestDelegateGenerator (4)
src\Shared\RoslynUtils\SymbolExtensions.cs (2)
168} || parameterSymbol.HasExplicitDefaultValue; 178return !parameterSymbol.HasExplicitDefaultValue
StaticRouteHandlerModel\EndpointParameter.cs (2)
25HasDefaultValue = parameter.HasExplicitDefaultValue; 35HasDefaultValue = parameter?.HasExplicitDefaultValue ?? false;
Microsoft.CodeAnalysis.CodeStyle (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (5)
1170Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values"); 1171Debug.Assert(parameter1.HasExplicitDefaultValue == parameter2.HasExplicitDefaultValue); 1173if (parameter1.HasExplicitDefaultValue && parameter2.HasExplicitDefaultValue)
Microsoft.CodeAnalysis.CodeStyle.Fixes (5)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (1)
227if (parameter.HasExplicitDefaultValue ||
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
308hasDefaultValue ?? parameter.HasExplicitDefaultValue, 311: parameter.HasExplicitDefaultValue
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IParameterSymbolExtensions.cs (2)
33parameter.HasExplicitDefaultValue, 34parameter.HasExplicitDefaultValue ? parameter.ExplicitDefaultValue : null);
Microsoft.CodeAnalysis.CSharp (1)
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
795symbol.HasExplicitDefaultValue &&
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
1434if (originalParameter.HasExplicitDefaultValue && 1435rewrittenParameter.HasExplicitDefaultValue &&
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
260if (delegateParameter?.HasExplicitDefaultValue == true)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ParameterGenerator.cs (2)
104if (parameter.HasExplicitDefaultValue || seenOptional) 106var defaultValue = parameter.HasExplicitDefaultValue ? parameter.ExplicitDefaultValue : null;
Microsoft.CodeAnalysis.CSharp.Features (4)
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (3)
169if (parameterSymbol1.HasExplicitDefaultValue != parameterSymbol2.HasExplicitDefaultValue) 172if (parameterSymbol1.HasExplicitDefaultValue)
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
260if (delegateParameter?.HasExplicitDefaultValue == true)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (6)
Semantics\LambdaTests.cs (6)
8020Assert.False(lambdas[0].Symbol.Parameters[0].HasExplicitDefaultValue); 8023Assert.True(lambdas[0].Symbol.Parameters[1].HasExplicitDefaultValue); 8030Assert.False(lambdas[2].Symbol.Parameters[0].HasExplicitDefaultValue); 8037Assert.False(lambdas[2].Symbol.Parameters[0].HasExplicitDefaultValue); 8044Assert.True(lambdas[3].Symbol.Parameters[0].HasExplicitDefaultValue); 8090Assert.True(newParam.HasExplicitDefaultValue);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Compilation\GetSemanticInfoTests.cs (4)
1854Assert.True(parameters[0].HasExplicitDefaultValue); 1857Assert.True(parameters[1].HasExplicitDefaultValue); 1860Assert.True(parameters[2].HasExplicitDefaultValue); 1863Assert.True(parameters[3].HasExplicitDefaultValue);
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
1434if (originalParameter.HasExplicitDefaultValue && 1435rewrittenParameter.HasExplicitDefaultValue &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ParameterGenerator.cs (2)
104if (parameter.HasExplicitDefaultValue || seenOptional) 106var defaultValue = parameter.HasExplicitDefaultValue ? parameter.ExplicitDefaultValue : null;
Microsoft.CodeAnalysis.Features (3)
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (1)
521&& parameterSymbol.HasExplicitDefaultValue)
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
603=> !parameter.HasExplicitDefaultValue &&
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (1)
227if (parameter.HasExplicitDefaultValue ||
Microsoft.CodeAnalysis.VisualBasic (2)
SymbolDisplay\SymbolDisplayVisitor.Members.vb (1)
556If Format.ParameterOptions.IncludesOption(SymbolDisplayParameterOptions.IncludeDefaultValue) AndAlso symbol.HasExplicitDefaultValue Then
Symbols\ParameterSymbol.vb (1)
152Public MustOverride ReadOnly Property HasExplicitDefaultValue As Boolean Implements IParameterSymbol.HasExplicitDefaultValue
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ParameterGenerator.vb (2)
92If parameter.HasExplicitDefaultValue OrElse parameter.IsOptional OrElse seenOptional Then 97If(parameter.HasExplicitDefaultValue, parameter.ExplicitDefaultValue, Nothing),
Microsoft.CodeAnalysis.VisualBasic.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ParameterGenerator.vb (2)
92If parameter.HasExplicitDefaultValue OrElse parameter.IsOptional OrElse seenOptional Then 97If(parameter.HasExplicitDefaultValue, parameter.ExplicitDefaultValue, Nothing),
Microsoft.CodeAnalysis.Workspaces (18)
Editing\SyntaxGenerator.cs (1)
327symbol.HasExplicitDefaultValue ? GenerateExpression(symbol.Type, symbol.ExplicitDefaultValue, canUseFieldReference: true) : null,
Shared\Extensions\IParameterSymbolExtensions.cs (2)
24parameter.HasExplicitDefaultValue, 25parameter.HasExplicitDefaultValue ? parameter.ExplicitDefaultValue : null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (5)
1170Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values"); 1171Debug.Assert(parameter1.HasExplicitDefaultValue == parameter2.HasExplicitDefaultValue); 1173if (parameter1.HasExplicitDefaultValue && parameter2.HasExplicitDefaultValue)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
308hasDefaultValue ?? parameter.HasExplicitDefaultValue, 311: parameter.HasExplicitDefaultValue
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (4)
74p.HasExplicitDefaultValue, p.HasExplicitDefaultValue ? p.ExplicitDefaultValue : null))); 171p.HasExplicitDefaultValue, p.HasExplicitDefaultValue ? p.ExplicitDefaultValue : null), arg),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IParameterSymbolExtensions.cs (2)
33parameter.HasExplicitDefaultValue, 34parameter.HasExplicitDefaultValue ? parameter.ExplicitDefaultValue : null);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IPropertySymbolExtensions.cs (2)
64p.HasExplicitDefaultValue, p.HasExplicitDefaultValue ? p.ExplicitDefaultValue : null), arg),
Microsoft.VisualStudio.LanguageServices (2)
ChangeSignature\ChangeSignatureDialogViewModel.ParameterViewModels.cs (2)
226if (!ParameterSymbol.HasExplicitDefaultValue) 254public override bool IsRequired => !ParameterSymbol.HasExplicitDefaultValue;
Microsoft.VisualStudio.LanguageServices.CSharp (1)
ObjectBrowser\DescriptionBuilder.cs (1)
454if (current.HasExplicitDefaultValue)
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
ObjectBrowser\DescriptionBuilder.vb (1)
404If current.HasExplicitDefaultValue Then
System.Text.Json.SourceGeneration (2)
JsonSourceGenerator.Parser.cs (2)
1483HasDefaultValue = parameterInfo.HasExplicitDefaultValue, 1484DefaultValue = parameterInfo.HasExplicitDefaultValue ? parameterInfo.ExplicitDefaultValue : null,