From 259e11f6bc37ead32adb606b7b695cab8d4b595c Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Mon, 9 Feb 2026 15:04:15 +1100 Subject: [PATCH] Add parameterless ctor and overload priority 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. --- src/Verify/TempDirectory.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Verify/TempDirectory.cs b/src/Verify/TempDirectory.cs index b85fb7119..4ca8d23ca 100644 --- a/src/Verify/TempDirectory.cs +++ b/src/Verify/TempDirectory.cs @@ -121,7 +121,12 @@ internal static void Cleanup() /// /// Thrown if the directory cannot be created (e.g., due to permissions or disk space). /// - public TempDirectory(bool ignoreLockedFiles = false) + public TempDirectory() : this(false) + { + } + + [OverloadResolutionPriority(1)] + public TempDirectory(bool ignoreLockedFiles) { this.ignoreLockedFiles = ignoreLockedFiles; Path = IoPath.Combine(RootDirectory, IoPath.GetRandomFileName());