这是indexloc提供的服务,不要输入任何密码
Skip to content

Handle Bool with exhaustive match #4572

@SeanTAllen

Description

@SeanTAllen

Currently, the following code isn't seen as an exhaustive match:

actor Main
	new create(env: Env) =>
	  env.out.print("Hello World")

	fun box fourty_two(err: Bool = false): USize ? =>
		match err
	  | true =>
	    return 50
	  | false =>
	    return 42
	  end

This is surprising to folks and we believe that exhaustiveness checking should be enhanced to handle this for booleans.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions