Skip to content

Commit

Permalink
all examples now run on v0.23
Browse files Browse the repository at this point in the history
  • Loading branch information
tzekid committed Jul 7, 2017
1 parent acbe378 commit 6c54fb7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion channel-select/channel-select.cr
@@ -1,4 +1,4 @@
def generator(n : T)
def generator(n : T) forall T
channel = Channel(T).new
spawn do
loop do
Expand Down
2 changes: 1 addition & 1 deletion def/def.cr
Expand Up @@ -19,7 +19,7 @@ def foo(x, y : Int32 = 1, z : Int64 = 2)
x + y + z
end

def foo(x : T)
def foo(x : T) forall T
end

foo(3) # x = 3, T = Int32
Expand Down
16 changes: 8 additions & 8 deletions json/json.cr
Expand Up @@ -10,16 +10,16 @@ puts Hash{"apple" => 5, "lettuce" => 7}.to_json
# json_object
# json_array
# field
result = String.build do |io|
io.json_object do |object|
object.field "address", "Crystal Road 1234"
object.field "location" do
io.json_array do |array|
array << 12.3
array << 34.5
result = JSON.build do |json|
json.object do
json.field "address", "Crystal Road 1234"
json.field "location" do
json.array do
json.number 12.3
json.number 34.5
end
end
end
end
end
puts result # => %({"address":"Crystal Road 1234","location":[12.3,34.5]})

Expand Down

0 comments on commit 6c54fb7

Please sign in to comment.