Skip to content

Nested Higher-Order Contract Oddities #31

Open
@stamourv

Description

@stamourv

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions