File tree Expand file tree Collapse file tree 5 files changed +10
-13
lines changed Expand file tree Collapse file tree 5 files changed +10
-13
lines changed Original file line number Diff line number Diff line change 1
- // MyLibrary.scala
1
+ /**
2
+ * JAR used for testing repl :require
3
+ * Generated using: mkdir out; scalac -d out MyLibrary.scala; jar cf mylibrary.jar -C out .
4
+ */
2
5
package mylibrary
3
6
4
7
object Utils :
5
8
def greet (name : String ): String = s " Hello, $name! "
6
-
7
- class Calculator :
8
- def add (x : Int , y : Int ): Int = x + y
9
- def subtract (x : Int , y : Int ): Int = x - y
10
-
Original file line number Diff line number Diff line change 1
- // MyLibrary2.scala
1
+ /**
2
+ * JAR used for testing repl :require
3
+ * Generated using: mkdir out2; scalac -d out MyLibrary2.scala; jar cf mylibrary2.jar -C out2 .
4
+ */
2
5
package mylibrary2
3
6
4
7
object Utils2 :
5
- def greet (name : String ): String = s " Hello, $name! "
6
-
7
- class Calculator2 :
8
- def add (x : Int , y : Int ): Int = x + y
9
- def subtract (x : Int , y : Int ): Int = x - y
8
+ def greet (name : String ): String = s " Greetings, $name! "
10
9
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ Added 'compiler/test-resources/jars/mylibrary2.jar' to classpath.
15
15
scala> import mylibrary2.Utils2
16
16
17
17
scala> Utils2.greet("Alice")
18
- val res1: String = Hello , Alice!
18
+ val res1: String = Greetings , Alice!
19
19
20
20
scala> Utils.greet("Alice")
21
21
val res2: String = Hello, Alice!
You can’t perform that action at this time.
0 commit comments