Drop obsolete List.get hardcoded type

This commit is contained in:
Richard Feldman 2020-04-26 09:33:08 -04:00
parent b7862f1dc1
commit ac6e98361e

View file

@ -372,21 +372,8 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
// List module // List module
// get : List elem, Int -> Result elem [ IndexOutOfBounds ]* // get : List elem, Int -> Result elem [ IndexOutOfBounds ]*
let index_out_of_bounds = SolvedType::TagUnion(
vec![(TagName::Global("IndexOutOfBounds".into()), vec![])],
Box::new(SolvedType::Wildcard),
);
add_type( add_type(
Symbol::LIST_GET, Symbol::LIST_GET_UNSAFE,
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, // TODO remove this once we can code gen Result
SolvedType::Func( SolvedType::Func(
vec![list_type(flex(TVAR1)), int_type()], vec![list_type(flex(TVAR1)), int_type()],
Box::new(flex(TVAR1)), Box::new(flex(TVAR1)),