Skip to content

Commit

Permalink
Fix varcast -> anycast
Browse files Browse the repository at this point in the history
  • Loading branch information
lerno committed Aug 16, 2024
1 parent be54868 commit f538ad2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/content/docs/references/docs/standard_library.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ int b = 5;
io::printfn("%d", a); // Prints 5
```
### varcast(any* v, $Type)
### anycast(any v, $Type)
Optionally cast the value `v` to type `$Type*` on failure returns `VarCastResult.TYPE_MISMATCH`.
Optionally cast the value `v` to type `$Type*` on failure returns `CastResult.TYPE_MISMATCH`.
```c
int b;
any* a = &b;
float*! c = varcast(a, float); // Will return TYPE_MISMATCH
int*! d = varcast(a, int); // Works!
any a = &b;
float*! c = anycast(a, float); // Will return TYPE_MISMATCH
int*! d = anycast(a, int); // Works!
```

### void unreachable($string = "Unreachable statement reached.")
Expand Down Expand Up @@ -103,7 +103,7 @@ are implemented.
- `IteratorResult` returned when reaching the end of an iterator.
- `SearchResult` used when a search fails.
- `AnyCastResult` when a any cast fails.
- `CastResult` when an anycast fails.
## std::core::env
Expand Down

0 comments on commit f538ad2

Please sign in to comment.