fefrei / prog2tests

Automatically exported from code.google.com/p/prog2tests
0 stars 0 forks source link

Variable declaration #68

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
TreeBewiedTest.testNamingBad contains the following line, which expects us to 
throw a Typing exception:

assertNamingException("int foo(int a) { { int b = b; int c = 42; } return a; 
}");

As far as I can see, the documentation does not oblige us to throw an 
TypingException in this case. I think "int b = b" is supposed to be a shortcut 
for "int b; b = b".

Original issue reported on code.google.com by Wob...@gmx.de on 1 Aug 2012 at 10:01

GoogleCodeExporter commented 9 years ago
Hm, I'm not 100% sure about that one. Throwing a *naming* exception certainly 
makes sense, but I'm not sure it is required. Let's ask Tobias about that one.

Original comment by felix@familie-freiberger.net on 2 Aug 2012 at 7:09

GoogleCodeExporter commented 9 years ago
As confirmed by Tobias in IRC, "int b = b;" is in fact illegal.

Original comment by felix@familie-freiberger.net on 6 Aug 2012 at 6:50