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)
Sat, Dec 14, 6:54 PM
Unknown Object (File)
Tue, Dec 3, 12:37 PM
Unknown Object (File)
Sat, Nov 30, 5:59 PM
Unknown Object (File)
Mon, Nov 25, 1:36 PM
Unknown Object (File)
Mon, Nov 25, 3:30 AM
Unknown Object (File)
Nov 19 2024, 9:44 PM
Unknown Object (File)
Nov 15 2024, 5:46 PM
Unknown Object (File)
Nov 12 2024, 3:28 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.