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
Excuse for confusing title, difficult explain my case in few words.
I'm declare custom class system and everything alright until not appearing property oops: JQuery, which suppress expected error:
declare var JQuery: any;
declare class BEM {
static decl<P, SP>(block: string, props: P, staticProps?: SP): Class<BEM & P> & SP;
static blocks: { [name: string]: Class<*> };
// oops: JQuery; // <- This line suppress an error.
}
var Provider = BEM.decl('provider', {}, {
foo: function(a: string) {}
});
var p: typeof Provider = BEM.blocks['provider'];
p.foo('');
p.bla(); // <- Expected error "property `bla`. Property not found in."
Experimentally I found that declaration below is not suppress an error:
declare class JQuery {}
But why the first code has the described behavior? Is it bug?
Flow version 0.40.0.
The text was updated successfully, but these errors were encountered:
If you use oops: typeof JQuery;, it works as intended. You're using a value as a type, which normally throws an error, but doesn't for some reason with any.
Excuse for confusing title, difficult explain my case in few words.
I'm declare custom class system and everything alright until not appearing property
oops: JQuery
, which suppress expected error:Experimentally I found that declaration below is not suppress an error:
But why the first code has the described behavior? Is it bug?
Flow version
0.40.0
.The text was updated successfully, but these errors were encountered: