D15694: Make implicit fallthroughs a compiler error, remove unneeded breaks

Aaron Puchert noreply at phabricator.kde.org
Sun Sep 23 17:42:07 BST 2018


aaronpuchert marked an inline comment as done.
aaronpuchert added subscribers: mssola, brauch.
aaronpuchert added inline comments.

INLINE COMMENTS

> aaronpuchert wrote in ghproviderwidget.cpp:166
> Looks suspicious to me, is that intended?

I'm pretty sure this is actually intended, maybe @mssola can confirm that.

> aaronpuchert wrote in context.cpp:459
> Looks also suspicious.

So `operator{Start,End}` are used in `functionCallTips` to find the `m_typeToMatch`. The idea seems to be that if we write `a +` then we want something of the same type as `a` to add to it. With the fallthrough we apply this for commas as well, so we try to match the type before the comma. That doesn't seem right. I'm actually inclined to insert a `break` here. Looking at change R32:699603b11f3664e9e386d32add8496a0d3a8a7cc <https://phabricator.kde.org/R32:699603b11f3664e9e386d32add8496a0d3a8a7cc> where this was introduced, it might have been an oversight.

@brauch Can you comment on that? The original author of the code doesn't seem to be on Phabricator, but you have apparently worked on QmlJs as well.

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D15694

To: aaronpuchert, #kdevelop
Cc: brauch, mssola, kossebau, kdevelop-devel, glebaccon, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180923/5981ac11/attachment-0001.html>


More information about the KDevelop-devel mailing list