-
-
Save exelotl/a9d1c75012e4287bf9598c084fd7eef5 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
type Point = object | |
x, y: int | |
var p = Point(x:100, y:200) | |
let y = 12 # outer variable should be masked by field y | |
with p: | |
echo(x, ",", y) # expected output: 100,200 | |
let x = 5 # inner variable should mask field x | |
echo(x, ",", y) # expected output: 5,200 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment