File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -300,16 +300,16 @@ So we have to provide the plugin reference for Elysia to find the service to add
300300// @errors: 2339
301301import { Elysia } from ' elysia'
302302
303- // setup.ts
304303const setup = new Elysia ({ name: ' setup' })
305304 .decorate (' a' , ' a' )
306305
307- // index.ts
306+ // Without 'setup', type will be missing
308307const error = new Elysia ()
309308 .get (' /' , ({ a }) => a )
310309
311310const main = new Elysia ()
312- .use (setup )
311+ // With `setup`, type will be inferred
312+ .use (setup ) // [!code ++]
313313 .get (' /' , ({ a }) => a )
314314 // ^?
315315```
Original file line number Diff line number Diff line change @@ -201,16 +201,16 @@ We simply provide the plugin reference for Elysia to find the service to add typ
201201// @errors: 2339
202202import { Elysia } from ' elysia'
203203
204- // setup.ts
205204const setup = new Elysia ({ name: ' setup' })
206205 .decorate (' a' , ' a' )
207206
208- // index.ts
207+ // Without 'setup', type will be missing
209208const error = new Elysia ()
210209 .get (' /' , ({ a }) => a )
211210
212211const main = new Elysia ()
213- .use (setup )
212+ // With `setup`, type will be inferred
213+ .use (setup ) // [!code ++]
214214 .get (' /' , ({ a }) => a )
215215 // ^?
216216```
You can’t perform that action at this time.
0 commit comments