Files
tsgo/testdata/baselines/reference/submodule/compiler/functionLikeInParameterInitializer(target=es2015).js

45 lines
884 B
TypeScript

//// [tests/cases/compiler/functionLikeInParameterInitializer.ts] ////
//// [functionLikeInParameterInitializer.ts]
// error
export function bar(func = () => foo) {
let foo = "in";
}
// error
export function baz1(func = { f() { return foo } }) {
let foo = "in";
}
// error
export function baz2(func = function () { return foo }) {
let foo = "in";
}
// error
export function baz3(func = class { x = foo }) {
let foo = "in";
}
//// [functionLikeInParameterInitializer.js]
// error
export function bar(func = () => foo) {
let foo = "in";
}
// error
export function baz1(func = { f() { return foo; } }) {
let foo = "in";
}
// error
export function baz2(func = function () { return foo; }) {
let foo = "in";
}
// error
export function baz3(func = class {
constructor() {
this.x = foo;
}
}) {
let foo = "in";
}