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
Current approach requires three modules to reproduce -- it seems to relate to the import structure (A imports C, then A imports B which imports C). This probably isn't 100% required, but there are no other external imports required, stdlib or otherwise.
# Order matters to reproduce this; switch these and it buildsimport./altair
import./forks_light_client
templatelazy_header(name: untyped): untyped {.dirty.} =var `name _ ptr`: ptr[data_fork.LightClientHeader] # this data_fork.Foo part seems required to reproduceproccreateLightClientUpdates(data_fork: staticLightClientDataFork) =lazy_header(attested_header)
createLightClientUpdates(LightClientDataFork.Altair)
A number of interesting quirks here, e.g., without the `{.dirty.} it fails with
a.nim(6, 35) Error: ambiguous identifier: 'LightClientHeader' -- use one of the following:
altair.LightClientHeader: LightClientHeader
forks_light_client.LightClientHeader: template (kind: static[LightClientDataFork]): auto
regardless of Nim 1.6/2.0/devel
Nim Version
Nim Compiler Version 1.6.14 [Linux: amd64]
Compiled at 2023-06-29
Copyright (c) 2006-2023 by Andreas Rumpf
active boot switches: -d:release
Nim Compiler Version 2.0.0 [Linux: amd64]
Compiled at 2023-08-03
Copyright (c) 2006-2023 by Andreas Rumpf
git hash: a488067a4130f029000be4550a0fb1b39e0e9e7c
active boot switches: -d:release
Nim Compiler Version 2.1.1 [Linux: amd64]
Compiled at 2023-08-03
Copyright (c) 2006-2023 by Andreas Rumpf
git hash: b40da812f7aa590ed16df54a492684c228320549
active boot switches: -d:release
Current Output
Nim 1.6 builds successfully.
Nim 2.0/devel:
a.nim(11, 25) template/generic instantiation of `createLightClientUpdates` from here
a.nim(6, 34) Error: type mismatch: got 'LightClientDataFork' for 'LightClientDataFork.Altair' but expected 'LightClientHeader = object'
Expected Output
No response
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Simplified (generics bug, not related to templates or interpolating symbol names):
# a.nimtypeTypeOrTemplate*=object# b.nimimport a
templateTypeOrTemplate*(num: int): untyped=# module a only exists so we can pick the type version of TypeOrTemplate heretypedesc[a.TypeOrTemplate]
# c.nimimport a, b
procgeneric[T](abc: T) =var x: abc.TypeOrTemplategeneric(123)
tersec
changed the title
Regression from 1.6 to 2.0 and devel with template interpolating symbol names
Regression from 1.6 to 2.0 and devel with generics across modules
Aug 3, 2023
Description
Current approach requires three modules to reproduce -- it seems to relate to the import structure (A imports C, then A imports B which imports C). This probably isn't 100% required, but there are no other external imports required, stdlib or otherwise.
Where
altair.nim
:and
forks_light_client.nim
:A number of interesting quirks here, e.g., without the `{.dirty.} it fails with
regardless of Nim 1.6/2.0/devel
Nim Version
Current Output
Expected Output
No response
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: