• 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

95.24
/src/types/DynamicType.ts
1
import type { GetTypeOptions, TypeCompatibilityData } from '../interfaces';
2
import { isDynamicType } from '../astUtils/reflection';
1✔
3
import { BscType } from './BscType';
1✔
4
import { BscTypeKind } from './BscTypeKind';
1✔
5
import { BuiltInInterfaceAdder } from './BuiltInInterfaceAdder';
1✔
6

7
export class DynamicType extends BscType {
1✔
8
    constructor(
9
        public typeText?: string
154✔
10
    ) {
11
        super();
154✔
12
    }
13

14
    public readonly kind = BscTypeKind.DynamicType;
154✔
15

16
    public static readonly instance = new DynamicType();
1✔
17

18
    get returnType() {
19
        return DynamicType.instance;
514✔
20
    }
21

22
    public isAssignableTo(targetType: BscType) {
23
        //everything can be dynamic, so as long as a type is provided, this is true
UNCOV
24
        return !!targetType;
×
25
    }
26

27
    /**
28
     * The dynamic type is convertible to everything.
29
     */
30
    public isTypeCompatible(targetType: BscType, data?: TypeCompatibilityData) {
31
        //everything can be dynamic, so as long as a type is provided, this is true
32
        return !!targetType;
342✔
33
    }
34

35
    public toString() {
36
        return this.typeText ?? 'dynamic';
4,836✔
37
    }
38

39
    public toTypeString(): string {
40
        return this.toString();
8✔
41
    }
42

43
    public isEqual(targetType: BscType) {
44
        return isDynamicType(targetType);
41✔
45
    }
46

47
    getMemberType(memberName: string, options: GetTypeOptions) {
48
        return DynamicType.instance;
581✔
49
    }
50
}
51

52
BuiltInInterfaceAdder.primitiveTypeInstanceCache.set('dynamic', DynamicType.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