Skip to content

feat(exo): unprotected exos#1725

Closed
erights wants to merge 1 commit intomasterfrom
markm-interface-method-optout-2
Closed

feat(exo): unprotected exos#1725
erights wants to merge 1 commit intomasterfrom
markm-interface-method-optout-2

Conversation

@erights
Copy link
Copy Markdown
Contributor

@erights erights commented Aug 16, 2023

@michaelfig , does this do what you need at this stage, i.e., without yet addressing the zone-POLA issue?

Not at all yet tested.

@erights erights self-assigned this Aug 16, 2023
@erights erights changed the base branch from master to markm-type-guards August 16, 2023 04:24
@erights erights requested review from michaelfig and turadg August 16, 2023 04:24
@erights erights force-pushed the markm-interface-method-optout-2 branch from 644b4f6 to aec653a Compare August 16, 2023 04:26
* methodGuards: M,
* options?: {sloppy?: false}): InterfaceGuard<M>;
* options?: {
* sloppy?: false,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@turadg , since I'm unsure why you split these cases on sloppy true vs false, I may be doing the wrong thing in not splitting on unprotected true vs false. Truly there are three cases: (false,false), (true,false), and (false,true). If I had not already introduced a boolean option, I would have made it a three-way. Oh well.

Copy link
Copy Markdown
Member

@turadg turadg Aug 16, 2023

Choose a reason for hiding this comment

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

The reason for the overloading here is that sloppy:true implies InterfaceGuard<any> (everything matches) and sloppy:false parameterizes InterfaceGuard with the type of methodGuards.

I take it that "unprotected" should be InterfaceGuard<any> so this type needs more work. But let's settle on the API first.

I would have made it a three-way

It's not too late! We could make it sloppiness: 'none' | 'sloppy' | 'unprotected' and still retain backwards compatibility with true ('sloppy') and false ('none')

Copy link
Copy Markdown
Member

@michaelfig michaelfig Aug 16, 2023

Choose a reason for hiding this comment

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

It's not too late! We could make it sloppiness: 'none' | 'sloppy' | 'unprotected' and still retain backwards compatibility with true ('sloppy') and false ('none')

Bikeshedding on how to spell this option: how about defaultGuards: 'never' | 'passable' | 'unprotected' with the same semantics for sloppy: true (defaultGuards: 'passable') and sloppy: false (defaultGuards: 'never').

I don't intend for that to be the final word; just presenting an idea.

@erights
Copy link
Copy Markdown
Contributor Author

erights commented Aug 16, 2023

Successor to #1724

* methodGuards: M,
* options?: {sloppy?: false}): InterfaceGuard<M>;
* options?: {
* sloppy?: false,
Copy link
Copy Markdown
Member

@turadg turadg Aug 16, 2023

Choose a reason for hiding this comment

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

The reason for the overloading here is that sloppy:true implies InterfaceGuard<any> (everything matches) and sloppy:false parameterizes InterfaceGuard with the type of methodGuards.

I take it that "unprotected" should be InterfaceGuard<any> so this type needs more work. But let's settle on the API first.

I would have made it a three-way

It's not too late! We could make it sloppiness: 'none' | 'sloppy' | 'unprotected' and still retain backwards compatibility with true ('sloppy') and false ('none')

@erights erights force-pushed the markm-type-guards branch from 505f81f to c2cd034 Compare August 21, 2023 22:48
Base automatically changed from markm-type-guards to master August 21, 2023 22:58
@erights erights force-pushed the markm-interface-method-optout-2 branch from aec653a to e6831ea Compare August 21, 2023 23:20
@erights erights marked this pull request as draft August 28, 2023 04:34
@erights
Copy link
Copy Markdown
Contributor Author

erights commented Aug 28, 2023

Converted to Draft in anticipation of successor from @michaelfig . Once that's pushed, I'll close this one.

@michaelfig
Copy link
Copy Markdown
Member

In experimenting with this API, I've come to feel that unprotected should be even more granular (explicitly annotating what is unprotected). I think we should flesh that out before deciding whether to implement defaultGuards after all, because it may be orthogonal to sloppy: true.

So, I've created #1772. Please take a look.

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.

3 participants