Allow defmulti without expected type

Description

Problem

defmulti expressions need an expected type at the moment. This is annoying and we can do better.

This should type check without issues.

Solution

Remove the restriction on a MultiFn requiring an expected type. This raises the question of how to infer the type of a multimethod based only on its dispatch function.

Here is the new scheme:

If the dispatch function is a function type

the entire multimethod is of type

That is, infer the type of the dispatch function, and replace the return types with Any.

eg.

Dispatch function is of type

Multimethod annotated as:

Filters and objects should be deleted from the dispatch function to generate the multimethod annotation.

Pull request: 83
Commit:
Version:

Environment

None

Activity

Show:
Ambrose Bonnaire-Sergeant
December 3, 2017, 10:06 PM

Never completed, closing.

Ambrose Bonnaire-Sergeant
July 10, 2018, 9:09 PM
Completed

Assignee

Ambrose Bonnaire-Sergeant

Reporter

Ambrose Bonnaire-Sergeant

Labels

None

Approval

None

Patch

None

Fix versions

Priority

Minor