Skip to content

Commit 9879691

Browse files
authored
Add parameterless ctor and overload priority (#1678)
Introduce a parameterless TempDirectory() that delegates to the existing constructor, and mark the bool-taking constructor with [OverloadResolutionPriority(1)]. This adds a convenient default ctor while making the intended overload resolution explicit; no change to behavior beyond the added API surface.
1 parent 71a431c commit 9879691

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/Verify/TempDirectory.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,12 @@ internal static void Cleanup()
121121
/// <exception cref="IOException">
122122
/// Thrown if the directory cannot be created (e.g., due to permissions or disk space).
123123
/// </exception>
124-
public TempDirectory(bool ignoreLockedFiles = false)
124+
public TempDirectory() : this(false)
125+
{
126+
}
127+
128+
[OverloadResolutionPriority(1)]
129+
public TempDirectory(bool ignoreLockedFiles)
125130
{
126131
this.ignoreLockedFiles = ignoreLockedFiles;
127132
Path = IoPath.Combine(RootDirectory, IoPath.GetRandomFileName());

0 commit comments

Comments
 (0)