fix(checker): let a generic type take its own parameter as the source of From beside the Never blanket #461
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/455-from-never-overlap"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #455
extend<Scalar> Wrapper<Scalar> with From<Scalar>(and thewithlist form) is accepted beside the std blanketextend<Target> Target with From<Never>. The two meet only atScalar = Never, andfrom(value: Never)can never be called, so no program can tell them apart.reportOverlapskips the report when one side is theFrom<Never>blanket and the other side's singleFromargument is a bare generic parameter (meetsOnlyAtNeverSource,isNeverSourceBlanket). OnlyFromis exempt; a hand-writtenFrom<Never>orFrom<Int>besideFrom<Scalar>stays an overlap with the unchanged message.compiler/tests/implementations.test.trbnext to the #441 ones, andtests/language/from-scalar.trbwith.expected.Dual<Scalar>getsFrom<Scalar>(a constant), with a test; the COMPUTE.md pitfall bullet is dropped.Not compiled locally (no
torbbinary here): CI is the first run.skills/and pdisc untouched because neither COMPUTE.md norstd/gradientis part of them; the gates will say otherwise if that is wrong.eeb46cc2c7debae5beb3From<Scalar>on a generic type is refused as overlapping the blanketFrom<Never>#455From<Scalar>on a generic type is refused as overlapping the blanketFrom<Never>#455debae5beb37d515f6ae1CI red on
6ececbd:ci / tier A (linux-x64)(failed after 25m),ci / tools/release-sync and tools/registry (linux-x64)(failed after 2m44s) andci / gates(failed after 0s, follows from the other two). Job logs are not readable with the reviewer account, so the cause is not seen. The PR body says nothing was compiled locally, so the new checker code,implementations.test.trb,tests/language/from-scalar.trband theDual<Scalar>: From<Scalar>addition are the first suspects for tier A. No other blockers found in the diff so far; review follows once CI is green on the next head.6ececbd3251c29930705Fixed in
1c299307(rebased on main57085dce):ci / tier A: the only red gate wasformat --checkontests/language/from-scalar.trb(1 of 1438 files):Wrapper.from(0.5)as an initializer is written as a command,Wrapper.from 0.5. Everything else in tier A (native/VM std suites, tests/language, packages, vendor, lock) was green.ci / tools/release-sync and tools/registry: one failure,torb login ... > a file: registry has no accounts(loginToDirectory.code == 1, registry/tests/commands.test.trb:356), 497 of 498 otherwise passing. The same job passed on #460, #462, #464 and #465, and nothing in this diff touches the registry or login, so I read it as a flake or a main-state issue and the rebased head re-runs it; if it is red again I will dig into it.ci / gatesfollowed from the two.CI red on
1c29930:ci / tier A (linux-x64)- the only red gate is stillformat --check:./tests/language/from-scalar.trb("1 of 1451 files would change"). The command-call change in this head was not enough; runtorb formaton that file and commit the result. Everything else in tier A (tests/language native+VM, packages, vendor, lock, repl/lsp/debug) and the registry job are green on this head, andci / gatesfollows from tier A. No other blockers found in the diff (checker change, tests,Dual<Scalar>: From<Scalar>and docs look right); review follows once CI is green on the next head.Self valuein the constructor)Fixed in
f32347c1: rantorb formatontests/language/from-scalar.trb. The remaining change was the constructor callSelf(value)->Self value(my earlier command-call edit only coveredWrapper.from).torb format --checkon the file is clean and the program still prints the.expectedoutput (2.5, 42, 1.0).Approved on
f32347c. Checklist:implementations.test.trb(accepted forextendandwithforms, hand-writtenFrom<Never>andFrom<Int>besideFrom<Scalar>still overlap with the unchanged message),tests/language/from-scalar.trb+.expected,Dual<Scalar>conversion test. CI green on this head (tier A, registry job, gates, pdisc).From<Never>and the other side's singleFromargument is a bare generic parameter; the two meet only atScalar = Never, which cannot be called.Dual<Scalar>: From<Scalar>as the motivating use, dropped pitfall bullet).Dualdoc comment updated.Non-blocking: none.