🔎 Search Terms
"constructor"
🕗 Version & Regression Information
⏯ Playground Link
https://www.typescriptlang.org/play/?ts=5.8.3#code/MYGwhgzhAECC0G8BQ1oHJgHsB2EAuATgK7B6YFoAUAlItAL5KNa57RjQC802ApgO5waSFhEwheAOhCYA5pTCTRhEmQLUgA
💻 Code
class A {
'constructor'() { }
}
const a = new A()
console.log(a.constructor)
🙁 Actual behavior
Open the console and place the cursor on the constructor in the last line, will throw this error:
🙂 Expected behavior
No error is expected
Additional information about the issue
|
const str = node as StringLiteralLike; |
|
return str.text.length === searchSymbolName.length && ( |
Here, str is a TokenObject, it doesn't have a text property.

🔎 Search Terms
"constructor"
🕗 Version & Regression Information
⏯ Playground Link
https://www.typescriptlang.org/play/?ts=5.8.3#code/MYGwhgzhAECC0G8BQ1oHJgHsB2EAuATgK7B6YFoAUAlItAL5KNa57RjQC802ApgO5waSFhEwheAOhCYA5pTCTRhEmQLUgA
💻 Code
🙁 Actual behavior
Open the console and place the cursor on the
constructorin the last line, will throw this error:🙂 Expected behavior
No error is expected
Additional information about the issue
TypeScript/src/services/findAllReferences.ts
Lines 1840 to 1841 in dd1e258
Here,
stris aTokenObject, it doesn't have atextproperty.