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

Submitted by:  Sébastien Villemot <svillemot>
Submitted on:  Tue 27 Aug 2019 12:32:05 PM UTC  
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  GNU/Linux

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

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>
Project 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 siko1056 (Posted a comment)
  • -email is unavailable- added by svillemot (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.

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    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.5