MeAmAnUsername / pie

Pipelines for Interactive Environments
Apache License 2.0
0 stars 0 forks source link

Allow comparing two suppliers if their element types are subtypes #201

Open MeAmAnUsername opened 3 years ago

MeAmAnUsername commented 3 years ago

Allow comparing two suppliers supplier<T> and supplier<U> if T is a subtype of U or vice versa.

Example PIE Code:

fruitSupplier: supplier<Fruit> = getFruit.supplier();
appleSupplier: supplier<Apple> = getApple.supplier();
fruitSupplier == appleSupplier

Current behavior Comparison is disallowed, because a supplier of Apples is not a subtype of a supplier of Fruit (or vice versa). Proposed behavior Comparison is allowed, because Apples are a subtype of Fruit.

Reason The equality of two suppliers is not well defined. They might be equal, even when their static types are not.

Related issues This is the same as #199 and #200, but now for suppliers

MeAmAnUsername commented 3 years ago

Postponed until #202 is resolved