Skip to content

Commit

Permalink
Fix compilation error in dce.ml. (#11779)
Browse files Browse the repository at this point in the history
This fixes the following compilation error:

```ocaml
File "src/optimization/dce.ml", line 90, characters 13-48:
90 |    List.exists (ExtString.String.starts_with file) dce.std_dirs
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: This expression has type prefix:string -> bool
       but an expression was expected of type 'a -> bool
make: *** [Makefile:81: haxe] Error 1
```

By replacing:

```ocaml
let is_std_file dce file =
	List.exists (ExtString.String.starts_with file) dce.std_dirs
```

with:

```ocaml
let is_std_file dce file =
	List.exists (fun dir -> ExtString.String.starts_with file dir)
dce.std_dirs
```
  • Loading branch information
tritao authored Sep 21, 2024
1 parent b99eda0 commit 1ce738c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/optimization/dce.ml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ let overrides_extern_field cf c =
loop c cf

let is_std_file dce file =
List.exists (ExtString.String.starts_with file) dce.std_dirs
List.exists (fun dir -> ExtString.String.starts_with file dir) dce.std_dirs

let keep_metas = [Meta.Keep;Meta.Expose]

Expand Down

0 comments on commit 1ce738c

Please sign in to comment.