JuliaLang / AllocCheck.jl

AllocCheck
Other
215 stars 8 forks source link

Built-in functions (e.g. `jl_type_error`) should provide better error messages #20

Closed topolarity closed 9 months ago

topolarity commented 10 months ago

Right now a call to jl_type_error prints as:

 Allocation of Any in ./foo.jl
  | y = foo(x, z)::Int64
Stacktrace:
 [1] alloc_in_catch(x::Any)
   @ Main ./REPL[4]:3

The allocation type should probably be a TypeError.

Or maybe we want specific diagnostics for this that say "type-assertion may allocate on error" or similar.

topolarity commented 10 months ago

Result from discussion today: We should distinguish between AllocationSites and AllocatingRuntimeCalls - and print slightly different errors in the two cases