Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dereferencing a ref type does not compile #11747

Closed
mathysr opened this issue Jul 16, 2019 · 0 comments
Closed

Dereferencing a ref type does not compile #11747

mathysr opened this issue Jul 16, 2019 · 0 comments

Comments

@mathysr
Copy link

mathysr commented Jul 16, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants