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

Parapoly struct alias is broken when both types are in same package #4252

Open
karl-zylinski opened this issue Sep 16, 2024 · 0 comments
Open

Comments

@karl-zylinski
Copy link
Contributor

Context

    Odin:    dev-2024-09:2d969bce3
    OS:      Windows 10 Professional (version: 22H2), build 19045.4894
    CPU:     Intel(R) Core(TM) i7-6950X CPU @ 3.00GHz
    RAM:     32674 MiB
    Backend: LLVM 18.1.8

Expected Behavior

This should work:

Poly_Type :: struct($N: int) {
	N: int,
}

Poly_Type2 :: Poly_Type

Current Behavior

C:/code/playground/playground.odin(11:15) Error: Invalid use of a non-specialized polymorphic type 'Poly_Type' 
	Poly_Type2 :: Poly_Type 
	              ^~~~~~~~^ 

Failure Information (for bugs)

Only happens if the two types are in the same package. If you put the original type in a separate package then the aliasing works OK.

Steps to Reproduce

  1. Paste code above into file
  2. Compile
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

1 participant