Skip to content

Instantly share code, notes, and snippets.

@controlflow
Created September 18, 2016 11:58
Show Gist options
  • Save controlflow/a8a242e87df5ab6350cfb18a3cbcf1eb to your computer and use it in GitHub Desktop.
Save controlflow/a8a242e87df5ab6350cfb18a3cbcf1eb to your computer and use it in GitHub Desktop.
T t;
U u;
if ((t = x.P as T) != null &&
(u = t.P as U) != null) {
// ... use u/t ...
}
// =>
if (x.P is T t &&
t.P is U u) {
// ... use u/t ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment