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

Nested Higher-Order Contract Oddities #31

Open
stamourv opened this issue Sep 1, 2021 · 0 comments
Open

Nested Higher-Order Contract Oddities #31

stamourv opened this issue Sep 1, 2021 · 0 comments

Comments

@stamourv
Copy link
Collaborator

stamourv commented Sep 1, 2021

Appears to require at least one of them to be defined in DSSL2 code (i.e, not built in).

#lang dssl2

class NotVec[K]:
    def __init__(self):
        pass

# this works
def foo(x: NotVec?):
    pass
foo(NotVec[VecC[num?]]())

# this works too
def foo2(x: NotVec?[num?]):
    pass
foo2(NotVec[num?]())

# this does not, contract violation
def foo3(x: NotVec?[VecC[num?]]):
    pass
foo3(NotVec[VecC[num?]]())

# this also works, different higher-order contract
def bar (x: FunC[num?, num?]):
    pass
bar(λ x: x)
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

No branches or pull requests

1 participant