开发者

Runtime bugs due to case-sensitivity in (variable) names

开发者 https://www.devze.com 2022-12-13 03:21 出处:网络
We recenly had a problem (ANTLR “Cannot launch the debugger. Time-out waiting to connect to the remote parser.”) where there was a runtime bug which could have been due to case-sensitivity in (varia

We recenly had a problem (ANTLR “Cannot launch the debugger. Time-out waiting to connect to the remote parser.”) where there was a runtime bug which could have been due to case-sensitivity in (variable) names and was OS-depend开发者_如何学运维ent. This was in ANTLR but I am wondering more generally whether there are common cases (in any language) where names differ only in case, the program compiles, but there are runtime errors due to name collisions. Is there also likely to be a difference between UNIX and Windows?

As a possible example can I create two Java classes in the same package: Foo in Foo.java and foo in foo.java on UNIX while I cannot do the same on Windows? If not, is this trapped by the compiler and what restriction does it put on case equality? And how do other common languages treat this problem?

[Of course I don't deliberately try to do this, but errors creep in and I rely heavily on compilers to detect them.]


This does not appear to be of great concern to most people

0

精彩评论

暂无评论...
验证码 换一张
取 消