-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Description
For example:
julia> struct S
a::Int
b::Bool
S(a::Int, b::Bool) = new(a)
end
julia> S(1, false)
S(1, true)
Would it make any sense to warn that the struct S is being created with an uninitialized isbits-field?
The problem is that this will act like a well formed type but there is garbage memory in S.b. It seems like an easy mistake: add a field to the struct, forget to update the new call, use garbage memory that might work in 99% of the cases. Perhaps there could be a way to enforce being explicit about using uninitialized isbits field, like new(a, uninitialized) or something...
nalimilan, mauro3, StefanKarpinski and oscardssmithstaticfloat
Metadata
Metadata
Assignees
Labels
No labels