25 references to Create
Microsoft.CodeAnalysis (3)
ConstantValue.cs (1)
393case ConstantValueTypeDiscriminator.String: return Create((string)value);
MetadataReader\MetadataDecoder.cs (1)
1127return ConstantValue.Create(sigReader.ReadUTF16(sigReader.RemainingBytes));
MetadataReader\PEModule.cs (1)
3749return ConstantValue.Create(reader.ReadUTF16(reader.Length));
Microsoft.CodeAnalysis.CSharp (12)
Binder\Binder_InterpolatedString.cs (3)
47resultConstant = ConstantValue.Create(string.Empty); 414expressions[0] = new BoundLiteral(syntax, ConstantValue.Create(formatString.ToStringAndFree()), GetSpecialType(Microsoft.CodeAnalysis.SpecialType.System_String, diagnostics, syntax)) { WasCompilerGenerated = true }; 955argumentsBuilder.Add(boundLiteral.Update(ConstantValue.Create(literalText), boundLiteral.Type));
Binder\Binder_Invocation.cs (4)
1691defaultValue = new BoundLiteral(syntax, ConstantValue.Create(path), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true }; 1696defaultValue = new BoundLiteral(syntax, ConstantValue.Create(memberName), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true }; 1705defaultValue = new BoundLiteral(syntax, ConstantValue.Create(argument.Syntax.ToString()), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true }; 2349return new BoundNameOfOperator(node, boundArgument, ConstantValue.Create(name), Compilation.GetSpecialType(SpecialType.System_String));
CodeGen\EmitStatement.cs (1)
1470stringJumpTable.StringCaseLabels.Select(p => new KeyValuePair<ConstantValue, object>(ConstantValue.Create(p.value), p.label)).ToArray(),
Lowering\StateMachineRewriter\ResumableStateMachineStateAllocator.cs (1)
98f.StringLiteral(ConstantValue.Create(errorCode.GetExceptionMessage())),
Lowering\SyntheticBoundNodeFactory.cs (2)
1150var stringConst = ConstantValue.Create(value); 1162return StringLiteral(ConstantValue.Create(stringValue));
Utilities\ValueSetFactory.StringTC.cs (1)
44ConstantValue IEquatableValueTC<string>.ToConstantValue(string value) => ConstantValue.Create(value);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (4)
Semantics\ConstantTests.cs (1)
4021stringConst = ConstantValue.Create("abcdefghijklmnopqrstuvwxyz"),
Semantics\NamedAndOptionalTests.cs (3)
2200Assert.Equal(ConstantValue.Create("A"), parameters[2].ExplicitDefaultConstantValue); 2226Assert.Equal(ConstantValue.Create("A"), parameters[6].ExplicitDefaultConstantValue); 2232Assert.Equal(ConstantValue.Create("A"), parameters[7].ExplicitDefaultConstantValue); // not imported for non-optional parameter
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (2)
PDB\PdbHelpers.cs (2)
102(SpecialType.System_String, null) => ConstantValue.Create(string.Empty), 103(SpecialType.System_String, string str) => ConstantValue.Create(str),
Microsoft.CodeAnalysis.UnitTests (4)
CorLibTypesTests.cs (4)
172var cv5 = ConstantValue.Create(null); 228var cv1 = ConstantValue.Create("1"); 229var cv2 = ConstantValue.Create("2"); 252cv = ConstantValue.Create(strVal);