The following code does not compile (https://www.typescriptlang.org/play):
// I can't change it to be Enum2
enum Enum1 {
A = 'a',
B = 'b',
}
// auto generated by third library tool - can't change it
enum Enum2 {
A = 'a',
B = 'b',
}
// auto generated by third library tool - can't change it
type Union = 'a' | 'b'
declare function f1(e: Enum1): void
// Argument of type 'Enum2.A' is not assignable to parameter of type 'Enum1'.(2345)
f1(Enum2.A) // does not compile
f1('a') // does not compile
Error:
TS2345: Argument of type 'HardhatPodStartedDto[]' is not assignable to parameter of type 'SetStateAction<HardhatPodStarted[]>'
What can I do to solve the compilation error?
- I can't change Enum1, Enum2, Union.
f1does something withe, and that may well influence the suggestions you're given. But right now, we don't have a lot to work with.