Skip to content

Should function declarations have return types? #14

Description

@pboyer

def foo : number (){ return "not a number"; }

The ability to do this is not so nice. This would probably need to emit a runtime warning. Alternatively, one could do a compile time check, but that would require an AST traversal for the type check.

Return type syntax is useful for FFI calls, but for user defined functions it could cause confusing situations without it having any semantics...

Activity

  1. pboyer commented on Jun 30, 2016

    @pboyer
    ContributorAuthor

    @ke-yu @lukechurch Just trying to separate this thread...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions