55 references to Create
Microsoft.CodeAnalysis (3)
ConstantValue.cs (1)
389case ConstantValueTypeDiscriminator.String: return Create((string)value);
MetadataReader\MetadataDecoder.cs (1)
1127return ConstantValue.Create(sigReader.ReadUTF16(sigReader.RemainingBytes));
MetadataReader\PEModule.cs (1)
3468return ConstantValue.Create(reader.ReadUTF16(reader.Length));
Microsoft.CodeAnalysis.CSharp (13)
Binder\Binder_InterpolatedString.cs (3)
47resultConstant = ConstantValue.Create(string.Empty); 137format = new BoundLiteral(interpolation.FormatClause, ConstantValue.Create(text), stringType, hasErrors); 787argumentsBuilder.Add(boundLiteral.Update(ConstantValue.Create(literalText), boundLiteral.Type));
Binder\Binder_Invocation.cs (4)
1382defaultValue = new BoundLiteral(syntax, ConstantValue.Create(path), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true }; 1387defaultValue = new BoundLiteral(syntax, ConstantValue.Create(memberName), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true }; 1396defaultValue = new BoundLiteral(syntax, ConstantValue.Create(argument.Syntax.ToString()), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true }; 1911return new BoundNameOfOperator(node, boundArgument, ConstantValue.Create(name), Compilation.GetSpecialType(SpecialType.System_String));
CodeGen\EmitStatement.cs (1)
1439stringJumpTable.StringCaseLabels.Select(p => new KeyValuePair<ConstantValue, object>(ConstantValue.Create(p.value), p.label)).ToArray(),
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (1)
280return ConstantValue.Create(leftVal + rightVal);
Lowering\StateMachineRewriter\ResumableStateMachineStateAllocator.cs (1)
92f.StringLiteral(ConstantValue.Create(message)))));
Lowering\SyntheticBoundNodeFactory.cs (2)
1069var stringConst = ConstantValue.Create(value); 1081return StringLiteral(ConstantValue.Create(stringValue));
Utilities\ValueSetFactory.StringTC.cs (1)
41ConstantValue IEquatableValueTC<string>.ToConstantValue(string value) => ConstantValue.Create(value);
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (3)
Rewriters\LocalDeclarationRewriter.cs (2)
110var name = new BoundLiteral(syntax, ConstantValue.Create(local.Name), stringType); 129var value = ConstantValue.Create(CustomTypeInfo.PayloadTypeId.ToString());
Symbols\ObjectIdLocalSymbol.cs (1)
89Microsoft.CodeAnalysis.ConstantValue.Create(name),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (4)
Semantics\ConstantTests.cs (1)
4002stringConst = 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)
128var cv5 = ConstantValue.Create(null); 184var cv1 = ConstantValue.Create("1"); 185var cv2 = ConstantValue.Create("2"); 208cv = ConstantValue.Create(strVal);
Microsoft.CodeAnalysis.VisualBasic (21)
Binding\Binder_Expressions.vb (5)
744Return New BoundNameOfOperator(node, argument, ConstantValue.Create(value), GetSpecialType(SpecialType.System_String, node, diagnostics)) 3720ConstantValue.Create(node.Name.Identifier.ValueText), 3740Dim arg = New BoundLiteral(name, ConstantValue.Create(node.Name.Identifier.ValueText), GetSpecialType(SpecialType.System_String, name, diagnostics)) 3759Dim arg = New BoundLiteral(name, ConstantValue.Create(node.Name.Identifier.ValueText), GetSpecialType(SpecialType.System_String, name, diagnostics)) 3801ConstantValue.Create(node.Name.Identifier.ValueText),
Binding\Binder_Invocation.vb (3)
3155callerInfoValue = ConstantValue.Create(container.Name) 3158callerInfoValue = ConstantValue.Create(callerInfoOpt.SyntaxTree.GetDisplayPath(callerInfoOpt.Span, Me.Compilation.Options.SourceReferenceResolver)) 3174callerInfoValue = ConstantValue.Create(argumentSyntax.ToString())
Binding\Binder_XmlLiterals.vb (1)
1057Dim result = New BoundLiteral(syntax, ConstantValue.Create(str), GetSpecialType(SpecialType.System_String, syntax, diagnostics), hasErrors:=hasErrors)
Binding\SyntheticBoundTrees\AnonymousTypeSyntheticMethods.vb (1)
377New BoundLiteral(syntax, ConstantValue.Create(formatString),
CodeGen\ResumableStateMachineStateAllocator.vb (1)
88f.StringLiteral(ConstantValue.Create(message)))))
Lowering\LocalRewriter\LocalRewriter_InterpolatedString.vb (3)
40Return factory.StringLiteral(ConstantValue.Create(String.Empty)) 46Return factory.StringLiteral(ConstantValue.Create(valueWithEscapes.Replace("{{", "{").Replace("}}", "}"))) 164arguments(0) = factory.StringLiteral(ConstantValue.Create(formatStringBuilderHandle.ToStringAndFree())).MakeCompilerGenerated()
Lowering\LocalRewriter\LocalRewriter_LateBindingHelpers.vb (1)
929Return New BoundLiteral(node, ConstantValue.Create(value), stringType)
Lowering\LocalRewriter\LocalRewriter_StringConcat.vb (2)
72Return factory.StringLiteral(ConstantValue.Create("")) 219Return ConstantValue.Create(leftVal + rightVal)
Lowering\LocalRewriter\LocalRewriter_XmlLiterals.vb (1)
326Return New BoundLiteral(syntax, ConstantValue.Create(str), GetSpecialType(SpecialType.System_String)).MakeCompilerGenerated()
Lowering\SyntheticBoundNodeFactory.vb (1)
758Dim boundNode = New BoundLiteral(_syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_String))
Semantics\CompileTimeCalculations.vb (1)
305Return ConstantValue.Create(New String(ChrW(UncheckedCInt(sourceValue)), 1))
Semantics\Conversions.vb (1)
768Return ConstantValue.Create(New String(sourceValue.CharValue, 1))
Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator.ExpressionCompiler (2)
Rewriters\LocalDeclarationRewriter.vb (1)
72Dim name = New BoundLiteral(syntax, ConstantValue.Create(local.Name), stringType)
Symbols\ObjectIdLocalSymbol.vb (1)
104Microsoft.CodeAnalysis.ConstantValue.Create(name),
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (3)
Semantics\Conversions.vb (2)
991stringValue = ConstantValue.Create("") 1016stringValue = ConstantValue.Create("abc")
Semantics\OptionalArgumentTests.vb (1)
2422Assert.Equal(ConstantValue.Create("A"), parameters(2).ExplicitDefaultConstantValue)