Page MenuHomePhabricator

Fix an issue where we infer the wrong type of a vector which mixes scalar types
ClosedPublic

Authored by epriestley on Oct 13 2015, 11:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 9, 10:25 PM
Unknown Object (File)
Wed, May 7, 8:38 AM
Unknown Object (File)
Sat, Apr 26, 6:28 AM
Unknown Object (File)
Sun, Apr 20, 10:56 AM
Unknown Object (File)
Sat, Apr 19, 12:41 AM
Unknown Object (File)
Sat, Apr 19, 12:41 AM
Unknown Object (File)
Tue, Apr 15, 1:30 AM
Unknown Object (File)
Apr 8 2025, 5:51 AM
Subscribers
None

Details

Summary

See General Chat. Broadly, we infer the type of lists that have multiple different types in them incorrectly, and try to do silly stuff like get_parent_class("string"), which won't ever work.

Instead, correctly decline to detect a common base class between nonsense like "string" and "array".

This fixes the issues elsewhere and produces a useful error:

Parameter 'linters' has invalid type. Expected type 'map<string, map<string, wild>>', got type 'map<string, wild>'.

Test Plan

Added and ran unit test. Reproduced original error, verified this fixed it.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Fix an issue where we infer the wrong type of a vector which mixes scalar types.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
chad edited edge metadata.
This revision is now accepted and ready to land.Oct 13 2015, 11:21 PM
This revision was automatically updated to reflect the committed changes.