it("explains identical signatures instead of diffing a type against itself", function()
localout=box(
"Type 'Effect<import(\"/app/node_modules/a/node_modules/effect/User\").User, never, never>' is not assignable to type 'Effect<import(\"/app/node_modules/effect/User\").User, never, never>'."
it("leaves the default width alone in a normal window", function()
localout=box(SCOPE_RIDES_ALONG)
assert.is_true(widths(out) <=70)
assert.is_truthy(out:find("│ ⚡ Hint: Scope also needs Effect.scoped(...)", 1, true))
end)
end)
describe("render — channels that never inferred", function()
it("does not ask you to provide `unknown`", function()
-- TS prints `unknown` for a requirement it never resolved. There is no
-- layer to provide, so the provide hint would send you looking for one.
localout=box(
"Argument of type 'Effect<Fiber<never, unknown>, never, unknown>' is not assignable to parameter of type 'Effect<Fiber<never, unknown>, never, never>'."
)
assert.is_truthy(out:find("R Not Inferred", 1, true))
assert.is_nil(out:find("Forgot to provide", 1, true))
assert.is_truthy(out:find("annotate the effect", 1, true))
end)
it("says the same inline", function()
localout=line(
"Argument of type 'Effect<Fiber<never, unknown>, never, unknown>' is not assignable to parameter of type 'Effect<Fiber<never, unknown>, never, never>'."
)
assert.are.equal("⚠ R never inferred (`unknown`)", out)
end)
it("treats `any` the same way", function()
localout=box("Type 'Effect<void, never, any>' is not assignable to type 'Effect<void, never, never>'.")
assert.is_truthy(out:find("R Not Inferred", 1, true))
assert.is_truthy(out:find("`any`", 1, true))
end)
it("labels the Layer channel RIn", function()
localout=box("Type 'Layer<Database, never, unknown>' is not assignable to type 'Layer<Database, never, never>'.")
assert.is_truthy(out:find("RIn Not Inferred", 1, true))
end)
it("keeps the provide hint when a real service rides along, and flags the rest", function()
localout=
box("Type 'Effect<void, never, Database | unknown>' is not assignable to type 'Effect<void, never, never>'.")
assert.is_truthy(out:find("Forgot to provide: Database", 1, true))
assert.is_nil(out:find("Forgot to provide: Database | unknown", 1, true))
it("keeps the import paths visible in the identical-signatures box", function()
localout=box(
"Type 'Effect<import(\"/app/node_modules/a/node_modules/effect/User\").User, never, never>' is not assignable to type 'Effect<import(\"/app/node_modules/effect/User\").User, never, never>'."
)
-- Prettifying these away would leave two lines that read identically. The
-- nested copy is the whole tell, so it has to survive the wrap intact.