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

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

[Octave-bug-tracker] [bug #60489] Erroneous duplicate method declaration


From: Rik
Subject: [Octave-bug-tracker] [bug #60489] Erroneous duplicate method declaration in classdef file does not generate an error
Date: Sun, 2 May 2021 21:31:58 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.72 Safari/537.36

Update of bug #60489 (project octave):

                  Status:                    None => Confirmed              
                 Release:                   6.2.0 => dev                    
        Operating System:       Microsoft Windows => Any                    
                 Summary: Erroneous duplicate declaration does not generate an
error => Erroneous duplicate method declaration in classdef file does not
generate an error

    _______________________________________________________

Follow-up Comment #1:

Confirmed.  Changing Summary to be more specific about the problem (classdef
methods).

For regular functions, the interpreter is smart enough to issue a warning. 
For this code (attached as tst_fcn_dup.m)


function tst_fcn_dup ()
  subfcn1 ();
  subfcn2 ();
endfunction

function subfcn1 ()
  disp ("First definition of subfcn1");
endfunction

function subfcn2 ()
  disp ("calling subfcn2");
endfunction

function subfcn1 ()
  disp ("Second definition of subfcn1");
endfunction


the error message when run is


error: parse error near line 14 of file
/home/rik/wip/Projects_Mine/octave-dev/tst_fcn_dup.m

  duplicate subfunction or nested function name

>>> function subfcn1 ()
            ^





(file #51365)
    _______________________________________________________

Additional Item Attachment:

File name: tst_fcn_dup.m                  Size:0 KB
    <https://file.savannah.gnu.org/file/tst_fcn_dup.m?file_id=51365>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60489>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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