Before I'd associated it with TEClass which was a bit of technical debt to ease implementation, but need to split DR checking from core lang checking completely
(* Can't assign a borrowed expr to a variable *)
let check_expr_not_borrowed type_expr loc =
match type_expr with
| TEClass (class_name, Borrowed) ->
Error
(Error.of_string
(Fmt.str "%s Type error: can't assign expr of type %s as it is borrowed."
(string_of_loc loc)
(Class_name.to_string class_name)))
| _ -> Ok ()
Before I'd associated it with
TEClass
which was a bit of technical debt to ease implementation, but need to split DR checking from core lang checking completelyThis ^ should go in DR checker