crystal v1.5.0 Release Notes
Release Date: 2022-07-06 // over 1 year ago-
Language
- (breaking-change) Warn on positional parameter mismatches for abstract def implementations (#11915, #12167, thanks @HertzDevil)
- ๐ Fix
\{{...}}
syntax in macro inside comments (#12175, thanks @asterite) - Let constant tuple indexers work with constants (#12012, thanks @asterite)
- ๐จ Refactor restriction mechanism for autocasting (#12014, thanks @HertzDevil)
- ๐ Support unions in
Crystal::Macros::ASTNode#is_a?
(#12086, thanks @HertzDevil) - Experimental: restriction augmenter (#12103, #12136, #12143, #12130, thanks @asterite)
- ๐ Method/macro parameter annotation support (#12044, thanks @Blacksmoke16)
Standard Library
- ๐ Support
Path
forchdir
arg inProcess
methods (#11932, thanks @caspiano) - โ Add docs for
Enum#value
(#11947, thanks @lbguilherme) - ๐ Fix positional parameter warnings in specs (#12158, thanks @straight-shoota)
- ๐ Use more specific expectations in specs (#11951, thanks @HertzDevil)
- ๐ Use
contain
expectations in more specs (#11950, thanks @HertzDevil)
Collection
- ๐ Fix
Hash#reject!
for non-equality key (#10511, thanks @straight-shoota) - Introduce
Tuple.element_type
andNamedTuple.element_type
(#12011, thanks @HertzDevil) - ๐ Rename "take" to "first" (#11988, thanks @jmdyck)
- โ Add spec for
Array#-
with different generic type arguments (#12049, thanks @straight-shoota)
Concurrency
- Windows: Always use
GC_set_stackbottom
on Windows (#12186, thanks @HertzDevil) - ๐ Windows: Event loop based on IOCP (#12149, thanks @straight-shoota, @wonderix, @yxhuvud, @HertzDevil)
- ๐ Use enum instead of symbol for
Atomic
primitives (#11583, thanks @HertzDevil) - Allow
Enumerable(Channel)
parameter forChannel.send_first
,.receive_first
(#12101, thanks @carlhoerberg)
Crypto
- ๐ (performance) Add faster
Digest#hexfinal
(#9292, thanks @didactic-drunk) - ๐ Handle OpenSSL 3.0 KTLS ctrl calls (#12034, thanks @1player)
Files
- ๐ Fix
Path#join(Enumerable)
(#12032, thanks @straight-shoota) - ๐ Fix
Path#join
to convert argument path to base kind (#12033, thanks @straight-shoota) - ๐ Fix
Dir.glob
with multi components after recursive wildcard (#12057, thanks @straight-shoota) - โ Add
File#delete?
andDir#delete?
(#11887, thanks @didactic-drunk) - Accept
Path
arguments inCompress::Zip
(#11925, thanks @didactic-drunk) - โก๏ธ Update file.cr (#12024, thanks @rdp)
- โ Add
File#chown
and#chmod
(#11886, thanks @didactic-drunk)
๐ฒ Log
- ๐ Change
Log
emitters to not emit event when block output isnil
(#12000, thanks @robacarp)
Networking
- ๐ Enable more networking specs on Windows (#12176, thanks @HertzDevil)
- โ Add specs for Windows directory separators in
StaticFileHandler
paths (#11884, thanks @straight-shoota) - โ Add property
HTTP::Server::Response#status_message
(#10416, thanks @straight-shoota)
Numeric
- ๐ Fix
Complex.multiplicative_identity
(#12051, thanks @I3oris) - โ Add docs for
Float
,BigFloat
rounding methods (#12004, thanks @marksiemers) - Implement rt builtins
__ashlti3
,__ashrti3
and__lshrti3
for wasm32 (#11948, thanks @lbguilherme)
Specs
- Align
Spec::Be
,BeClose
failure message to other messages (#11946, thanks @jgaskins)
System
- ๐ (security) Fix check for null byte in
File#tempfile
args (#12076, thanks @straight-shoota) - โ Add missing
SC_PAGESIZE
constant foraarch64-darwin
(#12037, thanks @carlhoerberg) - ๐ Docs: Add more prominent note about path traversal in
File.tempfile
(#12077, thanks @straight-shoota) - ๐ Support
Enumerable
as argument toFile.join
(#12102, thanks @caspiano)
โ Runtime
- Mention
#value
explicitly inPointer
overview. (#12184, thanks @elebow)
Text
- Add specs for
String#char_bytesize_at
(#11872, thanks @straight-shoota) - Flush shift state for
String#encode
(#11993, thanks @HertzDevil) - ๐ Handle invalid bytes in single-byte optimizable
String
s correctly (#12108, thanks @HertzDevil) - ๐ Fix: Don't stop on null byte in
String#%
(#12125, thanks @asterite) - โ Add
UUID.parse?
(#11998, thanks @jgaskins)
Time
- ๐ Fix: Better error message for
Time.parse!
when end of input is reached (#12124, thanks @asterite)
Compiler
- โ Clean up compiler warning specs (#11916, thanks @HertzDevil)
- โ Add support for
NO_COLOR
toColorize
(#11984, thanks @didactic-drunk) - ๐ (performance) Use LLVM's new pass manager when possible (#12116, thanks @asterite)
Macros
- Document
Crystal::Macros::Self
andUnderscore
(#12085, thanks @HertzDevil)
Generics
- ๐ Allow the empty instantiation
NamedTuple()
(#12009, thanks @HertzDevil)
Interpreter
- โ Add missing
EXPORT
in interpreter spec (#12201, thanks @HertzDevil) - ๐ Handle escaping exceptions in pry (#12211, thanks @asterite)
- ๐ Allow some options, and colorize whereami (#12198, thanks @asterite)
- ๐ Fix instance var offset of virtual struct (#12189, thanks @asterite)
- ๐ Handle explicit return when method type is Nil (#12179, thanks @asterite)
Crystal::Loader
: don't check if file exists, leave that to dlopen (#12207, thanks @asterite)- ๐ Fix call receiver by value from VirtualType struct (#12194, thanks @asterite)
- Clear finished hooks after intepreting (#12174, thanks @asterite)
- ๐ Fix FFI bindings for libffi >= 3.4 (#12192, thanks @straight-shoota)
- ๐ Fix
.class
for modules and unions (#12205, thanks @asterite) - Implement
Crystal::Loader
for MSVC (#12140, thanks @HertzDevil) - ๐ Fix: cast from virtual metaclass to union (#12163, thanks @asterite)
- ๐ Allow inspect vars when inside a block (#12165, thanks @asterite)
- ๐ Let pry see closured vars (#12169, thanks @asterite)
- ๐ Fix caller (#12182, thanks @asterite)
- Apply shell expansion in ldflags (#12094, thanks @mdwagner)
- ๐ Fix expression value of constant assignment in interpreter (#12016, thanks @beta-ziliani)
- ๐ Fix: Don't link
librt
andlibdl
on GNU systems (#12038, thanks @1player)
๐ Parser
- (breaking-change) Disallow empty parameter and argument names (#11971, thanks @HertzDevil)
- ๐ Disallow duplicate free variables in defs (#11965, thanks @HertzDevil)
- Disallow duplicate
fun
parameter names (#11967, thanks @HertzDevil) - โ Remove redundant check for EOF on
Crystal::Parser
(#12067, thanks @lbguilherme)
Semantic
- Compiler: don't check ivar read forms a closure in
exp.@x
(#12183, thanks @asterite) - Compiler: raise when allocating an abstract virtual type (#12141, thanks @asterite)
- Compiler: don't use
with_scope
if Call has a receiver (#12138, thanks @asterite) - Compiler: fix proc return type restriction for
Proc(...)
(#12129, thanks @asterite) - Compiler: simpler way to compute
Def#raises?
(#12121, thanks @asterite) - โ Remove unused
ASTNode#unbind_all
(#12120, thanks @asterite)
Debugger
- ๐ Improve the LLDB spec driver script (#12119, thanks @HertzDevil)
Tools
๐ Docs-generator
- ๐ [Docs] Adjust method sort order to sort all operators first (#12104, thanks @straight-shoota)
Formatter
- ๐ Fix formatter lib-fun declaration with newlines (#12071, thanks @ftarulla)
- ๐ Fix formatter alias-def with no-space before equals (#12073, thanks @ftarulla)
- ๐ Fix formatter for parenthesized arg after space (#11972, thanks @straight-shoota)
Playground
- Playground: fix
modalContenDom
typo (#12188, thanks @HertzDevil) - ๐ Fix: Unset executable bit from js/css files in playground (#12053, thanks @carlhoerberg)
Other
- ๐ [CI] Add build compiler step to smoke tests (#11814, thanks @straight-shoota)
- โ Add Makefile for Windows (#11773, thanks @HertzDevil)
- โก๏ธ [CI] Update distribution-scripts (#12155, thanks @straight-shoota)
- โก๏ธ [CI] Add
update-distributions-scripts.sh
(#12156, thanks @straight-shoota) - [CI] Ignore
pax_global_header
on Windows CI (#12173, thanks @HertzDevil) - ๐ [CI] Invalidate cached libraries on new MSVC release (#12064, thanks @HertzDevil)
- ๐ Fix spelling (#12040, thanks @jsoref)
- ๐ Update previous Crystal release - 1.4.1 (#12029, thanks @straight-shoota)
- ๐ [CI] Pin version of ubuntu base image for circleci jobs (#12030, thanks @straight-shoota)
- Samples: avoid
Symbol
variables (#11923, thanks @HertzDevil)