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
F14399312: D14271.diff
Sun, Dec 22, 4:33 PM
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
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.