Answer Overflow Logo
Change Theme
Search Answer Overflow
GitHub
Add Your Server
Login
Home
Popular
Topics
Gaming
Programming
ero
Posts
Comments
C
C#
•
Created by cheeze2000 on 11/16/2024 in
#help
Trying to understand required members
That's new to me
16 replies
C
C#
•
Created by cheeze2000 on 11/16/2024 in
#help
Trying to understand required members
What the
16 replies
C
C#
•
Created by cheeze2000 on 11/16/2024 in
#help
Trying to understand required members
And inheriting classes can call the
: base()
constructor
16 replies
C
C#
•
Created by cheeze2000 on 11/16/2024 in
#help
Trying to understand required members
I would give Animal a constructor that takes a string
16 replies
C
C#
•
Created by cheeze2000 on 11/16/2024 in
#help
Trying to understand required members
I agree it would be nice if the code knew the value is technically not "required" in the child class, but that's unfortunately not how c# works
16 replies
C
C#
•
Created by cheeze2000 on 11/16/2024 in
#help
Trying to understand required members
What you're seeing is intended
16 replies
C
C#
•
Created by cheeze2000 on 11/16/2024 in
#help
Trying to understand required members
required is purely for the object initializer
16 replies
C
C#
•
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 really think of a good way to handle this in that case. you would need to provide your own implementation of
IOther
60 replies
C
C#
•
Created by Pherenetic on 11/14/2024 in
#help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
a failure like that should throw, not return null
60 replies
C
C#
•
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 bad design by that api then
60 replies
C
C#
•
Created by Pherenetic on 11/14/2024 in
#help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
in what circumstance? and is there no
TryGet
method?
60 replies
C
C#
•
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 what it currently means
60 replies
C
C#
•
Created by Pherenetic on 11/14/2024 in
#help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
i'm not really sure what you mean.
Get<K>
can return null even when
K
may not be nullable?
60 replies
C
C#
•
Created by Pherenetic on 11/14/2024 in
#help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
that info should be conveyed through other means
60 replies
C
C#
•
Created by Pherenetic on 11/14/2024 in
#help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
i assume
K? Get<K>
means a potential failure in getting
60 replies
C
C#
•
Created by Pherenetic on 11/14/2024 in
#help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
Get<K>
should only return
K
, and a
TryGet
method would be nice to have as well
60 replies
C
C#
•
Created by Pherenetic on 11/14/2024 in
#help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
if you
can
control the dependency, then you should change the implementation, yes
60 replies
C
C#
•
Created by Pherenetic on 11/14/2024 in
#help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
they're unrelated
60 replies
C
C#
•
Created by Pherenetic on 11/14/2024 in
#help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
even when
K
in
MyDictionary<T, K>
is not nullable, the return value of
Get<K>
is
60 replies
C
C#
•
Created by Pherenetic on 11/14/2024 in
#help
NRT: How to correctly annotate my generic-class when inheriting from another generic class?
that doesn't matter here at all
60 replies