-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove most uses of uncheckedNN
#26239
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
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 |
|---|---|---|
|
|
@@ -15,7 +15,6 @@ import Spans.* | |
|
|
||
| import scala.annotation.tailrec | ||
| import scala.collection.{immutable, mutable} | ||
| import scala.compiletime.uninitialized | ||
|
|
||
| /** Some creators for typed trees */ | ||
| object tpd extends Trees.Instance[Type] with TypedTreeInfo { | ||
|
|
@@ -1373,13 +1372,12 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo { | |
| trait TreeProvider { | ||
| protected def computeRootTrees(using Context): List[Tree] | ||
|
|
||
| private var myTrees: List[Tree] | Null = uninitialized | ||
| private var myTrees: List[Tree] | Null = null | ||
|
|
||
| /** Get trees defined by this provider. Cache them if -Yretain-trees is set. */ | ||
| def rootTrees(using Context): List[Tree] = | ||
| if (ctx.settings.YretainTrees.value) { | ||
| if (myTrees == null) myTrees = computeRootTrees | ||
| myTrees.uncheckedNN | ||
| initialize(myTrees, myTrees = _, computeRootTrees) | ||
|
Contributor
Author
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. (scroll to the last file in this diff view to see the definition of this -- it's as you'd expect, hopefully) |
||
| } | ||
| else computeRootTrees | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -895,7 +895,7 @@ object Contexts { | |
| finally ctx.base.comparersInUse = saved | ||
| end comparing | ||
|
|
||
| @sharable val NoContext: Context = new FreshContext((null: ContextBase | Null).uncheckedNN) { | ||
| @sharable val NoContext: Context = new FreshContext(null.asInstanceOf[ContextBase]) { | ||
|
Member
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. Ugh. This is just wrong :(
Contributor
Author
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. I know 😭 |
||
| override val implicits: ContextualImplicits = new ContextualImplicits(Nil, null, false)(this: @unchecked) | ||
| setSource(NoSource) | ||
| } | ||
|
|
@@ -913,7 +913,7 @@ object Contexts { | |
| val initialCtx: Context = FreshContext.initial(this: @unchecked, settings) | ||
|
|
||
| /** The platform, initialized by `initPlatform()`. */ | ||
| private var _platform: Platform | Null = uninitialized | ||
| private var _platform: Platform | Null = null | ||
|
|
||
| /** The platform */ | ||
| def platform: Platform = { | ||
|
|
||
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.
no point in
uninitializedfor explicitly nullable stuff