Skip to content

__init__ function arguments types have no checks in the function body #35

@migeed-z

Description

@migeed-z

It seems that Reticulated skips the init function argument checks in the function body.
In the following class definition:

@fields({'my_dict': Dict(Int, Tuple(Int, Int))})
class UnionFind:
    def __init__(self:UnionFind, my_dict:Dict(Int, Tuple(Int, Int)))->Void:
        self.my_dict = my_dict

There are no checks to verify that my_dict has the correct type.
This is the resulting code from retic -p:

class UnionFind:
    def __init__(self, my_dict):
        self.my_dict = my_dict
    __init__ = check_type_function(__init__)

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