lang: If the test fails earlier than expected, exit early
If a test failed in stage 2 (fail2) instead of an expected fail in stage 3 (fail3) then it would continue running, which was an undefined behaviour in our API. IOW we should not run Unify if SetScope failed. This patch adds these additional checks to ensure our tests are more robust.
This commit is contained in:
@@ -3143,6 +3143,10 @@ func (obj *StmtInclude) Unify() ([]interfaces.Invariant, error) {
|
||||
if obj.Name == "" {
|
||||
return nil, fmt.Errorf("missing include name")
|
||||
}
|
||||
if obj.class == nil {
|
||||
// possible programming error
|
||||
return nil, fmt.Errorf("include doesn't contain a class pointer yet")
|
||||
}
|
||||
|
||||
// is it even possible for the signatures to match?
|
||||
if len(obj.class.Args) != len(obj.Args) {
|
||||
|
||||
Reference in New Issue
Block a user