summaryrefslogtreecommitdiff
path: root/test/checker-tests/fail9.scala
blob: 54cf0fc01e31110b7e89edb6cef549487c2e72d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
// More from constructors
class Dong {
  def y1 = Dong.x1
  def y2 = Dong.x2
  def y3 = Dong.x3
  def y4 = Dong.x4
  def y5 = Dong.x5
  def y6 = Dong.x6
}

object Dong {
  private val x1 = 1
  private def x2 = 2
  private lazy val x3 = 3
  private[Dong] val x4 = 4
  private[Dong] val x5 = 5
  private[Dong] val x6 = 6
}

// % work/check all -Xprint:constru work/fail9.scala
//
// TypeStack init: REFERENCE(type AnyRef)
// [Not checkable: parser]
// [Not checkable: namer]
// [Not checkable: packageobjects]
// [Now checking: typer]
// [Now checking: superaccessors]
// [Now checking: pickler]
// [Now checking: refchecks]
// [Now checking: selectiveanf]
// [Now checking: liftcode]
// [Now checking: selectivecps]
// [Now checking: uncurry]
// [Now checking: tailcalls]
// [Not checkable: specialize]
// [Not checkable: explicitouter]
// [Now checking: erasure]
// [Now checking: lazyvals]
// [Now checking: lambdalift]
// [[syntax trees at end of constructors]]// Scala source: fail9.scala
// package <empty> {
//   class Dong extends java.lang.Object with ScalaObject {
//     def y1(): Int = Dong.Dong$$x1();
//     def y2(): Int = Dong.Dong$$x2();
//     def y3(): Int = Dong.Dong$$x3();
//     def y4(): Int = Dong.x4();
//     def y5(): Int = Dong.x5();
//     def y6(): Int = Dong.x6();
//     def this(): Dong = {
//       Dong.super.this();
//       ()
//     }
//   };
//   final class Dong extends java.lang.Object with ScalaObject {
//     private[this] val Dong$$x1: Int = _;
//     final <stable> <accessor> def Dong$$x1(): Int = Dong.this.Dong$$x1;
//     final def Dong$$x2(): Int = 2;
//     lazy private[this] var Dong$$x3: Int = _;
//     final <stable> <accessor> lazy def Dong$$x3(): Int = {
//       Dong.this.Dong$$x3 = 3;
//       Dong.this.Dong$$x3
//     };
//     private[this] val x4: Int = _;
//     <stable> <accessor> private[Dong] def x4(): Int = Dong.this.x4;
//     private[this] val x5: Int = _;
//     <stable> <accessor> private[Dong] def x5(): Int = Dong.this.x5;
//     private[this] val x6: Int = _;
//     <stable> <accessor> private[Dong] def x6(): Int = Dong.this.x6;
//     def this(): object Dong = {
//       Dong.super.this();
//       Dong.this.Dong$$x1 = 1;
//       Dong.this.x4 = 4;
//       Dong.this.x5 = 5;
//       Dong.this.x6 = 6;
//       ()
//     }
//   }
// }
//
// [Now checking: constructors]
// work/fail9.scala:12: error:
// **** ERROR DURING INTERNAL CHECKING ****
// value Dong$$x1 in object Dong cannot be accessed in object Dong
//  because of an internal error (no accessible symbol):
// sym = value Dong$$x1
// underlying(sym) = value Dong$$x1
// pre = object Dong
// site = Dong.this
// tree = Dong.this.Dong$$x1
// sym.accessBoundary(sym.owner) = object Dong
// sym.ownerChain = List(value Dong$$x1, object Dong, package <empty>, package <root>)
// sym.owner.thisType = object Dong
// context.owner = package <empty>
// context.outer.enclClass.owner = package <empty>
//   private val x1 = 1
//               ^
// work/fail9.scala:15: error:
// **** ERROR DURING INTERNAL CHECKING ****
// value x4 in object Dong cannot be accessed in object Dong
//  because of an internal error (no accessible symbol):
// sym = value x4
// underlying(sym) = value x4
// pre = object Dong
// site = Dong.this
// tree = Dong.this.x4
// sym.accessBoundary(sym.owner) = object Dong
// sym.ownerChain = List(value x4, object Dong, package <empty>, package <root>)
// sym.owner.thisType = object Dong
// context.owner = package <empty>
// context.outer.enclClass.owner = package <empty>
//   private[Dong] val x4 = 4
//                     ^
// work/fail9.scala:16: error:
// **** ERROR DURING INTERNAL CHECKING ****
// value x5 in object Dong cannot be accessed in object Dong
//  because of an internal error (no accessible symbol):
// sym = value x5
// underlying(sym) = value x5
// pre = object Dong
// site = Dong.this
// tree = Dong.this.x5
// sym.accessBoundary(sym.owner) = object Dong
// sym.ownerChain = List(value x5, object Dong, package <empty>, package <root>)
// sym.owner.thisType = object Dong
// context.owner = package <empty>
// context.outer.enclClass.owner = package <empty>
//   private[Dong] val x5 = 5
//                     ^
// work/fail9.scala:17: error:
// **** ERROR DURING INTERNAL CHECKING ****
// value x6 in object Dong cannot be accessed in object Dong
//  because of an internal error (no accessible symbol):
// sym = value x6
// underlying(sym) = value x6
// pre = object Dong
// site = Dong.this
// tree = Dong.this.x6
// sym.accessBoundary(sym.owner) = object Dong
// sym.ownerChain = List(value x6, object Dong, package <empty>, package <root>)
// sym.owner.thisType = object Dong
// context.owner = package <empty>
// context.outer.enclClass.owner = package <empty>
//   private[Dong] val x6 = 6
//                     ^
// four errors found