File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44from spy import ast
55from spy .backend .c import c_ast as C
66from spy .backend .c .context import C_Ident , Context
7+ from spy .errors import SPyError
78from spy .fqn import FQN
89from spy .location import Loc
910from spy .textbuilder import TextBuilder
@@ -309,7 +310,14 @@ def fmt_expr_FQNConst(self, const: ast.FQNConst) -> C.Expr:
309310 assert w_obj .h == 0 , "only NULL _FILE can be a constant"
310311 return C .Literal ("NULL" )
311312 else :
312- assert False
313+ w_T = self .ctx .vm .dynamic_type (w_obj )
314+ t = w_T .fqn .human_name
315+ raise SPyError .simple (
316+ "W_WIP" ,
317+ f"Prebuilt constant of type `{ t } ` are not supported by the C backend" ,
318+ f"This is `{ t } `" ,
319+ const .loc ,
320+ )
313321
314322 def fmt_expr_Name (self , name : ast .Name ) -> C .Expr :
315323 assert False , "ast.Name nodes should not survive redshifting"
You can’t perform that action at this time.
0 commit comments