Skip to content

Conversation

T4cC0re
Copy link

@T4cC0re T4cC0re commented Sep 9, 2025

g := gorm.G[T](db)
var _ gorm.ChainInterface[T] = g
var _ gorm.Interface[T] = g

Should not produce a compiler error, but since 1.30.5 it does:

cannot use g (variable of interface type gorm.Interface[T]) as gorm.ChainInterface[T] value in variable declaration: gorm.Interface[T] does not implement gorm.ChainInterface[T] (missing method Count)
cannot use g (variable of interface type gorm.Interface[T]) as gorm.ChainInterface[T] value in struct literal: gorm.Interface[T] does not implement gorm.ChainInterface[T] (missing method Count)

Testing with 1.30.3 the code compiles, as expected.

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

Successfully merging this pull request may close these issues.

1 participant