Skip to content

Why does retic check return types twice? #37

@bennn

Description

@bennn

Reticulated seems to check return types in two places:

  1. at the return statement in a function
  2. at the call-site to a function

Is the first check necessary?


Example program:

def f()->List(Int):
  return []

f()

The output of retic -p has check_type_list before the return statement and around the call to f:

from retic.runtime import *
from retic.transient import *
from retic.typing import *

def f():
    return check_type_list([])
f = check_type_function(f)
check_type_list(f())

Reported by @migeed-z

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