shard-spectator/spec/spectator/dsl/mocks
Michael Miller e05ef94ef5
Initial work on stub DSL - found bug in Crystal compiler
```
Module validation failed: Invalid bitcast
  %4 = bitcast i32* %3 to %"(Spectator::Arguments(T, NT) | Nil)", !dbg !16
 (Exception)
  from /crystal/src/int.cr:541:9 in 'finish'
  from /crystal/src/compiler/crystal/codegen/codegen.cr:71:7 in 'codegen'
  from /crystal/src/compiler/crystal/compiler.cr:173:16 in 'compile'
  from /crystal/src/compiler/crystal/command/spec.cr:98:14 in 'spec'
  from /crystal/src/hash.cr:901:11 in '__crystal_main'
  from /crystal/src/crystal/main.cr:115:5 in 'main'
  from src/env/__libc_start_main.c:94:2 in 'libc_start_main_stage2'
Error: you've found a bug in the Crystal compiler. ...
```

I haven't been able to reproduce this in a simplified form.

Passing the `constraint` argument in NullStub#and_return to ValueStub.new triggers the bug.
Removing the `constraint` argument fixes the issue.
2022-03-31 22:49:45 -06:00
..
double_spec.cr Allow passing predefined stubs in as keyword args 2022-03-31 18:55:12 -06:00
lazy_double_spec.cr Simplify macro eval by returning a lazy double 2022-03-31 18:54:39 -06:00
null_double_spec.cr Allow passing predefined stubs in as keyword args 2022-03-31 18:55:12 -06:00
stubs_spec.cr Initial work on stub DSL - found bug in Crystal compiler 2022-03-31 22:49:45 -06:00