mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-22 10:57:18 +00:00
LibGC: Make GC::Root bool operator explicit
Not having this led to a sneaky bug where, given a Variant like so: Variant<double, GC::Root<T>> An incorrectly-written visit() branch for the Root would just cause it to be cast to a double and call that branch instead. With the cast made explicit, we get a compiler error, which is far more useful. Co-authored-by: Jelle Raaijmakers <jelle@ladybird.org>
This commit is contained in:
Notes:
github-actions[bot]
2025-08-21 16:51:47 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/8af99388a64 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5939 Reviewed-by: https://github.com/trflynn89 ✅
@@ -105,7 +105,7 @@ public:
|
||||
{
|
||||
return !cell();
|
||||
}
|
||||
operator bool() const
|
||||
explicit operator bool() const
|
||||
{
|
||||
return cell();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user