codemix / babel-plugin-typecheck

Static and runtime type checking for JavaScript in the form of a Babel plugin.
MIT License
886 stars 44 forks source link

Syntax error when using callback in generic function definition with flowtype annotation #28

Closed pristas-peter closed 9 years ago

pristas-peter commented 9 years ago

export function styleWithSetting(setting: RequiredSetting, callback: (value: T) => number): number { ... }

SyntaxError: layout.js: Line 82: Unsupported type annotation type: FunctionTypeAnnotation

SyntaxError: /Users/peter/Developer/js/src/lib/components/layout.js: Line 82: Unsupported type annotation type: FunctionTypeAnnotation 80 | } 81 |

82 | function styleWithSetting(setting: RequiredSetting, callback: (value: T) => Style): Style { | ^ 83 | 84 | let style: any = {}; 85 | at File.errorWithNode (/Users/peter/Developer/js/node_modules/babel-core/lib/transformation/file/index.js:489:13) at NodePath.errorWithNode (/Users/peter/Developer/js/node_modules/babel-core/lib/traversal/path/index.js:155:26) at NodePath.Function (/Users/peter/Developer/js/node_modules/babel-plugin-typecheck/lib/index.js:48:22) at NodePath.call (/Users/peter/Developer/js/node_modules/babel-core/lib/traversal/path/context.js:56:28) at NodePath.visit (/Users/peter/Developer/js/node_modules/babel-core/lib/traversal/path/context.js:90:8) at TraversalContext.visitMultiple (/Users/peter/Developer/js/node_modules/babel-core/lib/traversal/context.js:108:16) at TraversalContext.visit (/Users/peter/Developer/js/node_modules/babel-core/lib/traversal/context.js:146:19) at Function.traverse.node (/Users/peter/Developer/js/node_modules/babel-core/lib/traversal/index.js:76:17) at NodePath.visit (/Users/peter/Developer/js/node_modules/babel-core/lib/traversal/path/context.js:107:26) at TraversalContext.visitSingle (/Users/peter/Developer/js/node_modules/babel-core/lib/traversal/context.js:132:12) at TraversalContext.visit (/Users/peter/Developer/js/node_modules/babel-core/lib/traversal/context.js:148:19)