PlasmaLang / plasma

Plasma Programming Language
Other
162 stars 10 forks source link

An unhelpful type error #420

Open PaulBone opened 2 years ago

PaulBone commented 2 years ago

With this code I can make the type checker crash with an unhelpful error:

func split_at_once(split : func(CodePoint) -> Bool, string : String)
   -> (String, String)
{
   ...
}

func do_puzzle(line : String) uses IO {
    var part1, var part2 = split_at_once("|", line)
}

It crashes with:

A compilation error occured and this error is not handled gracefully
by the Plasma compiler. Sorry.
Message:            Failed disjunction
plzc location:      predicate `core.type_chk.solve.run_clause'/7
plzc file:          core.type_chk.solve.m