Open erdman opened 5 years ago
Thanks for reporting!
The compiler on my end runs into a segfault after going into an infinite loop:
frame #65001: 0x00005555555f8b2a ponyc`find_possible_fun_defs(opt=0x00007fffffffd320, ast=0x00007ffff0b111c0, fun_defs=0x00007fffffffc9e8, obj_caps=0x00007fffffffc9f0) at lambda.c:189
frame #65002: 0x00005555555f8b2a ponyc`find_possible_fun_defs(opt=0x00007fffffffd320, ast=0x00007ffff0b111c0, fun_defs=0x00007fffffffc9e8, obj_caps=0x00007fffffffc9f0) at lambda.c:189
frame #65003: 0x00005555555f8b2a ponyc`find_possible_fun_defs(opt=0x00007fffffffd320, ast=0x00007ffff0b111c0, fun_defs=0x00007fffffffc9e8, obj_caps=0x00007fffffffc9f0) at lambda.c:189
frame #65004: 0x00005555555f8b2a ponyc`find_possible_fun_defs(opt=0x00007fffffffd320, ast=0x00007ffff0b111c0, fun_defs=0x00007fffffffc9e8, obj_caps=0x00007fffffffc9f0) at lambda.c:189
frame #65005: 0x00005555555f8b2a ponyc`find_possible_fun_defs(opt=0x00007fffffffd320, ast=0x00007ffff0b111c0, fun_defs=0x00007fffffffc9e8, obj_caps=0x00007fffffffc9f0) at lambda.c:189
frame #65006: 0x00005555555f8b2a ponyc`find_possible_fun_defs(opt=0x00007fffffffd320, ast=0x00007ffff0b111c0, fun_defs=0x00007fffffffc9e8, obj_caps=0x00007fffffffc9f0) at lambda.c:189
frame #65007: 0x00005555555f8b2a ponyc`find_possible_fun_defs(opt=0x00007fffffffd320, ast=0x00007ffff0b111c0, fun_defs=0x00007fffffffc9e8, obj_caps=0x00007fffffffc9f0) at lambda.c:189
frame #65008: 0x00005555555f8b2a ponyc`find_possible_fun_defs(opt=0x00007fffffffd320, ast=0x00007ffff0b111c0, fun_defs=0x00007fffffffc9e8, obj_caps=0x00007fffffffc9f0) at lambda.c:189
frame #65009: 0x00005555555f8b2a ponyc`find_possible_fun_defs(opt=0x00007fffffffd320, ast=0x00007ffff0b111c0, fun_defs=0x00007fffffffc9e8, obj_caps=0x00007fffffffc9f0) at lambda.c:189
frame #65010: 0x00005555555f8b2a ponyc`find_possible_fun_defs(opt=0x00007fffffffd320, ast=0x00007ffff0b111c0, fun_defs=0x00007fffffffc9e8, obj_caps=0x00007fffffffc9f0) at lambda.c:189
frame #65011: 0x00005555555f8b2a ponyc`find_possible_fun_defs(opt=0x00007fffffffd320, ast=0x00007ffff0b111c0, fun_defs=0x00007fffffffc9e8, obj_caps=0x00007fffffffc9f0) at lambda.c:189
This is during lambda type inference. Will report back with more detailed findings.
Here is a minimal sample to reproduce the problem:
actor Main
new create (env: Env) =>
x({(s, t) => s})
fun x[T](t: T) =>
None
The infinite loop is entered when the type of the parameter, for which we provide a lambda without type annotations, is a type parameter that does is not provided. In this case it seems to reference itself.
Fixing either bug alone allows the compiler to report the remaining bug. It's the two together that seems to be problematic.