octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #52989] classdef: missing error messages on mu


From: A.R. Burgers
Subject: [Octave-bug-tracker] [bug #52989] classdef: missing error messages on multiply defined properties
Date: Sun, 28 Jan 2018 16:30:08 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0

Follow-up Comment #1, bug #52989 (project octave):

Here is a tentative patch, with which produces an error when an attempt is
made to create a property when a property with that name is already present in
the class or any of the superclasses:


diff -r d58543eb53e9 libinterp/octave-value/ov-classdef.cc
--- a/libinterp/octave-value/ov-classdef.cc     Fri Jan 26 00:11:11 2018
-0500
+++ b/libinterp/octave-value/ov-classdef.cc     Sun Jan 28 22:25:37 2018
+0100
@@ -2756,6 +2765,8 @@
               for (auto& prop_p : *pb_p->element_list ())
                 {
                   std::string prop_name = prop_p->ident ()->name ();
+                 if (retval.find_property(prop_name).ok())
+                   error ("property %s already defined", prop_name.c_str());

                   cdef_property prop = cdm.make_property (retval,
prop_name);



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52989>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]