question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flow Generics reported as error

See original GitHub issue

Following is a valid flow syntax, but is reported as error by prettier plugin: const funName = <T>(param: T): T => { // ... }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
shashanktomarcommented, May 31, 2017

@darahak Thanks for verifying. Submitted a bug #1828

0reactions
robwisecommented, Jun 1, 2017

closing since this is a prettier issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flow functions with generics reported as error · Issue #1828 · prettier ...
Following is a valid flow statement, but is reported as error by prettier. const fun1 = <T>(param: T): T => param; const fun2...
Read more >
Flow's Improved Handling of Generic Types - Medium
Flow has improved its handling of generic types by banning unsafe behaviors previously allowed and clarifying error messages.
Read more >
Flow doesn't allow me to pass generics with more properties ...
I asked this to flow maintainers and seems that I was actually pretty close. I was just missing a plus sign on the...
Read more >
Generic Types | Flow
Generics can be used within functions, function types, classes, type aliases, and interfaces. Warning: Flow does not infer generic types. If you want...
Read more >
Parsing error when calling generic function with type arguments
The first time I saw this error, my first impression was that I forgot to import XType , so I scrolled to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found