Skip to content

AssemblyExports correction for ctor with initializer-compatible param#89

Merged
ArcadeMode merged 3 commits intomasterfrom
constructor-initializer-compatible-param
Feb 28, 2026
Merged

AssemblyExports correction for ctor with initializer-compatible param#89
ArcadeMode merged 3 commits intomasterfrom
constructor-initializer-compatible-param

Conversation

@ArcadeMode
Copy link
Copy Markdown
Owner

class Options {
   int A { get; set; }
}
class SomeClass(Options opt) {
   // use opt ...
}

In TypeScript should support:

const someClass = new SomeClass(new Options({ A: 42 })); 
const someClass = new SomeClass({ A: 42 });

Codegen would output assemblyexports that wouldnt compile due to not reflecting the correct types for the initializer case

@ArcadeMode ArcadeMode changed the title AssemblyExports should accept initializer in compatible constructor param AssemblyExports invalid for ctor with initializer-compatible param Feb 28, 2026
@ArcadeMode ArcadeMode changed the title AssemblyExports invalid for ctor with initializer-compatible param AssemblyExports correction for ctor with initializer-compatible param Feb 28, 2026
@github-actions
Copy link
Copy Markdown

Test Results

    9 files  ±0     65 suites  ±0   31s ⏱️ ±0s
  676 tests +1    672 ✅ +1   4 💤 ±0  0 ❌ ±0 
1 876 runs  +1  1 851 ✅ +1  25 💤 ±0  0 ❌ ±0 

Results for commit 96e9f61. ± Comparison against base commit 9cdb0f6.

@github-actions
Copy link
Copy Markdown


BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.3 LTS (Noble Numbat)
AMD EPYC 7763 2.69GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.103
  [Host]     : .NET 10.0.3 (10.0.3, 10.0.326.7603), X64 RyuJIT x86-64-v3
  Job-MLTFGY : .NET 10.0.3 (10.0.3, 10.0.326.7603), X64 RyuJIT x86-64-v3

InvocationCount=1  IterationCount=1  LaunchCount=10  
RunStrategy=ColdStart  UnrollFactor=1  WarmupCount=0  

Method Compilation ClassCount Mean Error StdDev Min Max
Generate AOT 0 14.83 ms 1.821 ms 1.205 ms 13.54 ms 17.42 ms
Generate AOT 1 32.23 ms 0.802 ms 0.531 ms 31.35 ms 33.40 ms
Generate AOT 10 32.43 ms 1.043 ms 0.690 ms 31.83 ms 34.24 ms
Generate AOT 25 45.16 ms 0.844 ms 0.558 ms 44.20 ms 46.35 ms
Generate AOT 50 58.05 ms 1.781 ms 1.178 ms 56.27 ms 60.31 ms
Generate AOT 100 92.44 ms 2.043 ms 1.352 ms 90.77 ms 94.89 ms
Generate AOT 200 95.08 ms 1.801 ms 1.191 ms 93.59 ms 97.08 ms
Generate JIT 0 42.87 ms 0.436 ms 0.288 ms 42.41 ms 43.48 ms
Generate JIT 1 826.83 ms 7.601 ms 5.028 ms 820.13 ms 835.76 ms
Generate JIT 10 823.22 ms 10.319 ms 6.825 ms 816.72 ms 839.73 ms
Generate JIT 25 865.86 ms 5.146 ms 3.403 ms 860.49 ms 873.39 ms
Generate JIT 50 899.60 ms 7.734 ms 5.115 ms 893.35 ms 908.70 ms
Generate JIT 100 999.98 ms 9.673 ms 6.398 ms 990.27 ms 1,012.95 ms
Generate JIT 200 981.27 ms 11.014 ms 7.285 ms 970.19 ms 991.87 ms

@ArcadeMode ArcadeMode merged commit 6b47c31 into master Feb 28, 2026
13 checks passed
@ArcadeMode ArcadeMode deleted the constructor-initializer-compatible-param branch February 28, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant