bugGNU Octave - Bugs: bug #55812, Interpreter gives incorrect line...

 
 

bug #55812: Interpreter gives incorrect line number for class name / file name mismatch

Submitted by:  Rik <rik5>
Submitted on:  Sat 02 Mar 2019 06:22:12 PM UTC  
 
Category:  Interpreter Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Inaccurate Result
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 03 Mar 2019 03:22:16 PM UTC, comment #2:

classdef needs to be the first true code in a file, and the keyword can only occur once in the file.

Rik <rik5>
Project Administrator
Sun 03 Mar 2019 08:47:28 AM UTC, comment #1:

With a classdef, is it like a function in that the first line of script code must match the file name? Or is it that the definition must exist somewhere within the file? If the former, then yeah Line #1 makes more sense. If the latter, then maybe Line #[last line] makes more sense--but if that were the case then the error shouldn't be "the class name must match the filename".

Dan Sebald <sebald>
Sat 02 Mar 2019 06:22:12 PM UTC, original submission:

When parsing a classdef file the name of the class must match the name of the file exactly. If it does not, Octave emits an error about the mismatch, but incorrectly points to the line in the file corresponding to "endclassdef" rather than the true source of the error which is the initial "classdef" statement.

I found this accidentally with the following code which I placed in the lowercase filename "mydumbclass.m"

When trying to create an instance of the class I received the following error

It would be better if it cited line 1 and gave this reference

Rik <rik5>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by sebald (Posted a comment)
  • -email is unavailable- added by rik5 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.4