1 write to ConstantValue
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CompilationTestUtils.cs (1)
236
summary.
ConstantValue
= semanticModel.GetConstantValue(expr);
67 references to ConstantValue
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (16)
Semantics\ExpressionBodiedMemberTests.cs (1)
107
Assert.Equal(10, semanticInfo.
ConstantValue
);
Semantics\InterpolationTests.cs (1)
4617
Assert.False(semanticInfo.
ConstantValue
.HasValue);
Semantics\RawInterpolationTests_Handler.cs (1)
2918
Assert.False(semanticInfo.
ConstantValue
.HasValue);
Semantics\UnsafeTests.cs (13)
8888
Assert.False(summary.
ConstantValue
.HasValue);
8923
Assert.False(summary.
ConstantValue
.HasValue);
9350
Assert.False(summary.
ConstantValue
.HasValue);
10642
Assert.False(typeSummary.
ConstantValue
.HasValue);
10655
Assert.Equal(s_specialTypeSizeOfMap[type.SpecialType], sizeOfSummary.
ConstantValue
);
10704
Assert.False(typeSummary.
ConstantValue
.HasValue);
10717
Assert.Equal(s_specialTypeSizeOfMap[type.GetEnumUnderlyingType().SpecialType], sizeOfSummary.
ConstantValue
);
10764
Assert.False(typeSummary.
ConstantValue
.HasValue);
10777
Assert.False(sizeOfSummary.
ConstantValue
.HasValue);
11320
Assert.False(stackAllocSummary.
ConstantValue
.HasValue);
11332
Assert.False(typeSummary.
ConstantValue
.HasValue);
11346
Assert.True(countSummary.
ConstantValue
.HasValue);
11347
Assert.Equal((short)20, countSummary.
ConstantValue
.Value);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (50)
Compilation\GetSemanticInfoTests.cs (4)
1428
Assert.Null(bindInfo.
ConstantValue
.Value);
1469
Assert.Null(bindInfo.
ConstantValue
.Value);
1503
Assert.Null(bindInfo.
ConstantValue
.Value);
4298
Assert.False(info.
ConstantValue
.HasValue);
Compilation\SemanticModelGetSemanticInfoTests.cs (46)
1759
Assert.Null(semanticInfo.
ConstantValue
.Value);
1819
Assert.Equal(true, semanticInfo.
ConstantValue
);
1849
Assert.Equal(0, semanticInfo.
ConstantValue
);
1879
Assert.Equal(0, semanticInfo.
ConstantValue
);
3469
Assert.Equal((byte)133, semanticInfo.
ConstantValue
);
3948
Assert.Null(semanticInfo.
ConstantValue
.Value);
4581
Assert.Equal(2, semanticInfo.
ConstantValue
);
4619
Assert.Equal(2, semanticInfo.
ConstantValue
);
4685
Assert.Equal(2, semanticInfo.
ConstantValue
);
4826
Assert.Equal(3, semanticInfo.
ConstantValue
);
5586
Assert.Equal(1, semanticInfo.
ConstantValue
);
5618
Assert.Equal(1, semanticInfo.
ConstantValue
);
5773
Assert.Equal(43, semanticInfo.
ConstantValue
);
5840
Assert.Equal(43, semanticInfo.
ConstantValue
);
5908
Assert.Equal(43, semanticInfo.
ConstantValue
);
5976
Assert.Equal(43, semanticInfo.
ConstantValue
);
6043
Assert.Equal(43, semanticInfo.
ConstantValue
);
6071
Assert.Equal(1, semanticInfo.
ConstantValue
);
6211
Assert.Equal(5, (int)semanticInfo.
ConstantValue
.Value);
6818
Assert.Equal(123, semanticInfo.
ConstantValue
);
6977
Assert.Equal(1, semanticInfo.
ConstantValue
);
7355
Assert.Equal(1, semanticInfo.
ConstantValue
);
7411
Assert.Equal(4L, semanticInfo.
ConstantValue
);
7498
Assert.Equal(4, semanticInfo.
ConstantValue
);
8526
Assert.Equal(true, semanticInfo.
ConstantValue
);
8572
Assert.Null(semanticInfo.
ConstantValue
.Value);
8738
Assert.Equal(2.2, semanticInfo.
ConstantValue
);
8780
Assert.Null(semanticInfo.
ConstantValue
.Value);
8821
Assert.Equal(true, semanticInfo.
ConstantValue
);
8863
Assert.Equal(true, semanticInfo.
ConstantValue
);
8945
Assert.Equal(97, semanticInfo.
ConstantValue
);
9095
Assert.Equal(0, semanticInfo.
ConstantValue
);
9492
Assert.Equal(5, semanticInfo.
ConstantValue
);
10986
Assert.Equal(2, semanticInfo.
ConstantValue
);
11017
Assert.Equal(21, semanticInfo.
ConstantValue
);
11048
Assert.Equal(21, semanticInfo.
ConstantValue
);
11081
Assert.Equal(21, semanticInfo.
ConstantValue
);
11114
Assert.Equal(21, semanticInfo.
ConstantValue
);
11278
Assert.Equal((short)9, semanticInfo.
ConstantValue
);
11315
Assert.Equal(12, semanticInfo.
ConstantValue
);
11352
Assert.Equal(12, semanticInfo.
ConstantValue
);
11392
Assert.Equal(12, semanticInfo.
ConstantValue
);
11472
Assert.Equal(true, semanticInfo.
ConstantValue
);
11509
Assert.Null(semanticInfo.
ConstantValue
.Value);
11722
Assert.Equal(1, semanticInfo.
ConstantValue
);
13454
Assert.Equal(1, semanticInfo.
ConstantValue
);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CompilationTestUtils.cs (1)
217
public bool IsCompileTimeConstant { get { return
ConstantValue
.HasValue; } }