bugGNU Octave - Bugs: bug #55746, interpreter fails to instantiate...


bug #55746: interpreter fails to instantiate classdef with classdef properties

Submitted by:  A.R. Burgers <arb>
Submitted on:  Wed 20 Feb 2019 12:00:46 PM UTC  
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
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.


( Jump to the original submission)

Mon 11 Mar 2019 10:34:00 PM UTC, comment #6:

I can confirm this with the attached, adapted from @arb's example.

It seems like the 'ans' variable is being referenced when the class is parsed the first time.

If the class is instantiated first, then it works every subsequent time. If the 'ans' variable is never assigned to or is cleared before parsing the class the first time, then it works.

And this is a regression from Octave 5.1, where it works correctly.

(file #46500)

Mike Miller <mtmiller>
Project Administrator
Mon 04 Mar 2019 07:36:42 PM UTC, comment #5:

There was an interaction with my .octaverc file.
Here is a hopefully self-contained version. Execute with

After execution of the pkg command ans contains '/tmp/'. Clearing ans allows to instantiate pckg.cls1

A.R. Burgers <arb>
Thu 21 Feb 2019 06:25:51 PM UTC, comment #4:

Do you have a variable named pckg in the workspace? I see the same error as you if I do

Or maybe a function named pckg that returns a string?

That still doesn't explain why you see different results with 6.0.0 vs. 5.0.91.

John W. Eaton <jwe>
Project Administrator
Thu 21 Feb 2019 01:25:59 PM UTC, comment #3:

reverting all local changes doesn't change the result for me:

There still is some hidden factor at work that my example doesn't capture.

A.R. Burgers <arb>
Thu 21 Feb 2019 05:05:49 AM UTC, comment #2:

I finally had a chance to try your examples and here's what I see using hg ID 568565a70b5 (note your hg ID has a "+" appended indicating local changes -- what are those changes?)

and with my current sources:

John W. Eaton <jwe>
Project Administrator
Wed 20 Feb 2019 05:41:32 PM UTC, comment #1:

I've been working on refactoring the way packages are handled and some of my recent (incomplete, as yet) changes are probably the reason this fails now. I'll see about fixing it.

We could use more tests. Posting examples with expected output is certainly helpful, but it would be even more useful if someone could turn these into patches or changesets that would add them to the test suite in the Octave sources.

John W. Eaton <jwe>
Project Administrator
Wed 20 Feb 2019 12:00:46 PM UTC, original submission:

dev octave fails to instantiate a classdef, that has a property that is initialized to another classdef. See below for how to reproduce, and the octave-5.0.91 and octave-6.0.0 outputs. Apparently the pckg package name in the pckg.cls2 invocation is not recognized as a package, but interpreted as a string.

file lay-out

octave-5.0.x output:

octave 6.0.0 output:

A.R. Burgers <arb>


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

Attach Files:

Attached Files
file #46500:  xxx.tgz added by mtmiller (245B - application/x-compressed-tar)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by arb (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-11 mtmiller Attached File- => Added xxx.tgz, #46500
        StatusWorks For Me => Confirmed
    2019-02-21 jwe StatusNone => Works For Me

    Back to the top

    Powered by Savane 3.4