You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/TraitsTests.java
+39-4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2009-2020 the original author or authors.
2
+
* Copyright 2009-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -1550,7 +1550,9 @@ public void testTraits61() {
1550
1550
String[] sources = {
1551
1551
"Script.groovy",
1552
1552
"trait T {\n" +
1553
-
" @groovy.transform.PackageScope int m() { 42 }\n" +
1553
+
" @groovy.transform.PackageScope int m() {\n" +
1554
+
" 42\n" +
1555
+
" }\n" +
1554
1556
" def x() { print m() }\n" +
1555
1557
"}\n" +
1556
1558
"class C implements T {\n" +
@@ -1559,7 +1561,13 @@ public void testTraits61() {
1559
1561
};
1560
1562
//@formatter:on
1561
1563
1562
-
runConformTest(sources, "42");
1564
+
runNegativeTest(sources,
1565
+
"----------\n" +
1566
+
"1. ERROR in Script.groovy (at line 2)\n" +
1567
+
"\t@groovy.transform.PackageScope int m() {\n" +
1568
+
"\t^\n" +
1569
+
"Groovy:Can't use @PackageScope for method 'm' which has explicit visibility.\n" +
1570
+
"----------\n");
1563
1571
}
1564
1572
1565
1573
@Test
@@ -1797,7 +1805,7 @@ public void testTraits7288() {
1797
1805
runConformTest(sources, "");
1798
1806
}
1799
1807
1800
-
@Test@Ignore
1808
+
@Test
1801
1809
publicvoidtestTraits7293() {
1802
1810
//@formatter:off
1803
1811
String[] sources = {
@@ -2699,4 +2707,31 @@ public void testTraits9763() {
0 commit comments