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

[WX-1460] WDL 1.1 Struct Literal Parsing #7391

Merged
merged 11 commits into from
Mar 29, 2024
Merged

[WX-1460] WDL 1.1 Struct Literal Parsing #7391

merged 11 commits into from
Mar 29, 2024

Conversation

THWiseman
Copy link
Contributor

@THWiseman THWiseman commented Mar 26, 2024

This PR includes the majority of the work required to implement the Struct Literal Syntax of WDL 1.1 . At a high level, we can now parse the new syntax, and turn that into a value that can be validated & used.

This PR does not include the strict type checking defined in the spec. Since that will require some small tweaks to the linking step (and for the sake of the reviewers), I figure it's better to do that in a subsequent PR. In practice, this means that errors aren't thrown in certain situations where you would expect them to be thrown.

Examples:

struct MyStructType {
 Int myIntMember
 String? myStringMember
}

// the new syntax
MyStructType a = MyStructType{myIntMember: 4, myStringMember: "Hi!"}

// still works just like any old struct value
MyStructType b = a

// note that omission of optional members is allowed by the spec
MyStructType c = MyStructType{myIntMember: 3}

// Literals are values
Int someInt = (MyStructType{myIntMember: 5, myStringType: "Bye!"}).myIntMember

// As of this PR, this will not throw an error (but it technically should)
Boolean illegalBool = (MyStructType{myIntMember: 5, myStringType: "Bye!", iMadeUpThisBool: false}).iMadeUpThisBool

@THWiseman THWiseman requested a review from a team as a code owner March 26, 2024 20:05
@jgainerdewar jgainerdewar merged commit 2f8c46d into develop Mar 29, 2024
34 checks passed
@jgainerdewar jgainerdewar deleted the WX-1460-a branch March 29, 2024 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants