Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

En la consola REPL puedo definir una var y luego una const con el mismo nombre #110

Open
fdodino opened this issue Oct 30, 2023 · 1 comment
Assignees
Labels
componente: consola Interpreta los comandos de la consola priority: high Important issue - needs attention

Comments

@fdodino
Copy link
Contributor

fdodino commented Oct 30, 2023

Es decir, puedo hacer en la misma sesión REPL:

var a = 1
// y después 
const a = 2`

lo más bien. Lo ideal sería que me diga que ya está definida la variable a.

@fdodino fdodino added componente: consola Interpreta los comandos de la consola priority: high Important issue - needs attention labels Oct 30, 2023
@PalumboN
Copy link
Contributor

PalumboN commented Sep 9, 2024

Al interpretar la segunda variable (o constante) habría que validar si ya no existe en el mismo contexto?.
Hay que tener cuidado de que no evite definir una variable con el mismo nombre en un contexto más chico (que es posible).

https://github.com/uqbar-project/wollok-ts/blob/61ffa0e0efb2db9f5d65d6cb4fb05b49ff651c29/src/interpreter/runtimeModel.ts#L433-L439

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
componente: consola Interpreta los comandos de la consola priority: high Important issue - needs attention
Projects
None yet
Development

No branches or pull requests

2 participants