Skip to content

E0112: A pattern doesn't fit its subject ​

A case pattern can't match the subject: Ok(…) on an Option, a variant of another enum, a literal of another type, or patterns joined with commas that bind variables. Vuka also reports here a match it couldn't lower because the subject's type is unknown.

Wrong ​

vuka
func show(o Option[int]) {
	match o {
	case Ok(x):
		fmt.Println(x)
	case _:
	}
}
vuka
func show(o Option[int]) {
	match o {
	case Some(x):
		fmt.Println(x)
	case None:
	}
}

Released under the MIT License. Vuka builds on Go and its tools, which are made by the Go Authors. Vuka is not affiliated with Google or the Go project. Go is a trademark of Google LLC.