Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1cce74e
Initial plan
Copilot Oct 17, 2025
1b3d696
Add improved error message for record inheritance without parameter list
Copilot Oct 17, 2025
77e1c66
Add tests for improved record inheritance error message
Copilot Oct 17, 2025
83ed3ef
Update existing tests to expect new error message
Copilot Oct 17, 2025
b9b167c
Fix BaseArguments_07 test
Copilot Oct 17, 2025
0db5aaa
Address PR feedback: Add WorkItem attributes, use raw string literals…
Copilot Oct 17, 2025
503f3ef
Merge Fact and WorkItem attributes, add coverage tests for struct and…
Copilot Oct 17, 2025
1ed3ff4
Remove blank line and add coding guideline about blank lines
Copilot Oct 17, 2025
4de8ed3
Remove trailing spaces and update copilot instructions
Copilot Oct 17, 2025
3905212
Update CONTRIBUTING.md
CyrusNajmabadi Oct 17, 2025
fcbcb97
Fixup tests
CyrusNajmabadi Oct 17, 2025
f9e6b52
Apply suggestions from code review
CyrusNajmabadi Oct 17, 2025
819ed1b
Fix formatting and failing tests for LanguageVersion_02 and LanguageV…
Copilot Oct 20, 2025
659d910
Lint
CyrusNajmabadi Oct 20, 2025
dd44621
Merge remote-tracking branch 'upstream/main' into copilot/fix-records…
CyrusNajmabadi Nov 6, 2025
203b9fe
inline
CyrusNajmabadi Nov 6, 2025
3cb7766
Simplufy test
CyrusNajmabadi Nov 6, 2025
cc3d196
Tweak resourcce
CyrusNajmabadi Nov 7, 2025
ff5783c
Update tests
CyrusNajmabadi Nov 7, 2025
890ce03
Update tests
CyrusNajmabadi Nov 7, 2025
04acafa
Update tests
CyrusNajmabadi Nov 7, 2025
25a0a56
Invert if
CyrusNajmabadi Nov 7, 2025
7e874b2
Revert
CyrusNajmabadi Nov 7, 2025
81cd3ec
Revert
CyrusNajmabadi Nov 7, 2025
3e2b9f5
Direct cast
CyrusNajmabadi Nov 7, 2025
230ba35
Add test
CyrusNajmabadi Nov 7, 2025
4a4b5a0
Revert
CyrusNajmabadi Nov 7, 2025
749cc20
Revert
CyrusNajmabadi Nov 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ var symbolInfo = semanticModel.GetSymbolInfo(expression);
- **Cancellation**: Always thread `CancellationToken` through async operations
- **MEF Lifecycle**: Use `[ImportingConstructor]` with obsolete attribute for MEF v2 compatibility
- **PROTOTYPE Comments**: Only used to track follow-up work in feature branches and are disallowed in main branch
- **Code Formatting**: Avoid trailing spaces and blank lines (lines with only whitespace). Ensure all lines either have content or are completely empty.

## Common Gotchas

Expand Down
3 changes: 3 additions & 0 deletions src/Compilers/CSharp/Portable/CSharpResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -6567,6 +6567,9 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<data name="ERR_UnexpectedArgumentList" xml:space="preserve">
<value>Unexpected argument list.</value>
</data>
<data name="ERR_UnexpectedArgumentListInBaseTypeWithoutParameterList" xml:space="preserve">
<value>Cannot pass arguments to the base type without a parameter list on the type declaration.</value>
</data>
<data name="ERR_UnexpectedOrMissingConstructorInitializerInRecord" xml:space="preserve">
<value>A constructor declared in a type with parameter list must have 'this' constructor initializer.</value>
</data>
Expand Down
2 changes: 2 additions & 0 deletions src/Compilers/CSharp/Portable/Errors/ErrorCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2440,6 +2440,8 @@ internal enum ErrorCode
ERR_SingleInapplicableUnaryOperator = 9341,
ERR_AmbigOperator = 9342,

ERR_UnexpectedArgumentListInBaseTypeWithoutParameterList = 9343,

// Note: you will need to do the following after adding errors:
// 1) Update ErrorFacts.IsBuildOnlyDiagnostic (src/Compilers/CSharp/Portable/Errors/ErrorFacts.cs)
// 2) Add message to CSharpResources.resx
Expand Down
1 change: 1 addition & 0 deletions src/Compilers/CSharp/Portable/Errors/ErrorFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2547,6 +2547,7 @@ or ErrorCode.ERR_AmbigExtension
or ErrorCode.ERR_SingleInapplicableBinaryOperator
or ErrorCode.ERR_SingleInapplicableUnaryOperator
or ErrorCode.ERR_AmbigOperator
or ErrorCode.ERR_UnexpectedArgumentListInBaseTypeWithoutParameterList
=> false,
};
#pragma warning restore CS8524 // The switch expression does not handle some values of its input type (it is not exhaustive) involving an unnamed enum value.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ internal partial class SourceNamedTypeSymbol
private ImmutableArray<NamedTypeSymbol> _lazyInterfaces;

/// <summary>
/// Gets the BaseType of this type. If the base type could not be determined, then
/// Gets the BaseType of this type. If the base type could not be determined, then
/// an instance of ErrorType is returned. If this kind of type does not have a base type
/// (for example, interfaces), null is returned. Also the special class System.Object
/// always has a BaseType of null.
Expand Down Expand Up @@ -637,10 +637,16 @@ private Tuple<NamedTypeSymbol, ImmutableArray<NamedTypeSymbol>> MakeOneDeclaredB

void checkPrimaryConstructorBaseType(BaseTypeSyntax baseTypeSyntax, TypeSymbol baseType)
{
if (baseTypeSyntax is PrimaryConstructorBaseTypeSyntax primaryConstructorBaseType &&
(TypeKind != TypeKind.Class || baseType.TypeKind == TypeKind.Interface || ((TypeDeclarationSyntax)decl.SyntaxReference.GetSyntax()).ParameterList is null))
if (baseTypeSyntax is PrimaryConstructorBaseTypeSyntax primaryConstructorBaseType)
{
diagnostics.Add(ErrorCode.ERR_UnexpectedArgumentList, primaryConstructorBaseType.ArgumentList.Location);
if (TypeKind != TypeKind.Class || baseType.TypeKind == TypeKind.Interface)
{
diagnostics.Add(ErrorCode.ERR_UnexpectedArgumentList, primaryConstructorBaseType.ArgumentList.Location);
}
else if (((TypeDeclarationSyntax)decl.SyntaxReference.GetSyntax()).ParameterList is null)
{
diagnostics.Add(ErrorCode.ERR_UnexpectedArgumentListInBaseTypeWithoutParameterList, primaryConstructorBaseType.ArgumentList.Location);
}
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading