diff --git a/src/Features/Core/Portable/PublicAPI.Unshipped.txt b/src/Features/Core/Portable/PublicAPI.Unshipped.txt index d62edd386805..5542acfb736b 100644 --- a/src/Features/Core/Portable/PublicAPI.Unshipped.txt +++ b/src/Features/Core/Portable/PublicAPI.Unshipped.txt @@ -1,4 +1,5 @@ const Microsoft.CodeAnalysis.TextTags.Record = "Record" -> string +const Microsoft.CodeAnalysis.TextTags.RecordStruct = "RecordStruct" -> string Microsoft.CodeAnalysis.Completion.CompletionItem.IsComplexTextEdit.get -> bool Microsoft.CodeAnalysis.Completion.CompletionItem.WithIsComplexTextEdit(bool isComplexTextEdit) -> Microsoft.CodeAnalysis.Completion.CompletionItem static Microsoft.CodeAnalysis.Completion.CompletionChange.Create(Microsoft.CodeAnalysis.Text.TextChange textChange, System.Collections.Immutable.ImmutableArray textChanges, int? newPosition = null, bool includesCommitCharacter = false) -> Microsoft.CodeAnalysis.Completion.CompletionChange diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/NamedTypeGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/NamedTypeGenerator.cs index 7c77fc9bc429..38dcd702b90f 100644 --- a/src/Workspaces/CSharp/Portable/CodeGeneration/NamedTypeGenerator.cs +++ b/src/Workspaces/CSharp/Portable/CodeGeneration/NamedTypeGenerator.cs @@ -79,7 +79,7 @@ public static MemberDeclarationSyntax GenerateNamedTypeDeclaration( var members = GetMembers(namedType).Where(s => s.Kind != SymbolKind.Property || PropertyGenerator.CanBeGenerated((IPropertySymbol)s)) .ToImmutableArray(); - if (namedType.IsRecord && namedType.IsReferenceType) + if (namedType.IsRecord && namedType.TypeKind is TypeKind.Class) { declaration = GenerateRecordMembers(service, options, (RecordDeclarationSyntax)declaration, members, cancellationToken); } @@ -198,7 +198,7 @@ private static MemberDeclarationSyntax GetDeclarationSyntaxWithoutMembersWorker( TypeDeclarationSyntax typeDeclaration; if (namedType.IsRecord) { - typeDeclaration = namedType.IsReferenceType + typeDeclaration = namedType.TypeKind is TypeKind.Class ? SyntaxFactory.RecordDeclaration(SyntaxFactory.Token(SyntaxKind.RecordKeyword), namedType.Name.ToIdentifierToken()) : SyntaxFactory.RecordStructDeclaration(SyntaxFactory.Token(SyntaxKind.RecordKeyword), namedType.Name.ToIdentifierToken()); } diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationTypeSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationTypeSymbol.cs index 0dd38ed84b75..059421574d14 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationTypeSymbol.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationTypeSymbol.cs @@ -38,7 +38,7 @@ public virtual ImmutableArray Interfaces public ImmutableArray AllInterfaces => ImmutableArray.Create(); - public bool IsReferenceType => TypeKind != TypeKind.Enum && TypeKind != TypeKind.Struct && TypeKind != TypeKind.Error; + public bool IsReferenceType => false; public bool IsValueType => TypeKind == TypeKind.Struct || TypeKind == TypeKind.Enum;