Author Topic: Java live error "expected" instead of "';' expected"  (Read 209 times)

rowbearto

  • Senior Community Member
  • Posts: 1607
  • Hero Points: 116
Java live error "expected" instead of "';' expected"
« on: December 16, 2019, 08:39:04 pm »
With JDK 11.0.5 and Java live errors, if you "forget" to put a semicolon ';' at the end of a line, the Live errors only says "expected", not telling you what is expected.

But a java compile will say "';' expected"

It would be nice for the Live error message to mention that it is the semi-colon that is expected.

I think I've also seen other errors where certain characters were expected but the live errors only says "expected" and not what is expected.

UPDATE: If you call a function but forget the closing ')' (but still have ending semicolon), then live errors only says "expected" whereas the build says "')' expected"

Code: [Select]
  // Notice closing parenthesis missing
  callfunc(a, b ;
« Last Edit: December 16, 2019, 08:57:22 pm by rowbearto »

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1210
  • Hero Points: 117
Re: Java live error "expected" instead of "';' expected"
« Reply #1 on: December 17, 2019, 02:14:26 pm »
I'll take a look.  We're supposed to just be passing along the error we got from the compiler API, but maybe something is getting mangled.

rowbearto

  • Senior Community Member
  • Posts: 1607
  • Hero Points: 116
Re: Java live error "expected" instead of "';' expected"
« Reply #2 on: December 17, 2019, 03:00:45 pm »
Thanks!

I found a 3rd similar case: if you don’t have a return statement in a function that returns non-void.