-
-
Save josevalim/77ba585445e2eccb5160 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ erlc foo.erl | |
foo: function decode/1+28: | |
Internal consistency check failed - please report this bug. | |
Instruction: return | |
Error: {match_context,{x,0}}: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(foo). | |
-export([decode/1]). | |
decode(<<Code/integer, Bin/binary>>) -> | |
<<C1/integer, B1/binary>> = Bin, | |
case C1 of | |
X when X =:= 1 orelse X =:= 2 -> | |
Bin2 = <<>>; | |
_ -> | |
Bin2 = B1 | |
end, | |
case Code of | |
1 -> decode(Bin2); | |
_ -> Bin2 | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If there's any help, the consistency check error disappears if
orelse
is substituted with;
Bin2 =
assignment is factored out outside thecase
statement.