Closed
Description
Below should give me an error:
class A {
a(): string | null {
if (Math.random() > 0.5) {
return '';
}
// it does error here as expected
}
}
class A {
get a(): string | null {
if (Math.random() > 0.5) {
return '';
}
// it should error here because it returns undefined
}
}
tsc -v
Version 2.1.0-dev.20160713