2,542 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
116
views
C# values types - is this a compiler bug? [closed]
Let's assume we crate an extension method to expose Abs as a member of INumber
public static class MathIntExtensions
{
/// <summary>
/// Exposes Abs as extension method for all ...
0
votes
2
answers
240
views
Is it possible to call a static abstract interface method from implementation of another static interface method?
The question is simply in the comment of code below
By the way this code is valid only with C#-11 language version
(ie: create a Net 8.0 framework project or later to test).
Is the problem of code ...
2
votes
1
answer
68
views
Why are the generic parameter types of this method override incompatible (TS2416)?
I am attempting to override a generic method, however Typescript complains that the types are incompatible. I feel like I must be missing something as I would have thought that the types would be the ...
-1
votes
1
answer
50
views
I got Runtime Error with my sample project using freepascal and concerning casting tform and using virtual method
This sample use 2 forms
1 BaseForm (TFORM)
2 TF1 (BaseForm) inherited
BaseForm has the procedure
Procedure whenDeleteRec(dataset:tdataset) virtual;Abstract
TF1
Procedure whenDeletedRec(dataset:...
0
votes
0
answers
123
views
Casted pointer does not get desired properties and methods for abstract parent class
I have a program where I instantiated an abstract parent class and cast a pointer of a child class (C-style type cast) to one of the parent class. When I looked up properties and called functions, for ...
1
vote
1
answer
60
views
Use oo::configurable in tcl9.0
I am playing with configure in new version tcl9.0, it works, but I have the question:
how to make class both configurable and abstract?
I tried to do like this:
oo::abstract create Simulator {
...
0
votes
4
answers
131
views
How to specify parameter type as derived class type in override of abstract function where parameter is type of base class?
I would like to store SpecificResult instances (and other types derived from Result) in a List<Result>. Each derived type may contain different properties. I would like to have a virtual base ...
0
votes
1
answer
128
views
My generic class seems to not be *that* generic
I am currently creating a small plant caring game (Unity Engine 2022340f1). It's properties (genes) are passed onto it's parts as a genome. These properties can be floats, integers or colors.
For ...
-1
votes
1
answer
67
views
Does an abstract class get instantiated by its subclass? [duplicate]
While you cannot make an instance of an abstract class, in this example the super keyword is used to reference the instance variable of the super class, hence a reference that is provided in the ...
-1
votes
3
answers
655
views
Are all abstract classes parent classes? [closed]
I started learning Java few months ago. I am wondering if all abstract classes are parent classes. An abstract method in an abstract class won’t have a body. So the abstract method it must be ...
0
votes
1
answer
54
views
change detection of variables declared in the extended class in angular 14 applicaiton
I'm looking for the best approach to detect changes in properties declared in extended classes in Angular. These changes are not detected by ngOnChanges because they're not inputs.
I've currently ...
1
vote
1
answer
91
views
Combination of abstract classes and generics problem when declaring and instantiating
I am struggling with an app in C# that is a document review app that searches documents for a list of search terms. It needs to either take a PDF or WORD document and possibly others in the future.
I ...
2
votes
3
answers
767
views
How can I call abstract static methods through an interface?
I am looking for a better way than reflection to call static methods on a bunch of classes.
Consider that I have a factory that is seeded as such:
private static IReadOnlyDictionary<string, Type>...
0
votes
1
answer
92
views
How can I get an object of a given type to be returned from HttpClient.get when requesting an abstract object?
I have an abstract class:
export abstract class DataEntry {
...
public abstract clone(): DataEntry;
}
and an actual class extending it:
export class Record extends DataEntry {
...
public ...
0
votes
1
answer
239
views
MapStruct maps the model's field as empty when the field is of an abstract type
I have a class that has a field which in turn is an abstract class. I would like MapStruct to be able to map from the incoming DTO to the internal model including all the subfields of the abstract ...