### Godot version

4.2 (c5da2e54fe50cad34b5f93fa10538978b33af88d)

### System information

Windows 11

### Issue description

Attempting to run a scene with the following script report Identifier not found error:

![image](https://github.com/godotengine/godot/assets/3036176/3a63b930-0588-499d-80a2-4f88f5f07116)

This does not happen on 4.1.1 so this is a regression.

### Steps to reproduce

Create a script derived from Control and try to get access to the mouse_entered signal.

### Minimal reproduction project

[TestBug.zip](https://github.com/godotengine/godot/files/12237764/TestBug.zip)

codegen.generator->write_binary_operator(type_equality_addr, Variant::OP_OR, type_equality_addr, tmp_comp_addr);
				codegen.generator->pop_temporary(); 
			}
			codegen.generator->write_and_left_operand(type_equality_addr);
			
			GDScriptCodeGenerator::Address literal_addr = _parse_expression(codegen, r_error, p_pattern->literal);
			if (r_error) {
				return GDScriptCodeGenerator::Address();
			}
			
			GDScriptCodeGenerator::Address equality_addr = codegen.add_temporary(equality_type);
			codegen.generator->write_binary_operator(equality_addr, Variant::OP_EQUAL, p_value_addr, literal_addr);
			codegen.generator->write_and_right_operand(equality_addr);
			
			codegen.generator->write_end_and(type_equality_addr);
			codegen.generator->pop_temporary(); 
			if (literal_addr.mode == GDScriptCodeGenerator::Address::TEMPORARY) {
				codegen.generator->pop_temporary();
			}
			
			if (p_is_nested) {
				
				codegen.generator->write_and_right_operand(type_equality_addr);
				codegen.generator->write_end_and(p_previous_test);
			} else if (!p_is_first) {
				
				codegen.generator->write_or_right_operand(type_equality_addr);
				codegen.generator->write_end_or(p_previous_test);
			} else {