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
Forward declarations for procedures with a generic constraint don't work always. For some constraints it does work, for other constraints it does not work. Here is a list of constraints that I tested. I don't know if there are other corner cases that I did not cover.
/tmp/scratch.nim(40, 5) Error: ambiguous call; both scratch.foo5(arg: T: object) [declared in /tmp/scratch.nim(34, 6)] and scratch.foo5(arg: T: object) [declared in /tmp/scratch.nim(35, 6)] match for: (MyType)
/tmp/scratch.nim(44, 6) Error: implementation of 'scratch.foo6(arg: T: distinct) [declared in /tmp/scratch.nim(44, 6)]' expected
/tmp/scratch.nim(50, 5) Error: ambiguous call; both scratch.foo6(arg: T: distinct) [declared in /tmp/scratch.nim(44, 6)] and scratch.foo6(arg: T: distinct) [declared in /tmp/scratch.nim(45, 6)] match for: (MyDistinct)
/tmp/scratch.nim(54, 6) Error: implementation of 'scratch.foo7(arg: T: enum) [declared in /tmp/scratch.nim(54, 6)]' expected
/tmp/scratch.nim(60, 5) Error: ambiguous call; both scratch.foo7(arg: T: enum) [declared in /tmp/scratch.nim(54, 6)] and scratch.foo7(arg: T: enum) [declared in /tmp/scratch.nim(55, 6)] match for: (MyEnum)
/tmp/scratch.nim(54, 6) Error: implementation of 'scratch.foo7(arg: T: enum) [declared in /tmp/scratch.nim(54, 6)]' expected
This is not the real output of nim check. This is the accumulated output of several calls to nim check. For some reason Nim check only reports two error messages. I have to comment to see more errors.
Expected Output
Nim check should not complain with errors.
hello some integer
hello range
hello tuple
hello seq
hello object
hello distinct
hello enum
Additional Information
I my PR #12391, I wanted to use forward declarations of assignFromJson. This bug prevents me from doing so. The alternative was to make assignFromJson public, which for some unknown reason made it work. Where is the specification that defines this different behavior of symbol resolution for exported vs non-exported symbols?
The text was updated successfully, but these errors were encountered:
Forward declarations for procedures with a generic constraint don't work always. For some constraints it does work, for other constraints it does not work. Here is a list of constraints that I tested. I don't know if there are other corner cases that I did not cover.
Example
Current Output
This is not the real output of nim check. This is the accumulated output of several calls to nim check. For some reason Nim check only reports two error messages. I have to comment to see more errors.
Expected Output
Nim check should not complain with errors.
Additional Information
I my PR #12391, I wanted to use forward declarations of
assignFromJson
. This bug prevents me from doing so. The alternative was to makeassignFromJson
public, which for some unknown reason made it work. Where is the specification that defines this different behavior of symbol resolution for exported vs non-exported symbols?The text was updated successfully, but these errors were encountered: