mirror of
https://github.com/hanzoai/prettier.git
synced 2026-09-24 17:02:04 +00:00
15 lines
264 B
JavaScript
15 lines
264 B
JavaScript
class BaseClass {
|
|
baseProp: string;
|
|
}
|
|
|
|
class ChildClass extends BaseClass {
|
|
childProp: string;
|
|
}
|
|
|
|
function test(obj: BaseClass): string {
|
|
if (obj instanceof ChildClass) {
|
|
return obj.childProp_TYPO; // error (obj: ChildClass)
|
|
}
|
|
return obj.baseProp;
|
|
}
|