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

No se marca como error el uso de una variable de un bloque en el scope de afuera #1971

Closed
mmatos opened this issue Nov 13, 2020 · 2 comments
Closed

Comments

@mmatos
Copy link
Contributor

mmatos commented Nov 13, 2020

Esto no se está marcando como un error en el IDE

image

Sí falla al intentar ejecutarlo en el REPL y los tests correctamente

>>> carrito.productoMasCaro()
ERROR: Couldn't resolve reference to productoMasCaro
@fdodino
Copy link
Collaborator

fdodino commented Nov 15, 2020

Agh, @mmatos, me llevó casi 3 horas descular dónde estaba el problema, y lo más gracioso @npasserini @PalumboN es que cuando metí el fix saltaron dos errores, que son justamente tests que están mal:

	method descargarCamionEn(unLugar) { destino.remove(destinos.detect{destino => destino.getLugar() == unLugar}) }

acá hay un typo, debería ser destinos en lugar de destino.remove...

Y

	method comer(alimento) {
		alimento.sum { x =>
			// XPECT errors --> "Cannot assign a variable to itself. It does not have any effect" at "energia"
			energia = energia 
		}
		
		// XPECT errors --> "Cannot assign a variable to itself. It does not have any effect" at "y"
		const y = y 
		var z = 24
		z = y
		const w = y
		
		alimento.hacerAlgo(x,y,z,w)

acá x está en el Closure. Increíble pero hace 4 años que el test está así y nunca me saltó.

Como dice un amigo: "Good catch, Maiu!"

@PalumboN
Copy link
Contributor

Jajajaja yo conocía el error, creo que saltó en una demo en UTN (memoria dodinezca), pero me hice el dolobu estos 4 años :P

GROSES TODES :)

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

No branches or pull requests

3 participants