Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Spot
go2pins
Commits
2549b1bb
Commit
2549b1bb
authored
Sep 12, 2019
by
hmoreau
Browse files
pass triggering errors for use of switch
parent
4a8087d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/pass/switch.go
0 → 100644
View file @
2549b1bb
package
main
import
"fmt"
func
main
()
{
i
:=
2
switch
i
{
case
1
:
fmt
.
Println
(
"i = 1"
)
case
2
:
fmt
.
Println
(
"i = 2"
)
}
}
transform/checktype.go
View file @
2549b1bb
...
...
@@ -62,6 +62,9 @@ func (t *TypeChecker) Pre(meta *Meta, v *Visitor) bool {
case
*
ast
.
ChanType
:
fmt
.
Println
(
"Channels are not supported."
)
os
.
Exit
(
1
)
case
*
ast
.
SwitchStmt
:
fmt
.
Println
(
"Switch are not supported."
)
os
.
Exit
(
1
)
}
return
true
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment