SyntaxTree tree = CSharpSyntaxTree.ParseText(@" class MyClass { int x = default(int); string s = default(string); }"); Compilation compilation = CSharpCompilation.Create("MyCompilation", syntaxTrees: new[] { tree }); SemanticModel model = compilation.GetSemanticModel(tree); var classDeclarationSyntax = tree.GetRoot().DescendantNodes().OfTypeIn this example, we're parsing a class that has two fields, one of type int and another of type string, both initialized with default values. We're then using the IsDefaultValue method to determine whether the field initializers represent default values. The package library for this method is Microsoft.CodeAnalysis.CSharp.().Single(); var fieldDeclarations = classDeclarationSyntax.Members.OfType (); foreach (var field in fieldDeclarations) { foreach (var variable in field.Declaration.Variables) { var fieldSymbol = model.GetDeclaredSymbol(variable); var fieldInitializer = model.GetOperation(variable.Initializer.Value); var isDefault = (fieldInitializer as IBoundExpression)?.IsDefaultValue; Console.WriteLine($"Field {fieldSymbol.Name}: isDefault={isDefault}"); } }