From 17a80c3572d83a3e23aad74fe4320776ca169017 Mon Sep 17 00:00:00 2001 From: James Healy Date: Mon, 18 Apr 2022 11:20:18 +1000 Subject: [PATCH] Change PDF::Reader::CidWidths to strict typing Build on the work started in #461, hoping to flush out some bugs --- lib/pdf/reader/cid_widths.rb | 4 +--- rbi/pdf-reader.rbi | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/pdf/reader/cid_widths.rb b/lib/pdf/reader/cid_widths.rb index 143ea456..ebd90249 100644 --- a/lib/pdf/reader/cid_widths.rb +++ b/lib/pdf/reader/cid_widths.rb @@ -1,9 +1,7 @@ # coding: utf-8 -# typed: true +# typed: strict # frozen_string_literal: true -# - require 'forwardable' class PDF::Reader diff --git a/rbi/pdf-reader.rbi b/rbi/pdf-reader.rbi index c548cb2f..31a4e395 100644 --- a/rbi/pdf-reader.rbi +++ b/rbi/pdf-reader.rbi @@ -150,7 +150,7 @@ module PDF @widths = T.let(T.unsafe(nil), T::Hash[Numeric, Numeric]) end - sig { params(default: Numeric, array: T::Array[Numeric]).returns(T.untyped) } + sig { params(default: Numeric, array: T::Array[Numeric]).returns(T::Hash[Numeric, Numeric]) } def parse_array(default, array); end sig { params(first: Integer, widths: T::Array[Numeric]).returns(T::Hash[Numeric, Numeric]) }