Merge pull request #7562 from michaelnebel/csharp/record-seal-tostring

C#: Record types are allowed to seal ToString (test only).
This commit is contained in:
Michael Nebel
2022-01-12 08:08:32 +01:00
committed by GitHub
3 changed files with 10 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
using System;
public record MyEntry(string Name, string Address)
{
sealed public override string ToString() => $"{Name} lives at {Address}";
};

View File

@@ -0,0 +1 @@
| RecordTypeSealedToString.cs:5:35:5:42 | ToString |

View File

@@ -0,0 +1,3 @@
import csharp
query predicate sealed(Modifiable m) { m.getDeclaringType().fromSource() and m.isSealed() }