Skip to content

Commit

Permalink
Fixes to parsedAst.cs generation
Browse files Browse the repository at this point in the history
  • Loading branch information
keyboardDrummer committed Feb 12, 2025
1 parent eb80e14 commit 816fc76
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/DafnyCore/AST/Types/TypeParameterCharacteristics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ public static TypeParameterCharacteristics Default() {
};
}

public TypeParameterCharacteristics(TypeParameter.EqualitySupportValue eqSupport, Type.AutoInitInfo autoInit, bool containsNoReferenceTypes) {
EqualitySupport = eqSupport;
public TypeParameterCharacteristics(TypeParameter.EqualitySupportValue equalitySupport,
Type.AutoInitInfo autoInit, bool containsNoReferenceTypes) {
EqualitySupport = equalitySupport;
AutoInit = autoInit;
ContainsNoReferenceTypes = containsNoReferenceTypes;
}
Expand Down
8 changes: 8 additions & 0 deletions Source/Scripts/ParsedAstGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ protected override void HandleClass(Type type) {
return;
}

if (memberInfo.GetCustomAttribute<BackEdge>() != null) {
return;
}

if (memberInfo.DeclaringType != type) {
return;
}

var nullabilityContext = new NullabilityInfoContext();
var nullabilityInfo = nullabilityContext.Create(parameter);
bool isNullable = nullabilityInfo.ReadState == NullabilityState.Nullable;
Expand Down
4 changes: 4 additions & 0 deletions Source/Scripts/PostParseAstVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ private void VisitClass(Type type, Stack<Type> toVisit, IDictionary<Type, ISet<T
return;
}

if (field.DeclaringType != type) {
return;
}

var usedTyped = parameter.ParameterType;
VisitType(usedTyped, toVisit);
foreach (var argument in usedTyped.GenericTypeArguments) {
Expand Down

0 comments on commit 816fc76

Please sign in to comment.