[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #55223] can't subsasgn with 2-level index (cur
From: |
Sébastien Villemot |
Subject: |
[Octave-bug-tracker] [bug #55223] can't subsasgn with 2-level index (curly braces + parentheses) with classdef handle |
Date: |
Fri, 14 Dec 2018 05:01:54 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 |
URL:
<https://savannah.gnu.org/bugs/?55223>
Summary: can't subsasgn with 2-level index (curly braces +
parentheses) with classdef handle
Project: GNU Octave
Submitted by: svillemot
Submitted on: Fri 14 Dec 2018 10:01:53 AM UTC
Category: Interpreter
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Unexpected Error
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: GNU/Linux
_______________________________________________________
Details:
Hi,
With a classdef handle, it is impossible to implement a syntax such as:
obj{x}(y) = z;
Even with a proper subsasgn method overload, Octave errors out:
error: object cannot be indexed with `{'
I attach a minimal example.
Below is a backtrace (with mercurial tip) just before the error is printed:
#0 cdef_object_scalar::subsref (this=0x555555bd5210, type="{",
idx=std::__cxx11::list = {...}, nargout=1, address@hidden: 0,
context=..., auto_add=true) at libinterp/octave-value/ov-classdef.cc:1462
#1 0x00007ffff7232ece in cdef_object::subsref (auto_add=<optimized out>,
context=..., address@hidden: 0, nargout=1,
idx=std::__cxx11::list = {...}, type="{", this=0x55555593f600)
at ./libinterp/octave-value/ov-classdef.h:284
#2 octave_classdef::subsref (this=0x55555593f5f0, type="{",
idx=std::__cxx11::list = {...}, auto_add=<optimized out>)
at libinterp/octave-value/ov-classdef.cc:910
#3 0x00007ffff73d312e in octave_value::subsref (auto_add=true,
idx=std::__cxx11::list = {...}, type="{", this=0x7fffffffb670)
at ./libinterp/octave-value/ov.h:425
#4 octave::tree_index_expression::lvalue (this=0x55555596dc20, tw=...)
at libinterp/parse-tree/pt-idx.cc:227
#5 0x00007ffff73c133f in octave::tree_evaluator::visit_simple_assignment (
this=0x5555557cf228, expr=...) at libinterp/parse-tree/pt-eval.cc:2667
#6 0x00007ffff7259452 in octave::tree_evaluator::evaluate
(this=0x5555557cf228,
expr=0x55555593eca0, nargout=<optimized out>)
at libinterp/parse-tree/pt-eval.h:312
#7 0x00007ffff73bdf1f in octave::tree_evaluator::visit_statement (
this=0x5555557cf228, stmt=...) at libinterp/parse-tree/pt-eval.cc:2775
#8 0x00007ffff73b3c90 in octave::tree_statement::accept (tw=...,
this=0x555555bbc090) at libinterp/parse-tree/pt-stmt.h:119
#9 octave::tree_evaluator::visit_statement_list (this=0x5555557cf228,
lst=...)
at libinterp/parse-tree/pt-eval.cc:2844
#10 0x00007ffff73b7493 in octave::tree_statement_list::accept (tw=...,
this=0x555555a0f7c0) at libinterp/parse-tree/pt-stmt.h:194
#11 octave::tree_evaluator::execute_user_script
(address@hidden,
user_script=..., address@hidden, args=...)
at libinterp/parse-tree/pt-eval.cc:1512
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Fri 14 Dec 2018 10:01:53 AM UTC Name: bug-classdef-subsasgn.tar.gz
Size: 495B By: svillemot
<http://savannah.gnu.org/bugs/download.php?file_id=45649>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?55223>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #55223] can't subsasgn with 2-level index (curly braces + parentheses) with classdef handle,
Sébastien Villemot <=