crystal v1.2.0 Release Notes

Release Date: 2021-10-13 // over 2 years ago
  • 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 return nil (#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 and MacroId (#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 to Indexable#cartesian_product (#10013, thanks @HertzDevil)
    • Disallow Slice(T).new(Int) where T 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 for empty NamedTuple be Symbol (#10942, thanks @caspiano)
    • ๐Ÿ›  Fix overflow in BitArray#[](Int, Int) for sizes between 33 and 64 (#10809, thanks @HertzDevil)
    • ๐Ÿ›  Fix Range#step for non-integer Steppable types (#11130, thanks @straight-shoota)
    • ๐ŸŽ (performance) Construct an array literal in NamedTuple#map (#10950, thanks @caspiano)
    • โž• Add Slice#fill (#10924, thanks @HertzDevil)
    • โž• Add range overloads for BitArray#toggle (#10743, thanks @HertzDevil)
    • โž• Add stable sort implementation to Slice, Array and Indexable::Mutable (#10163, #11029, #11254, thanks @MakeNowJust, thanks @straight-shoota)
    • ๐Ÿ‘ Allow Enumerable(T)#reduce's return type to differ from T (#11065, thanks @HertzDevil)
    • Implement Enumerable#tally_by (#10922, thanks @caspiano)
    • โž• Add the Indexable::Mutable(T) module (#11059, thanks @HertzDevil)
    • โœ‚ Remove restriction of bsearch block output type (#11212, thanks @straight-shoota)
    • โž• Add and improve type restrictions of block arguments (#10467, #11246, #11267
    • ๐ŸŽ (performance) Optimize #rotate! (#11198, thanks @HertzDevil)

    Concurrency

    • ๐Ÿ›  Fix Documentation of Fiber.timeout (#11271, thanks @toddsundsted)
    • ๐ŸŽ (performance) Scheduler#reschedule: Shortcut lookup for current fiber. (#11156, thanks @yxhuvud)
    • โž• Add sleep support to win32 event loop (#10605, thanks @straight-shoota)

    Files

    • (breaking-change) Change nonsense return types to Nil in IO-related methods (#10621, thanks @oprypin)
    • ๐Ÿ›  Fix File.match? to accept Path type as path argument (#11075, thanks @fishnibble)
    • โž• Add FileUtils method specs with String and Path arguments (#10987, thanks @straight-shoota)
    • 0๏ธโƒฃ Make IO#read_char's default behaviour UTF-8-strict (#10446, thanks @HertzDevil)
    • ๐Ÿ›  Fix glob with multiple recurse patterns (#10813, thanks @straight-shoota)
    • IO: fix bug in gets without peek involving \r and limit (#11241, thanks @asterite)
    • ๐Ÿ‘‰ Make FileUtils.mv work across filesystems (#10783, thanks @naqvis)
    • ๐ŸŽ (performance) Improve performance of Path#dirname and Path#extension (#11001, thanks @BlobCodes)

    Networking

    • (breaking-change) Change nonsense return types to Nil in HTTP-related methods and Log (#10624, thanks @oprypin)
    • ๐Ÿ›  Fix trailing rescue syntax (#11083, thanks @straight-shoota)
    • ๐Ÿ›  Fix spec for HTTP::Params can't run on its own (#11128, thanks @asterite)
    • ๐Ÿ›  Fix parsing cookie Domain attribute with leading dot (#11098, thanks @mamantoha)
    • Rescue OpenSSL::SSL::Error in HTTP::Server#handle_client (#11146, thanks @straight-shoota)
    • ๐Ÿ›  Fix TCPSocket constructors (#11049, thanks @straight-shoota)
    • ๐Ÿ‘Œ Support basic auth from URI in websockets (#10854, thanks @willhbr)
    • ๐Ÿท Tag std specs that need network access (#11048, thanks @toshokan)
    • Proper handling of max-age and expires for cookies (#10564, thanks @straight-shoota, @watzon)
    • Retry HTTP::Client requests once if io is closed (#11088, thanks @carlhoerberg)
    • Implement Socket for win32 (#10784, thanks @straight-shoota)
    • โž• Add URI.encode_path and deprecate URI.encode (#11248, thanks @straight-shoota)

    Numeric

    • (breaking-change) Refine type restriction of Math.frexp(BigFloat) (#10998, thanks @straight-shoota)
    • ๐Ÿ›  Fix BigInt#to_s emitting null bytes for certain values (#11063, thanks @HertzDevil)
    • ๐Ÿ›  Fix Float#humanize for values outside 1e-4...1e15 (#10881, thanks @straight-shoota)
    • โž• Add type restrictions and fix return types of BigFloat#to_x methods (#10996, thanks @straight-shoota)
    • โž• Add integer square root (#10549, thanks @kimburgess)
    • โž• Add negative exponential support to BigDecimal (#10892, thanks @stakach)
    • Add #next_float and #prev_float to Float32 and Float64 (#10908, thanks @HertzDevil)
    • โž• Add precision parameter to Int#to_s (#10926, thanks @HertzDevil)
    • ๐ŸŽ (performance) Improve Int parsing performance (#11093, thanks @BlobCodes)
    • Implement Int128 compiler-rt methods (#11206, thanks @BlobCodes)
    • ๐Ÿ›  Fix BigDecimal operations with floats (#10874, thanks @stakach)
    • โž• Add String#to_(u/i)128(?) methods (#11245, thanks @BlobCodes)

    โš™ Runtime

    • Extract libunwind from callstack (#11205, thanks @straight-shoota)

    Serialization

    • (breaking-change) Change nonsense return types to Nil: JSON and YAML (#10622, thanks @oprypin)
    • (breaking-change) Add type restriction and conversion to YAML::PullParser#location (#10997, thanks @straight-shoota)
    • ๐Ÿ‘ Allow EOF IO passed to JSON::PullParser.new (#10864, thanks @Blacksmoke16)
    • Quote the named tuple's keys on deserialization (#10919, thanks @Blacksmoke16)
    • ๐Ÿ”จ Refactor JSON::PullParser#consume_number to use stdlib number parsing (#10447, thanks @straight-shoota)
    • XML Namespace improvements (#11072, thanks @Blacksmoke16)
    • โž• Add JSON/YAML serialization to URI (#10404, thanks @straight-shoota)

    Specs

    • โž• Add missing require in iterator_spec (#11148, thanks @asterite)
    • โž• Add missing requires to run a couple of specs standalone (#11152, thanks @asterite)
    • ๐Ÿ‘ Allow describe without requiring an argument (#10974, thanks @straight-shoota)

    System

    • SystemError: Fix inconsistent signature. (#11002, thanks @yxhuvud)

    Text

    • (breaking-change) Deprecate String#unsafe_byte_at (#10559, thanks @straight-shoota)
    • (breaking-change) Rename IO#write_utf8 to #write_string. (#11051, thanks @straight-shoota)
    • ๐Ÿ‘‰ Use #write_string instead of #write whenever writing strings to unknown IOs (#11011, thanks @HertzDevil)
    • Don't use #write_byte whenever writing ASCII characters to unknown IOs (#11124, thanks @HertzDevil)
    • ๐Ÿ‘‰ Make Int#chr reject surrogate halves (#10451, thanks @HertzDevil)
    • CSV: don't eagerly check next char after newline (#11174, thanks @asterite)
    • ๐Ÿ›  Fix link on regex.cr (#11204, thanks @gemmaro)
    • ๐Ÿ— Disallow non-UTF-8 encoding settings for String::Builder (#11025, thanks @HertzDevil)
    • โšก๏ธ Unicode: update to version 14.0.0 (#11215, thanks @Blacksmoke16)

    Tools

    • Formatter: Handle (-> ) correctly (#10945, thanks @HertzDevil)
    • ๐Ÿ‘‰ Use markd for markdown rendering in the compiler (#11040, thanks @straight-shoota)
    • Formatter: Handle leading tuple literals in multi-expression return/break/next properly (#10597, thanks @HertzDevil)
    • Include parent headings in anchor links (#9839, thanks @Blacksmoke16)
    • ๐Ÿ›  Fix formatting nested multiline array and tuple (#11153, thanks @MakeNowJust)
    • crystal init: Improve transformation of project name with hyphens (#11170, thanks @Kanezoh)
    • ๐Ÿ›  Fix formatting generic types with suffix (#11187, thanks @MakeNowJust)
    • โš  Make WARNING an admonition keyword (#10898, thanks @HertzDevil)
    • ๐Ÿ”จ Refactor hierarchy printers (#10791, thanks @HertzDevil)

    Other

    • ๐Ÿ›  Fix typos (#11045, #11163, #11138, hanks @toshokan, thanks @MakeNowJust, thanks @schmijos)
    • โšก๏ธ Update readme to point to IRC channel on libera.chat (#11024, thanks @jhass)
    • โšก๏ธ [CI] Update ruby-install (#11276, thanks @straight-shoota)
    • ๐Ÿง [CI] Remove test_linux_32 and add smoke test for 32-bit gnu (#11127, thanks @straight-shoota)
    • ๐Ÿ“ฆ [CI] Remove obsolete package_build workflow (#11240, thanks @straight-shoota)
    • ๐Ÿ— [CI] Add build matrix with 1.0.0 and 1.1.1 (#11278, thanks @straight-shoota)
    • โšก๏ธ [CI] Update aarch64.yml (#11160, thanks @beta-ziliani)
    • โšก๏ธ [CI] Update distribution-scripts (universal darwin & demote alpine to 3.12) (#11228, thanks @bcardiff)
    • โšก๏ธ Update shards 0.16.0 (#11292, thanks @straight-shoota)
    • ๐Ÿš€ Update previous release Crystal 1.1.0 (#10955, thanks @straight-shoota)
    • ๐Ÿ”€ Merge changelog entry for 1.1.1 (#11028, thanks @straight-shoota)
    • ๐Ÿš€ Update previous release Crystal 1.1.1 (#11053, thanks @straight-shoota)
    • PR template (#10894, thanks @beta-ziliani)
    • โž• Add github-changelog script (#11155, thanks @straight-shoota)
    • โž• Add make install (#10878, thanks @straight-shoota)
    • [CI] Sanitize version from branch name (#11294, thanks @straight-shoota)
    • โšก๏ธ Update libgc to 8.2.0 (#11293, thanks @straight-shoota)
    • ๐Ÿš€ [CI] Unify maintenance_release and tagged_release workflows (#11273, thanks @straight-shoota)
    • โšก๏ธ [CI] Update distribution-scripts (make install) (#11307, thanks @straight-shoota)
    • ๐Ÿš€ [CI] Enable publish docker images on tagged release (#11309, thanks @straight-shoota)
    • โšก๏ธ [CI] Update distribution-scripts (fix for libgc in alpine Docker image) (#11310, thanks @straight-shoota)
    • ๐ŸŽ [CI] Pin macOS runner to 10.15 (#11282, thanks @straight-shoota)
    • [CI] Fix push_obs_nightly (#11301, thanks @straight-shoota)
    • โšก๏ธ [CI] Update distribution-scripts (#11285, thanks @straight-shoota)
    • ๐Ÿ— [CI] Remove i386 builds (#11287, thanks @straight-shoota)