@@ -4,8 +4,13 @@ use anyhow::{anyhow, Result};
44use hugr_core:: builder:: {
55 BuildHandle , Container , DFGWrapper , HugrBuilder , ModuleBuilder , SubContainer ,
66} ;
7- use hugr_core:: extension:: { ExtensionRegistry , EMPTY_REG } ;
7+ use hugr_core:: extension:: prelude:: PRELUDE_ID ;
8+ use hugr_core:: extension:: { ExtensionRegistry , ExtensionSet , EMPTY_REG } ;
89use hugr_core:: ops:: handle:: FuncID ;
10+ use hugr_core:: std_extensions:: arithmetic:: {
11+ conversions, float_ops, float_types, int_ops, int_types,
12+ } ;
13+ use hugr_core:: std_extensions:: logic;
914use hugr_core:: types:: TypeRow ;
1015use hugr_core:: { Hugr , HugrView } ;
1116use inkwell:: module:: Module ;
@@ -137,7 +142,20 @@ impl SimpleHugrConfig {
137142 ) -> Hugr {
138143 let mut mod_b = ModuleBuilder :: new ( ) ;
139144 let func_b = mod_b
140- . define_function ( "main" , HugrFuncType :: new ( self . ins , self . outs ) )
145+ . define_function (
146+ "main" ,
147+ HugrFuncType :: new ( self . ins , self . outs ) . with_extension_delta (
148+ ExtensionSet :: from_iter ( [
149+ PRELUDE_ID ,
150+ int_types:: EXTENSION_ID ,
151+ int_ops:: EXTENSION_ID ,
152+ float_types:: EXTENSION_ID ,
153+ float_ops:: EXTENSION_ID ,
154+ conversions:: EXTENSION_ID ,
155+ logic:: EXTENSION_ID ,
156+ ] ) ,
157+ ) ,
158+ )
141159 . unwrap ( ) ;
142160 make ( func_b, & self . extensions ) ;
143161
0 commit comments