Created
November 21, 2019 14:44
-
-
Save woarewe/587411b9b39fd00920b54f75d4eae7d5 to your computer and use it in GitHub Desktop.
Frozen string literal magic comment investigation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative 'lib' | |
str = 'string' | |
p Str.call.equal?(str) # Try to predict result and than add # frozen_string_literal: true and run app.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
class Str | |
def self.call | |
'string' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment