File tree 2 files changed +31
-10
lines changed
2 files changed +31
-10
lines changed Original file line number Diff line number Diff line change @@ -40,11 +40,6 @@ class Baz() extends Foo(4, 4):
40
40
class Qux () extends Foo (5 , 5 ):
41
41
inline def qux : Int = protectedVal + packagePrivateVal
42
42
43
- def test =
44
- Foo (3 , 3 ).foo
45
- Bar ().bar
46
- Baz ().baz
47
- Qux ().qux
48
43
49
44
@ publicInBinary given Int = 1
50
45
@ publicInBinary given (using Double ): Int = 1
@@ -78,9 +73,9 @@ package foo {
78
73
@ publicInBinary private [foo] def x : Int = 1
79
74
inline def f : Int = Foo .x
80
75
}
81
- def testFoo = foo.f
76
+ def testFoo () = foo.f
82
77
83
- def localTest =
78
+ def localTest () =
84
79
class Foo :
85
80
@ publicInBinary private [Foo ] val a : Int = 1
86
81
@ publicInBinary protected val b : Int = 1
@@ -112,10 +107,10 @@ package traits {
112
107
113
108
trait Foo :
114
109
inline def foo : Any = bar
115
- @ publicInBinary private [Foo ] def bar : Any = ???
110
+ @ publicInBinary private [Foo ] def bar : Any = 2
116
111
end Foo
117
112
118
- def test =
113
+ def test () =
119
114
Baz .foo
120
115
(new Baz ).foo
121
116
val baz = new Baz
@@ -134,7 +129,7 @@ package constructors {
134
129
inline def newFoo (x : Int , y : Int ) = new Foo (x, y)
135
130
}
136
131
137
- def testConstructors =
132
+ def testConstructors () =
138
133
val f = constructors.newFoo(1 )
139
134
val g = constructors.newFoo(1 , 2 )
140
135
val h = new constructors.Bar (1 ).bar
Original file line number Diff line number Diff line change
1
+ import foo .*
2
+
3
+ @ main def Test : Unit =
4
+ val foo : Foo = new Foo (1 , 2 )
5
+ foo.foo
6
+
7
+ val bar = new Bar ()
8
+ bar.foo
9
+ bar.bar
10
+
11
+ val baz = new Baz ()
12
+ baz.foo
13
+ baz.baz
14
+
15
+ val qux = new Qux ()
16
+ qux.foo
17
+ qux.qux
18
+
19
+ val c = new inlines.TestPassing
20
+ c.foo(1 )
21
+ c.bar(2 )
22
+
23
+ testFoo()
24
+ localTest()
25
+ traits.test()
26
+ testConstructors()
You can’t perform that action at this time.
0 commit comments