You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While looking into why the standard library wasn't building correctly for me, I found that that readByte for StandardInput
was trying to call an incompatible mono in the generated c code.
In the source I found that the implementations of the readByte and writeByte functions in the instances for StandardInput and StandardError respectively did not have the correct types in the function definition.
The typeclass definition demands that the instance type parameter matches the stream type
-- standard/src/IO/Terminal.aum
instance ByteInputStream(StandardInput) is
generic [R: Region]
method readByte(stream: &![StandardOutput, R]): Option[Nat8] is
let stdin: Address[Nat8] := getStdin();
let res: Int32 := fgetc(stdin);
if res = EOF then
return None();
else
return toNat8(res);
end if;
end;
end;
I have created a PR to fix the discrepancy in this code, but surely this should be getting caught by the type checker?
The text was updated successfully, but these errors were encountered:
While looking into why the standard library wasn't building correctly for me, I found that that readByte for StandardInput
was trying to call an incompatible mono in the generated c code.
In the source I found that the implementations of the readByte and writeByte functions in the instances for StandardInput and StandardError respectively did not have the correct types in the function definition.
The typeclass definition demands that the instance type parameter matches the stream type
But the implementation does not follow this
I have created a PR to fix the discrepancy in this code, but surely this should be getting caught by the type checker?
The text was updated successfully, but these errors were encountered: