Skip to content

Clean up Object, Conditional, and Boolean

Yorick Peterse requested to merge cleanup-object into master

This makes it easier to implement Conditional and Equal, and makes Object a little bit less of a mess. These changes uncovered two bugs:

  1. The compiler did not support looking up default methods on a trait when they were defined on Object.

  2. Map.iter was not implemented correctly. If the last bucket in a Map was Nil, Map.iter would produce a Nil value. This has been fixed by the Iterator not producing values at all in this case.

Originally I started working on these changes in hopes of getting rid of Object entirely. This will not be possible, as it makes Inko a bit annoying to work with. For example, Conditional and Equal would have to be implemented manually for every object, leading to a lot of boilerplate. Instead, we'll keep Object for the time being.

Merge request reports