#Getting a "cannot format error union without a specifier" compilation error

1 messages ยท Page 1 of 1 (latest)

sinful urchin
#

The weird thing is, I'm getting this at debug.print() / log.error() statements that worked before (before unrelated code changes). The operand is just a simple value (f64). It's probably something simple that I just don't realise ๐Ÿคทโ€โ™‚๏ธ

I tried changing the operands (in .{}) towards "try operand" -> but then I get a compilation error that the operand is not an error union type (which it indeed isn't, as it's a simple f64).

I have been messing around with memory allocation in an unrelated part of the code, but don't understand how that can affect trying to print something.

Is there anyone that has experienced something similar and knows how to fix this?

amber skiff
#

I experienced a similar thing once but I don't quite remember how I fixed it, but I believe that it might be showing the error in the wrong place?
maybe try looking for any logs or prints or formats that use the value you changed?

sinful urchin
#

Thank. I'll have a look; it's going to be a large back-trace though (made quite some changes since last it worked).

amber skiff
#

gl

sinful urchin
#

Ok. It becomes weirder... now I outcommented all log statements; now it says the same thing about a log statement in the allocator standard library code.

#

Going to outcomment further ๐Ÿ˜‰

amber skiff
#

huh, that's strange

#

I wonder if you perhaps missed a try or a catch somewhere considering its talking about an error union and you mentioned memory allocation?

sinful urchin
#

Outcommenting that test case -> now again in another testcase where I deinit an arena allocator -> but still the compiler error regarding the formatter deep in std library code.
Don't know what I broke ๐Ÿ™‚

#

I'll rummage around, and post my findings later (if I find something)

amber skiff
#

alright good luck, it took me a while to find the problem when I had it and for all I know it's something completely different here than what I had to do but hopefully you can find it

sinful urchin
#

Well it has to do with a certain method that is probably not compiled in when I don't test that method.

Just as soon as I start testing that method, all hell breaks loose in other unrelated code

#

So. Starting there...

#

Right. Found the single line that triggered it.
Has nothing to do whatsoever with the stacktrace of the compilation error I'm getting.

Investigating further ๐Ÿ™‚

#

(because I don't yet know what's wrong with that line)

amber skiff
#

that's progress

sinful urchin
#

Ok. Found it.

#

That single line would print a string -> however, that string was indeed an error union (![]const u8)

-> However, when I forgot to put "try" there, the compiler error showed a completely different originating call in the stack trace.
-> No relation whatsoever (different file, etc.)

#

Now change back everything I commented out, etc. ๐Ÿ˜‰