Skip to content

Instantly share code, notes, and snippets.

Template Cyclic Type Error Analysis: Pointer Shallow Semantic Analysis Proposal

Executive Summary

This report explores the validity of the insight that pointer types (classes, slices, pointers to structs) should not trigger cyclic type errors when contained in templated types, because pointers have a known fixed size regardless of the pointee type. The current semantic analysis performs "deep" analysis of field types, which causes false-positive cyclic errors for valid recursive data structures.

The Problem

Current Behavior

opUnwrapIfTrue

Field Value
DIP: (number/id -- assigned by DIP Manager)
Author: Richard (Rikki) Andrew Cattermole
Implementation: dlang/dmd#22570
Status: Draft

Abstract

@rikkimax
rikkimax / app.d
Last active February 3, 2026 15:30
Rust style diagnostic reporting code, toy that tries to get the basic algorithm right.
module diagreport.app;
import diagreport.defs;
import diagreport.geometry;
import diagreport.renderer;
import std.stdio;
import std.conv;
import std.range;
import std.array;
import std.string;
module testdfa.extracted;
import core.stdc.stdio;
void funcCall()
{
static struct S
{
int field;
void method()

TODO: @gcout?

Escape Analysis

Field Value
DIP: (number/id -- assigned by DIP Manager)
Author: Richard (Rikki) Andrew Cattermole firstname@lastname.co.nz
Implementation: (links to implementation PR if any)
Status: Draft

Value type exceptions

Field Value
DIP: (number/id -- assigned by DIP Manager)
Author: Richard (Rikki) Andrew Cattermole firstname@lastname.co.nz
Implementation: (links to implementation PR if any)
Status: Draft

Framework for Escape Set

Field Value
DIP: (number/id -- assigned by DIP Manager)
Author: Richard (Rikki) Andrew Cattermole firstname@lastname.co.nz
Implementation: (links to implementation PR if any)
Status: Draft

Sum Type by Struct

Field Value
DIP: (number/id -- assigned by DIP Manager)
Author: Richard (Rikki) Andrew Cattermole firstname@lastname.co.nz
Implementation: (links to implementation PR if any)
Status: Draft

Escape Analysis

Field Value
DIP: (number/id -- assigned by DIP Manager)
Author: Richard (Rikki) Andrew Cattermole firstname@lastname.co.nz
Implementation: (links to implementation PR if any)
Status: Draft

Abstract