This is an automated email from the ASF dual-hosted git repository.
emilles pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new fd43443ca9 GROOVY-11775: add test case
fd43443ca9 is described below
commit fd43443ca9c64d1e83769f76f646362584aec411
Author: Eric Milles <[email protected]>
AuthorDate: Wed Nov 19 09:53:52 2025 -0600
GROOVY-11775: add test case
---
src/test/groovy/groovy/lang/MixinTest.groovy | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/src/test/groovy/groovy/lang/MixinTest.groovy
b/src/test/groovy/groovy/lang/MixinTest.groovy
index fa24f5ce9a..d7d7ea1160 100644
--- a/src/test/groovy/groovy/lang/MixinTest.groovy
+++ b/src/test/groovy/groovy/lang/MixinTest.groovy
@@ -383,6 +383,7 @@ final class MixinTest {
'''
}
+ @Test
void testMixinWithVarargs() {
assertScript '''
class Dsl {
@@ -397,6 +398,25 @@ final class MixinTest {
'''
}
+ // GROOVY-11775
+ @Test
+ void testRepeatMixing() {
+ assertScript '''
+ class Foo {
+ int value = new Random().nextInt()
+ }
+ class Bar {
+ }
+ Bar.mixin(Foo)
+ def bar = new Bar()
+ int val = bar.value
+ assert bar.value == val
+ Bar.mixin(Foo)
+ assert bar.value == val
+ assert bar.value == val
+ '''
+ }
+
//--------------------------------------------------------------------------
static class ArrayListExt {