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
{{ message }}
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.
it("declared function type parameter bounds",()=>{verifyAndAssertMessages(unpad(` import type Foo from 'foo'; declare function foo<T: Foo>(a: T): T; foo(1); `),{"no-unused-vars": 1,"no-undef": 1},[]);});
results in
[
{
"ruleId":"no-unused-vars",
"severity":1,
"message":"'Foo' is defined but never used.",
"line":1,
"column":13,
"nodeType":"Identifier",
"source":"import type Foo from 'foo';"
}
]
and
it("declared class type parameter bounds",()=>{verifyAndAssertMessages(unpad(` import type Foo from 'foo'; declare class C<T: Foo> { x: T }; new C(); `),{"no-unused-vars": 1,"no-undef": 1},[]);});
results in
[
{
"ruleId":"no-unused-vars",
"severity":1,
"message":"'Foo' is defined but never used.",
"line":1,
"column":13,
"nodeType":"Identifier",
"source":"import type Foo from 'foo';"
},
{
"ruleId":"no-unused-vars",
"severity":1,
"message":"'T' is defined but never used.",
"line":2,
"column":17,
"nodeType":"Identifier",
"source":"declare class C<T: Foo> {"
}
]
I don't use Flow much, so I'm not encountering this in the wild, but trying the above at https://flowtype.org/try/ appears to indicate that the code is semantically correct.
The text was updated successfully, but these errors were encountered:
rattrayalex
changed the title
[flow] declare function does not recognized bounded polymorphic types
[flow] declare function does not recognize bounded polymorphic types
Mar 23, 2017
In the course of #444 , I noticed that
results in
and
results in
I don't use Flow much, so I'm not encountering this in the wild, but trying the above at https://flowtype.org/try/ appears to indicate that the code is semantically correct.
The text was updated successfully, but these errors were encountered: