Skip to content

Different type IDs can point at the same type #53

@kubouch

Description

@kubouch

As pointed out in #50, typecheck_match() looks only at type IDs without actually checking the underlying type. This means that two identical types, such as:

let x: oneof<list<int>, list<string>> = []
let y: oneof<list<int>, list<string>> = []

would have different IDs and result in type mismatch.

Two possible solutions:

  1. Change typecheck_match() to actually check the types properly
  2. When creating a type, first check whether it's been created already and reuse its ID if so. This would ensure that different type IDs would point at different types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions