Add types for Str.startsWith

This commit is contained in:
Dimitar Apostolov 2020-09-20 14:11:34 +02:00 committed by Dimitar Apostolov
parent 9e1836dde0
commit b82baf55e7
3 changed files with 24 additions and 0 deletions

View file

@ -505,6 +505,12 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
top_level_function(vec![str_type()], Box::new(bool_type())),
);
// startsWith : Str, Str -> Bool
add_type(
Symbol::STR_STARTS_WITH,
SolvedType::Func(vec![str_type(), str_type()], Box::new(bool_type())),
);
// List module
// get : List elem, Int -> Result elem [ OutOfBounds ]*