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

rokucommunity / brighterscript / #12717

14 Jun 2024 08:20PM UTC coverage: 85.629% (-2.3%) from 87.936%
#12717

push

web-flow
Merge 94311dc0a into 42db50190

10808 of 13500 branches covered (80.06%)

Branch coverage included in aggregate %.

6557 of 7163 new or added lines in 96 files covered. (91.54%)

83 existing lines in 17 files now uncovered.

12270 of 13451 relevant lines covered (91.22%)

26531.66 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,668✔
11
        super();
1,668✔
12
    }
13

14
    public readonly kind = BscTypeKind.FunctionType;
1,668✔
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