nitlang / nit

Nit language
http://nitlanguage.org
Apache License 2.0
239 stars 65 forks source link

model: Add `mpackage` importation hierarchy #2788

Closed Delja closed 5 years ago

Delja commented 5 years ago

Added a mpackage_importation_hierarchy graph to keep the hierarchy of packages. The packages relations are defined when the set_imported_mmodules is called.

This pr is related to the programming by contract. The objective is to determine when the use of a contract is necessary in a given context.

Note in this graph all the packages are in relation with themself.

example for all nitc package hierarchy :

This pr has a dependency with the #2784

Delja commented 5 years ago

@Morriar The POSet automatically do a transitive reduction. example:

var poset = new POSet[String]
poset.add_edge("A", "B")
poset.add_edge("B", "C")
poset.add_edge("A", "C")
assert not poset.has_direct_edge("A", "C")

In that case you lost the information of A import directly the C.