The initialization of isReadOnly in DeclarationModifiers.From must be extended in case ~ when ISymbol is type declaration.
DeclarationModifiers.cs#L80
public static DeclarationModifiers From(ISymbol symbol)
{
/// ...
isReadOnly: field?.IsReadOnly == true || property?.IsReadOnly == true,
/// ...
DeclarationModifiers.From(...) is used not just for fields and properties and for SymbolKind.NamedType: with TypeKind.Class and TypeKind.Struct: SyntaxGenerator.cs#L612
namespace Foo
{
public readonly struct PublicReadonlyStruct { }
}
After roundtrip: source -> ISymbol-> SyntaxGenerator -> source:
namespace Foo
{
public struct PublicReadonlyStruct { }
}