From: Eric Wong Date: 2015-07-03T08:21:33+00:00 Subject: [ruby-core:69850] Re: [Ruby trunk - Bug #11326] [Open] Defining a writer as a Struct member allowed? peter-rl@suschlik.de wrote: > I don't have a strong opinion whether defining a writer member should > be possible or not. I suggest banning it (barely-tested patch): --- a/struct.c +++ b/struct.c @@ -12,6 +12,7 @@ #include "internal.h" #include "vm_core.h" #include "id.h" +#include "symbol.h" /* only for struct[:field] access */ #define AREF_HASH_THRESHOLD (10) @@ -510,6 +511,10 @@ rb_struct_s_def(int argc, VALUE *argv, VALUE klass) rest = rb_ary_tmp_new(argc); for (i=0; i'