The challenge is to find a string of characters that cannot appear in any legal program in your programming language of choice. That includes comments, strings, or other "non-executable" parts.
- Your program may be specific to a particular version or implementation of your language's compiler/interpreter/runtime environment. If so, please specify the particulars.
- Only standard compiler/interpreter/runtime options are permitted. You cannot pass some weird flag to your compiler to get a specific result (e.g. passing a flag to convert warnings into errors).
- If your programming language requires a specific encoding (e.g. UTF-8), your string must also be correctly encoded (i.e. strings which fail solely due to character decoding errors are not allowed).
- Every individual character in your submission must be admissible in a legal program; that is, you can't just use a character which is always rejected.
- The compiler/interpreter/runtime must give an error when given any source code that contains your string as a substring. The error does not have to be the same across programs - one embedding of your string might cause a syntax error, while another might cause a runtime error.
- Shortest illegal string for each language wins.
- You should explain why your string is illegal (why it cannot appear anywhere in a legal program).
- Dispute incorrect solutions in the comments. More specifically, you should provide a link to TIO or equivalent demonstrating a legal program (i.e. one that doesn't produce any errors) that contains the proposed substring.
- Some languages (e.g. Bash, Batch, Perl) allow arbitrary binary data to be appended to a program without affecting validity (e.g. using
__DATA__in Perl). For such languages, you may submit a solution that can appear only in such a trailing section. Make sure to make a note of that in your answer. (The definition of this "trailing section" is language-dependent, but generally means any text after the parser has entirely stopped reading the script).
In Python, I might submit
but this can be embedded into the larger program
so it isn't admissible.