-
Couldn't load subscription status.
- Fork 12
Open
Description
Proposal
NameRes should associate each constructor name to a list of {datatype : Name.t; clbl : string} which represents all possible interpretations. This will automatically support renaming, namespaces, shadowing, etc., correctly. A type checker should first consult the name resolver and then use typing information to disambiguate overloaded constructors if needed.
favonia: I think the following example should be forbidden due to self-shadowing:
data tt where tt
Spec of shadowing
These should work:
data bool where tt | ff
def tt : bool = ff
def x : [i] bool [i=0 -> tt | i=1 -> ff] = refl
data bool where tt | ff
def mybool : type = bool
def bool : type^1 = type
def x : mybool = tt
These should not work:
data bool where tt | ff
def tt : type^1 = type
data unit where tt
def x : bool = tt
These I do not know:
data bool where tt | ff
data tt where tt
def x : bool = tt
Thoughts? @ecavallo @jonsterling @cangiuli
jonsterling
Metadata
Metadata
Assignees
Labels
No labels