squiggle icon indicating copy to clipboard operation
squiggle copied to clipboard

@hide() applied to an export hides the function from importing models

Open mlao-pdx opened this issue 1 year ago • 3 comments

  • x Is refactor
  • _ Is new feature
  • _ Concerns documentation

Description of suggestion or shortcoming:

@hide() applied to an export hides the function from importing models, but not from the model within which it is defined. Expected behavior is that it would be available in the importing model, and only block rendering of the function in the model within which it is defined.

@hide()
export example(parm) = String(parm)

example([1,2])
import "previous_code_block" as pcb

pcb.example([1,2]) // Runtime Error: Dict property not found: example

mlao-pdx avatar Jan 02 '24 19:01 mlao-pdx

Yea, this is weird. I wouldn't have expected this with the implementation we used. Thanks for filing!

OAGr avatar Jan 02 '24 19:01 OAGr

If you're on 0.9.0, it's the same bug as #2823, decorators are not compatible with exports. Will be fixed soon in 0.9.1.

berekuk avatar Jan 02 '24 20:01 berekuk

I'm not sure, but I'm getting the impression that the decorators also hide functions/variables from SquiggleHub's autocomplete in the editor.

mlao-pdx avatar Jan 05 '24 01:01 mlao-pdx