koka-lang / koka

Koka language compiler and interpreter
http://koka-lang.org
Other
3.16k stars 151 forks source link

internal error: Core.Parc.getDataDefInfo: cannot find type: std/time/timestamp/timespan #500

Open Caid11 opened 2 months ago

Caid11 commented 2 months ago

I see this error when I try to compile my code:

parse   : .../bb.kk
check   : bb
bb(1, 1): internal error: Core.Parc.getDataDefInfo: cannot find type: std/time/timestamp/timespan
CallStack (from HasCallStack):
  error, called at src\Common\Failure.hs:46:12 in koka-3.1.1-4KWDIhobz6XJ1Dhpw9I5uN:Common.Failure
  raise, called at src\Common\Failure.hs:32:5 in koka-3.1.1-4KWDIhobz6XJ1Dhpw9I5uN:Common.Failure
  failure, called at src\Backend\C\Parc.hs:988:34 in koka-3.1.1-4KWDIhobz6XJ1Dhpw9I5uN:Backend.C.Parc

Failed to compile bb.kk

Some notes:

The failing code is here: https://github.com/Caid11/Functional-Program-Studio/tree/internal-error-cannot-find-type/blockbuilder

It only compiles on Windows and is a large reproducer, but I'm not sure how to meaningfully reduce it (suggestions are welcome).

daanx commented 2 months ago

Ah, I know about this bug but haven't been able to find the culprit yet. You can work around it by importing std/time/timestamp explicitly I think.

Caid11 commented 2 months ago

I tried importing timestamp, but I still see the error, unfortunately.

I also opened #501 on a very similar and possibly related issue, although it produces a different error message.

TimWhiting commented 2 months ago

This is what I've had to import for a similar error before: (using now()).

import std/time
import std/num/ddouble
import std/time/instant
import std/time/chrono
import std/time/duration

I'm not sure if all of those are actually necessary.