1.5.0
1.5.0 (2022-07-06)
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
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
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
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
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)