Skip to content

Typer context - Replace lists by maps

Nicolas Phan requested to merge nicphan/typer_context into dev

type:fixed

Using lists for the typer context type permitted the use of types defined in a shadowed module, which is undesired behaviour.

Using a map removes this issue by removing duplicates.

However, we must keep track of the order in which elements were added, because when a constructor expression is typed, the typer needs to find the latest sum-type whose definition matches the given constructor.

This is why the map has been augmented with an id, indexing elements in chronological order.

Also, warnings have been added when several sum types match a data constructor.

Changelog details: Closes(https://gitlab.com/ligolang/ligo/-/issues/1390)

Edited by Nicolas Phan

Merge request reports