Haskell, 26 18 bytes
main=print$0 +1-- Doubled:
main=print$0 +1--main=print$0 +1-- I found this version while answering the tripple version of the challenge.
26 byte version without comment abuse:
main|n<-1,nmain<-2=print n Try it online! Prints 1.
In the pattern guard the identifier n is set to 1 and nmain to 2, then print n prints 1.
###Double program:
Double program:
main|n<-1,nmain<-2=print nmain|n<-1,nmain<-2=print n [Try it online!][TIO-j55yf85f]Try it online! Prints 2.
In the first pattern guard again n is set to 1 and nmain to 2, however the print statement has become print nmain, so 2 is printed. Because identifier declarations in a pattern guard evaluate to true, the second pattern guard can never be reached. Haskell: https://www.haskell.org/ [TIO-j55yf85f]: https://tio.run/##y0gszk7Nyfn/PzcxM68mz0bXUCcPxLTRNbItKMrMK1HIwy3z/z8A "Haskell – Try It Online"