14 lines
No EOL
509 B
Text
14 lines
No EOL
509 B
Text
tests/cases/compiler/thisInArrowFunctionInStaticInitializer1.ts(6,7): error TS2334: 'this' cannot be referenced in a static property initializer.
|
|
|
|
|
|
==== tests/cases/compiler/thisInArrowFunctionInStaticInitializer1.ts (1 errors) ====
|
|
function log(a) { }
|
|
|
|
class Vector {
|
|
static foo = () => {
|
|
// 'this' should not be available in a static initializer.
|
|
log(this);
|
|
~~~~
|
|
!!! error TS2334: 'this' cannot be referenced in a static property initializer.
|
|
}
|
|
} |