guard let
에서의 상수는 스코프가 전역
이다
guard let
에서의 상수는 다음과 같은 명명은 불가능함
guard let
의 상수 이름으로 쓸 수 있지만,func test( testvalue : int? ) {
guard let testvalue = testvalue else{
return
}
}
변수
나 상수
이름은 다시 guard let
의 상수 이름으로 지정할 수 없다.func test(){
let testvalue : Int? = 10
guard let testvalue = testvalue else{
// 에러!! 이미 변수/상수명으로 쓰인 testvalue는 다시 선언할 수 없다.
return
}
}