roc-lang / roc

A fast, friendly, functional language.
https://roc-lang.org
Universal Permissive License v1.0
4.4k stars 309 forks source link

single-tag recursive tag union monomorphization error #3243

Closed BrianHicks closed 1 year ago

BrianHicks commented 2 years ago

This Package-Config.roc fails when I try roc build on it, as of commit 2e8dc51840316be1fa65dc3f0d60af3400ee4cc9.

platform "hello-world-in-rust"
    requires {} { main : Job }
    exposes []
    packages {}
    imports []
    provides [mainForHost]

mainForHost : Job
mainForHost = main

Job : [ Job (List Job) ]

The error is:

thread '<unnamed>' panicked at 'SymbolSpecializations(VecMap { keys: [`..main`], values: [VecMap { keys: [SpecializationMark { layout: Union(NonNullableUnwrapped([Builtin(List(RecursivePointer))])), function_mark: None }], values: [(65, `..main`)] }] })', compiler/mono/src/ir.rs:2657:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

and then it hangs!

rtfeldman commented 2 years ago

Of note, roc build on a platform module should give an error anyway (like "this isn't buildable on its own!") but I suspect this will still be reproducible if it were in an app module instead.

Ivo-Balbaert commented 1 year ago

This now (but was probably solved a long time ago) the right error message:

$ roc test12.roc ── NO PLATFORM ─────────────────────────────────────────────────── UNKNOWN.roc ─

The input file is a platform module, but only app modules can be run.

Tip: You can use roc check or roc test to verify a platform module like this one.

So this issue can be closed. @Anton-4 ?