assemblyscript icon indicating copy to clipboard operation
assemblyscript copied to clipboard

Uses short names for buitlin types for diagnostics and bindings

Open MaxGraey opened this issue 2 years ago • 3 comments

Instead internat ~lib/string/String or ~lib/string/Array<i32> this PR simplify such names to string and Array<i32>

  • [x] I've read the contributing guidelines
  • [x] I've added my name and email to the NOTICE file

MaxGraey avatar Jul 02 '22 09:07 MaxGraey

One way to think about this could be that global elements have a second internal name, e.g. ~lib/string/String can also be looked up internally with just String. So by convention, if an element is in global scope, the short name could be used. This however differs slightly from what the PR does (looks a ~lib/ even if an element is not global) - perhaps change?

dcodeIO avatar Jul 02 '22 15:07 dcodeIO

So by convention, if an element is in global scope, the short name could be used. This however differs slightly from what the PR does (looks a ~lib/ even if an element is not global) - perhaps change?

Hmm, interesting. But how I can check is this element global easily?

MaxGraey avatar Jul 02 '22 15:07 MaxGraey

Hmm, perhaps a check that elementsByName.get(theShortName) exists, i.e. that the assumption that the short name can be used holds.

dcodeIO avatar Jul 02 '22 15:07 dcodeIO

This PR has been automatically marked as stale because it has not had recent activity. It will be closed in one week if no further activity occurs. Thank you for your contributions!

github-actions[bot] avatar Oct 29 '23 23:10 github-actions[bot]

This PR has been automatically closed due to lack of recent activity, but feel free to reopen it as long as you merge in the main branch afterwards.

github-actions[bot] avatar Nov 05 '23 23:11 github-actions[bot]