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
F14007995: D14271.diff
Tue, Oct 29, 1:52 PM
F13980502: D14271.diff
Sat, Oct 19, 11:07 AM
Unknown Object (File)
Oct 2 2024, 5:52 PM
Unknown Object (File)
Oct 2 2024, 2:58 PM
Unknown Object (File)
Oct 1 2024, 7:51 AM
Unknown Object (File)
Sep 24 2024, 3:24 AM
Unknown Object (File)
Sep 16 2024, 6:55 PM
Unknown Object (File)
Aug 25 2024, 8:53 PM
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
Branch
inferv
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 8268
Build 9469: Run Core Tests
Build 9468: arc lint + arc unit

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.