-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
Dereferencing a ref type does not compile
No suitable [] implementation is found for the reference type itself. Derefencing an instance works.
Example
type
MyType = object
a: int
b: int
c: int
MyRefType = ref MyType
echo compiles(MyRefType[])
Remark: the compiles proc checks whether MyRefType[] compiles. As it generates false as output, it does not.
Current Output
false
Expected Output
true
Possible Solution
Additional Information
The issue came up in this thread on the Nim forum when discussing how to get the size of the underying type of a ref.
nim version 0.20.0
https://play.nim-lang.org/#ix=1OE9