This repository was archived by the owner on Sep 3, 2020. It is now read-only.
File tree 1 file changed +32
-2
lines changed
src/test/scala/scala/tools/refactoring/tests/implementations
1 file changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,36 @@ class ImplementMethodsTest extends TestHelper with TestRefactoring {
50
50
""" .stripMargin
51
51
} applyRefactoring implementMethods
52
52
53
+ @ Test
54
+ def implementMethodFromExtendedClass () = new FileSet () {
55
+ """
56
+ |package implementMethods
57
+ |
58
+ |abstract class C {
59
+ | def f(x: Int): String
60
+ |}
61
+ |
62
+ |object Obj extends /*(*/C/*)*/ {
63
+ | val x: Int = ???
64
+ |}
65
+ """ .stripMargin becomes
66
+ """
67
+ |package implementMethods
68
+ |
69
+ |abstract class C {
70
+ | def f(x: Int): String
71
+ |}
72
+ |
73
+ |object Obj extends /*(*/C/*)*/ {
74
+ | val x: Int = ???
75
+ |
76
+ | def f(x: Int): String = {
77
+ | ???
78
+ | }
79
+ |}
80
+ """ .stripMargin
81
+ } applyRefactoring implementMethods
82
+
53
83
@ Test
54
84
def implementMethodFromSecondMixing () = new FileSet () {
55
85
"""
@@ -63,7 +93,7 @@ class ImplementMethodsTest extends TestHelper with TestRefactoring {
63
93
| def g(x: Int): Int
64
94
|}
65
95
|
66
- |object Obj extends T with /*(*/S/*)*/ {
96
+ |class C extends T with /*(*/S/*)*/ {
67
97
| val x: Int = ???
68
98
|}
69
99
""" .stripMargin becomes
@@ -78,7 +108,7 @@ class ImplementMethodsTest extends TestHelper with TestRefactoring {
78
108
| def g(x: Int): Int
79
109
|}
80
110
|
81
- |object Obj extends T with /*(*/S/*)*/ {
111
+ |class C extends T with /*(*/S/*)*/ {
82
112
| val x: Int = ???
83
113
|
84
114
| def g(x: Int): Int = {
You can’t perform that action at this time.
0 commit comments