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

rokucommunity / brighterscript / #13028

05 Sep 2024 06:50PM UTC coverage: 86.418% (-1.5%) from 87.933%
#13028

push

web-flow
Merge c5c56b09a into 43cbf8b72

10784 of 13272 branches covered (81.25%)

Branch coverage included in aggregate %.

153 of 158 new or added lines in 7 files covered. (96.84%)

811 existing lines in 44 files now uncovered.

12484 of 13653 relevant lines covered (91.44%)

27481.68 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;
341✔
33
    }
34

35
    public toString() {
36
        return this.typeText ?? 'dynamic';
4,534✔
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;
571✔
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