Page MenuHomePhabricator

Add a support class to simplify typechecking list-of-objects return values
ClosedPublic

Authored by epriestley on May 28 2020, 2:30 PM.
Tags
None
Referenced Files
F19083342: D21293.id50707.diff
Dec 2 2025, 12:34 PM
F19040214: D21293.diff
Nov 26 2025, 11:39 AM
F18985498: D21293.id50705.diff
Nov 17 2025, 1:04 PM
F18762034: D21293.id50705.diff
Oct 6 2025, 5:20 PM
F18735438: D21293.diff
Oct 1 2025, 1:37 AM
F18734307: D21293.id.diff
Sep 30 2025, 10:51 PM
F18624131: D21293.diff
Sep 15 2025, 7:04 PM
F18102450: D21293.diff
Aug 9 2025, 8:54 PM
Subscribers
None

Details

Summary

With some frequency, code wants to assert that some "$o->m()" returns a list of objects of type X, possibly with unique values for some "getKey()"-style method result.

Existing checks via PhutilTypeMap and assert_instances_of() aren't quite powerful enough to do this while producing an easily understandable error state. We want to know that the error arose from a call to "$o->m()" in particular.

Test Plan

Currently used elsewhere, in Piledriver code.

Diff Detail

Repository
rARC Arcanist
Branch
acheck1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 24525
Build 33798: Run Core Tests
Build 33797: arc lint + arc unit

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.May 28 2020, 2:33 PM
This revision was automatically updated to reflect the committed changes.