Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes: Rust supports overriding traits #5948

Merged
merged 89 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
ca3c142
General traits WIP, including library tests
MikaelMayer Nov 21, 2024
56fe9f9
WIP
MikaelMayer Nov 22, 2024
ab10000
WIP
MikaelMayer Nov 22, 2024
01bd657
Support for calling trait methods on datatypes
MikaelMayer Nov 25, 2024
f2e38c7
Simplified the code further. No box ownership
MikaelMayer Nov 25, 2024
535f061
Removed where clauses + WIP upcastBox
MikaelMayer Nov 26, 2024
3091945
Fix ownership issue
MikaelMayer Nov 26, 2024
45b6741
PR Preparation. Support for method overrides
MikaelMayer Nov 28, 2024
a35f0f2
Merge branch 'master' into feat-rust-support-general-trait-boxing
MikaelMayer Nov 28, 2024
ceff36e
Merge branch 'master' into feat-rust-support-general-trait-boxing
MikaelMayer Nov 29, 2024
596a0d1
Fixed CI tests
MikaelMayer Nov 29, 2024
4602d32
Fixed proofs
MikaelMayer Nov 29, 2024
31da8a2
Update rust module
MikaelMayer Nov 29, 2024
bc36621
All changes
MikaelMayer Nov 30, 2024
11fe1ea
Support for formatting
MikaelMayer Dec 2, 2024
69cfd0b
Removed support for default
MikaelMayer Dec 2, 2024
215f2e3
Fixed null pointer exception and formatting
MikaelMayer Dec 2, 2024
ad56533
Support for more cases in the first argument
MikaelMayer Dec 2, 2024
7786869
Tested library model for downcasting
MikaelMayer Dec 2, 2024
b4447dc
Merge branch 'master' into feat-rust-support-general-trait-boxing
MikaelMayer Dec 2, 2024
16bacd2
Merge branch 'master' into feat-rust-support-overriding-trait
MikaelMayer Dec 2, 2024
3cc649a
Merge branch 'refs/heads/feat-rust-support-general-trait-boxing' into…
MikaelMayer Dec 4, 2024
7afb387
WIP to include all traits
MikaelMayer Dec 4, 2024
125ae65
Merge branch 'refs/heads/master' into feat-rust-support-overriding-trait
MikaelMayer Dec 4, 2024
e09172a
Fixed the merge
MikaelMayer Dec 4, 2024
322577d
Merge branch 'refs/heads/master' into feat-rust-support-overriding-trait
MikaelMayer Dec 5, 2024
787088c
Fixed the merge
MikaelMayer Dec 5, 2024
c92ba66
Merge branch 'master' into feat-rust-support-overriding-trait
MikaelMayer Dec 5, 2024
b199b24
Only negative downcasts remaining
MikaelMayer Dec 6, 2024
178f339
Support for negative traits.
MikaelMayer Dec 6, 2024
0110087
WIP to fix remaining bugs
MikaelMayer Dec 9, 2024
7375c25
More fixes
MikaelMayer Dec 10, 2024
4256cce
More fixes
MikaelMayer Dec 11, 2024
0f20e72
Fixed inherited function call
MikaelMayer Dec 11, 2024
e16dce9
Fixed wrongly inferred equality
MikaelMayer Dec 11, 2024
cc8a0b7
WIP
MikaelMayer Dec 16, 2024
ebecb68
Merge branch 'master' into feat-rust-support-overriding-trait
MikaelMayer Dec 16, 2024
04596a9
Applied addendum
MikaelMayer Dec 16, 2024
e07ed6e
Fixed newtype range and equality support
MikaelMayer Dec 16, 2024
b04dce7
Fixed the fix
MikaelMayer Dec 17, 2024
e56ddd7
Fixed newtype and seq update and coerce patterns as well
MikaelMayer Dec 17, 2024
972929d
No emitting self-upcastbox if not general trait
MikaelMayer Dec 17, 2024
1505c1d
Merge branch 'refs/heads/master' into feat-rust-support-overriding-trait
MikaelMayer Dec 24, 2024
d507cec
Fixed the build
MikaelMayer Dec 24, 2024
1b70b1f
Compilation name gets an enclosing module name.
MikaelMayer Jan 3, 2025
b0fca0d
Fixed a lot of issues
MikaelMayer Jan 3, 2025
68a02b0
Fixed traits downcast
MikaelMayer Jan 3, 2025
ea7ae6f
Merge branch 'refs/heads/master' into feat-rust-support-overriding-trait
MikaelMayer Jan 3, 2025
5f42d6d
Fixed the merge
MikaelMayer Jan 3, 2025
e9ece6b
All other test files
MikaelMayer Jan 3, 2025
1d97c22
CI fixes
MikaelMayer Jan 3, 2025
71703d9
Regenerated core files
MikaelMayer Jan 3, 2025
c825852
Merge branch 'refs/heads/master' into feat-rust-support-overriding-trait
MikaelMayer Jan 3, 2025
617695c
Fixed template and expect files
MikaelMayer Jan 3, 2025
5e7d312
Updated runtime rust
MikaelMayer Jan 3, 2025
c8b1739
Update Source/DafnyCore/Backends/Dafny/DafnyCodeGenerator.cs
MikaelMayer Jan 15, 2025
852e2c4
code review
MikaelMayer Jan 15, 2025
ccb8619
Review comments
MikaelMayer Jan 23, 2025
48f0cee
Merge branch 'master' into feat-rust-support-overriding-trait
MikaelMayer Jan 23, 2025
50ae443
Merge branch 'master' into feat-rust-support-overriding-trait
MikaelMayer Jan 24, 2025
e6c9ec2
Fixed build and merge
MikaelMayer Jan 24, 2025
d7ba154
Merge branch 'master' into feat-rust-support-overriding-trait
MikaelMayer Jan 28, 2025
954e724
Fix format from merge
MikaelMayer Jan 28, 2025
cb45a40
Fixed CI tests
MikaelMayer Jan 30, 2025
801abb2
Ensure everything is tested
MikaelMayer Jan 30, 2025
ef24124
Merge branch 'master' into feat-rust-support-overriding-trait
MikaelMayer Jan 30, 2025
2fa934c
Updated tooltip
MikaelMayer Jan 30, 2025
8b34df8
Fixed two issues
MikaelMayer Feb 4, 2025
8065cb7
Merge branch 'master' into feat-rust-support-overriding-trait
MikaelMayer Feb 4, 2025
b5950ba
Added two failing tests
MikaelMayer Feb 4, 2025
f2d7eb8
Support for detecting complete assignments in constructor and panic i…
MikaelMayer Feb 5, 2025
b243b6e
Need to see if I'm breaking anyone's code
MikaelMayer Feb 6, 2025
48b97c3
Require --enforce-determinism
MikaelMayer Feb 7, 2025
384eae6
Fixed tests
MikaelMayer Feb 7, 2025
d928f2f
Removed definite assignment change.
MikaelMayer Feb 10, 2025
c044738
Fixed an issue
MikaelMayer Feb 11, 2025
00f7265
Fixed a test
MikaelMayer Feb 12, 2025
3390b6d
Fixed hopefully all tests
MikaelMayer Feb 13, 2025
644c05a
Fixed a verification issue
MikaelMayer Feb 14, 2025
2fee75d
Merge branch 'master' into feat-rust-support-overriding-trait
MikaelMayer Feb 14, 2025
d848223
Change in verification
MikaelMayer Feb 14, 2025
a1d92de
Fixed a warning in generated code + support for printing functions
MikaelMayer Feb 14, 2025
e07725f
Merge branch 'master' into feat-rust-support-overriding-trait
MikaelMayer Feb 17, 2025
04098e9
merge fixup
MikaelMayer Feb 18, 2025
090558f
Fixed printability of functions in async
MikaelMayer Feb 20, 2025
b7796b1
Merge branch 'master' into feat-rust-support-overriding-trait
MikaelMayer Feb 21, 2025
81d0a3f
typo
MikaelMayer Feb 21, 2025
89948d4
Renaming missed
MikaelMayer Feb 22, 2025
68e5cde
Renaming missed
MikaelMayer Feb 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static void TestApply()
_3_std__any__Any = (((RAST.__default.@global).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("std"))).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("any"))).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("Any"));
RAST._IType _4_Any;
_4_Any = RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("Any"));
FactorPathsOptimizationTest.__default.ShouldBeEqual(Dafny.Helpers.Id<Func<RAST._IMod, RAST._IMod>>(FactorPathsOptimization.__default.apply(RAST.__default.crate))(RAST.Mod.create_Mod(RAST.__default.NoDoc, RAST.__default.NoAttr, Dafny.Sequence<Dafny.Rune>.UnicodeFromString("onemodule"), Dafny.Sequence<RAST._IModDecl>.FromElements(RAST.ModDecl.create_StructDecl(RAST.Struct.create(RAST.__default.NoDoc, Dafny.Sequence<Dafny.ISequence<Dafny.Rune>>.FromElements(), Dafny.Sequence<Dafny.Rune>.UnicodeFromString("test"), Dafny.Sequence<RAST._ITypeParamDecl>.FromElements(_0_T__Decl), RAST.Fields.create_NamedFields(Dafny.Sequence<RAST._IField>.FromElements(RAST.Field.create(RAST.Visibility.create_PUB(), RAST.Formal.create(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("a"), (_3_std__any__Any).AsType())))))), RAST.ModDecl.create_ImplDecl(RAST.Impl.create_Impl(Dafny.Sequence<RAST._ITypeParamDecl>.FromElements(_0_T__Decl), (RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("test"))).Apply(Dafny.Sequence<RAST._IType>.FromElements(_2_T)), Dafny.Sequence<RAST._IImplMember>.FromElements())), RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(Dafny.Sequence<RAST._ITypeParamDecl>.FromElements(_0_T__Decl), (_3_std__any__Any).AsType(), ((((RAST.__default.crate).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("onemodule"))).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("test"))).AsType()).Apply(Dafny.Sequence<RAST._IType>.FromElements(_2_T)), Dafny.Sequence<RAST._IImplMember>.FromElements()))))), RAST.Mod.create_Mod(RAST.__default.NoDoc, RAST.__default.NoAttr, Dafny.Sequence<Dafny.Rune>.UnicodeFromString("onemodule"), Dafny.Sequence<RAST._IModDecl>.FromElements(RAST.ModDecl.create_UseDecl(RAST.Use.create(RAST.Visibility.create_PUB(), (RAST.__default.dafny__runtime).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("DafnyType")))), RAST.ModDecl.create_UseDecl(RAST.Use.create(RAST.Visibility.create_PUB(), _3_std__any__Any)), RAST.ModDecl.create_StructDecl(RAST.Struct.create(RAST.__default.NoDoc, Dafny.Sequence<Dafny.ISequence<Dafny.Rune>>.FromElements(), Dafny.Sequence<Dafny.Rune>.UnicodeFromString("test"), Dafny.Sequence<RAST._ITypeParamDecl>.FromElements(_1_T__Decl__simp), RAST.Fields.create_NamedFields(Dafny.Sequence<RAST._IField>.FromElements(RAST.Field.create(RAST.Visibility.create_PUB(), RAST.Formal.create(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("a"), _4_Any)))))), RAST.ModDecl.create_ImplDecl(RAST.Impl.create_Impl(Dafny.Sequence<RAST._ITypeParamDecl>.FromElements(_1_T__Decl__simp), (RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("test"))).Apply(Dafny.Sequence<RAST._IType>.FromElements(_2_T)), Dafny.Sequence<RAST._IImplMember>.FromElements())), RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(Dafny.Sequence<RAST._ITypeParamDecl>.FromElements(_1_T__Decl__simp), _4_Any, (RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("test"))).Apply(Dafny.Sequence<RAST._IType>.FromElements(_2_T)), Dafny.Sequence<RAST._IImplMember>.FromElements())))));
FactorPathsOptimizationTest.__default.ShouldBeEqual(Dafny.Helpers.Id<Func<RAST._IMod, RAST._IMod>>(FactorPathsOptimization.__default.apply(RAST.__default.crate))(RAST.Mod.create_Mod(RAST.__default.NoDoc, RAST.__default.NoAttr, Dafny.Sequence<Dafny.Rune>.UnicodeFromString("onemodule"), Dafny.Sequence<RAST._IModDecl>.FromElements(RAST.ModDecl.create_StructDecl(RAST.Struct.create(RAST.__default.NoDoc, Dafny.Sequence<RAST._IAttribute>.FromElements(), Dafny.Sequence<Dafny.Rune>.UnicodeFromString("test"), Dafny.Sequence<RAST._ITypeParamDecl>.FromElements(_0_T__Decl), RAST.Fields.create_NamedFields(Dafny.Sequence<RAST._IField>.FromElements(RAST.Field.create(RAST.Visibility.create_PUB(), RAST.Formal.create(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("a"), (_3_std__any__Any).AsType())))))), RAST.ModDecl.create_ImplDecl(RAST.Impl.create_Impl(Dafny.Sequence<RAST._ITypeParamDecl>.FromElements(_0_T__Decl), (RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("test"))).Apply(Dafny.Sequence<RAST._IType>.FromElements(_2_T)), Dafny.Sequence<RAST._IImplMember>.FromElements())), RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(Dafny.Sequence<RAST._ITypeParamDecl>.FromElements(_0_T__Decl), (_3_std__any__Any).AsType(), ((((RAST.__default.crate).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("onemodule"))).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("test"))).AsType()).Apply(Dafny.Sequence<RAST._IType>.FromElements(_2_T)), Dafny.Sequence<RAST._IImplMember>.FromElements()))))), RAST.Mod.create_Mod(RAST.__default.NoDoc, RAST.__default.NoAttr, Dafny.Sequence<Dafny.Rune>.UnicodeFromString("onemodule"), Dafny.Sequence<RAST._IModDecl>.FromElements(RAST.ModDecl.create_UseDecl(RAST.Use.create(RAST.Visibility.create_PUB(), (RAST.__default.dafny__runtime).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("DafnyType")))), RAST.ModDecl.create_UseDecl(RAST.Use.create(RAST.Visibility.create_PUB(), _3_std__any__Any)), RAST.ModDecl.create_StructDecl(RAST.Struct.create(RAST.__default.NoDoc, Dafny.Sequence<RAST._IAttribute>.FromElements(), Dafny.Sequence<Dafny.Rune>.UnicodeFromString("test"), Dafny.Sequence<RAST._ITypeParamDecl>.FromElements(_1_T__Decl__simp), RAST.Fields.create_NamedFields(Dafny.Sequence<RAST._IField>.FromElements(RAST.Field.create(RAST.Visibility.create_PUB(), RAST.Formal.create(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("a"), _4_Any)))))), RAST.ModDecl.create_ImplDecl(RAST.Impl.create_Impl(Dafny.Sequence<RAST._ITypeParamDecl>.FromElements(_1_T__Decl__simp), (RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("test"))).Apply(Dafny.Sequence<RAST._IType>.FromElements(_2_T)), Dafny.Sequence<RAST._IImplMember>.FromElements())), RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(Dafny.Sequence<RAST._ITypeParamDecl>.FromElements(_1_T__Decl__simp), _4_Any, (RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("test"))).Apply(Dafny.Sequence<RAST._IType>.FromElements(_2_T)), Dafny.Sequence<RAST._IImplMember>.FromElements())))));
FactorPathsOptimizationTest.__default.ShouldBeEqual(Dafny.Helpers.Id<Func<RAST._IMod, RAST._IMod>>(FactorPathsOptimization.__default.apply(RAST.__default.crate))(RAST.Mod.create_Mod(RAST.__default.NoDoc, RAST.__default.NoAttr, Dafny.Sequence<Dafny.Rune>.UnicodeFromString("onemodule"), Dafny.Sequence<RAST._IModDecl>.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(Dafny.Sequence<RAST._ITypeParamDecl>.FromElements(_0_T__Decl), (((RAST.__default.dafny__runtime).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("UpcastObject"))).AsType()).Apply(Dafny.Sequence<RAST._IType>.FromElements(RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("x")))), (RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("test"))).Apply(Dafny.Sequence<RAST._IType>.FromElements(_2_T)), Dafny.Sequence<RAST._IImplMember>.FromElements()))))), RAST.Mod.create_Mod(RAST.__default.NoDoc, RAST.__default.NoAttr, Dafny.Sequence<Dafny.Rune>.UnicodeFromString("onemodule"), Dafny.Sequence<RAST._IModDecl>.FromElements(RAST.ModDecl.create_UseDecl(RAST.Use.create(RAST.Visibility.create_PUB(), (RAST.__default.dafny__runtime).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("DafnyType")))), RAST.ModDecl.create_UseDecl(RAST.Use.create(RAST.Visibility.create_PUB(), (RAST.__default.dafny__runtime).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("UpcastObject")))), RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(Dafny.Sequence<RAST._ITypeParamDecl>.FromElements(_1_T__Decl__simp), (RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("UpcastObject"))).Apply(Dafny.Sequence<RAST._IType>.FromElements(RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("x")))), (RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("test"))).Apply(Dafny.Sequence<RAST._IType>.FromElements(_2_T)), Dafny.Sequence<RAST._IImplMember>.FromElements())))));
FactorPathsOptimizationTest.__default.ShouldBeEqual(Dafny.Helpers.Id<Func<RAST._IMod, RAST._IMod>>(FactorPathsOptimization.__default.apply(RAST.__default.crate))(RAST.Mod.create_Mod(RAST.__default.NoDoc, RAST.__default.NoAttr, Dafny.Sequence<Dafny.Rune>.UnicodeFromString("onemodule"), Dafny.Sequence<RAST._IModDecl>.FromElements(RAST.ModDecl.create_ConstDecl(RAST.Constant.create(RAST.__default.NoDoc, RAST.__default.NoAttr, Dafny.Sequence<Dafny.Rune>.UnicodeFromString("dummy"), (_3_std__any__Any).AsType(), RAST.Expr.create_StmtExpr(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence<Dafny.Rune>.UnicodeFromString("doit"), Std.Wrappers.Option<RAST._IType>.create_Some((RAST.__default.RcType).Apply1(RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("unknown")))), Std.Wrappers.Option<RAST._IExpr>.create_Some(((RAST.Expr.create_Identifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("something"))).ApplyType(Dafny.Sequence<RAST._IType>.FromElements(RAST.Type.create_DynType((RAST.__default.std__default__Default).AsType())))).Apply(Dafny.Sequence<RAST._IExpr>.FromElements(RAST.__default.std__default__Default__default, (((RAST.__default.dafny__runtime).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("rd!"))).AsExpr()).Apply1(RAST.Expr.create_Identifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("obj"))))))), RAST.Expr.create_TypeAscription(RAST.Expr.create_ExprFromType(((RAST.__default.dafny__runtime).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("DafnyString"))).AsType()), ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("DafnyType"))).AsType()))))))), RAST.Mod.create_Mod(RAST.__default.NoDoc, RAST.__default.NoAttr, Dafny.Sequence<Dafny.Rune>.UnicodeFromString("onemodule"), Dafny.Sequence<RAST._IModDecl>.FromElements(RAST.ModDecl.create_UseDecl(RAST.Use.create(RAST.Visibility.create_PUB(), _3_std__any__Any)), RAST.ModDecl.create_UseDecl(RAST.Use.create(RAST.Visibility.create_PUB(), RAST.__default.RcPath)), RAST.ModDecl.create_UseDecl(RAST.Use.create(RAST.Visibility.create_PUB(), RAST.__default.std__default__Default)), RAST.ModDecl.create_UseDecl(RAST.Use.create(RAST.Visibility.create_PUB(), (RAST.__default.dafny__runtime).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("rd")))), RAST.ModDecl.create_UseDecl(RAST.Use.create(RAST.Visibility.create_PUB(), (RAST.__default.dafny__runtime).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("DafnyString")))), RAST.ModDecl.create_UseDecl(RAST.Use.create(RAST.Visibility.create_PUB(), (RAST.__default.dafny__runtime).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("DafnyType")))), RAST.ModDecl.create_ConstDecl(RAST.Constant.create(RAST.__default.NoDoc, RAST.__default.NoAttr, Dafny.Sequence<Dafny.Rune>.UnicodeFromString("dummy"), RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("Any")), RAST.Expr.create_StmtExpr(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence<Dafny.Rune>.UnicodeFromString("doit"), Std.Wrappers.Option<RAST._IType>.create_Some((RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("Rc"))).Apply1(RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("unknown")))), Std.Wrappers.Option<RAST._IExpr>.create_Some(((RAST.Expr.create_Identifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("something"))).ApplyType(Dafny.Sequence<RAST._IType>.FromElements(RAST.Type.create_DynType(RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("Default")))))).Apply(Dafny.Sequence<RAST._IExpr>.FromElements(((RAST.Expr.create_Identifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("Default"))).FSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("default"))).Apply(Dafny.Sequence<RAST._IExpr>.FromElements()), (RAST.Expr.create_Identifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("rd!"))).Apply1(RAST.Expr.create_Identifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("obj"))))))), RAST.Expr.create_TypeAscription(RAST.Expr.create_ExprFromType(RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("DafnyString"))), RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("DafnyType")))))))));
FactorPathsOptimizationTest.__default.ShouldBeEqual(Dafny.Helpers.Id<Func<RAST._IMod, RAST._IMod>>(FactorPathsOptimization.__default.apply(RAST.__default.crate))(RAST.Mod.create_Mod(RAST.__default.NoDoc, RAST.__default.NoAttr, Dafny.Sequence<Dafny.Rune>.UnicodeFromString("onemodule"), Dafny.Sequence<RAST._IModDecl>.FromElements(RAST.ModDecl.create_TraitDecl(RAST.Trait.create(RAST.__default.NoDoc, RAST.__default.NoAttr, Dafny.Sequence<RAST._ITypeParamDecl>.FromElements(), RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("Something")), Dafny.Sequence<RAST._IType>.FromElements(), Dafny.Sequence<RAST._IImplMember>.FromElements())), RAST.ModDecl.create_ConstDecl(RAST.Constant.create(RAST.__default.NoDoc, RAST.__default.NoAttr, Dafny.Sequence<Dafny.Rune>.UnicodeFromString("dummyExtern"), (((RAST.__default.crate).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("anothermodule"))).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("Something"))).AsType(), RAST.Expr.create_RawExpr(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("nothing")))), RAST.ModDecl.create_ConstDecl(RAST.Constant.create(RAST.__default.NoDoc, RAST.__default.NoAttr, Dafny.Sequence<Dafny.Rune>.UnicodeFromString("dummyIntern"), (((RAST.__default.crate).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("onemodule"))).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("Something"))).AsType(), RAST.Expr.create_RawExpr(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("nothing"))))))), RAST.Mod.create_Mod(RAST.__default.NoDoc, RAST.__default.NoAttr, Dafny.Sequence<Dafny.Rune>.UnicodeFromString("onemodule"), Dafny.Sequence<RAST._IModDecl>.FromElements(RAST.ModDecl.create_TraitDecl(RAST.Trait.create(RAST.__default.NoDoc, RAST.__default.NoAttr, Dafny.Sequence<RAST._ITypeParamDecl>.FromElements(), RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("Something")), Dafny.Sequence<RAST._IType>.FromElements(), Dafny.Sequence<RAST._IImplMember>.FromElements())), RAST.ModDecl.create_ConstDecl(RAST.Constant.create(RAST.__default.NoDoc, RAST.__default.NoAttr, Dafny.Sequence<Dafny.Rune>.UnicodeFromString("dummyExtern"), (((RAST.__default.crate).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("anothermodule"))).MSel(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("Something"))).AsType(), RAST.Expr.create_RawExpr(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("nothing")))), RAST.ModDecl.create_ConstDecl(RAST.Constant.create(RAST.__default.NoDoc, RAST.__default.NoAttr, Dafny.Sequence<Dafny.Rune>.UnicodeFromString("dummyIntern"), RAST.Type.create_TIdentifier(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("Something")), RAST.Expr.create_RawExpr(Dafny.Sequence<Dafny.Rune>.UnicodeFromString("nothing")))))));
Expand Down
27 changes: 26 additions & 1 deletion Source/DafnyCore/AST/TypeDeclarations/Declaration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@

