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

rokucommunity / brighterscript / #14125

04 Apr 2025 03:30PM UTC coverage: 87.111% (-2.0%) from 89.104%
#14125

push

web-flow
Merge dfcaf56c4 into e8dca2372

13299 of 16135 branches covered (82.42%)

Branch coverage included in aggregate %.

7986 of 8664 new or added lines in 102 files covered. (92.17%)

84 existing lines in 22 files now uncovered.

14378 of 15637 relevant lines covered (91.95%)

19659.35 hits per line

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

80.77
/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
    public readonly kind = BscTypeKind.FunctionType;
2✔
11

12
    public static instance = new FunctionType();
1✔
13

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

27
    public toString() {
28
        return this.toTypeString();
44✔
29

30
    }
31

32
    public toTypeString(): string {
33
        return 'function';
44✔
34
    }
35

36
    isEqual(targetType: BscType) {
NEW
37
        if (isFunctionTypeLike(targetType)) {
×
NEW
38
            return true;
×
39
        }
NEW
40
        return false;
×
41
    }
42
}
43

44
BuiltInInterfaceAdder.primitiveTypeInstanceCache.set('function', FunctionType.instance);
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