Releases: crystal-lang/crystal
Releases · crystal-lang/crystal
1.2.0
Compiler
- Fix variance checks between generic instances for
Proc#call
and abstract defs. (#10899, thanks @HertzDevil) - Fix
proc_spec
forcing normal compilation instead of JIT (#10964, thanks @straight-shoota) - Fix
ProcNotation#to_s
remove whitespace for nil output type (#10935, thanks @straight-shoota) - Compiler: carry FileModule information inside Block (#11039, thanks @asterite)
- Splat values correctly inside return/break/next statements (#10193, thanks @HertzDevil)
- Handle already stripped column numbers in compiler exceptions (#11008, thanks @pyrsmk)
- Substitute unbound type parameters in virtual metaclass types (#11067, thanks @HertzDevil)
- Improve detection of instance variables in extended modules (#10554, thanks @HertzDevil)
- Don't compute instance variable initializers on unbound generic instances (#11000, thanks @HertzDevil)
- Syntax errors for invalid 128-bit integer literals (#10975, thanks @rymiel)
- Support auto-splatting in captured block literals (#10251, thanks @HertzDevil)
- Detect cyclic includes between generic modules (#10529, thanks @HertzDevil)
- Add stricter checks for arguments to macro methods on AST nodes (#10498, thanks @HertzDevil)
- Compiler: fix
is_a?
for virtual metaclass types (#11121, thanks @asterite) - Fix edge cases with unicode method names (#10978, thanks @HertzDevil)
- Don't emit debug info for unused variable declarations (#10957, thanks @HertzDevil)
- Fix
Call.def_full_name
print full block parameter (#10915, thanks @straight-shoota) - Allow union types to be unbound (#11166, thanks @HertzDevil)
- Make
typeof
start a nested lexical scope (#10796, thanks @HertzDevil) - Fix edge case for intersection between virtual metaclasses (#11185, thanks @HertzDevil)
- Compiler: don't trigger "already had enclosing call" for same object (#11202, thanks @asterite)
- Properly handle indirect arguments for external C functions (#11189, thanks @ggiraldez)
- Fix resolve generic argument in block output type restriction mismatch (#11186, thanks @straight-shoota)
- Secure array slicing when expanding macro for stack trace (#11109, thanks @pyrsmk)
- Fix debug locations for
Proc
pointers (#11243, thanks @HertzDevil) - Allow assignments from generic instance metaclasses to virtual metaclasses (#11250, thanks @HertzDevil)
- Refactor
CrystalPath#find_in_path_relative_to_dir
for readability (#10876, #10990, #10988, thanks @straight-shoota) - Allow constants and instance / class variables as receivers for setter proc pointers (#10741, thanks @HertzDevil)
- Do not use globals for regex (#10951, thanks @asterite)
- Define type filtering through an intersection operation (#10781, thanks @HertzDevil)
- Fix no overflow check when primitive int converts to same type (#11003, thanks @HertzDevil)
- Attach debug locations to generated internal LLVM functions (#10934, thanks @HertzDevil)
- Add helpful error message for invalid number literal like '.42' (#4665, thanks @makenowjust)
- Add
CrystalPath.expand_paths
, expand relative to compiler path (#11030, thanks @straight-shoota) - Clarify usage of "arguments" and "parameters" in error messages (#10378, thanks @HertzDevil)
- (performance) Don't generate type IDs for formal generic instances (#11167, thanks @HertzDevil)
- (performance) Don't generate unique type IDs for virtual metaclasses (#11188, thanks @HertzDevil)
- Add an environment variable for dumping type IDs (#11168, thanks @HertzDevil)
- Allow underscores in macro
for
's loop variables (#11141, thanks @HertzDevil) - (performance) Compiler: cache cleanup transformer (#11197, thanks @asterite)
- Avoid needless union in
LLVM::ABI::AArch64#homogeneous_aggregate?
(#11199, thanks @asterite) - Removing ThinLTO support (#11194, thanks @beta-ziliani)
- Error if abstract def implementation is inherited from supertype (#11056, thanks @straight-shoota)
- (performance) Add
inject_primitives: false
to macro_spec (#11269, thanks @straight-shoota) - Primitive annotations for interpreter (#11147, thanks @asterite)
- Support generic module instances in
TypeNode#includers
(#11116, thanks @HertzDevil) - Reject hash literals with mixed syntax (#11154, thanks @makenowjust)
Language
- Make
.as?(NoReturn)
always returnnil
(#10896, thanks @HertzDevil) - Compiler: make
is_a?(union)
work correctly for virtual types (#11176, thanks @asterite) - Adjust docs for
Crystal::Macros::HashLiteral#[]
(#10930, thanks @kevinsjoberg) - Fix path lookup when ancestor finds type with same name as current scope (#10901, thanks @HertzDevil)
- Fix several compile-time operations on generic instance metaclasses (#11101, thanks @HertzDevil)
- Make
#is_a?
in macros respect the AST node hierarchy (#11062, thanks @HertzDevil) - Add docs to string methods in
SymbolLiteral
andMacroId
(#9298, thanks @makenowjust) - Add clarification about when
instance_vars
can be called (#11171, thanks @willhbr) - Add
file_exists?
macro method (#10540, thanks @Sija)
Standard Library
- (breaking-change) Change nonsense return types to Nil: uncategorized (#10625, thanks @oprypin)
- (breaking-change) Change nonsense return types to Nil in formatter classes (#10623, thanks @oprypin)
- Add base64 to prelude (#11050, thanks @straight-shoota)
- Remove calls to deprecated
SystemError.from_winerror
(#11220, thanks @straight-shoota) - Add support for LLVM 12 (#10873, #11178, thanks @maxfierke, @Blacksmoke16)
- Examples: fix (2021-09) (#11234, thanks @maiha)
- Don't use
:nodoc:
when overriding public methods (#11096, thanks @HertzDevil) - Add internal registry implementation for win32 (#11137, thanks @straight-shoota)
Collection
- (breaking-change) Move
Array#product
toIndexable#cartesian_product
(#10013, thanks @HertzDevil) - Disallow
Slice(T).new(Int)
whereT
is a union of primitive number types (#10982, thanks @HertzDevil) - Make
Array#transpose
,Enumerable#reject
,Enumerable#to_h
work with tuples (#10445, thanks @HertzDevil) - Fix
Enumerable#each
block return type (#10928, thanks @straight-shoota) - Fix key type f...
1.1.1
Language changes
- Revert name of top-level module to
main
(#10993, thanks @beta-ziliani)
Standard Library
- Fix missing required args for
Socket::Addrinfo::Error.new
(#10960, thanks @straight-shoota) - Fix disable unnecessary spec on win32 (#10971, thanks @straight-shoota)
- Remove incorrect type restrictions on index methods with offset (#10972, thanks @straight-shoota)
- Fix: documentation of
#step
inNumber
andChar
(#10966, #11006, thanks @beta-ziliani and @straight-shoota)
Compiler
- Fix parsing macro body with escaped backslash in literal (#10995, thanks @straight-shoota)
Other
- Updating aarch64 actions to use 1.0.0 images (#10976, thanks @beta-ziliani)
1.1.0
1.1.0 (2021-07-14)
Language changes
- Support splat expansions inside tuple and array literals. (#10429, thanks @HertzDevil)
- Support breaks with values inside
while
expressions. (#10566, thanks @HertzDevil)
Macros
- Add
@top_level
to access the top-level scope in macros. (#10682, thanks @beta-ziliani) - Fix: preserve integer sizes in
NumberLiteral#int_bin_op
. (#10713, thanks @collidedscope) - Add
NumberLiteral#to_number
. (#10802, thanks @straight-shoota) - (breaking-change) Add
Crystal::Macros::Path#global?
deprecating the oldCrystal::Macros::Path#global
. (#10812, thanks @HertzDevil) - Minor fixes to docs of
UnaryExpression
macro nodes. (#10816, thanks @HertzDevil) - Add macro method
ASTNode#nil?
. (#10850, #10616, thanks @straight-shoota)
Standard library
Global changes
Windows support
- Port
Socket::Address
to win32 . (#10610, thanks @straight-shoota) - Port
Socket::Addrinfo
to win32. (#10650, thanks @straight-shoota) - Extract system-specifics from Socket. (#10706, thanks @straight-shoota)
- Make
WinError
portable and add it to prelude. (#10725, thanks @straight-shoota) - Improve portability of
SystemError
. (#10726, thanks @straight-shoota) - Refactor
Socket::Addrinfo::Error
based onos_error
. (#10761, thanks @straight-shoota) - Add
WinError.wsa_value
and specs forWinError
. (#10762, thanks @straight-shoota) - Add specs for
Errno
. (#10763, thanks @straight-shoota) - Refactor: Move win32 libc bindings from
winbase.cr
to approriate files. (#10771, thanks @straight-shoota) - Refactor: Change protocol socket fd to
Socket::Handle
. (#10772, thanks @straight-shoota) - Fix
Socket::Connect
error in addrinfo inheritos_error
. (#10782, thanks @straight-shoota) - Reorganize some win32 libc bindings (#10776, thanks @straight-shoota)
Type annotations
- Add type restriction to private
Process
constructor. (#7040, thanks @z64) - Add various return type restrictions (thanks @oprypin, @straight-shoota, and @caspiano):
#10578, #10579,
#10580, #10581,
#10582, #10583,
#10584, #10585,
#10586, #10587,
#10588, #10849,
#10856, #10857,
#10858, #10905 - Add type restrictions for splat-less overloads of some methods. (#10594, thanks @HertzDevil)
Numeric
- Add
Number.new
overload forString
. (#10422, thanks @Blacksmoke16) - Fix
Math.pw2ceil
for zero and 64-bit integers. (#10555, thanks @straight-shoota) - Add
#positive?
&#negative?
toNumber
andTime::Span
. (#10601, thanks @Blacksmoke16) - Fix imprecise
Number#significant
algorithm. (#10615, thanks @straight-shoota) - Add
BigFloat
's rounding modes. (#10618, thanks @HertzDevil) - Fix handling of arithmetic overflow in
BigDecimal#div
. (#10628, thanks @kellydanma) - Clarify behaviour of unsafe
Float
-to-number conversions. (#10631, thanks @HertzDevil) - Fix return type restriction for
Number#humanize
overload. (#10633, thanks @HertzDevil) - Fix
printf
float with with many digits. (#10719, thanks @straight-shoota) - Add
BigDecimal
's missing rounding modes. (#10798, thanks @HertzDevil) - Add support for using big rational
#**
with unsigned ints. (#10887, thanks @stakach) - Add overflow detection to
BigFloat#to_i64
and#to_u64
. (#10630, thanks @HertzDevil)
Text
- (performance) Optimize
Levenshtein.distance
. (#8324, thanks @r00ster91) - Refactor: add private
Slice#hexdump(io : IO)
overload. (#10496, thanks @HertzDevil) - Restrict
MatchData#begin
and#end
toInt32
. (#10656, thanks @straight-shoota) - Refactor: remove
#check_needs_resize
fromIO::Memory
,String::Builder
. (#10732, thanks @straight-shoota) - Fix
Base64#encode
, exclude last 3 bytes from bswap. (#10752, thanks @kostya) - Refactor: avoid union type in
Char::Reader#decode_char_at
. (#10758, thanks @asterite)
Collections
- Add sub/superset checking methods to
Hash
. (#7500, thanks @Sija) - Improve documentation of
Array#[](Range)
. (#10243, thanks @straight-shoota) - Add
Steppable
module as generalizedNumber#step
. (#10279, thanks @straight-shoota) - Add docs for
#map_with_index
. (#10512, thanks @wontruefree) - Add
Array#truncate
. (#10712, thanks @HertzDevil) - Fix: Always copy
Hash
's default block on#dup
and#clone
. (#10744, thanks @HertzDevil) - Apply
Array#push
's resizing heuristic to#unshift
. (#10750, thanks @HertzDevil) - Refactor index / count normalization in range-like methods. (#10753, thanks @HertzDevil)
- Add methods for cumulative folding and prefix sums. (#10789, thanks @HertzDevil)
- Fix: Pass read-only flag to peeked slice in
IO::Memory
. (#10891, thanks @z64)
Crypto
- Add methods for getting peer certificates and signatures in
OpenSSL
. (#8005, thanks @will) - Add docs for
OpenSSL::Cipher
. (#9934, thanks @sol-vin) - Fix format of
src/openssl/cipher.cr
. (#10705, thanks @straight-shoota) - Refine documentation for
Random#urlsafe_base64
. (#10724, thanks @straight-shoota) - Fix ssl context required for
add_x509_verify_flags
. (#10756, thanks @stakach)
Time
- Improve error handling for
load_localtime
on unix. (#10654, thanks @straight-shoota) - Fix broken call to
Time#to_s
. (#10778, thanks @straight-shoota) - Fix
Time#shift
cover date boundaries with zone offset. (#10871, thanks @straight-shoota)
Files
- Fix and unify documentation for
puts
. (#10614, thanks @straight-shoota) - Fix
Path#sibling
return type. (#10655, thanks @Sija) - Add
Path
inFileUtils
's methods to match the interfaces it's wrapping. (#10747, thanks @yb66) - Fix
FileDescriptor#pos
returnInt64
on armv6 ([#10845](https://github.com/crystal-l...
1.0.0
Language changes
- Support
Tuple#[](Range)
with compile-time range literals. (#10379, thanks @HertzDevil)
Macros
- Don't use named argument key names as parameters for
method_missing
calls. (#10388, thanks @HertzDevil)
Standard library
- (breaking-change) Drop deprecated definitions. (#10386, thanks @bcardiff)
- Fix example codes in multiple places. (#10505, thanks @maiha)
Macros
- (breaking-change) Always add explicit return types in getter/property macros. (#10405, thanks @Sija)
Numeric
- (breaking-change) Change default rounding mode to
TIES_EVEN
. (#10508, thanks @straight-shoota) - Fix downcasting float infinity. (#10420, thanks @straight-shoota)
- Fix
String#to_f
out of range behaviour. (#10425, thanks @straight-shoota) - Implement rounding mode for
Number#round
. (#10413, #10360, #10479, thanks @straight-shoota)
Text
- Add missing unicode whitespace support to
String
methods. (#10367, thanks @straight-shoota)
Collections
- Fix
Range#==
to ignore generic type arguments. (#10309, thanks @straight-shoota) - Make
Enumerable#flat_map
,Iterator#flat_map
work with mixed element types. (#10329, thanks @HertzDevil) - Remove duplicated
sort
related specs. (#10208, thanks @makenowjust) - Fix docs regarding
Set#each
return type. (#10477, thanks @kachick) - Fix docs examples regarding
Set#*set_of?
. (#10285, thanks @oddp) - Fix expectation on set specs. (#10482, thanks @kachick)
Serialization
- (breaking-change) Serialize
Enum
to underscoredString
by default. (#10431, thanks @straight-shoota, @caspiano) - (breaking-change) Use class instead of struct for types in XML module. (#10436, thanks @hugopl)
- Add
YAML::Nodes::Node#kind
. (#10432, thanks @straight-shoota)
Files
- Let
IO::Memory
not be writable with read-onlySlice
. (#10391, thanks @straight-shoota) - Allow
Int64
values withinIO#read_at
. (#10356, thanks @Blacksmoke16) - Add
IO::Sized#remaining=(value)
to reuse an existing instance. (#10520, thanks @jgaskins)
Networking
- (security) Remove Cookie Name Decoding. (#10442, thanks @security-curious)
- (breaking-change) Remove implicit en-/decoding for cookie values. (#10485, thanks @straight-shoota)
- (breaking-change) Split
HTTP::Cookies.from_headers
into separate methods for server/client. (#10486, thanks @straight-shoota) - (performance) Minor performance improvements to
HTTP::Cookies
. (#10488, thanks @straight-shoota) - Respect subclasses when constructing
HTTP::Client
from class methods. (#10375, thanks @oprypin) - Make the
content-length
header more RFC compliant. (#10353, thanks @Blacksmoke16) - Fix
#respond_with_status
when headers written or closed. (#10415, thanks @straight-shoota) - Fix
Cookie#==
to take all ivars into account. (#10487, thanks @straight-shoota) - Remove implicit
path=/
fromHTTP::Cookie
. (#10491, thanks @straight-shoota) - Add
HTTP::Request#local_address
. (#10385, thanks @carlhoerberg)
Logging
- Close
AsyncDispatcher
on#finalize
. (#10390, thanks @straight-shoota)
System
- Fix
Process.parse_argument
behavior against a quote in a word. (#10337, thanks @makenowjust) - Add aarch64 support for macOS/darwin targets. (#10348, thanks @maxfierke, @RomainFranceschini)
- Add
LibC::MAP_ANONYMOUS
to x86_64-darwin to match other platforms. (#10398, thanks @sourgrasses)
Runtime
- Improve error message for ELF reader on uninitialized runtime. (#10282, thanks @straight-shoota)
Compiler
- (breaking-change) Disallow surrogate halves in escape sequences of string and character literals, use
\x
for arbitrary binary values. (#10443, thanks @HertzDevil) - Fix ICE when exhaustive in-clause calls pseudo-method. (#10382, thanks @HertzDevil)
- Fix ICE when parsing
foo.%
calls. (#10351, thanks @makenowjust) - Fix edge cases for symbol quoting rules. (#10389, thanks @HertzDevil)
- Support closured vars inside
Const
initializer. (#10478, thanks @RX14) - Documentation grammar fix. (#10369, thanks @szTheory)
Language semantics
- Don't fail on untyped
is_a?
. (#10320, thanks @asterite) - Fix named arguments in
super
andprevious_def
calls. (#10400, thanks @HertzDevil) - Fix assignments in array literals. (#10009, thanks @straight-shoota)
- Consider type var splats in generic type restrictions. (#10168, thanks @HertzDevil)
- Align
Proc.new(&block)
's behaviour with other captured blocks. (#10263, thanks @HertzDevil) - Don't merge
NamedTuple
metaclasses through instance types. (#10501, thanks @HertzDevil) - Access instantiations of
NamedTuple
and other generics uniformly. (#10401, thanks @HertzDevil) - Improve error message for auto-cast error at Var assign. (#10327, thanks @straight-shoota)
- Exclude abstract defs from "no overload matches" errors. (#10483, thanks @HertzDevil)
- Support splats inside tuple literals in type names. (#10430, thanks @HertzDevil)
- Accept pointer instance types on falsey conditional branches. (#10464, thanks @HertzDevil)
- Match named arguments by external parameter names when checking overload cover. (#10530, thanks @HertzDevil)
Doc generator
Others
- CI improvements and housekeeping. (#10299, #10340, #10476, #10480, thanks @bcardiff, @Sija, @straight-shoota)
- Update distribution-scripts to use Shards v0.14.1. (#10494, thanks @bcardiff)
- Add GitHub issue templates. (#8934, thanks @j8r)
- Add LLVM 11.1 to the list of supported versions. (#10523, thanks @Sija)
- Fix SDL examples crashes. (#10470, thanks @megatux)
0.36.1
Standard library
- Fix
Enum.from_value?
for flag enum with nonInt32
base type. (#10303, thanks @straight-shoota)
Text
Collections
- Explicitly return a
Hash
inHash#dup
andHash#clone
(reverts #9871). (#10331, thanks @straight-shoota)
Serialization
Runtime
Compiler
- (performance) Initialize right-away constants in a separate function. (#10334, thanks @asterite)
- Fix incorrect casting between different union types. (#10333, thanks @asterite)
- Fix a formatting error in the "missing argument" error. (#10325, thanks @BlobCodes)
- Fix while condition assignment check for Not. (#10347, thanks @asterite)
- Allow operators and setters-like macros names back. (#10338, thanks @asterite)
Language semantics
0.36.0
Language changes
- (breaking-change) Reject annotations on ivars defined in base class. (#9502, thanks @waj)
- (breaking-change) Make
**
be right associative. (#9684, thanks @asterite)
Macros
- (breaking-change) Deprecate
TypeNode#has_attribute?
in favor of#annotation
. (#9950, thanks @HertzDevil) - Support heredoc literal in macro. (#9467, thanks @makenowjust)
- Support
%Q
,%i
,%w
, and%x
literals in macros. (#9811, thanks @toddsundsted) - Allow executing multi-assignments in macros. (#9440, thanks @makenowjust)
Standard library
- (breaking-change) Drop deprecated
CRC32
,Adler32
top-level. (#9530, thanks @bcardiff) - (breaking-change) Drop deprecated
Flate
,Gzip
,Zip
,Zlib
top-level. (#9529, thanks @bcardiff) - (breaking-change) Drop deprecated
with_color
top-level method. (#9531, thanks @bcardiff) - (breaking-change) Make
SemanticVersion
parsing more strict. (#9868, thanks @hugopl) - Respect explicitly provided type vars for
Tuple.new
andNamedTuple.new
. (#10047, thanks @HertzDevil) - Fix
OptionParser
to handle sub-commands with hyphen. (#9465, thanks @erdnaxeli) - Fix
OptionParser
to not call handler if value is given to none value handler. (#9603, thanks @makenowjust) - Make
def_equals
compare first by reference. (#9650, thanks @waj) - Remove unnecessary
def ==(other)
fallbacks. (#9571, thanks @makenowjust) - Fix
OptionParser
indentation of option descriptions. (#10183, thanks @wonderix) - Add
#hash
toLog::Metadata
,Path
,SemanticVersion
,Socket::Address
,URI::Params
, andUUID
. (#10119, thanks @straight-shoota) - Refactor several
case
statements with exhaustivecase
/in
. (#9656, thanks @Sija) - Remove
Kernel
mentions in docs. (#9549, thanks @toddsundsted) - Improve docs for
Object#dup
. (#10053, thanks @straight-shoota) - Fix example codes in multiple places. (#9818, thanks @maiha)
- Fix typos, misspelling and styling. (#9636, #9638, #9561, #9786, #9840, #9844, #9854, #9869, #10068, #10123, #10102, #10116, #10229, #10252, thanks @kubo, @m-o-e, @mgomes, @philipp-classen, @dukeraphaelng, @camreeves, @docelic, @ilmanzo, @Sija, @pxeger, @oprypin)
Macros
- Fix documentation for
#[]=
macro methods. (#10025, thanks @HertzDevil)
Numeric
- (breaking-change) Move
Complex#exp
,Complex#log
, etc. toMath.exp
,Math.log
overloads. (#9739, thanks @cristian-lsdb) - (performance) Use unchecked arithmetics in
Int#times
. (#9511, thanks @waj) - Check for overflow when extending signed integers to unsigned integers. (#10000, thanks @HertzDevil)
- Fix
sprintf
for zero left padding a negative number. (#9725, thanks @asterite) - Fix
BigInt#to_64
andBigInt#hash
. (#10121, thanks @oprypin) - Fix
BigDecimal#to_s
for numbers between-1
and0
. (#9897, thanks @dukeraphaelng) - Fix
Number#step
. (#10130, #10295, thanks @straight-shoota, @bcardiff) - Make
Complex
unary plus returnsself
. (#9719, thanks @asterite) - Improve
Int#lcm
andInt#gcd
. (#9999, thanks @HertzDevil) - Add
Math::TAU
. (#10179, thanks @j8r) - Add wrapped unary negation to unsigned integer types to allow
&- x
expressions. (#9947, thanks @HertzDevil) - Improve documentation of mathematical functions. (#9994, thanks @HertzDevil)
Text
- (breaking-change) Fix
String#index
not working well for broken UTF-8 sequences. (#9713, thanks @asterite) - (performance)
String
: Don't materializeRegex
match[0]
if not needed. (#9615, thanks @asterite) - Fix
String#rindex
default offset for matching empty regex correctly. (#9690, thanks @makenowjust) - Add various
String#delete_at
methods. (#9398, thanks @asterite) - Raise if passing
null
Pointer toString
. (#9653, thanks @jgaskins) - Add
Regex#capture_count
. (#9746, thanks @Sija) - Add
Regex::MatchData#[]
overloading toRange
. (#10076, thanks @makenowjust) - Fix duplicates in
String
documentation. (#9987, thanks @Nicolab) - Add docs for substitution to
Kernel.sprintf
. (#10227, thanks @straight-shoota)
Collections
- (breaking-change) Make
Hash#reject!
,Hash#select!
, andHash#compact!
consistent withArray
and returnself
. (#9904, thanks @caspiano) - (breaking-change) Deprecate
Hash#delete_if
in favor ofHash#reject!
, addDequeue#reject!
andDequeue#select!
. (#9878, thanks @caspiano) - (breaking-change) Change
Set#delete
to return Bool. (#9590, thanks @j8r) - (breaking-change) Drop deprecated
Enumerable#grep
. (#9711, thanks @j8r) - (breaking-change) Remove
Hash#key_index
. (#10016, thanks @asterite) - (breaking-change) Deprecate
StaticArray#[]=(value)
in favor ofStaticArray#fill
. (#10027, thanks @HertzDevil) - (breaking-change) Rename
Set#{sub,super}set?
to{sub,super}set_of?
. (#10187, thanks @straight-shoota) - (performance) Optimize
Array#shift
andArray#unshift
. (#10081, thanks @asterite) - (performance)
Array#rotate
optimization for small arrays. (#8516, thanks @wontruefree) - Fix
Hash#dup
andHash#clone
to return correct type for subclasses. (#9871, thanks @vlazar) - Fix
Iterator#cons_pair
return type. (#9788, thanks @asterite) - Fix key type restriction of
Hash#merge
block. (#9495, thanks @makenowjust) - Fix
Range#step
. (#10203, thanks @straight-shoota) - Let
Range#step
delegate tobegin.step
and allow float based ranges to be stepped. (#10209, thanks @straight-shoota) - Fix
Indexable#join
withIO
. (#10152, thanks @straight-shoota) - Fix
Flatten
for value-type iterators. (#10096, thanks @f-fr) - Fix
Indexable.range_to_index_and_count
to not raiseIndexError
. (#10191, thanks @straight-shoota) - Handle recursive structures in
def_clone
,Hash
,Array
,Dequeue
. (#9800, thanks @asterite) - Add
BitArray#dup
. ([#9550](#9550...
0.35.1
Standard library
Collections
Networking
- Revert
IO#write
changes in 0.35.0 and let it return Nil. (#9469, thanks @bcardiff) - Avoid leaking logging context in HTTP request handlers. (#9494, thanks @Blacksmoke16)
Crypto
- Use less strict cipher compatibility for OpenSSL client context. (#9459, thanks @straight-shoota)
- Fix
Digest::Base
block argument type restrictions. (#9500, thanks @straight-shoota)
Logging
Compiler
- Show warnings even if there are errors. (#9461, thanks @asterite)
- Fix parsing of
{foo: X, typeof: Y}
type. (#9453, thanks @makenowjust) - Fix parsing of proc in hash
of
key type. (#9458, thanks @makenowjust) - Revert debug level information changes in specs to fix 32 bits builds. (#9466, thanks @bcardiff)
Others
- CI improvements and housekeeping. (#9455, thanks @bcardiff)
- Code formatting. (#9482, thanks @makenowjust)
0.35.0
Language changes
- (breaking-change) Let
case when
be non-exhaustive, introducecase in
as exhaustive. (#9258, #9045, thanks @asterite) - Allow
->@ivar.foo
and->@@cvar.foo
expressions. (#9268, thanks @makenowjust)
Macros
Standard library
- (breaking-change) Refactor to standardize on first argument for methods receiving
IO
. (#9134, #9289, #9303, #9318, thanks @straight-shoota, @bcardiff, @oprypin) - (breaking-change) Cleanup Digest and OpenSSL::Digest. (#8426, thanks @didactic-drunk)
- Fix
Enum#to_s
for private enum. (#9126, thanks @straight-shoota) - Refactor
Benchmark::IPS::Entry
to useUInt64
inbytes_per_op
. (#9081, thanks @jhass) - Add
Experimental
annotation and doc label. (#9244, thanks @bcardiff) - Add subcommands to
OptionParser
. (#9009, #9133, thanks @RX14, @Sija) - Make
NamedTuple#sorted_keys
public. (#9263, thanks @waj) - Fix example codes in multiple places. (#9203, thanks @maiha)
Macros
- (breaking-change) Remove top-level
assert_responds_to
macro. (#9085, thanks @bcardiff) - (breaking-change) Drop top-level
parallel
macro. (#9097, thanks @bcardiff) - Fix lazy property not forwarding annotations. (#9140, thanks @asterite)
- Add
host_flag?
macro method, not affected by cross-compilation. (#9049, thanks @oprypin) - Add
.each
and.each_with_index
to various macro types. (#9120, thanks @Blacksmoke16) - Add
StringLiteral#titleize
macro method. (#9269, thanks @makenowjust) - Add
TypeNode
methods to check what "type" the node is. (#9270, thanks @Blacksmoke16) - Fix support
TypeNode.name(generic_args: false)
for generic instances. (#9224, thanks @Blacksmoke16)
Numeric
- (breaking-change) Add
Int#digits
, reverseBigInt#digits
result. (#9383, thanks @asterite) - Fix overflow checking for operations with mixed sign. (#9403, thanks @waj)
- Add
BigInt#factorial
using GMP. (#9132, thanks @peheje)
Text
- Add
String#titleize
. (#9204, thanks @hugopl) - Add
Regex#matches?
andString#matches?
. (#8989, thanks @makenowjust) - Add
IO
overloads to variousString
case methods. (#9236, thanks @Blacksmoke16) - Improve docs examples regarding
Regex::MatchData
. (#9010, thanks @makenowjust) - Improve docs on
String
methods. (#8447, thanks @jan-zajic)
Collections
- (breaking-change) Add
Enumerable#first
with fallback block. (#8999, thanks @makenowjust) - Fix
Array#delete_at
bug with negative start index. (#9399, thanks @asterite) - Fix
Enumerable#{zip,zip?}
when self is anIterator
. (#9330, thanks @mneumann) - Make
Range#each
andRange#reverse_each
work better with end/begin-less values. (#9325, thanks @asterite) - Improve docs on
Hash
. (#8887, thanks @rdp)
Serialization
- (breaking-change) Deprecate
JSON.mapping
andYAML.mapping
. (#9272, thanks @straight-shoota) - (breaking-change) Make
INI
a module. (#9408, thanks @j8r) - Fix integration between
record
macro andJSON::Serializable
/YAML::Serializable
regarding default values. (#9063, thanks @Blacksmoke16) - Fix
XML.parse
invalid mem access in multi-thread. (#9098, thanks @bcardiff, @asterite) - Fix double string escape in
XML::Node#content=
. (#9300, thanks @straight-shoota) - Improve xpath regarding namespaces. (#9288, thanks @asterite)
- Escape CDATA end sequences. (#9230, thanks @Blacksmoke16)
- Add
JSON
andYAML
serialization toPath
. (#9156, thanks @straight-shoota) - Specify pkg-config name for
libyaml
. (#9426, thanks @jhass) - Specify pkg-config name for
libxml2
. (#9436, thanks @Blacksmoke16) - Make YAML specs robust against libyaml 0.2.5. (#9427, thanks @jhass)
Time
- (breaking-change) Support different number of fraction digits for RFC3339 time format. (#9283, thanks @waj)
- Fix parsing AM/PM hours. (#9334, thanks @straight-shoota)
- Improve
File.utime
precision from second to 100-nanosecond on Windows. (#9344, thanks @kubo)
Files
- (breaking-change) Move
Flate
,Gzip
,Zip
,Zlib
toCompress
. (#8886, thanks @bcardiff) - (breaking-change) Cleanup
File
&FileUtils
. (#9175, thanks @bcardiff) - Fix realpath on macOS 10.15 (Catalina). (#9296, thanks @waj)
- Fix
File#pos
,File#seek
andFile#truncate
over 2G on Windows. (#9015, thanks @kubo) - Fix
File.rename
to overwrite the destination file on Windows, like elsewhere. (#9038, thanks @oprypin) - Fix
File
's specs and related exception types on Windows. (#9037, thanks @oprypin) - Add support for
Path
arguments to multiple methods. (#9153, thanks @straight-shoota) - Add
Path#each_part
iterator. (#9138, thanks @straight-shoota) - Add
Path#relative_to
. (#9169, thanks @straight-shoota) - Add support for
Path
pattern toDir.glob
. (#9420, thanks @straight-shoota) - Implement
File#fsync
on Windows. (#9257, thanks @kubo) - Refactor
Path
regarding empty and.
. (#9137, thanks @straight-shoota)
Networking
- (breaking-change) Make
IO#skip
,IO#write
returns the number of bytes it skipped/written asInt64
. (#9233, #9363, thanks @bcardiff) - (breaking-change) Improve error handling and logging in
HTTP::Server
. (#9115, #9034, thanks @waj, @straight-shoota) - (breaking-change) Change
HTTP::Request#remote_address
type toSocket::Address?
. (#9210, thanks @waj) - Fix
flush
methods to always flush underlyingIO
. (#9320, thanks @straight-shoota) - Fix
HTTP::Server
sporadic failure in SSL handshake. (#9177, thanks @waj) WebSocket
shouldn't reply with same close code. (#9313, thanks @waj)- Ignore response body during
WebSocket
handshake. (#9418, thanks @waj) - Treat cookies which expire in this instant as expired. (#9061, thanks @RX14)
- Set
sync
orflush_on_newline
for standard I/O on Windows. (#9207, thanks @kubo) - Prefer HTTP basic authentication in OAuth2 client. (#9127, ...
0.34.0
Language changes
- (breaking-change) Exhaustive
case
expression check added, for now it produces warnings. (#8424, #8962, thanks @asterite, @Sija) - Let
Proc(T)
be used as aProc(Nil)
. (#8969, #8970, thanks @asterite)
Standard library
- (breaking-change) Replace
Errno
,WinError
,IO::Timeout
withRuntimeError
,IO::TimeoutError
,IO::Error
,File::Error
,Socket::Error
, and subclasses. (#8885, thanks @waj) - (breaking-change) Replace
Logger
module in favor ofLog
module. (#8847, #8976, thanks @bcardiff) - (breaking-change) Move
Adler32
andCRC32
toDigest
. (#8881, thanks @bcardiff) - (breaking-change) Remove
DL
module. (#8882, thanks @bcardiff) - Enable more win32 specs. (#8683, #8822, thanks @straight-shoota)
- Make
SemanticVersion::Prerelease
comparable. (#8991, thanks @makenowjust) - Use
flag?(:i386)
instead of obsoleteflag?(:i686)
. (#8863, thanks @bcardiff) - Remove Windows workaround using
vsnprintf
. (#8942, thanks @oprypin) - Fixed docs broken link to ruby's prettyprint source. (#8915, thanks @MattHin)
- Update
OptionParser
example to exit on--help
. (#8927, thanks @vlazar)
Numeric
- Fixed
Float32#to_s
corner-case. (#8838, thanks @toddsundsted) - Fixed make
Big*#to_u
raise on negative values. (#8826, thanks @Sija) - Fixed
BigDecimal#to_big_i
regression. (#8790, thanks @Sija) - Add
Complex#round
. (#8819, thanks @miketheman) - Add
Int#bit_length
andBigInt#bit_length
. (#8924, #8931, thanks @asterite) - Fixed docs of
Int#gcd
. (#8894, thanks @nard-tech)
Text
- (breaking-change) Deprecate top-level
with_color
in favor ofColorize.with
. (#8892, #8958, thanks @bcardiff, @oprypin) - Add overloads for
String#ljust
,String#rjust
andString#center
that take anIO
. (#8923, thanks @asterite) - Add missing
Regex#hash
andRegex::MatchData#hash
. (#8986, thanks @makenowjust) - Upgrade Unicode to 13.0.0. (#8906, thanks @Blacksmoke16)
- Revert deprecation of
String#codepoint_at
. (#8902, thanks @vlazar) - Move
Iconv
toCrystal
namespace. (#8890, thanks @bcardiff)
Collections
- Fixed make
Range#size
raise on an open range. (#8829, thanks @Sija) - Add
Enumerable#empty?
. (#8960, thanks @Sija) - (performance) Optimized Implementation of
Array#fill
for zero Values. (#8903, thanks @toddsundsted) - Refactor
Reflect
to anEnumerable
private definition. (#8884, thanks @bcardiff)
Serialization
- (breaking-change) Rename
YAML::Builder.new
with block toYAML::Builder.build
. (#8896, thanks @straight-shoota) - Add
XML.build_fragment
. (#8813, thanks @straight-shoota) - Add
CSV#rewind
. (#8912, thanks @asterite) - Add
Deque#from_json
andDeque#to_json
. (#8850, thanks @carlhoerberg) - Call to
IO#flush
onCSV
,INI
,JSON
,XML
, andYAML
builders. (#8876, thanks @asterite) - Add docs to
Object.from_yaml
. (#8800, thanks @wowinter13)
Time
- (breaking-change) Improve
Time::Span
initialization API with mandatory named arguments. (#8257, #8857, thanks @dnamsons, @bcardiff) - Add
Time::Span#total_microseconds
. (#8966, thanks @vlazar)
Files
- Fixed multi-thread race condition by setting
fd
to-1
on closedFile
/Socket
. (#8873, thanks @bcardiff) - Fixed
File.dirname
with unicode chars. (#8911, thanks @asterite) - Add
IO::Buffered#flush_on_newline
back and set it to true for non-tty. (#8935, thanks @asterite) - Forward missing methods of
IO::Hexdump
to underlyingIO
. (#8908, thanks @carlhoerberg)
Networking
- (breaking-change) Correctly support WebSocket close codes. (#8975, #8981, thanks @RX14, @Sija)
- Make
HTTP::Client
return emptybody_io
if content-length is zero. (#8503, thanks @asterite) - Fixed
UDP
specs in the case of a local firewall. (#8817, thanks @RX14) - Fixed
MIME
spec examples to not collide with actual registry. (#8795, thanks @straight-shoota) - Fixed
UNIXServer
, andHTTP::WebSocket
specs to ensure server is accepting before closing. (#8755, #8879, thanks @bcardiff) - Add type annotation to
tls
argument inHTTP
. (#8678, thanks @j8r) - Add
Location
toHTTP::Request
common header names. (#8992, thanks @mamantoha)
Concurrency
- Add docs on
Future
regarding exceptions. (#8860, thanks @rdp) - Disable occasionally failing
Thread
specs on musl. (#8801, thanks @straight-shoota)
System
- Fixed typo on
src/signal.cr
. (#8805, thanks @lbguilherme)
Runtime
- Fixed exceptions not being inspectable when running binary from PATH. (#8807, thanks @willhbr)
- Move
AtExitHandlers
toCrystal
namespace. (#8883, thanks @bcardiff)
Compiler
- (breaking-change) Drop
disable_overflow
compiler flag. (#8772, thanks @Sija) - Fixed url in "can't infer block return type" error message. (#8869, thanks @nilium)
- Fixed typo in math interpreter error message. (#8941, thanks @j8r)
- Use
CRYSTAL_OPTS
environment variable as default compiler options. (#8900, thanks @bcardiff) - Avoid using the default
--exclude-warnings
value if some is specified. (#8899, thanks @bcardiff) - Honor
LIBRARY_PATH
as default library path, and allow linking with no explicit/usr/lib:/usr/local/lib
paths. (#8948, thanks @bcardiff) - Fix Windows LLVM globals codegen in non-single-module mode. (#8978, thanks @oprypin)
- Add support for LLVM 10. (#8940, thanks @RX14)
- Remove redundant calls to
Object.to_s
in interpolation in compiler's code. (#8947, thanks @veelenga)
Language semantics
- Type as
NoReturn
if calling method on abstract class with no concrete subclasses. (#8870, thanks @asterite)
Tools
- Add
crystal init
name validation. (#8737, thanks @straight-shoota)
Doc generator
Others
0.33.0
Language changes
Macros
- Add
TypeNode#name(generic_args : BoolLiteral)
to returnTypeNode
's name with or without type vars. (#8483, thanks @Blacksmoke16)
Standard library
- (breaking-change) Remove several previously deprecated methods and modules:
PartialComparable
,Crypto::Bcrypt::Password#==
,HTTP::Server::Response#respond_with_error
,JSON::PullParser::Kind#==
,Symbol#==(JSON::PullParser::Kind)
,JSON::Token#type
,String#at
,Time.new
,Time.now
,Time.utc_now
,URI.escape
,URI.unescape
. (#8646, #8596, thanks @bcardiff, @Blacksmoke16) - Fixed docs wording. (#8606, #8784, thanks @fxn)
- Add
Object#in?
. (#8720, #8723, thanks @Sija) - Allow to create an enum from a symbol. (#8634, thanks @bew)
- Add
VaList#next
for getting the next element in a variadic argument list. (#8535, #8688, thanks @ffwff, @RX14) - Refactor
ARGF
implementation. (#8593, thanks @arcage) - Fixed specs of
Colorize
on dumb terminal. (#8673, thanks @oprypin) - Fixed some specs on Win32. (#8670, thanks @straight-shoota)
Numeric
- Add
BigInt#unsafe_shr
. (#8763, thanks @asterite) - Refactor
Float#fdiv
to use binary primitive. (#8662, thanks @bcardiff)
Text
Collections
- Fixed
Enumerable#zip
to work with union types. (#8621, thanks @asterite) - Fixed docs regarding
Hash
'sinitial_capacity
. (#8569, thanks @r00ster91)
Serialization
- Improved JSON deserialization into union types. (#8689, thanks @kimburgess)
- Fixed expected error message in libxml2 error spec. (#8699, thanks @straight-shoota)
- Fixed
JSON::PullParser
overflow handling. (#8698, thanks @kimburgess) - Fixed
JSON::Any#dig?
/YAML::Any#dig?
on non-structure values. (#8745, thanks @Sija)
Time
- Fixed
Time#shift
over date boundaries with zone offset. (#8742, thanks @straight-shoota)
Files
- (breaking-change) Deprecate
File::Info#owner
, andFile::Info#group
; useowner_id
, andgroup_id
. (#8007, thanks @j8r) - Fixed
Path.new
receivingPath
as first argument. (#8753, thanks @straight-shoota) - Fixed
File.size
andFile.info
to work withPath
parameters. (#8625, thanks @snluu) - Fixed
Path
specs whenENV["HOME"]
is unset. (#8667, thanks @straight-shoota) - Refactor
Dir.mkdir_p
to usePath#each_parent
and make it work on Win32. (#8668, thanks @straight-shoota) - Fixed
IO::MultiWriter
specs to close file before reading/deleting it. (#8674, thanks @oprypin)
Networking
- Fixed invalid call to libevent and race conditions on closed
IO
when resuming readable/writable event. (#8707, #8733, thanks @bcardiff) - Fixed unexpected EOF in terminated SSL connection. (#8540, thanks @rdp)
- Fixed
HTTP::Cookie
to supportInt64
max-age values. (#8759, thanks @asterite) - Improve error message for
getaddrinfo
failure. (#8498, thanks @rdp) - Make
IO::SysCall#wait_readable
andIO::SysCall#wait_writable
public, yet:nodoc:
. (#7366, thanks @stakach) - Refactor
StaticFileHandler
to usePath
. (#8672, thanks @straight-shoota) - Remove fixed date in spec. (#8640, thanks @bcardiff)
- Remove non-portable error message in
TCPServer
spec. (#8702, thanks @straight-shoota)
Crypto
- Add
Crypto::Bcrypt::Password
check for invalid hash value. (#6467, thanks @miketheman) - Improve documentation for
Random::Secure
. (#8484, thanks @straight-shoota)
Concurrency
- Fixed
Future(Nil)
when the block raises. (#8650, thanks @lbguilherme) - Fixed
IO
closing in multi-thread mode. (#8733, thanks @bcardiff) - Fixed some regular failing specs in multi-thread mode. (#8592, #8643, #8724, #8761, thanks @bcardiff)
- Add docs to
Fiber
. (#8739, thanks @straight-shoota)
System
- Enable
system
module for Win32 in prelude. (#8661, thanks @straight-shoota) - Handle exceptions raised at
__crystal_sigfault_handler
. (#8743, thanks @waj)
Runtime
- Fixed wrongly collected exception object by the GC. Ensure
LibUnwind::Exception
struct is not atomic. (#8728, thanks @waj) - Fixed reporting of non-statement rows in DWARF backtrace. (#8499, thanks @rdp)
- Add top level exception handler. (#8735, #8791, thanks @waj)
- Try to open stdio in non-blocking mode. (#8787, thanks @waj)
- Allow
Crystal::System.print_error
to useprintf
like format. (#8786, thanks @bcardiff)
Spec
- (breaking-change) Remove previously deprecated spec method
assert
. (#8767, thanks @Blacksmoke16) Spec::JUnitFormatter
output and options enhancements. (#8599, #8692, thanks @Sija, @bcardiff)
Compiler
- (breaking-change) Drop support for previously deprecated comma separators in enums and other cleanups. (#8657, thanks @bcardiff)
- (breaking-change) Drop uppercase F32 and F64 float number suffixes. (#8782, thanks @rhysd)
- Fixed memory corruption issues by using LLVM's
memset
andmemcpy
that matches target machine. (#8746, thanks @bcardiff) - Fixed ICE when trying to add type inside annotation. (#8628, thanks @asterite)
- Fixed ICE on
typeof
in an unused block. (#8695, thanks @asterite) - Fixed ICE in case of wrong target triple. (#8710, thanks @Sija)
- Fixed ICE when raising a macro exception with empty message. (#8654, thanks @jan-zajic)
- Fixed parser bug macro with "eenum" in it. (#8760, thanks @asterite)
- Change
CRYSTAL_PATH
to allow shards to override std-lib. (#8752, thanks @bcardiff)
Language semantics
- Fixed missing virtualization of
Proc
pointer. (#8757, thanks @asterite) - Fixed type of vars after
begin
/rescue
if allrescue
are unreachable. (#8758, thanks @asterite) - Fixed visibility propagation to macro expansions in all cases. (#8762, #8796, thanks @asterite)
Tools
- Update
crystal init
to handle.
. (#8681, thanks @jethrodaniel)
Formatter
- Fixed indent after comme...