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

Type inferring templates do not work with non-ref types. #4973

Closed
endragor opened this issue Oct 31, 2016 · 1 comment
Closed

Type inferring templates do not work with non-ref types. #4973

endragor opened this issue Oct 31, 2016 · 1 comment

Comments

@endragor
Copy link
Contributor

endragor commented Oct 31, 2016

Sample:

import sequtils

type
  SomeObj = object
  OtherObj = object
    field: SomeObj

let aSeq = @[OtherObj(field: SomeObj())]
let someObjSeq = aSeq.mapIt(it.field)
# Error: type mismatch: got (SomeObj) but expected 'outType = object'

This sample works if SomeObj is defined as: SomeObj = ref object.

Nim Git hash: 0f34196

@johnnovak
Copy link
Contributor

Maybe related to #4798?

@Araq Araq closed this as completed in 3c773c1 Feb 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants