mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
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:
@@ -0,0 +1,6 @@
|
||||
using System;
|
||||
|
||||
public record MyEntry(string Name, string Address)
|
||||
{
|
||||
sealed public override string ToString() => $"{Name} lives at {Address}";
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
| RecordTypeSealedToString.cs:5:35:5:42 | ToString |
|
||||
@@ -0,0 +1,3 @@
|
||||
import csharp
|
||||
|
||||
query predicate sealed(Modifiable m) { m.getDeclaringType().fromSource() and m.isSealed() }
|
||||
Reference in New Issue
Block a user