Repeatedly infer maps until nothing changes

When an inferred map is nested in another inferred map,
the inner one will usually not actually be made into a map
because its original class will be unified with another class
in the process of making the outer map.  On the other
hand, this unification can lead to more inner classes
becoming viable as maps.
This commit is contained in:
Mark Probst 2018-04-24 08:22:03 -07:00
Родитель 8a0df28496
Коммит 7247919875
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -243,7 +243,13 @@ export class Run {
}
graph = flattenStrings(graph, stringTypeMapping, debugPrintReconstitution);
if (this._options.inferMaps) {
graph = inferMaps(graph, stringTypeMapping, true, debugPrintReconstitution);
for (;;) {
const newGraph = inferMaps(graph, stringTypeMapping, true, debugPrintReconstitution);
if (newGraph === graph) {
break;
}
graph = newGraph;
}
}
graph = noneToAny(graph, stringTypeMapping, debugPrintReconstitution);
if (!targetLanguage.supportsOptionalClassProperties) {