Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Sample code for "Ever been stumped by <E>..." Medium post
class CacheItem<A> { // Using the letter A
CacheItem(A this.itemToCache);
final itemToCache;
String get detail => '''
Cached item: $itemToCache
The item type is $A
void main() {
var cached = CacheItem<int>(1);
// Output:
// Cached item: 1
// The item's type is int
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.