bugGNU Octave - Bugs: bug #56816, calling classdef methods with the...

 
 

bug #56816: calling classdef methods with the dot-syntax from an old-style method fails

Submitter:  Sébastien Villemot <svillemot>
Submitted:  Tue 27 Aug 2019 12:32:05 PM UTC
   
 
Category:  Classdef Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 27 Aug 2019 01:10:04 PM UTC, comment #1: 

Thank you for the report.

I just made sure, that it is no regression. Your example did not work in 4.2.2, 4.4.1, and 5.1.0 either.

To give a short overview:


.
├── @bar        # classdef
│   └── bar.m
├── @foo        # old style class
│   ├── foo.m
│   ├── meth1.m
│   └── meth2.m
└── runtest.m


with


function x = meth1(o)
  z = bar;
  x = meth(z);
endfunction

function x = meth2(o)
  z = bar;
  x = z.meth;  # Error with or without assignment to x!
endfunction


runtest.m


o = foo;
meth1(o);
meth2(o); # Error


The error message:


>> runtest
error: class not found: foo
error: called from
    meth2 at line 3 column 5
    runtest at line 3 column 1


Kai Torben Ohlhus <siko1056>
Group Member
Tue 27 Aug 2019 12:32:05 PM UTC, original submission:  

Hi,

Suppose we have two classes "foo" and "bar".

"foo" uses old-style classes, while "bar" uses classdef.

From the body of a method of "foo", calling a method of "bar" using the dot-syntax (i.e. bar.method()) triggers a weird error. However the functional syntax (method(bar)) works.

Note that MATLAB accepts both syntaxes in this context.

I attach a code example that demonstrates the problem.

Sébastien Villemot <svillemot>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #47399:  classdef-old-style-mix.tar.gz added by svillemot (407B - application/gzip)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Updated the item)
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by svillemot (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-23 mmuetzel CategoryInterpreter Classdef
    2019-08-27 siko1056 StatusNone Confirmed
    2019-08-27 svillemot Attached File- Added classdef-old-style-mix.tar.gz, #47399

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code