Pherenetic
Pherenetic
CC#
Created by Pherenetic on 11/14/2024 in #help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
Thank you for your answers. That was very enlightening.
60 replies
CC#
Created by Pherenetic on 11/14/2024 in #help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
I agree
60 replies
CC#
Created by Pherenetic on 11/14/2024 in #help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
There is no TryGet and if it fails to get & convert that value.
60 replies
CC#
Created by Pherenetic on 11/14/2024 in #help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
And that's exactly what it does. Returning null even if K would be string 🤔
60 replies
CC#
Created by Pherenetic on 11/14/2024 in #help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
💡 let me check
60 replies
CC#
Created by Pherenetic on 11/14/2024 in #help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
No it really means K could be null here.
60 replies
CC#
Created by Pherenetic on 11/14/2024 in #help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
Yeah I know it's only compile time 🤔 So I have to either try change my dependency or suppress the warning with ! and hope for the best 🥴
60 replies
CC#
Created by Pherenetic on 11/14/2024 in #help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
60 replies
CC#
Created by Pherenetic on 11/14/2024 in #help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
That's true. But I can't decide whether the used K from the consumer allows null or not.
60 replies
CC#
Created by Pherenetic on 11/14/2024 in #help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
I can't just check against null...
60 replies
CC#
Created by Pherenetic on 11/14/2024 in #help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
That's my problem xD
60 replies
CC#
Created by Pherenetic on 11/14/2024 in #help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
My problem/question is: How do I implement MyDictionary<T, K> : Dictionary<T, K> where I can leverage NRT and it's up to an actual consumer of that type if he wants to allow null or not.
60 replies
CC#
Created by Pherenetic on 11/14/2024 in #help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
I can't decide whether K will be nullable or not
60 replies
CC#
Created by Pherenetic on 11/14/2024 in #help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
Exactly
60 replies
CC#
Created by Pherenetic on 11/14/2024 in #help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
MyDictionary<Guid, string> <- No ? on string.
60 replies