• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rokucommunity / brighterscript / #12930

13 Aug 2024 05:02PM UTC coverage: 86.193% (-1.7%) from 87.933%
#12930

push

web-flow
Merge 58ad447a2 into 0e968f1c3

10630 of 13125 branches covered (80.99%)

Branch coverage included in aggregate %.

6675 of 7284 new or added lines in 99 files covered. (91.64%)

84 existing lines in 18 files now uncovered.

12312 of 13492 relevant lines covered (91.25%)

26865.48 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.18
/src/types/InterfaceType.ts
1
import type { TypeCompatibilityData } from '../interfaces';
2
import { SymbolTypeFlag } from '../SymbolTypeFlag';
1✔
3
import { isDynamicType, isInterfaceType, isObjectType } from '../astUtils/reflection';
1✔
4
import type { BscType } from './BscType';
5
import { BscTypeKind } from './BscTypeKind';
1✔
6
import { InheritableType } from './InheritableType';
1✔
7
import { isUnionTypeCompatible } from './helpers';
1✔
8
import type { ReferenceType } from './ReferenceType';
9

10
export class InterfaceType extends InheritableType {
1✔
11
    public constructor(
12
        public name: string,
264,037✔
13
        public readonly superInterface?: InterfaceType | ReferenceType
264,037✔
14
    ) {
15
        super(name, superInterface);
264,037✔
16
    }
17

18
    public readonly kind = BscTypeKind.InterfaceType;
264,037✔
19

20
    public isTypeCompatible(targetType: BscType, data?: TypeCompatibilityData) {
21
        if (isDynamicType(targetType) || isObjectType(targetType) || isUnionTypeCompatible(this, targetType, data)) {
78✔
22
            return true;
4✔
23
        }
24
        if (isInterfaceType(targetType)) {
74✔
25
            return this.checkCompatibilityBasedOnMembers(targetType, SymbolTypeFlag.runtime, data);
39✔
26
        }
27
        const ancestorTypes = this.getAncestorTypeList();
35✔
28
        if (ancestorTypes?.find(ancestorType => ancestorType.isEqual(targetType))) {
35!
NEW
29
            return true;
×
30
        }
31
        return this.checkCompatibilityBasedOnMembers(targetType, SymbolTypeFlag.runtime, data);
35✔
32
    }
33

34
    /**
35
     *  Is this the exact same interface as the target?
36
     */
37
    isEqual(targetType: BscType, data?: TypeCompatibilityData): boolean {
38
        return isInterfaceType(targetType) && super.isEqual(targetType, data);
29✔
39
    }
40
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc