You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#### Check if two identifiers refer to the same symbol
883
883
884
-
> **TODO** - Is this possible?
884
+
Identifiers are created by the parser and are always unique.
885
+
Say, if you create a variable `foo` and use it in another line, it will create 2 separate identifiers with the same text `foo`.
886
+
887
+
Then, the linker runs through these identifiers and connects the identifiers referring to the same variable with a common symbol (while considering scope and shadowing). Think of symbols as what we intuitively think as variables.
888
+
889
+
So, to check if two identifiers refer to the same symbol - just get the symbols related to the identifier and check if they are the same (by reference).
0 commit comments