feat(pbs): add parametric arrays and concrete generic contracts
Support explicit contract type parameters, canonical nominal applications, recursive substitution, concrete implementations and instantiated editor views. Complete parametric Array syntax and contextual construction integration. Preserve type origins across imports and reexports, fix trait argument stack order, and relocate global slots before lifecycle assembly. Publish specs, installed examples and consolidated discussion lessons. Validate frontend, common pipeline, architecture, LSP and installed knowledge gates, plus the full production VM conformance corpus with 14 generic fixtures.
This commit is contained in:
+4
-29
@@ -115,7 +115,7 @@ public final class LifecycleAssemblerService {
|
||||
}
|
||||
|
||||
final var entryPointCallableName = frameWrapperCallableName(entryPointModuleId);
|
||||
final var bootGuardSlot = nextGlobalSlot(globals, entryPointModuleId);
|
||||
final var bootGuardSlot = nextGlobalSlot(globals);
|
||||
final var wrapperCallableId = new CallableId(callableSignatures.size());
|
||||
callableSignatures.add(new CallableSignatureRef(
|
||||
entryPointModuleId,
|
||||
@@ -206,7 +206,7 @@ public final class LifecycleAssemblerService {
|
||||
.entryPointModuleId(entryPointModuleId)
|
||||
.functions(backend.getFunctions())
|
||||
.syntheticFunctions(ReadOnlyList.wrap(syntheticFunctions))
|
||||
.globals(ReadOnlyList.wrap(normalizeGlobalSlots(globals)))
|
||||
.globals(ReadOnlyList.wrap(globals))
|
||||
.executableFunctions(ReadOnlyList.wrap(executableFunctions))
|
||||
.modulePool(backend.getModulePool())
|
||||
.callableSignatures(ReadOnlyList.wrap(callableSignatures))
|
||||
@@ -354,39 +354,14 @@ public final class LifecycleAssemblerService {
|
||||
}
|
||||
|
||||
private int nextGlobalSlot(
|
||||
final ArrayList<IRGlobal> globals,
|
||||
final ModuleId moduleId) {
|
||||
final ArrayList<IRGlobal> globals) {
|
||||
var nextSlot = 0;
|
||||
for (final var global : globals) {
|
||||
if (sameModuleId(moduleId, global.moduleId())) {
|
||||
nextSlot = Math.max(nextSlot, global.slot() + 1);
|
||||
}
|
||||
nextSlot = Math.max(nextSlot, Math.addExact(global.slot(), 1));
|
||||
}
|
||||
return nextSlot;
|
||||
}
|
||||
|
||||
private ArrayList<IRGlobal> normalizeGlobalSlots(final ArrayList<IRGlobal> globals) {
|
||||
final var nextSlotByModule = new LinkedHashMap<ModuleId, Integer>();
|
||||
final var normalized = new ArrayList<IRGlobal>(globals.size());
|
||||
for (final var global : globals) {
|
||||
final var moduleId = normalizeModuleId(global.moduleId());
|
||||
final var slot = nextSlotByModule.getOrDefault(moduleId, 0);
|
||||
nextSlotByModule.put(moduleId, slot + 1);
|
||||
normalized.add(new IRGlobal(
|
||||
global.fileId(),
|
||||
moduleId,
|
||||
global.name(),
|
||||
global.declaredTypeSurface(),
|
||||
slot,
|
||||
global.visibility(),
|
||||
global.isHidden(),
|
||||
global.hiddenKind(),
|
||||
global.origin(),
|
||||
global.span()));
|
||||
}
|
||||
return normalized;
|
||||
}
|
||||
|
||||
private IRBackendExecutableFunction.Instruction callInstruction(
|
||||
final IRBackendExecutableFunction callee,
|
||||
final Span span) {
|
||||
|
||||
Reference in New Issue
Block a user