Skip to content

Typing error when mixing dependent types and implicit types #2784

Answered by aseemr
klinvill asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @klinvill:

The issue here is that while test_proto has a dependent type, the type protocol is not dependent. If we change the protocol type to:

type protocol (#args_1_type: Type) (#args_2_type: args_1_type → Type) (#result_type: args_1_type → Type) =
  n:args_1_type → args_2_type n → result_type n

to reflect the dependence of the type of the second argument and return type on the first argument, then it checks out. The refinement version also works with this.

(The error message (*?u11*) _ is not equal to the expected type n could be better.)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@klinvill
Comment options

Answer selected by klinvill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants