Today I spent a moment scratching my head at the following snippet:
interface Foo {
bar: number = 5;
}
"Of course!" I say now, I was trying to set a default value on an interface, which makes no sense. TypeScript didn't see that this might be something I would do, and instead gave me a syntax error:
Error TS1005: ';' expected.
Error TS1131: Property or signature expected.
Error TS1128: Declaration or statement expected.
Would it be possible to get a more useful error message for this case (and potentially cases like this?)
Today I spent a moment scratching my head at the following snippet:
"Of course!" I say now, I was trying to set a default value on an interface, which makes no sense. TypeScript didn't see that this might be something I would do, and instead gave me a syntax error:
Would it be possible to get a more useful error message for this case (and potentially cases like this?)