-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat(TestModels): Resource #103
Conversation
Ran: git checkout smithy-test-models -- resources.smithy
…igDecimal We may have to address this later.
Oi... this depends on all the simple types... Is that intentional? Or is that a mistake when we authored this Smithy?
Our Dafny code generator does not support: - Bytes - Shorts - Floats - BigInteger - BigDecimal - Timestamp
Or smithy-polymorph will not output a Types.dfy.
Issue: transpile_test_net is failing: ``` $ make polymorph_dafny verify polymorph_net transpile_net dafny \ -vcsCores:2 \ -compileTarget:cs \ -spillTargetCode:3 \ -compile:0 \ -optimizeErasableDatatypeWrapper:0 \ -useRuntimeLib \ -out runtimes/net/tests/TestsFromDafny \ -library /Volumes/workplace/ryan-new-world/polymorph/TestModels/resources/src/Index.dfy \ `find ./test -name '*.dfy'` Unhandled exception. System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.) ---> System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Dafny.ErrorReporter.Error(MessageSource source, IToken tok, String msg) in /Volumes/workplace/dafny_src/dafny/Source/DafnyCore/Reporting.cs:line 45 at Microsoft.Dafny.ErrorReporter.Error(MessageSource source, IToken tok, String msg, Object[] args) in /Volumes/workplace/dafny_src/dafny/Source/DafnyCore/Reporting.cs:line 67 at Microsoft.Dafny.Resolver.ResolveMember(IToken tok, Type receiverType, String memberName, NonProxyType& tentativeReceiverType) in /Volumes/workplace/dafny_src/dafny/Source/DafnyCore/Resolver/Resolver.cs:line 12384 at Microsoft.Dafny.Resolver.EnsureSupportsErrorHandling(IToken tok, Type tp, Boolean expectExtract, Boolean hasKeywordToken) in /Volumes/workplace/dafny_src/dafny/Source/DafnyCore/Resolver/Resolver.cs:line 11884 at Microsoft.Dafny.Resolver.ResolveAssignOrReturnStmt(AssignOrReturnStmt s, ResolutionContext resolutionContext) in /Volumes/workplace/dafny_src/dafny/Source/DafnyCore/Resolver/Resolver.cs:line 11866 at Microsoft.Dafny.Resolver.ResolveConcreteUpdateStmt(ConcreteUpdateStatement s, ResolutionContext resolutionContext) in /Volumes/workplace/dafny_src/dafny/Source/DafnyCore/Resolver/Resolver.cs:line 11476 at Microsoft.Dafny.Resolver.ResolveStatement(Statement stmt, ResolutionContext resolutionContext) in /Volumes/workplace/dafny_src/dafny/Source/DafnyCore/Resolver/Resolver.cs:line 9581 at Microsoft.Dafny.Resolver.ResolveStatementWithLabels(Statement stmt, ResolutionContext resolutionContext) in /Volumes/workplace/dafny_src/dafny/Source/DafnyCore/Resolver/Resolver.cs:line 12132 at Microsoft.Dafny.Resolver.ResolveBlockStatement(BlockStmt blockStmt, ResolutionContext resolutionContext) in /Volumes/workplace/dafny_src/dafny/Source/DafnyCore/Resolver/Resolver.cs:line 12102 at Microsoft.Dafny.Resolver.ResolveMethod(Method m) in /Volumes/workplace/dafny_src/dafny/Source/DafnyCore/Resolver/Resolver.cs:line 8809 at Microsoft.Dafny.Resolver.ResolveClassMemberBodies(TopLevelDeclWithMembers cl) in /Volumes/workplace/dafny_src/dafny/Source/DafnyCore/Resolver/Resolver.cs:line 8001 at Microsoft.Dafny.Resolver.ResolveTopLevelDecls_Core(List`1 declarations, Graph`1 datatypeDependencies, Graph`1 codatatypeDependencies, Boolean isAnExport) in /Volumes/workplace/dafny_src/dafny/Source/DafnyCore/Resolver/Resolver.cs:line 2854 at Microsoft.Dafny.Resolver.ResolveModuleDefinition(ModuleDefinition m, ModuleSignature sig, Boolean isAnExport) in /Volumes/workplace/dafny_src/dafny/Source/DafnyCore/Resolver/Resolver.cs:line 1043 at Microsoft.Dafny.Resolver.ResolveProgram(Program prog) in /Volumes/workplace/dafny_src/dafny/Source/DafnyCore/Resolver/Resolver.cs:line 510 at Microsoft.Dafny.Main.Resolve(Program program, ErrorReporter reporter) in /Volumes/workplace/dafny_src/dafny/Source/DafnyCore/DafnyMain.cs:line 215 at Microsoft.Dafny.Main.ParseCheck(IList`1 files, String programName, ErrorReporter reporter, Program& program) in /Volumes/workplace/dafny_src/dafny/Source/DafnyCore/DafnyMain.cs:line 166 at Microsoft.Dafny.DafnyDriver.ProcessFilesAsync(IList`1 dafnyFiles, ReadOnlyCollection`1 otherFileNames, ErrorReporter reporter, Boolean lookForSnapshots, String programId) in /Volumes/workplace/dafny_src/dafny/Source/DafnyDriver/DafnyDriver.cs:line 345 --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task`1.get_Result() at Microsoft.Dafny.DafnyDriver.ThreadMain(String[] args) in /Volumes/workplace/dafny_src/dafny/Source/DafnyDriver/DafnyDriver.cs:line 123 at Microsoft.Dafny.DafnyDriver.<>c__DisplayClass10_0.<Main>b__0() in /Volumes/workplace/dafny_src/dafny/Source/DafnyDriver/DafnyDriver.cs:line 100 at System.Threading.Thread.StartCallback() /Users/tonyknap/workplace/dafny_src/dafny_path/dafny: line 34: 15045 Abort trap: 6 "$DOTNET" "$DAFNY" "$@" make: *** [transpile_test_net] Error 134 ```
For Dafny team: content deleted, for Dafny issue is #131 |
`test_net` now fails with: ``` /Volumes/workplace/ryan-new-world/polymorph/TestModels/resources/runtimes/net/Generated/Wrapped/TypeConversion.cs(190,13): error CS0246: The type or namespace name 'WrappedNativeWrapper_SimpleResource' could not be found (are you missing a using directive or an assembly reference?) [/Volumes/workplace/ryan-new-world/polymorph/TestModels/resources/runtimes/net/SimpleResources.csproj] ``` Which I suspect is smithy-dotnet issue. It may be that smithy-dotnet assumes all resources are extendable.
The C# Native Wrapper assumes an exception exsits named SimpleResourcesException. More generically, it assumes an exception named <Namespace>Exception exsits. Run: `make polymorph_dafny polymorph_net verify transpile_net setup_net test_net` to confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Options is imported from Wrappers, which is opened.
Resolves PR #135 Feedback: - #135 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Have a single place for dafny version for CI
Issue #, if available: CrypTool-4913
Description of changes:
Squash and Merge:
TODO:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.