feat: add method call support and analyzeFull
- Add analyzeFull() to return Sema context with method table - Improve method call desugaring: obj.method() → Type_method(obj) - Search methodTable by method name when type inference fails - Add methods.bux example demonstrating struct with extend blocks - Use analyzeFull in cli.nim for proper method resolution
This commit is contained in:
@@ -573,3 +573,11 @@ proc analyze*(modu: Module): SemaResult =
|
||||
sema.collectGlobals()
|
||||
sema.checkBodies()
|
||||
result = SemaResult(diagnostics: sema.diagnostics)
|
||||
|
||||
proc analyzeFull*(modu: Module): tuple[result: SemaResult, sema: Sema] =
|
||||
## Analyze module and return both result and full Sema context
|
||||
## Use this when you need the Sema for lowering (method table, etc.)
|
||||
var sema = Sema(module: modu, globalScope: newScope())
|
||||
sema.collectGlobals()
|
||||
sema.checkBodies()
|
||||
result = (SemaResult(diagnostics: sema.diagnostics), sema)
|
||||
|
||||
Reference in New Issue
Block a user