# The Solidity compiler does not raise any warnings or errors for the incorrect use of operators in variable initialization at the function level

**URL:** <https://forum.soliditylang.org/t/the-solidity-compiler-does-not-raise-any-warnings-or-errors-for-the-incorrect-use-of-operators-in-variable-initialization-at-the-function-level/1395>\
**Category:** Feedback\
**Created:** [January 3, 2023, 5:44am UTC](https://forum.soliditylang.org/t/the-solidity-compiler-does-not-raise-any-warnings-or-errors-for-the-incorrect-use-of-operators-in-variable-initialization-at-the-function-level/1395 "2023-01-03T05:44:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ROOTBABU](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.soliditylang.org/rootbabu/32/805_2.png) [@ROOTBABU](https://forum.soliditylang.org/u/ROOTBABU)\
**Post date:** [January 3, 2023, 5:44am UTC](https://forum.soliditylang.org/t/the-solidity-compiler-does-not-raise-any-warnings-or-errors-for-the-incorrect-use-of-operators-in-variable-initialization-at-the-function-level/1395/1 "2023-01-03T05:44:15Z")

</div>

```auto
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.17;

contract Lottery{
    address public owner;
    constructor(){
        owner == msg.sender;
    }
} 

```

**Issue:** In the given code, there is a mistake in the assignment of the `owner` variable in the `constructor` function. Instead of using the assignment operator `=`, the double equal `==` operator is used, which is a comparison operator and does not assign a value to the variable. This mistake can be hard to identify, as the Solidity compiler does not raise any `warnings` or `errors` for this issue.

**Expected:** As a result, it is essential for the compiler should carefully check the code and make sure that the correct operators are used at the time of initialization of a variable at the function level.

---

<div class="post-metadata">

**Author:** ![franzihei](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.soliditylang.org/franzihei/32/19_2.png) [@franzihei](https://forum.soliditylang.org/u/franzihei)\
**Post date:** [March 20, 2023, 2:10pm UTC](https://forum.soliditylang.org/t/the-solidity-compiler-does-not-raise-any-warnings-or-errors-for-the-incorrect-use-of-operators-in-variable-initialization-at-the-function-level/1395/2 "2023-03-20T14:10:18Z")

</div>


