paulk-asert commented on PR #3017:
URL: https://github.com/apache/groovy/pull/3017#issuecomment-6641008940

   Thanks Daniel. On your points:
   
   1. The new check is in recordMissingProperty, so it only runs once 
existsProperty has failed and the type checking extensions have had their 
chance. Everything it rejects was already a compile error, previously reported 
as "No such property: null for class: …", the message Björn flagged on the 
JIRA. So it can't reject anything that compiled before; it only explains the 
error and points to subscript notation. A name without interpolation, such as 
map."a", is a constant and never reaches the check.
   2. FieldsAndPropertiesStaticCompileTest extends FieldsAndPropertiesSTCTest, 
so these tests, including map[key] and date[key] via subscript, also run under 
@CompileStatic.
   3. Yes, that's intentional: the caret goes on the interpolated name, which 
is what needs changing.
   4. [a: 1]."a${''}" covers an interpolated name whose value is known at 
compile time, and it's rejected like the others. As Jochen notes on the JIRA, 
x."$name" follows a different path from x[name], so the checker leaves it alone 
rather than guessing.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to