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

x/mobile: cannot use generic type demo.GenericTestData[T any] without instantiation #64486

Open
pinguo-yangbing opened this issue Dec 1, 2023 · 0 comments
Labels
generics Issue is related to generics mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@pinguo-yangbing
Copy link

I have a piece of code:

func NewGenericTestData[T any](path string) *GenericTestData[T] {
return &GenericTestData[T]{
dataPath: strings.TrimRight(path, "/"),
}
}

type GenericTestData[T any] struct {
dataPath string
*CBaseInfo
Data T
}

When I run gomobile, I get an error: cannot use generic type demo.GenericTestData[T any] without instantiation

@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Dec 1, 2023
@gopherbot gopherbot added this to the Unreleased milestone Dec 1, 2023
@pinguo-yangbing pinguo-yangbing changed the title x/mobile: cannot use generic type demo.GenericTestData[T demo.YY] without instantiation x/mobile: cannot use generic type demo.GenericTestData[T any] without instantiation Dec 1, 2023
@dmitshur dmitshur added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. generics Issue is related to generics labels Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generics Issue is related to generics mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants