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

rokucommunity / brighterscript / #13117

01 Oct 2024 08:24AM UTC coverage: 86.842% (-1.4%) from 88.193%
#13117

push

web-flow
Merge abd960cd5 into 3a2dc7282

11537 of 14048 branches covered (82.13%)

Branch coverage included in aggregate %.

6991 of 7582 new or added lines in 100 files covered. (92.21%)

83 existing lines in 18 files now uncovered.

12692 of 13852 relevant lines covered (91.63%)

29478.96 hits per line

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

93.55
/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) {
1,878✔
11
        super();
1,878✔
12
    }
13

14
    public readonly kind = BscTypeKind.FunctionType;
1,878✔
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();
34✔
32

33
    }
34

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

39
    isEqual(targetType: BscType) {
40
        if (isFunctionType(targetType)) {
4!
41
            return true;
4✔
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 · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc