Category "generics"

What is the "proper" way to cast Hibernate Query.list() to List<Type>?

I'm a newbie with Hibernate, and I'm writing a simple method to return a list of objects matching a specific filter. List<Foo> seemed a natural return typ

Difference between any/interface{} as constraint vs. type of argument?

As generics have been released in Go 1.18 pretty recently, I've started learning them. I generally get the concept, because I have some Java experience from the

How jasmine spyOn a generic method

I try to make a spy on a generic method in typescript, but cannot get Jasmine to recognise it. I have code http: HttpClient <- Not proper code, just showin

Nim - How to access mytype of a field that has the type Option[mytype] at compile time?

Heyho, While coding my way through some generics I stumbled upon an issue with one of my generic functions. I have 2 types such as this import std/options impor

How to pass one SwiftUI View as a variable to another View struct

I'm implementing a very custom NavigationLink called MenuItem and would like to reuse it across the project. It's a struct that conforms to View and implements

Generic callback with generic class as parameter in Dart

I wrote a custom switch class in Flutter to implement generic parameters, I used the flutter_switch package. When I toggle the switch I faced the following erro

Can I use generics over reference types only?

While coding a Map<>, I found out that declaring Map<int, int> is a syntax error while Map<Integer, Integer> is OK. Is it only possible in Jav