private bool scopeIsInherited = false;

protected Declaration(Cloner cloner, Declaration original) : base(cloner, original) {

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / build-refman (ubuntu-22.04)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / build-refman (ubuntu-22.04)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / singletons

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / singletons

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / singletons

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / singletons

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / ubuntu-20.04 (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / ubuntu-20.04 (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / ubuntu-20.04 (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / ubuntu-20.04 (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / ubuntu-20.04 (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / ubuntu-20.04 (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / ubuntu-20.04 (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / ubuntu-20.04 (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / doctests

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / doctests

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / win (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / win (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / win (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / integration-tests / test (ubuntu-20.04, 4)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / osx (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / osx (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / osx (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / integration-tests / test (ubuntu-20.04, 5)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / integration-tests / test (ubuntu-20.04, 1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / integration-tests / test (ubuntu-20.04, 3)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / integration-tests / test (ubuntu-20.04, 2)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
NameNode = original.NameNode.Clone(cloner);
BodyStartTok = cloner.Origin(original.BodyStartTok);
Attributes = cloner.CloneAttributes(original.Attributes);
}

[SyntaxConstructor]
protected Declaration(IOrigin origin, Name nameNode, Attributes attributes) : base(origin) {

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / build-refman (ubuntu-22.04)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / build-refman (ubuntu-22.04)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / singletons

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / singletons

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / singletons

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / singletons

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / ubuntu-20.04 (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / ubuntu-20.04 (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / ubuntu-20.04 (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / ubuntu-20.04 (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / ubuntu-20.04 (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / ubuntu-20.04 (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / ubuntu-20.04 (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / ubuntu-20.04 (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / doctests

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / doctests

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / win (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / win (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / win (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / integration-tests / test (ubuntu-20.04, 4)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / osx (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / osx (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / xunit-tests / osx (1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / integration-tests / test (ubuntu-20.04, 5)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / integration-tests / test (ubuntu-20.04, 1)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / integration-tests / test (ubuntu-20.04, 3)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 37 in Source/DafnyCore/AST/TypeDeclarations/Declaration.cs

View workflow job for this annotation

GitHub Actions / integration-tests / test (ubuntu-20.04, 2)

Non-nullable field 'enclosingModuleName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
Contract.Requires(origin != null);
this.NameNode = nameNode;
this.Attributes = attributes;
Expand Down Expand Up @@ -111,17 +111,42 @@
protected string? sanitizedName;
public virtual string SanitizedName => sanitizedName ??= NonglobalVariable.SanitizeName(Name);

protected string enclosingModuleName; // Computed at the same time as compileName

protected string? compileName;

public virtual string GetCompileName(DafnyOptions options) {
if (compileName == null) {
this.IsExtern(options, out _, out compileName);
this.IsExtern(options, out var possibleEnclosingModuleName, out compileName);
if (!IsCompiled) {
enclosingModuleName = possibleEnclosingModuleName;
}
if (this is TopLevelDecl topDecl) {
enclosingModuleName ??= topDecl.EnclosingModuleDefinition.GetCompileName(options);
}

compileName ??= SanitizedName;
}

return compileName;
}

public bool IsCompiled {
get {
var compile = true;
return !Attributes.ContainsBool(Attributes, "compile", ref compile) || compile;
}
}

public string GetQualificationName(DafnyOptions options) {
if (compileName == null) {
GetCompileName(options); // Sets the enclosing module name if defined by externs.
return enclosingModuleName;
}

return enclosingModuleName;
}

public Attributes? Attributes; // readonly, except during class merging in the refinement transformations and when changed by Compiler.MarkCapitalizationConflict
Attributes? IAttributeBearingDeclaration.Attributes {
get => Attributes;
Expand Down
Loading
Loading