stc icon indicating copy to clipboard operation
stc copied to clipboard

Mark nested modules as valid LHS

Open kdy1 opened this issue 3 years ago • 9 comments

https://github.com/dudykr/stc/blob/2ab93ad46cd2683539300bde8f30c7bf89ac1e15/crates/stc_ts_type_checker/tests/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts#L27-L29

The lines above should not report an error, but stc currently emits image

The cause is

https://github.com/dudykr/stc/blob/2ab93ad46cd2683539300bde8f30c7bf89ac1e15/crates/stc_ts_file_analyzer/src/analyzer/assign/mod.rs#L936-L946

and it should be fixed to allow assignment to nested modules

kdy1 avatar Nov 04 '22 01:11 kdy1

Hey @kdy1 I'd like to look at this!

nyarthan avatar Nov 04 '22 02:11 nyarthan

Cool, thank you!

kdy1 avatar Nov 04 '22 02:11 kdy1

@kdy1 I think I need some directions. I basically have to check if the exported vars of the nested module and the RHS match, is that correct?

nyarthan avatar Nov 04 '22 20:11 nyarthan

No, problem is that the assignment validation logic unconditionally emits an error if the LHS is a module

kdy1 avatar Nov 04 '22 23:11 kdy1

Please read the body of the issue. I linked the problematic code.

kdy1 avatar Nov 04 '22 23:11 kdy1

@nyarthan Are you working on it? Feel free to tell me if you want me to take it (or unassign)

kdy1 avatar Nov 11 '22 02:11 kdy1

@kdy1 Yes I'm working on it, if I don't find a solution soon I will let you know, I don't want to halt the progress..

nyarthan avatar Nov 11 '22 15:11 nyarthan

No worries, it's not urgent at all. I just wanted to ensure that good first issues are not assigned to someone who isn't going to work on it.

kdy1 avatar Nov 11 '22 23:11 kdy1

@nyarthan Are you still working on it?

kdy1 avatar Nov 26 '22 13:11 kdy1

Closing as fixed

kdy1 avatar Dec 08 '22 11:12 kdy1