Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Few small fixes #4551

Merged
merged 2 commits into from Jun 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 3 additions & 16 deletions spec/compiler/semantic/instance_var_spec.cr
Expand Up @@ -4686,7 +4686,7 @@ describe "Semantic: instance var" do
)) { tuple_of([int32, int32]) }
end

it "errors if assigning instance variable at top level block" do
it "errors when assigning instance variable at top level block" do
assert_error %(
def foo
yield
Expand All @@ -4699,25 +4699,12 @@ describe "Semantic: instance var" do
"can't use instance variables at the top level"
end

it "errors when assigning instance variable at top level block" do
it "errors when assigning instance variable at top level control block" do
assert_error %(
def foo
yield
end

foo do
if true
@foo = 1
end
),
"can't use instance variables at the top level"
end

it "errors when assigning instance variable at top level control block" do
assert_error %(
if true
@foo = 1
end
),
"can't use instance variables at the top level"
end
end
2 changes: 1 addition & 1 deletion src/object.cr
Expand Up @@ -194,7 +194,7 @@ class Object
# 1.234_f64.unsafe_as(Int64) # => 4608236261112822104
# ```
#
# This method is **unsafe** becuase it behaves unpredictably when the given
# This method is **unsafe** because it behaves unpredictably when the given
# `type` doesn't have the same bytesize as the receiver, or when the given
# `type` representation doesn't semantically match the underlying bytes.
#
Expand Down