Switch
이 페이지에서

Switch()

함수, 작성 분류

Open a switch (scrut) chain: Switch(scrut).case(n, body)….default(body).

import { Switch } from 'typeshade'

시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.

구문

function Switch(scrut: ReadonlyNode<'i32' | 'u32'>): SwitchChain

매개변수

scrut ReadonlyNode<'i32' | 'u32'>

the integer value dispatched on.

반환값

SwitchChain

the chain, for .case and .default.

설명

The scrutinee is a read position, so a read-only node is accepted, and it must be i32 or u32: WGSL and GLSL ES 3.00 both type switch over integers only.

관련 가이드

함께 보기

소스

src/core/ir/builder.ts, 2123행, 커밋 c66579bf 기준

이 페이지 편집 문제 보고