Ignore method conflicts in bit-struct

git-svn-id: file:///home/svn/framework3/trunk@6862 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2009-07-22 02:57:37 +00:00
parent 54fc8e70e2
commit 885f82e760
1 changed files with 4 additions and 3 deletions

View File

@ -146,15 +146,16 @@ class BitStruct < String
if fields.find {|f|f.name == name}
raise FieldNameError, "Field #{name} is already defined as a field."
end
=begin
if instance_methods(true).find {|m| m == name}
if opts[:allow_method_conflict] || opts["allow_method_conflict"]
warn "Field #{name} is already defined as a method."
else
raise FieldNameError,"Field #{name} is already defined as a method."
raise FieldNameError,"Field #{name} is already defined as a method. #{caller}"
end
end
=end
field_class = opts[:field_class]
prev = fields[-1] || NULL_FIELD