diff --git a/src/System.Runtime/ref/System.Runtime.cs b/src/System.Runtime/ref/System.Runtime.cs index 96e942ac203d..28b86ffdf8b3 100644 --- a/src/System.Runtime/ref/System.Runtime.cs +++ b/src/System.Runtime/ref/System.Runtime.cs @@ -1202,6 +1202,7 @@ public partial interface IProgress public partial class Lazy { public Lazy() { } + public Lazy(T value) { } public Lazy(bool isThreadSafe) { } public Lazy(System.Func valueFactory) { } public Lazy(System.Func valueFactory, bool isThreadSafe) { } diff --git a/src/System.Runtime/tests/System/LazyTests.cs b/src/System.Runtime/tests/System/LazyTests.cs index a30fb44ad760..4a6a6ded4934 100644 --- a/src/System.Runtime/tests/System/LazyTests.cs +++ b/src/System.Runtime/tests/System/LazyTests.cs @@ -19,6 +19,18 @@ public static void Ctor() VerifyLazy(lazyObject, 0, true); } + [Theory] + [InlineData(21)] + [InlineData(366.58)] + [InlineData("hello")] + public static void Ctor_T_PreInitialized(T value) + { + var lazyObject = new Lazy(value); + + Assert.True(lazyObject.IsValueCreated); + Assert.Equal(value, lazyObject.Value); + } + [Theory] [InlineData(true)] [InlineData(false)]