Skip to content

Instantly share code, notes, and snippets.

@jeffmo
Created October 18, 2016 18:24
Show Gist options
  • Save jeffmo/2011c226a0a73b80ec3f097e42a1cada to your computer and use it in GitHub Desktop.
Save jeffmo/2011c226a0a73b80ec3f097e42a1cada to your computer and use it in GitHub Desktop.
// @flow
const K = require('./main');
new K({errorHandler(err) { err.code; }});
// @flow
type Options = {
errorHandler?: (err: Error) => void,
};
class K {
constructor(options: Options) {
}
}
module.exports = K;
/*
new K({
errorHandler(err) {
err.code;
},
});
*/
> flow version
Flow, a static type checker for JavaScript, version 0.33.0
> flow check
dep.js:5
5: new K({errorHandler(err) { err.code; }});
^^^^ property `code`. Property not found in
5: new K({errorHandler(err) { err.code; }});
^^^ Error
Found 1 error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment