Skip to content
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

AssertionError: unknown FUN_DECL #19

Closed
julianhyde opened this issue Mar 9, 2020 · 2 comments
Closed

AssertionError: unknown FUN_DECL #19

julianhyde opened this issue Mar 9, 2020 · 2 comments

Comments

@julianhyde
Copy link
Collaborator

The function

fun wordcount lines =
  let
    fun split0 [] word words = word :: words
      | split0 (#" " :: s) word words = split0 s "" (word :: words)
      | split0 (c :: s) word words = split0 s (word ^ (String_str c)) words
    fun split s = List_rev (split0 (String_explode s) "" [])
  in
    from line in lines,
        word in split(line)
    group word compute count of 1 as count
  end;

gives error

Exception in thread "main" java.lang.AssertionError: unknown FUN_DECL; fun split0 ([]) word words = word :: words | split0 (  :: s) word words = split0 s "" (word :: words) | split0 (c :: s) word words = split0 s (word ^ String_str c) words
	at net.hydromatic.morel.compile.Compiler.compileDecl(Compiler.java:327)
	at net.hydromatic.morel.compile.Compiler.compileLet(Compiler.java:301)

Also note that in the error message, split0 ( :: s) word words should be split0 (#" " :: s) word words.

@julianhyde
Copy link
Collaborator Author

Simpler case:

fun foo arg =
  let
    fun baz x = x
  in
    baz arg
  end

@julianhyde
Copy link
Collaborator Author

julianhyde commented Mar 11, 2020

Fixed in 431bab5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant