std: survey and reduce untyped usage (1066 → 1025)#12850
Draft
Copilot wants to merge 2 commits intodevelopmentfrom
Draft
std: survey and reduce untyped usage (1066 → 1025)#12850Copilot wants to merge 2 commits intodevelopmentfrom
untyped usage (1066 → 1025)#12850Copilot wants to merge 2 commits intodevelopmentfrom
Conversation
…d alternatives Co-authored-by: Simn <634365+Simn@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Categorize and reduce occurrences of untyped in std
std: survey and reduce Mar 20, 2026
untyped usage (1066 → 1025)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Browsed
std/for all 1066untypedoccurrences, categorized them, and eliminated 41 that were genuinely unnecessary.Categories found
__define_feature__,__feature__,__resources__)__lua__,__dollar__,__global__,__lock__, etc.)__class__,__enum__,__name__,_hx_index, etc.).__s,.cca(),__unsafe_get, etc.)untyped { }blocks@:privateAccess@:access(Class)Changes made
JS global functions →
js.Lib.global.*untyped console,untyped setTimeout,untyped setInterval,untyped clearInterval,untyped encodeURIComponent,untyped decodeURIComponentreplaced withjs.Lib.global.*calls inLog.hx,Timer.hx,EntryPoint.hx,StringTools.hx.Dynamic field access → typed alternatives
untyped this[key]/untyped this[key] = valueinDynamicAccess.hx→js.Syntax.code("{0}[{1}]", ...)untyped obj.__id__/untyped h[id]inObjectMap.hx(JS) →js.Syntax.codeuntyped t.__meta__inMeta.hx→t.__meta__(tis alreadyDynamic)untyped o.toStringinside outeruntyped {}inBoot.hx(JS) → redundantuntypedremoveduntyped s == null ? "null" : s.toString()inStd.hx(CPP) → direct call onDynamicuntyped Array.prototype.slice.call(...)inReflect.hx(JS) →js.Syntax.code("Array.prototype.slice.call(arguments)")untyped js.Lib.document.selection.createRange()inSelection.hx→(js.Lib.document : Dynamic).selection...untyped d.toGMTString()inCookie.hx→(d : Dynamic).toGMTString()Constructor access →
@:privateAccessuntyped new FileInput/FileOutput(...)incpp/_std/sys/io/File.hx,php/_std/sys/io/File.hx,neko/_std/Sys.hxreplaced with@:privateAccess new.Private method access →
@:accessuntyped lua.Boot.__instanceof(v, t)anduntyped neko.Boot.__instanceof(v, t)inStd.hxreplaced with@:access(lua.Boot)/@:access(neko.Boot)annotations (consistent with how JS already does@:privateAccess js.Boot.__instanceof).JVM typed casts
untyped s.hashCode()/untyped k.equals(get())inWeakMap.hxreplaced with(cast s : java.lang.Object).hashCode()etc.Misc
untyped cur.substring(...)in JVMEReg.hx(String.substringis standard —untypedwas just historical baggage)untyped Math.imulinInt32.hx→(cast Math : Dynamic).imulwithif/elsefor clarityuntyped { }wrapper inArrayBuffer.hxIE10 polyfill removed (body only usesjs.Syntax.code)untyped x <= 0 ? 0 : Math.floor(...)in LuaStd.random→ typed (both branches areInt)✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.