Flow: T incompatible with T

Created on 20 Dec 2019  路  2Comments  路  Source: facebook/flow

Flow version: 0.114

Expected behavior

This doesn't quite look like the issue reported in https://github.com/facebook/flow/issues/6810

Ceate a generic type T to represent a list item in a component while additionally using T as an argument for a callback

Actual behavior

`T` [1] is incompatible with `T` [2]

cc: @dsainati1

completeness bug

Most helpful comment

This looks like a bug with generics. We are planning a big overhaul of how generic typing works in the first half of 2020, so that should address this.

All 2 comments

This looks like a bug with generics. We are planning a big overhaul of how generic typing works in the first half of 2020, so that should address this.

Interestingly, defining handleSelectItem as a regular function (rather than a class property arrow fn assignment) does not exhibit the bug.

https://flow.org/try/#0PTAEAEDMBsHsHcBQBLAtgB1gJwC6gFSgCGAzqAEoCmRAxnpFrKqAERbV0sDciiOAnukqgACo3QkAPABUAfKAC8oAN6JQoZDkqoSALlDSA2gF0ANGtAlK0SnUoATAJJbU+6eYC+PRJQAemXFB7SkgiAFdoPBpoUjIAMWRIyiwZeT8tADt7MipaHAA6AGEmTAzKDJxJCzFYCVTEeVV1dHE9UVbUnnUACyIsmwBla1scZ20ACk1tNwBKFQt1Cw9edXYs5PG5pvVQGlgMkjx9wuhkGgBrRVBNxUaFnZxu5BJ83v7KIZs6MdRxx+f8i1ai8rF8tE4XDMujtlosdqB2DgwlgMqAMhFoNDlssgA

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jamiebuilds picture jamiebuilds  路  3Comments

pelotom picture pelotom  路  3Comments

ghost picture ghost  路  3Comments

mmollaverdi picture mmollaverdi  路  3Comments

bennoleslie picture bennoleslie  路  3Comments