Skip to content

Either instead of typed Exception #22

@tmackenzie

Description

@tmackenzie

Parser currently returns typed exceptions, RequiredException,OptionalException, ParseException.

RequiredException and OptionalException both have an ivar, target which when read cause warnings because it's type is Object and callers are forced to cast to what they desire, the casting causes the warning.

target is an Object because it's assigned to what is intended to be returned, which is defined via generic methods.
A Exception cannot be parameterized with generics, which is why it's a `Object'

Change the response from Parser to be an Either so under an exceptional state, target can have the appropriate type so the caller does not observer any warnings when reading target.

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