Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with object constness in Circuit::net_for_pin #617

Closed
klayoutmatthias opened this issue Jul 28, 2020 · 1 comment
Closed

Problem with object constness in Circuit::net_for_pin #617

klayoutmatthias opened this issue Jul 28, 2020 · 1 comment
Assignees
Labels

Comments

@klayoutmatthias
Copy link
Collaborator

klayoutmatthias commented Jul 28, 2020

The following script:

netlist = RBA::Netlist::new
netlist.from_s(<<"END")
circuit TOP ();
  subcircuit SC1 $1 (A='1', B='2');
end;
circuit SC1 (A='A', 'B'='B');
end;
END

def collect_net_names(net)
  names = []
  if ! net.name.empty?
    names << net.name
  end
  net.each_subcircuit_pin do |scp|
    subnet = scp.subcircuit.circuit_ref.net_for_pin(scp.pin_id)
    names += collect_net_names(subnet)
  end
  names
end

puts collect_net_names(netlist.circuit_by_name("TOP").net_by_name("1")).inspect

errors out with this message:

new_macro_7.lym:17: Cannot call non-const method on a const reference in Circuit::net_for_pin
@klayoutmatthias
Copy link
Collaborator Author

klayoutmatthias commented Sep 19, 2020

Released with 0.26.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant