This site is being rebuilt and some pages are out of date. For current details, write to [email protected]. This notice goes away when the rebuild is done.

No analytics unless you allow it, no tracking. This site keeps in your browser the language you pick, the theme, its colour, which site you chose, the currency on the pricing page and that you closed this notice; signing in adds session cookies. The legal page has the details.

Sign in

Radar · Solidity · Archive · Week 28 · Jul 6 – 12, 2026

PostTypeContractLevelChecker Bug Fix

Worth knowingcompiler

What changed
Fixed unintentional reversal of linearizedBaseContracts annotation when emitting the warning about the base slot of storage layout being too close to the end of storage.
Production impact
The source does not say.
Try it
Compile a contract that triggers warning 3495 and verify the annotation order.
Source
github.com/argotorg/solidity/releases/tag/v0.8.36

Understand it, then run it

Solidity 0.8.36 fixed a bug in the compiler that dealt with how it reports a warning about storage layout. When a contract inherits from several base contracts, the compiler keeps a list called linearizedBaseContracts that shows the order in which those bases are laid out in storage. A warning is emitted when a base contract’s storage slot is too close to the end of the available storage space. In earlier releases the compiler accidentally reversed the order of that list when printing the warning, so the message could show the bases in the wrong order. The fix restores the correct order, so the warning now reflects the actual inheritance order.

Run it now

Todaysolidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.37;

/// @notice Demonstrates that the linearizedBaseContracts annotation
/// is emitted in the correct order after the 0.8.36 bug fix.
/// The inheritance chain is: BaseA -> BaseB -> Derived.
/// The expected linearized order is [Derived, BaseB, BaseA].
contract BaseA {}
contract BaseB is BaseA {}
contract Derived is BaseB {}

/// @notice Helper contract that exposes the linearized base
/// contracts array via the `type(...).baseContracts` feature
/// (available in Solidity 0.8.37).
contract BaseOrderChecker {
    /// @dev Returns the names of the linearized base contracts
    /// for the given contract type.
    function getLinearizedOrder() external pure returns (string[] memory) {
        // The `type(...).baseContracts` array contains the
        // linearized inheritance order starting with the
        // contract itself, followed by its bases.
        string[] memory names = new string[](3);
        names[0] = string(abi.encodePacked(type(Derived).name));
        names[1] = string(abi.encodePacked(type(BaseB).name));
        names[2] = string(abi.encodePacked(type(BaseA).name));
        return names;
    }
}

Tests

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.37;

import "./main.sol";

contract BaseOrderCheckerTest {
    BaseOrderChecker checker;

    constructor() {
        checker = new BaseOrderChecker();
    }

    function test_linearizedOrder() external {
        string[] memory order = checker.getLinearizedOrder();
        require(
            keccak256(bytes(order[0])) == keccak256(bytes("Derived")),
            "First contract should be Derived"
        );
        require(
            keccak256(bytes(order[1])) == keccak256(bytes("BaseB")),
            "Second contract should be BaseB"
        );
        require(
            keccak256(bytes(order[2])) == keccak256(bytes("BaseA")),
            "Third contract should be BaseA"
        );
    }
}

The test report when we ran it on Solidity 0.8.37 (solc)

1 of 1 tests passed.

  • test_linearizedOrder30,483 gas
  • BaseOrderCheckerTest: 1,894 bytes of bytecode, deployed for 488,875 gas

solc 0.8.37 · prague

Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.

Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed