-
Notifications
You must be signed in to change notification settings - Fork 560
Description
Proposal
Goal
Enable variables to remain untyped until first use
Note
You should investigate all the possibility before u make decisions. for exaple, you can use go module to read gogen code if needed
Scope
Add deferred type tracking in cl/compile.go (symbol table extension)
Implement placeholder type for untyped variables (types.Typ[types.UntypedNil] variant)
Create deferred resolution queue mechanism
No syntax changes - focus on internal infrastructure
Deliverables
New deferredVar structure to track unresolved variables
Type resolution deferral mechanism in blockCtx
Test cases in cl/_testgop/ for simple deferred inference scenarios
Example Test Case
x := 100 // deferred
x + 200 // resolves to int
Related
Parent issue: #2441 (Untyped Literal Extension)
Part of Phase 1: Foundation - Deferred Type Inference
Notes
This is the foundational step that enables all subsequent steps in the untyped literal extension feature. It focuses on the internal infrastructure without any syntax changes.
Background
it is a part of deferred type
Workarounds
no.