godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.2k stars 20.22k forks source link

Error "Unexpected Identfier in class body" shows wrong line #96792

Open tobydjones opened 1 week ago

tobydjones commented 1 week ago

Tested versions

4.3

System information

Godot v4.3.stable - Windows 10.0.19045 - GLES3 (Compatibility) - AMD Radeon RX 6600 (Advanced Micro Devices, Inc.; 31.0.24033.1003) - Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 Threads)

Issue description

The parser error Error at (3,16): Unexpected "Identifier" in class body. is reporting the wrong line

Steps to reproduce

Make a new script with the following lines

extends Node2D

var test = true
error = true

The error message will say the error is on line 3, at the end of the line, and that line will be highlighted, but the error is on line 4

Minimal reproduction project (MRP)

N/A

dalexeev commented 1 week ago