Closed hpablo closed 11 months ago
Wild. That sure seems like it would be difficult for a novice to understand for me too. I'll take a look and see if I can't figure out why it's choosing that message.
Well look at that. It really does do this. Well, it's confirmed. I'll see if I can't get rid of this one.
Well, I still have to run the test suite and push it up, but I think I've fixed it. It looks like there were instances where it was actually token splitting, which is correct in this case, but because of that it thought there was an expression and a statement. That's actually correct as well, but under that very specific instance, if the compiler generated the correct message, it would sometimes throw it away and not give it to the user, which led to a fallback. There was another bug in there where it wouldn't tell you which token was the problem, so I fixed that too.
The new message is as follows:
The text ended when trying to process an identifier named 'b.' You could try calling an action with parens (), setting it to a value with = (equals) or other options.
Personally I think that's still a bit unclear, but I think at this particular spot in the compiler it probably couldn't tell you much more than that. It's also consistent with other messages at least and 8th grade reading level (I just checked). That said, I'm happy to take suggestions.
In any case, thanks so much for sending this to us! I didn't know this bug existed and it really was pretty confusing. I'll try to have this come out in the next patch, online and off.
Here's the commit with the fix:
When exploring the first Activity in this web page introducing types, I tried
and got
which is fine. But then tried
and got
which I'd think a novice will find unexpected, and difficult to understand.