Skip to content

Commit ac19f1a

Browse files
committed
Move check around
1 parent 3c04003 commit ac19f1a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

internal/checker/checker.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16321,9 +16321,6 @@ func (c *Checker) getConstraintOfType(t *Type) *Type {
1632116321
}
1632216322

1632316323
func (c *Checker) getConstraintOfTypeParameter(typeParameter *Type) *Type {
16324-
if typeParameter.flags&TypeFlagsTypeParameter == 0 {
16325-
return nil
16326-
}
1632716324
if c.hasNonCircularBaseConstraint(typeParameter) {
1632816325
return c.getConstraintFromTypeParameter(typeParameter)
1632916326
}
@@ -16336,6 +16333,10 @@ func (c *Checker) hasNonCircularBaseConstraint(t *Type) bool {
1633616333

1633716334
// This is a worker function. Use getConstraintOfTypeParameter which guards against circular constraints
1633816335
func (c *Checker) getConstraintFromTypeParameter(t *Type) *Type {
16336+
if t.Flags()&TypeFlagsTypeParameter == 0 {
16337+
return nil
16338+
}
16339+
1633916340
tp := t.AsTypeParameter()
1634016341
if tp.constraint == nil {
1634116342
var constraint *Type

0 commit comments

Comments
 (0)