-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error messages related to . and -> (#626)
- Loading branch information
Showing
21 changed files
with
82 additions
and
51 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class Foo: | ||
n: int | ||
|
||
|
||
def blah() -> None: | ||
f = Foo{} | ||
f->n++ # Error: left side of '->' operator must be a pointer to an instance of a class, not Foo (try . instead of ->) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class Foo: | ||
n: int | ||
|
||
|
||
def blah() -> None: | ||
f = Foo{} | ||
f->do_stuff() # Error: left side of '->' operator must be a pointer to an instance of a class, not Foo (try . instead of ->) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
def foo() -> None: | ||
num = 1 | ||
x = num->lol # Error: left side of '->' operator must be a pointer to an instance of a class, not int |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
def foo() -> None: | ||
num = 1 | ||
x = num->lol() # Error: left side of '->' operator must be a pointer to an instance of a class, not int |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
def foo() -> None: | ||
num = 1 | ||
pointer = &num | ||
x = pointer->lol # Error: left side of '->' operator must be a pointer to an instance of a class, not int* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
def foo() -> None: | ||
num = 1 | ||
pointer = &num | ||
x = pointer->lol() # Error: left side of '->' operator must be a pointer to an instance of a class, not int* |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class Foo: | ||
n: int | ||
|
||
|
||
def blah(ptr: Foo*) -> None: | ||
ptr.n++ # Error: left side of '.' operator must be an instance of a class, not Foo* (try -> instead of .) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class Foo: | ||
n: int | ||
|
||
|
||
def blah(ptr: Foo*) -> None: | ||
ptr.foo() # Error: left side of '.' operator must be an instance of a class, not Foo* (try -> instead of .) |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
def foo() -> None: | ||
x = 123 | ||
y = x.lolwat # Error: left side of '.' operator must be an instance of a class, not int |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
def foo() -> None: | ||
x = 123 | ||
y = x.lolwat() # Error: left side of '.' operator must be an instance of a class, not int |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
def foo() -> None: | ||
x = 123 | ||
y = &x | ||
z = y.lolwat # Error: left side of '.' operator must be an instance of a class, not int* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
def foo() -> None: | ||
x = 123 | ||
y = &x | ||
z = y.lolwat() # Error: left side of '.' operator must be an instance of a class, not int* |