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

Passing pointers should always pass Pointer class, not Int class, etc. #752

Closed
nddrylliog opened this issue Dec 6, 2013 · 1 comment
Closed
Assignees
Milestone

Comments

@nddrylliog
Copy link
Member

@nddrylliog nddrylliog commented Dec 6, 2013

Test case:

check: func <T> (t: T) {
    if (T size != Pointer size) {
        "Fail! T size should be #{Pointer size}, is #{T size}" println()
        exit(1)
    }
}

main: func {
    a: Int*
    check(a)

    b: UInt64*
    check(b)

    c: Char*
    check(c)
}

On 64-bit, it fails at the first check.

@ghost ghost assigned nddrylliog Dec 6, 2013
nddrylliog added a commit that referenced this issue Dec 6, 2013
@nddrylliog
Copy link
Member Author

@nddrylliog nddrylliog commented Dec 6, 2013

Again, ugly code, but it works.

Loading

@nddrylliog nddrylliog closed this Dec 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant