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+ */
25package mylibrary
36
47object Utils :
58 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+ */
25package mylibrary2
36
47object 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! "
109
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ Added 'compiler/test-resources/jars/mylibrary2.jar' to classpath.
1515scala> import mylibrary2.Utils2
1616
1717scala> Utils2.greet("Alice")
18- val res1: String = Hello , Alice!
18+ val res1: String = Greetings , Alice!
1919
2020scala> Utils.greet("Alice")
2121val res2: String = Hello, Alice!
You can’t perform that action at this time.
0 commit comments