# Assigns the `ftype` to class definitions, work on the AST only
private class ExternClassesTypingPhaseAst
super Phase
redef fun process_nclassdef(nclassdef)
do
if not nclassdef isa AStdClassdef then return
var code_block = nclassdef.n_extern_code_block
if code_block == null then return
if nclassdef.n_kwredef != null then
# A redef cannot specify a different extern type
toolcontext.error(nclassdef.location, "FFI Error: only the introduction of a class can declare an extern type.")
return
end
var ftype = code_block.language.get_ftype(code_block, nclassdef)
nclassdef.mclassdef.ftype_cache = ftype
nclassdef.mclassdef.ftype_computed = true
end
end
src/ffi/extern_classes.nit:30,1--51,3