Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

I Break Your Code: No More Uninitialized Variables


Variables must now be initialized before use.

This was the case before now, but the compiler checks as of today. This
code is no longer valid:

	const f = {
		var x

		use(x)
	}

This has already led to fixing two bugs in the standard distribution.

The change breaks one legitimate use from libstd, and I'd be open to clean
ways to fix it, since it's already ugly:

	var dummy : mytype

	std.fmtinstall(std.typeof(dummy), fmtfunc)

For now, I worked around it by initializing a few spurious values and free
them when installing format funcs.

I'm currently thinking that the entire introspection API needs an overhaul.

-- 
    Ori Bernstein

Follow-Ups:
Re: I Break Your Code: No More Uninitialized VariablesRyan Gonzalez <rymg19@xxxxxxxxx>