Skip to content

Commit db1138c

Browse files
committed
added more comments to ReferenceTypeWithDefault
1 parent e129f4b commit db1138c

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/types/ReferenceType.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,21 @@ export class ParamTypeFromValueReferenceType extends BscType {
646646

647647
/**
648648
* Used when an IntersectionType has at least one member that may have default dynamic members.
649-
* If the inner type is not resolvable, this type will resolve to the given type DynamicType.
649+
* If the inner type is not resolvable, this type will resolve to the given type instead.
650+
* @example
651+
* ```brighterscript
652+
* interface HasAge
653+
* age as integer
654+
* end interface
655+
*
656+
* type foo = HasAge and roAssociativeArray
657+
*
658+
* sub useFoo(f as foo)
659+
* print f.age ' f.age is an integer
660+
* print f.doesExist("key") ' will result in a boolean, from roAssociativeArray
661+
* print f.someKey ' no idea - so this is dynamic, and will not cause a validation error
662+
* end sub
663+
* ```
650664
*/
651665
export class ReferenceTypeWithDefault extends BscType {
652666
constructor(public baseType: BscType, public defaultType: BscType) {

0 commit comments

Comments
 (0)