~sircmpwn/hare-users

1

Assertion `tagged->storage == STORAGE_TAGGED' failed

Details
Message ID
<CADVGtmsP=jD4jU3wwc16XctYZ4MzSuNUbwKB1YrVbxbhUq-xGA@mail.gmail.com>
DKIM signature
pass
Download raw message
use fmt;
use io;
use bufio;
use memio;
use os;
use fs;
use strings;
use types;
use encoding::utf8;

export fn main() void = {

   const file = os::open("app.ha")!;
   const file_scan = bufio::newscanner(file, types::SIZE_MAX);

   for(true) {
      const line = match(bufio::scan_line(&file_scan)) {
         case let line: str => yield line;
         case io::EOF => break;
         case utf8::invalid => fmt::fatal("Fatal error");
         case io::error => fmt::fatal("Fatal error");

      };
   };

};

Is it compiler bug or an error in code?
Details
Message ID
<CYULVR8I1W4F.1H7VPR6E7DR4M@attila>
In-Reply-To
<CADVGtmsP=jD4jU3wwc16XctYZ4MzSuNUbwKB1YrVbxbhUq-xGA@mail.gmail.com> (view parent)
DKIM signature
pass
Download raw message
On Fri Feb 2, 2024 at 1:13 PM CET, Dmitry B wrote:
> use fmt;
> use io;
> use bufio;
> use memio;
> use os;
> use fs;
> use strings;
> use types;
> use encoding::utf8;
>
> export fn main() void = {
>
>    const file = os::open("app.ha")!;
>    const file_scan = bufio::newscanner(file, types::SIZE_MAX);
>
>    for(true) {
>       const line = match(bufio::scan_line(&file_scan)) {
>          case let line: str => yield line;
>          case io::EOF => break;
>          case utf8::invalid => fmt::fatal("Fatal error");
>          case io::error => fmt::fatal("Fatal error");
>
>       };
>    };
>
> };
>
> Is it compiler bug or an error in code?

case let line: str
should be
case let line: const str

The compiler should detect that and report an error, but we haven't
implemented that yet.
Reply to thread Export thread (mbox)