Skip to content

Commit

Permalink
GROOVY-9966
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Mar 5, 2021
1 parent 783164f commit ccc3896
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4655,6 +4655,21 @@ public void testGroovy9906() {
runConformTest(sources, "");
}

@Test // https://issues.apache.org/jira/browse/GROOVY-9966
public void testGroovy9966() {
//@formatter:off
String[] sources = {
"Main.groovy",
"import static java.util.Arrays.*\n" +
"def m(x) { return x }\n" +
"final value = 123.456\n" +
"m(\"$value\").missing\n",
};
//@formatter:on

runConformTest(sources, "", "groovy.lang.MissingPropertyException: No such property: missing for class: org.codehaus.groovy.runtime.GStringImpl");
}

// was worried <clinit> would surface in list of methods used to build the type declaration, but that doesn't appear to be the case
@Test
public void testExtendingGroovyObjects_clinit() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,19 @@ public Expression transform(Expression exp) {
}
if (clazz == ArgumentListExpression.class) {
Expression result = exp.transformExpression(this);
// GRECLIPSE add -- GROOVY-9966
if (foundArgs == null)
// GRECLIPSE end
if (inPropertyExpression) {
foundArgs = result;
}
return result;
}
if (exp instanceof ConstantExpression) {
Expression result = exp.transformExpression(this);
// GRECLIPSE add -- GROOVY-9966
if (foundConstant == null)
// GRECLIPSE end
if (inPropertyExpression) {
foundConstant = result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,19 @@ public Expression transform(Expression exp) {
}
if (clazz == ArgumentListExpression.class) {
Expression result = exp.transformExpression(this);
// GRECLIPSE add -- GROOVY-9966
if (foundArgs == null)
// GRECLIPSE end
if (inPropertyExpression) {
foundArgs = result;
}
return result;
}
if (exp instanceof ConstantExpression) {
Expression result = exp.transformExpression(this);
// GRECLIPSE add -- GROOVY-9966
if (foundConstant == null)
// GRECLIPSE end
if (inPropertyExpression) {
foundConstant = result;
}
Expand Down

0 comments on commit ccc3896

Please sign in to comment.