How to solve generics error CS0311?

I have searched the web and stackoverflow and found many posts that deals with CS0311 error. None of the scenarios are close to mine. I have a generic class that inherits from a generic class. Please note that BusinessBase is a class in the CSLA fra...
more »

2017-01-10 15:01 (2) Answers

Pass Generic Type up the Inheritance Tree

I have the following classes: abstract class Foo<T> abstract class BaseClass : Foo<BaseClass> class DerivedOne : BaseClass class DerivedTwo : BaseClass Using this structure, all class that derive from BaseClass inherit from Foo<BaseC...
more »

2017-01-05 04:01 (1) Answers

VB.Net Com Class inheritance

I have a situation where a VB.Net COM Class in not inheriting functions accessible to the parent class when accessing the interface via VBA. I.e. I have a VB.Net COM Class (myParent) and a VB.net COM Subclass (myChild). I have searched and found so...
more »

2017-01-04 03:01 (1) Answers

Python class - attribute inheritance

I am trying to implement a project using class inheritance, where parent class is: class radio: def __init__(self, artist=None, track=None, genre=None): self.artist = artist self.track = track self.genre = genre then...
more »

2016-12-31 19:12 (2) Answers

C# Generic Base Polymorphism

i have one generic base class and two classes derived from base class. I want to create this kind of derived classes with a object factory. But i can not do this with a generic base class. I can do this, this way, in Java without any problems. I also...
more »

2016-12-30 00:12 (2) Answers

C# Generic: How to properly wrap method

I am a newer in programming and I have a question about Generic. Here is structure of my small program: public enum FieldsA { A, B, C } public enum FieldsB { A, B, C } public abstract class Page { } public abstract class ...
more »

2016-12-29 14:12 (2) Answers

Extend inner abstract class outside

I have the following classes: public class A { public abstract class B{} } How I can create a 'C' class that extends 'A.B' when 'A.B' needs an instance of 'A'? Something like this: public class C extends A.B{} ...
more »

2016-12-28 00:12 (0) Answers

Are there templates for Angular 2 templates?

Facelets, Thymeleaf, ASP.NET and other view frameworks supports templating to create uniform GUI. Are there templates for Angular 2 templates? E.g. I would like to have business form template with commond comands such as Save, Cancel, Exit and use th...
more »

2016-12-27 07:12 (1) Answers

Python - Name format_string is not defined error

I'm trying to create a class tree from which I can create various files and insert a list of values.I have only included code for the Delimited file. Whilst running the below code,I get the message that appears in the title, please assist.Thanks fro...
more »

2016-12-25 13:12 (0) Answers

Inheritance and Generic Type Setting

Can someone explain to me why the below code outputs what it does? Why is T a String in the first one, not an Int32, and why is it the opposite case in the next output? This puzzle is from an interview with Eric Lippert When I look through the code...
more »

2016-12-25 10:12 (5) Answers

Kotlin generics inheritance - Type mismatch

I am trying to build a set of providers for realm objects. Here is an example structure I've tried to build: Interface: interface IDataProvider<out T : RealmObject> { fun getRealmObject(): T } Base provider class with companion functi...
more »

2016-12-25 01:12 (1) Answers

Issue with creating base generic view class

I try to create base class for all custom views which will also include presenter and binding. But I can't implement generics inheritance. Please point me where I am wrong public abstract class BasePresenterView<T extends View> extends BaseVie...
more »

2016-12-24 11:12 (1) Answers

Why do we override initializers in Swift?

From Swift's documentation: Unlike subclasses in Objective-C, Swift subclasses do not inherit their superclass initializers by default. But then it says: When you write a subclass initializer that matches a superclass designated initial...
more »

2016-12-24 09:12 (1) Answers