I don't know if you currently want feedback, since you're working on major changes? let me know if this is wanted or not? 🙂
This issue is best explained by example:
class UserRepo {
getUsers() {
return [{ name: "Bob", age: "42" }];
}
}
function run<T>(fn: () => T): T {
const type = getType<T>();
console.log(type.id);
return fn();
}
run(() => new UserRepo()); // 👎 ::invalid::Invalid
run<UserRepo>(() => new UserRepo()); // 👍 @try-rttist/dist/index::UserRepo
The two run calls should return the same type - as you can see here, it's being inferred:

With an explicit type argument, it works, but I'm assuming this should work with inference as well?
Here's a repro for this issue:
https://github.com/mindplay-dk/try-rttist/tree/inference-repro
I don't know if you currently want feedback, since you're working on major changes? let me know if this is wanted or not? 🙂
This issue is best explained by example:
The two
runcalls should return the same type - as you can see here, it's being inferred:With an explicit type argument, it works, but I'm assuming this should work with inference as well?
Here's a repro for this issue:
https://github.com/mindplay-dk/try-rttist/tree/inference-repro