// The closure caveat: use of loop variables in time dependent functions
// Reported by Petio Natzkin and Mykola Dvornik, May 2016


	setgridsize(128, 32, 1)
	setcellsize(500e-9/128, 125e-9/32, 3e-9)

	Msat  = 1600e3
	Aex   = 13e-12
	E_total.get()  // try to trigger bad lex2

	alpha = 0.02
	m  = uniform(1, .1, 0)

	i := 800
	Msat = i*1e3 
	expect("Msat", Msat.average(), 800e3, 1)

	Msat = i*1e3 + 0*t
	steps(1)
	expect("Msat", Msat.average(), 800e3, 1)

	i = 400 // should not influence Msat
	steps(1)
	expect("Msat", Msat.average(), 800e3, 1)

