dafny icon indicating copy to clipboard operation
dafny copied to clipboard

internal error on trait functions taking multiple arguments of trait type parameter

Open erniecohen opened this issue 10 months ago • 2 comments

Dafny version

nightly 4/25/24

Code to produce this issue

newtype V = bv64 
trait Op<T> {
    //function op(t:T):T // no problem with this
    function op2(t0:T,t1:T):T // this triggers the problem
}

Command to run and resulting output

vscode

What happened?

Dafny encountered an internal error. Please report it at https://github.com/dafny-lang/dafny/issues. System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Dafny.ModuleResolver.AddToInheritedMembers(TopLevelDeclWithMembers cl, TopLevelDeclWithMembers baseOrParentTypeDecl, Dictionary2 inheritedMembers, List1 membersWithErrors) at Microsoft.Dafny.ModuleResolver.RegisterInheritedMembers(TopLevelDeclWithMembers cl, DPreType basePreType) at Microsoft.Dafny.PreTypeResolver.ResolvePreTypeSignature(Declaration d, PreTypeInferenceModuleState preTypeInferenceModuleState, ModuleResolver resolver) at Microsoft.Dafny.PreTypeResolver.ResolveDeclarations(List1 declarations, ModuleResolver resolver, Boolean firstPhaseOnly) at Microsoft.Dafny.ModuleResolver.ResolveTopLevelDecls_Core(List1 declarations, Graph1 datatypeDependencies, Graph1 codatatypeDependencies, String moduleDescription, Boolean isAnExport) at Microsoft.Dafny.ModuleDefinition.Resolve(ModuleSignature sig, ModuleResolver resolver, String exportSetName) at Microsoft.Dafny.LiteralModuleDecl.Resolve(ModuleResolver resolver, CompilationData compilation) at Microsoft.Dafny.ModuleResolver.ResolveModuleDeclaration(CompilationData compilation, ModuleDecl decl) at Microsoft.Dafny.ProgramResolver.ResolveModuleDeclaration(CompilationData compilation, ModuleDecl decl) at Microsoft.Dafny.LanguageServer.Language.CachingResolver.ResolveModuleDeclaration(CompilationData compilation, ModuleDecl decl) at Microsoft.Dafny.ProgramResolver.Resolve(CancellationToken cancellationToken) at Microsoft.Dafny.LanguageServer.Language.CachingResolver.<>n__0(CancellationToken cancellationToken) at Microsoft.Dafny.LanguageServer.Language.CachingResolver.<>c__DisplayClass5_0.<Resolve>b__0() at Microsoft.Dafny.LanguageServer.Language.CacheExtensions.ProfileAndPruneCache[T,Key,Value](PruneIfNotUsedSinceLastPruneCache2 cache, Func1 useCache, TelemetryPublisherBase telemetryPublisher, String programName, String activity) at Microsoft.Dafny.LanguageServer.Language.CachingResolver.Resolve(CancellationToken cancellationToken) at Microsoft.Dafny.LanguageServer.Language.Symbols.DafnyLangSymbolResolver.RunDafnyResolver(Compilation compilation, Program program, CancellationToken cancellationToken) at Microsoft.Dafny.LanguageServer.Language.Symbols.DafnyLangSymbolResolver.ResolveSymbols(Compilation compilation, Program program, CancellationToken cancellationToken) at Microsoft.Dafny.TextDocumentLoader.ResolveInternal(Compilation compilation, Program program, CancellationToken cancellationToken) at Microsoft.Dafny.TextDocumentLoader.<>c__DisplayClass5_0.<<ResolveAsync>b__0>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.Dafny.TextDocumentLoader.ResolveAsync(Compilation compilation, Program program, CancellationToken cancellationToken) at Microsoft.Dafny.Compilation.ResolveAsync()

What type of operating system are you experiencing the problem on?

Mac

erniecohen avatar Apr 26 '24 01:04 erniecohen

I assume this is a temporary breakage, but this means a regression test should probably be added.

erniecohen avatar Apr 26 '24 01:04 erniecohen

I assume this is a temporary breakage, but this means a regression test should probably be added.

Definitely. These reports are useful. We'll try to resolve them ASAP.

keyboardDrummer avatar Apr 26 '24 10:04 keyboardDrummer