miniblog.

← Back to all posts
14
I've been using "Expected Int, but got String" for my type error messages, but I've been wondering if I could do better. "Expected Int here, but this value has type String" or "This expression requires Int, but the value is String". Do you have a favourite?

4 Comments

@wilfredh the last one for me. You don't know off the bat which side is actually wrong. And one day, we can look at what just changed in the code, and use that to formulate it.
@wilfredh I like "Expected Int, got String"