@@ -13,9 +13,10 @@ import {
13
13
markRaw ,
14
14
shallowReadonly ,
15
15
set ,
16
- del
16
+ del ,
17
+ ShallowRef
17
18
} from '../../index'
18
- import { IsUnion , describe , expectType } from '../utils'
19
+ import { IsUnion , describe , expectType , expectError } from '../utils'
19
20
20
21
function plainType ( arg : number | Ref < number > ) {
21
22
// ref coercing
@@ -163,6 +164,13 @@ if (shallowStatus.value === 'initial') {
163
164
shallowStatus . value = 'invalidating'
164
165
}
165
166
167
+ expectType < ShallowRef < number > > ( shallowRef ( 1 ) )
168
+ expectType < ShallowRef < { name : string } | Ref < { name : string } > > > (
169
+ shallowRef ( { } as { name : string } | Ref < { name : string } > )
170
+ )
171
+ expectType < Ref < string > > ( shallowRef ( ref ( 'foo' ) ) )
172
+ expectType < ShallowRef < string > > ( shallowRef ( shallowRef ( 'foo' ) ) )
173
+
166
174
const refStatus = ref < Status > ( 'initial' )
167
175
if ( refStatus . value === 'initial' ) {
168
176
expectType < Ref < Status > > ( shallowStatus )
@@ -386,7 +394,6 @@ describe('set/del', () => {
386
394
del ( [ ] , 'fse' , 123 )
387
395
} )
388
396
389
-
390
397
{
391
398
//#12978
392
399
type Steps = { step : '1' } | { step : '2' }
@@ -395,4 +402,4 @@ describe('set/del', () => {
395
402
396
403
expectType < IsUnion < typeof shallowUnionGenParam > > ( false )
397
404
expectType < IsUnion < typeof shallowUnionAsCast > > ( false )
398
- }
405
+ }
0 commit comments