@@ -1331,7 +1331,8 @@ let translate_type_decl' env ty: option decl =
1331
1331
Some ( DTypeAbstractStruct name )
1332
1332
else if assumed then
1333
1333
let name = string_of_mlpath name in
1334
- BU. print1_warning " Not extracting type definition %s to KaRaMeL (assumed type)\n " name ;
1334
+ if Debug. any () then
1335
+ BU. print1_warning " Not extracting type definition %s to KaRaMeL (assumed type)\n " name ;
1335
1336
// JP: TODO: shall we be smarter here?
1336
1337
None
1337
1338
else
@@ -1381,7 +1382,8 @@ let translate_let' env flavor lb: option decl =
1381
1382
if List. length tvars = 0 then
1382
1383
Some ( DExternal ( translate_cc meta , translate_flags meta , name , translate_type env t0 , arg_names ))
1383
1384
else begin
1384
- BU. print1_warning " Not extracting %s to KaRaMeL (polymorphic assumes are not supported)\n " ( Syntax. string_of_mlpath name );
1385
+ if Debug. any () then
1386
+ BU. print1_warning " Not extracting %s to KaRaMeL (polymorphic assumes are not supported)\n " ( Syntax. string_of_mlpath name );
1385
1387
None
1386
1388
end
1387
1389
@@ -1405,7 +1407,7 @@ let translate_let' env flavor lb: option decl =
1405
1407
in
1406
1408
let name = env . module_name , name in
1407
1409
let i , eff , t = find_return_type E_PURE ( List. length args ) t0 in
1408
- if i > 0 then begin
1410
+ if i > 0 && Debug. any () then begin
1409
1411
let msg = " function type annotation has less arrows than the \
1410
1412
number of arguments; please mark the return type abbreviation as \
1411
1413
inline_for_extraction" in
@@ -1509,7 +1511,8 @@ let translate_decl env d: list decl =
1509
1511
failwith " todo: translate_decl [MLM_Top]"
1510
1512
1511
1513
| MLM_Exn ( m , _ ) ->
1512
- BU. print1_warning " Not extracting exception %s to KaRaMeL (exceptions unsupported)\n " m ;
1514
+ if Debug. any () then
1515
+ BU. print1_warning " Not extracting exception %s to KaRaMeL (exceptions unsupported)\n " m ;
1513
1516
[]
1514
1517
1515
1518
let translate_module uenv ( m : mlpath & option ( mlsig & mlmodule ) & mllib ) : file =
0 commit comments