fn(input$0, then$1) =>
let malformed$2 = @definy.snapshot-check-malformed(parts: $0.parts);
match @core.list-get(list: $2, index: 0) {
#some(_) =>
$1(errors: $2),
#none(_) =>
let violations$3 = @core.check-reference-visibility(
project_name: $0.project_name,
committed: @definy.snapshot-check-visibility-parts(parts: $0.parts),
environment: $0.environment
);
match @core.list-get(list: $3, index: 0) {
#some(_) =>
$1(
errors: @core.list-map(
T: @core.visibility-violation,
U: String,
f: fn(item$4) =>
@definy.visibility-violation-message(violation: $4),
xs: $3
)
),
#none(_) =>
let latest$6 = @definy.snapshot-check-latest-entries(
latest: $0.latest,
replaced: @core.list-concat(
left: @core.list-map(
T: @definy.snapshot-check-part,
U: String,
f: fn(item$5) =>
$5.module_id,
xs: $0.parts
),
right: $0.project_module_ids
)
);
let committed$7 = @definy.snapshot-check-entries(parts: $0.parts, resolutions: $0.resolutions);
let plan$8 = @core.type-checker(latest: $6, committed: $7, module_id: "#replaced");
let without_expression$9 = @definy.snapshot-check-without-expression(ids: $8.without_expression, parts: $0.parts);
$1(
errors: @core.list-concat(
left: $9,
right: @definy.type-check-requests-errors(
requests: @definy.snapshot-check-requests(ids: $8.to_check, parts: $0.parts),
check: fn(expr$10, expected_type$11) =>
$8.check(expr: $10, expected_type: $11)
)
)
)
}
}