static_h: Assertion `Val && "isa<> used on a null pointer"' failed with -typed on tsc.js
jakebailey opened this issue · comments
Bug Description
Hermes git revision (if applicable): 208adbf
OS: Ubuntu 22.04 on WSL2
Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64): x86_64
Steps To Reproduce
Running shermes
on tsc.js
using the same command used in the ffe examples:
$ ~/work/hermes-build/bin/shermes -typed -exec ~/work/TypeScript/built/local/tsc.js
shermes: /home/jabaile/work/hermes/external/llvh/include/llvh/Support/Casting.h:106: static bool llvh::isa_impl_cl<To, const From*>::doit(const From*) [with To = hermes::flow::ClassType; From = hermes::flow::TypeInfo]: Assertion `Val && "isa<> used on a null pointer"' failed.
[1] 46223 IOT instruction ~/work/hermes-build/bin/shermes -typed -exec
Obviously I am not expecting this to work out of the box, but it sounds like there's something wrong here.
The Expected Behavior
No crash, some other error. Running without -typed
gives more reasonable errors, like:
/home/jabaile/work/TypeScript/src/compiler/debug.ts:859:16: [original] warning: the variable "console" was not declared in function "printControlFlowGraph"
/home/jabaile/work/TypeScript/built/local/tsc.js:1904:12: [transpiled] warning: the variable "console" was not declared in function "printControlFlowGraph"
return console.log(formatControlFlowGraph(flowNode));
^~~~~~~
/home/jabaile/work/TypeScript/src/compiler/performanceCore.ts:88:58: [original] warning: the variable "require" was not declared in function "tryGetNodePerformanceHooks"
/home/jabaile/work/TypeScript/built/local/tsc.js:2586:88: [transpiled] warning: the variable "require" was not declared in function "tryGetNodePerformanceHooks"
const { performance: performance2, PerformanceObserver: PerformanceObserver2 } = require("perf_hooks");
/home/jabaile/work/TypeScript/src/compiler/semver.ts:46:8: [original] error: Invalid expression encountered
/home/jabaile/work/TypeScript/built/local/tsc.js:2268:16: [transpiled] error: Invalid expression encountered
var _Version = class _Version {
... a few more things
Looks like this is due to our inconsistent handling of ClassExpression, which we don't fully support yet (only ClassDeclaration for typed classes at the moment).
Obviously we shouldn't fail with an assert, we'll look into fixing it. Thanks for the report.