You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* @flow */typeProperties={a: string,b: string};classFoo<Properties: Object>{$key: $Keys<Properties>;
$value: $Values<Properties>;};constfoo: Foo<Properties> = new Foo();
// ✔ Will work fine:
foo["a"] = "adsasd";
// ✔ Will throw an error because "c" in not in Properties:
foo["c"] = "adsasd";
// ✘ Will throw an error because of the dot notation:
foo.b = "adsasd";
// ✘ Will thrown an error because of deconstruction:
const {a,b} = foo;
(nothing changes when Foo extends Object)
The text was updated successfully, but these errors were encountered:
Bartozzz
changed the title
$key doesn't support dot notation in classes
$key doesn't support dot property accessors
May 16, 2018
In my opinion
$key
should work with both bracket (e.g.foo["bar"]
) and dot (e.g.foo.bar
) notations.Reproduction on Flow/try:
(nothing changes when Foo
extends Object
)The text was updated successfully, but these errors were encountered: