Open jakebailey opened 1 year ago
Here's what happens:
checkVariableLikeDeclaration
call for result
variable.getTypeOfSymbol
for result
variable.checkExpression
for myRequire("something")
.getFlowTypeOfReference
for myRequire
.getTypeAtFlowLoopLabel
for back edge of loop.getEffectsSignature
for assertIsDefined(result)
call.inferTypeArguments
for that call.checkExpression
for result
argument.getTypeOfSymbol
for result
variable.We probably could be a bit smarter about realizing that none of the arguments in the assertIsDefined(result)
call match the reference (myRequire
) for which we are currently doing CFA.
I'm noticing an odd "referenced directly or indirectly in its own initializer" error in my code. Wondering if you can help confirm whether this is the same issue or a separate one?
Bug Report
🔎 Search Terms
referenced directly or indirectly asserts
🕗 Version & Regression Information
⏯ Playground Link
Playground Link
💻 Code
🙁 Actual behavior
result
is claimed to be referenced directly or indirectly in its initializer.Modifying the code in various ways makes the error go away.
🙂 Expected behavior
No error; there's no relationship between the initializer and the result.