You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
api [nfc]: Seal the TopicName migration by making non-transparent
We're now explicitly using apiName, canonicalize, or displayName in
each of the places where we had been implicitly treating a topic name
as a String. Let the type-checker catch any future regressions on
that front, by removing "implements String".
More precisely, I *think* we've covered each such place. The
loophole is that Object methods can still be called, including
toString, so an interpolation like "${channelName} > ${topic}" won't
be flagged by the analyzer. I found some such interpolations with a
grep, but that's necessarily heuristic and there could be more.
So the analyzer won't give us quite as much help here as we'd like;
but it'll give quite a bit, and this is the most I see how to do.
Without the "implements String", a TopicName value can no longer be
implicitly converted to String or have String methods called on it.
Instead the type-checker will require any code that has such a value
to call one of the members we've declared on TopicName (or a member
of Object) in order to do anything with it. That way the code will
be explicit about whether it needs the API name, or the display
name, or the canonicalized form for making equality comparisons.
And that in turn will enable us to make "display name" behave
differently from "API name", for zulip#1250 the "general chat" feature,
with a reliable way of tracking down which sites need which version.
0 commit comments