-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Labels
AnalysisIssues related to static analysis (vet, x/tools/go/analysis)Issues related to static analysis (vet, x/tools/go/analysis)LanguageChangeSuggested changes to the Go languageSuggested changes to the Go languageLanguageChangeReviewDiscussed by language change review committeeDiscussed by language change review committeeProposal
Milestone
Description
Now that we have introduced a vet check for this (see #4483), once we use modules to select the language version, we should disallow impossible interface-interface type assertions.
A quick refresher: Given a variable x of type interface I1 with a method m(), and an interface I2 with a method of the same name but different signature m(int), the type assertion x.(I2) can never succeed because no value satisfying I1 can also satisfy I2. The compiler can statically detect that this type assertion makes no sense (it will always panic or return false).
OneOfOne, mvdan, bronze1man, daemonfire300, komuw and 15 more
Metadata
Metadata
Assignees
Labels
AnalysisIssues related to static analysis (vet, x/tools/go/analysis)Issues related to static analysis (vet, x/tools/go/analysis)LanguageChangeSuggested changes to the Go languageSuggested changes to the Go languageLanguageChangeReviewDiscussed by language change review committeeDiscussed by language change review committeeProposal