Skip to content

"TypeError: in ccall: ..." when using (:function, library) ccall form #124

@topolarity

Description

@topolarity

Very similar to #54, but technically a different problem since it's the 2-argument (fn, lib) tuple form that is problematic:

julia> using LibCURL_jll: libcurl
julia> JuliaLowering.include_string(Main, raw"""
       function curl_version_info(arg1)
           ccall((:curl_version_info, libcurl), Ptr{Cvoid}, (UInt32,), arg1)
       end
       """)
julia> curl_version_info(UInt32(5))
ERROR: TypeError: in ccall: first argument not a pointer or valid constant expression, expected Ptr, got a value of type Tuple{Symbol, Base.Libc.Libdl.LazyLibrary}

This probably became an issue with JuliaLang/julia#59165.

That PR cleaned up the usage of static_eval in codegen by making this a syntactic opt-in, but it seems like it needs a "forward-port" to JS / JL to use the 2-tuple syntax - @mlechu can you take care of that?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions