munificent / ui-as-code

Design work on improving Dart's syntax for UI code
BSD 3-Clause "New" or "Revised" License
121 stars 11 forks source link

Calling through a subtype can bind differently from the supertype #12

Closed munificent closed 6 years ago

munificent commented 6 years ago

The same function called through two different static types can bind different parameters:

foo([int x], int y, [int z]) => "$x$y$z";
Function([int x], int y, int z) bar = foo;
print(foo(1, 2));  // 12null
print(bar(1, 2));  // null12

It "works", but that's not what I intended and I don't think it's what we want.