WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
200006
style checker should suggest that single-argument constructors be explicit
https://bugs.webkit.org/show_bug.cgi?id=200006
Summary
style checker should suggest that single-argument constructors be explicit
Simon Fraser (smfr)
Reported
2019-07-22 11:36:57 PDT
Constructors that take a single argument should always be explicit; style checker should enforce this.
Attachments
Add attachment
proposed patch, testcase, etc.
Darin Adler
Comment 1
2019-07-22 12:35:11 PDT
Many constructors that can take a single argument should be explicit. But some should not be. This is something that requires thought so I’m not sure the style checker should check it, unless we have a guideline that says "ignore the style checker when you intentionally are creating a type conversion". There isn’t a "style suggestion checker", but for something like this there would need to be. One alternative to consider would be to come up with some comment syntax meaning "I mean to use this constructor for type conversion". Then I think it would be fine for the style checker to warn when there's neither "explicit" nor the comment.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug