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

rokucommunity / brighterscript / #13625

16 Jan 2025 06:37PM UTC coverage: 86.817% (-1.4%) from 88.185%
#13625

push

web-flow
Merge 4d932f3a2 into 71f9febcc

12444 of 15150 branches covered (82.14%)

Branch coverage included in aggregate %.

7705 of 8349 new or added lines in 101 files covered. (92.29%)

85 existing lines in 17 files now uncovered.

13351 of 14562 relevant lines covered (91.68%)

34002.61 hits per line

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

83.87
/src/types/FunctionType.ts
1
import { isCallableType, isDynamicType, isFunctionType, 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,025✔
11
        super();
2,025✔
12
    }
13

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

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

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

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

33
    }
34

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

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

47
BuiltInInterfaceAdder.primitiveTypeInstanceCache.set('function', new FunctionType());
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc