From 2ee1ea128ae8e3e57d3c46b3a9dfd2409f3d43b5 Mon Sep 17 00:00:00 2001 From: Prophet Lamb Date: Thu, 30 Jun 2022 16:24:16 +0200 Subject: [PATCH] Fix dynamic type self --- CSharpFunctionalExtensions/Maybe/Maybe.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CSharpFunctionalExtensions/Maybe/Maybe.cs b/CSharpFunctionalExtensions/Maybe/Maybe.cs index 841517a1..9f14f2c7 100644 --- a/CSharpFunctionalExtensions/Maybe/Maybe.cs +++ b/CSharpFunctionalExtensions/Maybe/Maybe.cs @@ -55,6 +55,10 @@ private Maybe(T value) public static implicit operator Maybe(T value) { + if (value is Maybe m) + { + return m; + } return EqualityComparer.Default.Equals(default, value) ? default : new Maybe(value); }