-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(compiler): unknown property diagnostic is same as unknown symbol (#…
…5807) Fixes #2769 A revisit of #5761 `x_instance.unkonwn_prop` resulted in: ``` Unknown symbol "unkonwn_prop" ``` And now results in: ``` Property "unkonwn_prop" doesn't exist in "X" ``` ## Checklist - [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted) - [x] Description explains motivation and solution - [x] Tests added (always) - [ ] Docs updated (only required for features) - [ ] Added `pr/e2e-full` label if this feature requires end-to-end testing *By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
- Loading branch information
1 parent
13b79ea
commit 365827a
Showing
11 changed files
with
126 additions
and
90 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
let m1 = Map<str>{"a" => "hi"}; | ||
|
||
m1.set("a", "bye"); | ||
// ^^^ Unknown symbol "set" (TODO: better error message https://github.com/winglang/wing/issues/1660) | ||
// ^^^ Member "set" doesn't exist in "Map" (TODO: better error message https://github.com/winglang/wing/issues/1660) | ||
|
||
let m2: Map<str> = MutMap<str> {}; | ||
// ^^^^^^^^^^^^^^ Expected type to be "Map<str>", but got "MutMap<str>" instead | ||
let m3 = Map<bool> { "a" => "A" }; | ||
// ^^^ Expected type to be "bool", but got "str" instead | ||
let m4 = {"1" => 1, "2" => 2 }; | ||
m4.set("2", 3); | ||
// ^^^ Unknown symbol "set" | ||
// ^^^ Member "set" doesn't exist in "Map" | ||
let m5 = m4.copy(); | ||
// ^^^^ Unknown symbol "copy" | ||
// ^^^^ Member "copy" doesn't exist in "Map" | ||
m4.delete("1"); | ||
// ^^^^^^ Unknown symbol "delete" | ||
// ^^^^^^ Member "delete" doesn't exist in "Map" | ||
m4.clear(); | ||
// ^^^^^ Unknown symbol "clear" | ||
// ^^^^^ Member "clear" doesn't exist in "Map" | ||
|
||
|
||
let s1: Set<Array<num>> = MutSet<Array<num>>[[1]]; | ||
// ^^^^^^^^^^^^^^^^^^^^^^^^ Expected type to be "Set<Array<num>>", but got "MutSet<Array<num>>" instead | ||
let s2 = Set<str> ["a", "b", "c"]; | ||
s2.delete("a"); | ||
// ^^^^^^ Unknown symbol "delete" | ||
// ^^^^^^ Member "delete" doesn't exist in "Set" | ||
s2.add("d"); | ||
// ^^^ Unknown symbol "add" | ||
// ^^^ Member "add" doesn't exist in "Set" | ||
let s3 = s2.copy(); | ||
// ^^^^ Unknown symbol "copy" | ||
// ^^^^ Member "copy" doesn't exist in "Set" | ||
s2.clear(); | ||
// ^^^^^ Unknown symbol "clear" | ||
// ^^^^^ Member "clear" doesn't exist in "Set" | ||
let s4: Set<bool> = Set<bool>[[3]]; | ||
// ^^^^^ Expected type to be "Set<bool>", but got "Set<Array<num>>" instead |
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 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 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 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 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 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 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 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 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
Oops, something went wrong.