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

rokucommunity / brighterscript / #13683

03 Feb 2025 04:19PM UTC coverage: 86.753% (-1.4%) from 88.185%
#13683

push

web-flow
Merge 34e72243e into 4afb6f658

12476 of 15203 branches covered (82.06%)

Branch coverage included in aggregate %.

7751 of 8408 new or added lines in 101 files covered. (92.19%)

85 existing lines in 17 files now uncovered.

13398 of 14622 relevant lines covered (91.63%)

34302.41 hits per line

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

84.38
/src/types/FunctionType.ts
1
import { isCallableType, isDynamicType, isFunctionTypeLike, isObjectType } from '../astUtils/reflection';
1✔
2
import { BaseFunctionType } from './BaseFunctionType';
1✔
3
import type { BscType } from './BscType';
4
import { BscTypeKind } from './BscTypeKind';
1✔
5
import { isUnionTypeCompatible } from './helpers';
1✔
6
import { BuiltInInterfaceAdder } from './BuiltInInterfaceAdder';
1✔
7
import type { TypeCompatibilityData } from '../interfaces';
8

9
export class FunctionType extends BaseFunctionType {
1✔
10
    constructor(public typeText?: string) {
2,032✔
11
        super();
2,032✔
12
    }
13

14
    public readonly kind = BscTypeKind.FunctionType;
2,032✔
15

16
    public static instance = new FunctionType('function');
1✔
17

18
    public isTypeCompatible(targetType: BscType, data?: TypeCompatibilityData) {
19
        if (
15✔
20
            isDynamicType(targetType) ||
35✔
21
            isCallableType(targetType) ||
22
            isFunctionTypeLike(targetType) ||
23
            isObjectType(targetType) ||
24
            isUnionTypeCompatible(this, targetType, data)
25
        ) {
26
            return true;
14✔
27
        }
28
        return false;
1✔
29
    }
30

31
    public toString() {
32
        return this.toTypeString();
42✔
33

34
    }
35

36
    public toTypeString(): string {
37
        return this.typeText ?? 'function';
45✔
38
    }
39

40
    isEqual(targetType: BscType) {
NEW
41
        if (isFunctionTypeLike(targetType)) {
×
NEW
42
            return true;
×
43
        }
NEW
44
        return false;
×
45
    }
46
}
47

48
BuiltInInterfaceAdder.primitiveTypeInstanceCache.set('function', new FunctionType());
1✔
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

© 2026 Coveralls, Inc