Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

Disallow multiple definitions of the same name #303

Closed
kach opened this issue Jul 17, 2018 · 3 comments
Closed

Disallow multiple definitions of the same name #303

kach opened this issue Jul 17, 2018 · 3 comments
Labels

Comments

@kach
Copy link
Contributor

kach commented Jul 17, 2018

This kind of thing should not be allowed in the compiler (but ideally should be allowed in the REPL for the sake of experimentation). The check can be implemented as part of the typechecker.

define constant x = 5
define constant x = 6
@kach kach added Type: Bug 🐛 Something isn't working Range: Typing labels Jul 17, 2018
@jeromesimeon
Copy link
Member

I don't see a problem with this code. Also having the REPL behavior differ from the one in Ergo is a nuisance since we have to maintain both behaviors.

@jeromesimeon
Copy link
Member

Enums support is based on constants, which means there can be shadowing. We should make this a compiler warning (using the recently added #300 support).

@jeromesimeon
Copy link
Member

jeromesimeon commented Oct 29, 2019

This has been made a warning (#699 )

Screenshot 2019-10-29 at 11 53 18 AM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants