google/tuple.dart

Whats the point of Tuple always being 'const'?

Closed this issue · 1 comments

Maybe I'm missing something but I can't pair a with an runtime object as one of the pairs of the tuple since the Tuple2 constructor is const. This completely misses the point then of why you would use a Tuple in the first place. Am I missing something?

e.g.

class Dog
{
String name;
}

enum Action
{
Walk, Wash, Play, Feed
}

void main()
{
var myDog = new Dog();
var myFancyTuple = Tuple2<Dog, Action>(myDog, Action.Feed); <- Invalid since class myDog is not a const.
}

BS on my end, a Flutter component above was CONST. I saw the CONST in the source on the constructor and thought it was the issue.