You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2025/04/27 23:09:00 UTC
[jira] [Created] (GROOVY-11641) trait extends trait and uses static field in static method
Eric Milles created GROOVY-11641:
------------------------------------
Summary: trait extends trait and uses static field in static method
Key: GROOVY-11641
URL: https://issues.apache.org/jira/browse/GROOVY-11641
Project: Groovy
Issue Type: Bug
Reporter: Eric Milles
Assignee: Eric Milles
Consider the following:
{code:groovy}
trait Foo {
public static final String BANG = '!'
}
trait Bar extends Foo {
static staticMethod(String string) {
string + BANG
}
}
class Main implements Bar {
static test1() {
String result = staticMethod('works')
assert result == 'works!'
}
void test2() {
String result = staticMethod('works')
assert result == 'works!'
}
}
Main.test1()
new Main().test2()
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)