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

Draft: (partial) fix for 'ce.declare' with SymbolDefinition using prop. 'type' #226

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

samueltlg
Copy link

@samueltlg samueltlg commented Dec 23, 2024

Noticed that ce.declare errors when supplying a SymbolDefinition of form {type: TypeString} for second arg.

Current changes appear to address the issue, but appears to surface or reveal a few existing test errs. where throughout these, type values given through 'SymbolDefinition.type' do not conform to current type definitions: e.g. { type: 'set<integers>', ... } is given whereas in this context, according to definition of the type 'Type', a {kind: 'set', elements: 'integers' } is expected instead. Did try to investigate further but opened a bit of a can of worms.

Believe that almost all errs. can be addressed fairly easily with present changes, but may require some alterations.
For reference, for the commit at which this was branched, 4 'snapshot' errors were already present split between tests 'compute-engine/compile.test.ts', and 'compute-engine/compile.test.ts'. This change surfaces ~18 newer. Feel free to edit as pleased or denounce changes

!(
(typeof def.type === 'string' && isSubtype(def.type, 'function')) ||
(def.type && isValidType(def.type))
)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this was a bug/typo? I.e. final cond. to be negated.

throw new Error(
'The `type` field of a symbol definition should be of type `string`'
);
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think that's OK; but some introduced errs. may be surfacing on account of type being given as undefined: so may require minor adjstment.

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

Successfully merging this pull request may close these issues.

1 participant