From 3317fa16aacd3a0063e2c2e42cfc02e08bb6d393 Mon Sep 17 00:00:00 2001 From: Mikael Pettersson Date: Mon, 10 Jul 2023 18:18:14 +0200 Subject: [PATCH] pdp10_stdio: define and export the location/0 type ourselves --- erlang/apps/lib/src/pdp10_stdio.erl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/erlang/apps/lib/src/pdp10_stdio.erl b/erlang/apps/lib/src/pdp10_stdio.erl index 03319e7..d6af452 100644 --- a/erlang/apps/lib/src/pdp10_stdio.erl +++ b/erlang/apps/lib/src/pdp10_stdio.erl @@ -89,7 +89,16 @@ -record(file, {pid :: pid()}). -type file() :: #file{}. +%% The file module defines but doesn't export the location/0 type. Starting with +%% OTP-26 dialyzer considers references to unknown types as errors by default, +%% causing the build to fail. This is a verbatim copy of the type from OTP-26. +%% See https://github.com/erlang/otp/issues/7485. +-type location() :: integer() | {'bof', Offset :: integer()} + | {'cur', Offset :: integer()} + | {'eof', Offset :: integer()} | 'bof' | 'cur' | 'eof'. + -export_type([ file/0 + , location/0 ]). -record(state, @@ -139,7 +148,7 @@ fputc(Nonet, #file{pid = Pid}) -> fputs(Nonets, #file{pid = Pid}) -> gen_server:call(Pid, {fputs, Nonets}, infinity). --spec fseek(file(), file:location()) -> ok | {error, {module(), term()}}. +-spec fseek(file(), location()) -> ok | {error, {module(), term()}}. fseek(#file{pid = Pid}, Location) -> gen_server:call(Pid, {fseek, Location}, infinity).