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).
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
xof type interfaceI1with a methodm(), and an interfaceI2with a method of the same name but different signaturem(int), the type assertionx.(I2)can never succeed because no value satisfyingI1can also satisfyI2. The compiler can statically detect that this type assertion makes no sense (it will always panic or return false).