Skip to content

Panic with Arrow Kinds in Parameterized Modules #1834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
j-christensen1 opened this issue Mar 31, 2025 · 2 comments
Open

Panic with Arrow Kinds in Parameterized Modules #1834

j-christensen1 opened this issue Mar 31, 2025 · 2 comments
Labels
bug Something not working correctly typechecker Issues related to type-checking Cryptol code.

Comments

@j-christensen1
Copy link

I was trying to generalize the behavior of something like this:

module NotParameterized where

  type Arrow n = n + 1

  f: {n} () => [n] -> [Arrow n]
  f x = [True] # x

by leaving Arrow and f parameters.

module Parameterized where

    parameter
        type Arrow: # -> #

        f: {n} () => [n] -> [Arrow n]

This panics, however:

version 3.3.0 (285c30d)
https://cryptol.net  :? for help

Loading module Cryptol
Loading interface module Parameterized__parameter
cryptol: You have encountered a bug in Cryptol's implementation.
*** Please create an issue at https://github.com/GaloisInc/cryptol/issues

%< --------------------------------------------------- 
  Revision:  285c30d32e38ba50476260f7d5b4fac6afd16471
  Branch:    release-3.3.0 (uncommited files present)
  Location:  Kind.checkTUser.checkModuleParam
  Message:   Unexpected parameters
CallStack (from HasCallStack):
  panic, called at src/Cryptol/Utils/Panic.hs:21:9 in cryptol-3.3.0-inplace:Cryptol.Utils.Panic
  panic, called at src/Cryptol/TypeCheck/Kind.hs:394:10 in cryptol-3.3.0-inplace:Cryptol.TypeCheck.Kind
%< --------------------------------------------------- 
@j-christensen1 j-christensen1 added the bug Something not working correctly label Mar 31, 2025
@yav yav added the typechecker Issues related to type-checking Cryptol code. label Mar 31, 2025
@yav
Copy link
Member

yav commented Mar 31, 2025

Thanks! This is not supposed to work---aparently we forgot to check that the kinds of parameters are limited to # and * (i.e., no kind functions in parameters)

@j-christensen1
Copy link
Author

Ah! I figured it may not be supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something not working correctly typechecker Issues related to type-checking Cryptol code.
Projects
None yet
Development

No branches or pull requests

2 participants