-
Notifications
You must be signed in to change notification settings - Fork 1.1k
A simpler implementation of init checker #12495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c8fe7e8
006f714
5373188
b31bbda
d955d26
b3ebab0
ea7185f
021b58e
34e476a
ab926d9
21cfb0f
237ceec
3058635
a8c70d5
6c7f170
f8abf7e
0a39a8f
4f298c0
dd65e1a
849a5df
252f3e4
fff6f48
44031b8
962fb94
a6f27df
3d6c79a
683a4a1
5a3e3d1
3fccd63
7717c5b
d3383f6
9831b97
366c972
9960e5a
89a0845
01fc3e6
390691e
c6ea1a2
fa3d6ed
f4aa49b
48f7b97
ee84531
d94d794
2f2253d
062bb98
a7af9d8
b978ad9
3c25533
f67b3cd
12bfbd2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,8 @@ class Checker extends MiniPhase { | |
// cache of class summary | ||
private val cache = new Cache | ||
|
||
private val semantic = new Semantic | ||
|
||
override val runsAfter = Set(Pickler.name) | ||
|
||
override def isEnabled(using Context): Boolean = | ||
|
@@ -57,7 +59,14 @@ class Checker extends MiniPhase { | |
env = Env(ctx.withOwner(cls), cache) | ||
) | ||
|
||
Checking.checkClassBody(tree) | ||
// Checking.checkClassBody(tree) | ||
|
||
import semantic._ | ||
val tpl = tree.rhs.asInstanceOf[Template] | ||
val thisRef = ThisRef(cls) | ||
val heap = Objekt(cls, fields = mutable.Map.empty) | ||
val res = eval(tpl, thisRef, cls)(using heap, ctx, Vector.empty) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We discussed that we could in theory call There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here the reason is only for consistency and tries to follow the Scala specification on initialization literally. |
||
res.errors.foreach(_.issue) | ||
} | ||
|
||
tree | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove
checkClassBody
or is it too early? Alsocache
, summarization, etc.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we will remove the existing version in another PR.