Please look at this example. I wonder why the p-parameter is unknown in the function test2. I expected p to be known as a number.
interface MyInterface<A,B>{}
class MyClass<A,B> implements MyInterface<A,B> {}
function test1<A,B>(p:MyClass<A,B>, callback:(p:B)=>void){}
function test2<A,B>(p:MyInterface<A,B>, callback:(p:B)=>void){}
const myInstance = new MyClass<string,number>()
test1(myInstance, (p)=>{
// Here p is a number
})
test2(myInstance, (p)=>{
// Why is p unknown?
})