Skip to content

Commit 80f3326

Browse files
committed
Fix some compiler errors to show more information.
These were a few errors that tripped me up in my latest round of work, where I had to add more information to figure out what was going on. This PR adds that missing information.
1 parent 9f86124 commit 80f3326

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

main.cr

+6
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,9 @@ module Savi
393393
if check_only
394394
sources.each { |source_package, sources|
395395
ctx = Savi.compiler.compile(sources, :manifests, options)
396+
errors.concat(ctx.errors)
397+
next if errors.any?
398+
396399
AST::Format.check(ctx, ctx.root_package_link, ctx.root_docs)
397400
errors.concat(ctx.errors)
398401
}
@@ -401,6 +404,9 @@ module Savi
401404
edited_count = 0
402405
sources.each { |source_package, sources|
403406
ctx = Savi.compiler.compile(sources, :manifests, options)
407+
errors.concat(ctx.errors)
408+
next if errors.any?
409+
404410
edits_by_doc =
405411
AST::Format.run(ctx, ctx.root_package_link, ctx.root_docs)
406412

src/savi/compiler/code_gen/continuation_info.cr

+6-3
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ class Savi::Compiler::CodeGen
2525
# We don't yet support the case where the public elements of the
2626
# continuation data do not match - they would need to be boxed/unboxed
2727
# in a wrapper virtual function, which we don't yet have code for.
28-
public_elements_match = concrete_infos
29-
.map(&.struct_element_types.[0...3].as(Array(LLVM::Type))).uniq.one?
28+
public_elements_uniq = concrete_infos
29+
.map(&.struct_element_types.[0...3].as(Array(LLVM::Type))).uniq
30+
public_elements_match = public_elements_uniq.one?
3031
raise NotImplementedError.new \
31-
"heterogenous public members of virtual continuation types" \
32+
"heterogenous public members of virtual continuation types: #{
33+
public_elements_uniq
34+
}" \
3235
unless public_elements_match
3336

3437
# Create a virtual continuation struct type which has all of the

0 commit comments

Comments
 (0)