You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2021/03/21 07:59:03 UTC

[groovy] 01/02: GROOVY-7968: update test cases

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 279e290c8c08bcf9682219b1bfae486730805ad8
Author: Joona <jo...@gmail.com>
AuthorDate: Sun Feb 14 12:42:58 2021 +0200

    GROOVY-7968: update test cases
---
 .../scope/MultipleDefinitionOfSameVariableTest.groovy  | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/test/gls/scope/MultipleDefinitionOfSameVariableTest.groovy b/src/test/gls/scope/MultipleDefinitionOfSameVariableTest.groovy
index a113f13..146cd49 100644
--- a/src/test/gls/scope/MultipleDefinitionOfSameVariableTest.groovy
+++ b/src/test/gls/scope/MultipleDefinitionOfSameVariableTest.groovy
@@ -116,6 +116,15 @@ class MultipleDefinitionOfSameVariableTest extends CompilableTestSupport {
         """
     }
 
+    void testPropertyFieldBothInit() {
+        shouldNotCompile """
+            class A {
+                def foo = 3
+                private foo = 4
+            }
+        """
+    }
+
     void testFieldProperty() {
         shouldCompile """
             class A {
@@ -125,6 +134,15 @@ class MultipleDefinitionOfSameVariableTest extends CompilableTestSupport {
         """
     }
 
+    void testFieldPropertyBothInit() {
+        shouldNotCompile """
+            class A {
+                private foo = 'a'
+                def foo = 'b'
+            }
+        """
+    }
+
     void testFieldPropertyProperty() {
         shouldNotCompile """
             class A {