-
Notifications
You must be signed in to change notification settings - Fork 306
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
Struct literal - Revist #286
Conversation
Re the open question - IMO I think we can state that it's possible if a map happens to be (a) a valid WDL map and (b) the right shape, but in our examples we should always use struct literals to demonstrate creation of structs |
@cjllanwarne I agree, I changed a few map literal casts to simply structs |
👍 |
👍 |
1 similar comment
👍 |
👍 We should fix |
@patmagee considering some of our more eagle eye voters are starting to pick up on typos and such, it might be worth pulling this back and then re-launching the vote |
|
||
#Simple case | ||
File fastq_1 | ||
File fastq_2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also a typo presumably? I think it should either be (a) assigned a value (even File fastq2 = ...
as a placeholder) or put into an input { }
section
One more potential typo for a fixup, but otherwise this looks great - and thanks for taking care of those option literals! 👍 |
@patmagee Voting has passed however it's clear that there are multiple typos here. Would you rather go ahead and merge in & followup w/ a cleanup PR, or would you rather clean it up & resubmit? |
@geoffjentry I am notorious for my typos, this is quite bad. I personally think I should create a separate PR, closing this one, and we can merge that one. I would rather not include any errors that might be missed |
I have modified my original
Struct Literal
PR after rebasing on master once the object removal PR had been merged. I have removed all references toobject literal
notation and replaced it withstruct literal
as requested by @cjllanwarne .Changes
Currently, there is no such thing as a
Struct Literal
, instead we use theObject literal
notation and hope that the engine conversion does not mess up any of the types. On top ofobjects
being deprecated in the near future, there is also the added problem that there could be a loss of information if an object literal is the first cast to an object, before being cast to the declaring type.To address this, I propose the idea of
Struct Literals
, which as previously discussed here #201I chose to go with a simple annotation for defining struct literals that should both look familiar and also not look too ugly when implementing (since it is based on python constructors)
Here is an example:
Open Questions for debate: