Temporarily disable List.get in favor of getUnsafe

This commit is contained in:
Richard Feldman 2020-04-26 09:24:45 -04:00
parent 52a3e0afb5
commit 1bee16decd
6 changed files with 141 additions and 142 deletions

View file

@ -371,7 +371,20 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
// List module
// get : List elem, Int -> Result elem [ IndexOutOfBounds ]*
// get : List elem, Int -> Result elem [ OutOfBounds ]*
let index_out_of_bounds = SolvedType::TagUnion(
vec![(TagName::Global("OutOfBounds".into()), vec![])],
Box::new(SolvedType::Wildcard),
);
add_type(
Symbol::LIST_GET,
SolvedType::Func(
vec![list_type(flex(TVAR1)), int_type()],
Box::new(result_type(flex(TVAR1), index_out_of_bounds)),
),
);
add_type(
Symbol::LIST_GET_UNSAFE,
SolvedType::Func(