Open cvik opened 5 years ago
Looks like an implementation bug, not a type system bug.
@cvik would you have time to run this in a debugger and put the results in here?
I can try.
@aturley What particular output are you looking for from debugger?
@cvik I'm looking for the debugger backtrace here.
@aturley I compiled ponyc
with debug options and ran it in gdb
and ran bt
after the crash, is this what you were after?
#0 0x00007f069466e428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1 0x00007f069467002a in __GI_abort () at abort.c:89
#2 0x0000000000826756 in ponyint_assert_fail (expr=0x215c56f "ast != NULL", file=0x215c558 "src/libponyc/ast/ast.c", line=421, func=0x215d388 <__func__.7070> "ast_from")
at src/libponyrt/platform/ponyassert.c:65
#3 0x00000000007855b3 in ast_from (ast=0x0, id=TK_THISTYPE) at src/libponyc/ast/ast.c:421
#4 0x000000000079abab in viewpoint_replacethis (ast=0x0, with=0x7f0690a61b00, duplicate=false) at src/libponyc/type/viewpoint.c:404
#5 0x00000000007993e1 in deferred_reify (deferred=0x7f0690a647c0, ast=0x0, opt=0x7ffd948cce70) at src/libponyc/type/reify.c:296
#6 0x000000000075a402 in gen_repeat (c=0x7ffd948cc9b0, ast=0x7f0693d28840) at src/libponyc/codegen/gencontrol.c:420
#7 0x00000000007512c1 in gen_expr (c=0x7ffd948cc9b0, ast=0x7f0693d28840) at src/libponyc/codegen/genexpr.c:79
#8 0x0000000000754901 in gen_assign (c=0x7ffd948cc9b0, ast=0x7f0693d28fc0) at src/libponyc/codegen/genoperator.c:914
#9 0x00000000007514a0 in gen_expr (c=0x7ffd948cc9b0, ast=0x7f0693d28fc0) at src/libponyc/codegen/genexpr.c:148
#10 0x0000000000758f9e in gen_seq (c=0x7ffd948cc9b0, ast=0x7f0693d28180) at src/libponyc/codegen/gencontrol.c:22
#11 0x000000000075119c in gen_expr (c=0x7ffd948cc9b0, ast=0x7f0693d28180) at src/libponyc/codegen/genexpr.c:26
#12 0x000000000075ad4c in gen_try (c=0x7ffd948cc9b0, ast=0x7f0693d29640) at src/libponyc/codegen/gencontrol.c:636
#13 0x00000000007512dd in gen_expr (c=0x7ffd948cc9b0, ast=0x7f0693d29640) at src/libponyc/codegen/genexpr.c:84
#14 0x0000000000758f9e in gen_seq (c=0x7ffd948cc9b0, ast=0x7f0693d28300) at src/libponyc/codegen/gencontrol.c:22
#15 0x000000000075119c in gen_expr (c=0x7ffd948cc9b0, ast=0x7f0693d28300) at src/libponyc/codegen/genexpr.c:26
#16 0x000000000076df01 in genfun_newbe (c=0x7ffd948cc9b0, t=0x7f0694056400, m=0x7f0693ea0980) at src/libponyc/codegen/genfun.c:599
#17 0x000000000076e8df in genfun_method (c=0x7ffd948cc9b0, t=0x7f0694056400, n=0x7f0693ea0900, m=0x7f0693ea0980) at src/libponyc/codegen/genfun.c:794
#18 0x000000000076edee in genfun_method_bodies (c=0x7ffd948cc9b0, t=0x7f0694056400) at src/libponyc/codegen/genfun.c:956
#19 0x0000000000765160 in gentypes (c=0x7ffd948cc9b0) at src/libponyc/codegen/gentype.c:857
#20 0x000000000076892d in genexe (c=0x7ffd948cc9b0, program=0x7f06945f8d00) at src/libponyc/codegen/genexe.c:552
#21 0x00000000007458ba in codegen (program=0x7f06945f8d00, opt=0x7ffd948cce70) at src/libponyc/codegen/codegen.c:880
#22 0x00000000007a7483 in generate_passes (program=0x7f06945f8d00, options=0x7ffd948cce70) at src/libponyc/pass/pass.c:360
#23 0x000000000073da7b in compile_package (path=0x21550a8 ".", opt=0x7ffd948cce70, print_program_ast=false, print_package_ast=false) at src/ponyc/main.c:67
#24 0x000000000073dbf9 in main (argc=1, argv=0x7ffd948cd038) at src/ponyc/main.c:109
@cvik Yeah, this is a good place for us to start, thanks!
Compiling this:
Results in a compiler crash. It's reproducable in the playground. Removing the
else error
and letting the alias type become(U8 | None)
seem to fix it.Compiler output:
Compiler version: