Build stuck on Semantic (type declarations)

Hi,
I am stuck on code compilation phase: [4/13] Semantic (type declarations)
Crystal version is 1.8.2
I have this error after changing the following code:

abstract class Pipeable(T)
  property id : String?
  property in_channel : Channel(T)?

TO:

abstract class Pipeable(T)
  property id : String?
  property in_channel : Channel(PipeMessage(T))?

My system info:
System:
Kernel: 6.1.29-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.1
parameters: BOOT_IMAGE=/boot/vmlinuz-6.1-x86_64
root=UUID=9c573c2e-069b-4273-aac2-a972294567e5 rw quiet splash apparmor=1
security=apparmor udev.log_priority=3
Desktop: GNOME v: 43.5 tk: GTK v: 3.24.37 wm: gnome-shell dm: GDM v: 44.0
Distro: Manjaro Linux base: Arch Linux
Machine:
Type: Laptop System: HP product: HP 250 G8 Notebook PC
v: Type1ProductConfigId serial: Chassis: type: 10
serial:
Mobo: HP model: 85F3 v: 40.38 serial: UEFI: Insyde
v: F.57 date: 09/19/2022
Battery:
ID-1: BAT1 charge: 8.2 Wh (21.3%) condition: 38.5/41.0 Wh (93.8%) volts: 10.9
min: 11.3 model: COMPAL PABAS0241231 type: Li-ion serial:
status: discharging
Memory:
System RAM: available: 15.41 GiB used: 4.22 GiB (27.4%)
RAM Report: permissions: Unable to run dmidecode. Root privileges required.
CPU:
Info: model: Intel Core i5-1035G1 bits: 64 type: MT MCP arch: Ice Lake
gen: core 10 level: v4 note: check built: 2019-21 process: Intel 10nm
family: 6 model-id: 0x7E (126) stepping: 5 microcode: 0xB8
Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
L1: 320 KiB desc: d-4x48 KiB; i-4x32 KiB L2: 2 MiB desc: 4x512 KiB L3: 6 MiB
desc: 1x6 MiB
Speed (MHz): avg: 1192 high: 1200 min/max: 400/3600 scaling:
driver: intel_pstate governor: powersave cores: 1: 1200 2: 1200 3: 1143
4: 1200 5: 1200 6: 1200 7: 1200 8: 1200 bogomips: 19048

It seems like a bug, maybe it got stuck in a loop? Anyway, but it’s hard to tell from the small snippet. Do you think you can reduce the original program into something we can inspect?

Here few code snippets

class PipeMessage(T)
  property headers = Hash(String, String).new
  property body : T?
end

abstract class Pipeable(T)
  property in_channel : Channel(PipeMessage(T))?
  property out_channel : Channel(PipeMessage(T))?
  property prev_pipeable : Pipeable(PipeMessage(T))? #loop?
end

As you suggested probably there is a loop.
I think the loop is due to the following row: property prev_pipeable : Pipeable(PipeMessage(T))? infact if I remove the row, the build is successful

my fault is due to the fact that I put Pipeable(PipeMessage(T))? instead of Pipeable(T)? and this mistake accidentally discovered probably a bug during the build phase

let me know if the information above are enough

P.S.: if i change Pipeable(PipeMessage(T))? with Pipeable(T)? (that is what I want) the build is successful

Thanks

Reduced:

class PipeMessage(T)
  @body : T?
end

class Pipeable(T)
  @prev_pipeable : Pipeable(PipeMessage(T))?
end