I've created a server using Actix Web which has authentication support. Now I want to add an OpenAPI Specification using paperclip. Normally you only have to ad
Let's say you have a structure that you want to be a generic over time type T, so long as that type implements some trait R. That's pretty trivial: trait R {
Suppose I have an object with a static set of keys, and then a type specifying a subset of those keys as a static array: const myBigStaticObject = { key1: ()
I have a class similar to this: public class Car<T> { private T model; private CarBodyParts body; } public class CarBodyParts { private Integer
I'm experimenting with generic-like code and I have a function like this (a lot of not relevant code removed): typedef uint8_t (*struct_converter_t)(void *, cha
I'm experimenting with generic-like code and I have a function like this (a lot of not relevant code removed): typedef uint8_t (*struct_converter_t)(void *, cha
In other words, how do I implement type-specific solutions for different types in a union type set? Given the following code... type FieldType interface { s
I'm invoking a function from another library whose return signature is defined as under: (*studentlib.Student[StudentResponse], error) Student is defined as: t
I am interested in creating a generic to add a fixed functionality to different types in python. I have a semi working solution, but it's tying is problematic.
I have found myself writing the same function X number of times to get different types of Items out of my go-cache. The duplicate functions ar
When I write this code in IntelliJ, it gives this error: Wildcards may be used only as reference parameters. Here is my code static <T extends Iterable<
I want to create a base service using a generic class which I wrote below: import { BaseEntity } from './base.entity'; import { Repository } from 'typeorm'; e
I am trying to create an abstract data model where i pass data and type a and then is return list, but when i can't call T.fromJson() method, note that passes t
After updating to Xcode 11.4, I started to get this error Failed to produce diagnostic for expression please file a bug report On: let provider = MoyaProvider
So I was reading through the source code of Collections.java, there is a generic method copy(). I simplified it to this: public static <T> void copy(List&
I'm trying to filter a List of objects that implements an interface. And I'm trying to create a generic method for all the classes. Something like: interface So
I am trying to come up with a way to do this where I can have type safety but also loose coupling of a couple of different components in my class. I am running
How can I enforce providing the generic type of a generic method in dart. By default, dart allows us to not provide a generic type at all. And this should be a
I am testing out generics in go 1.18 and took a look at this example. I would like to recreate that example but instead be able to pass in a slice of int or sli
Probably a golang beginner's question :) I'm facing following compiler error when trying to compile the code below. I want to implement an object store for diff