Skip to content

Added scopt. #11625

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

Closed
wants to merge 5 commits into from
Closed

Added scopt. #11625

wants to merge 5 commits into from

Conversation

dotbg
Copy link
Contributor

@dotbg dotbg commented Mar 5, 2021

No description provided.

@dotbg
Copy link
Contributor Author

dotbg commented Mar 7, 2021

Seems to be blocked by #10544 and #7128

scala.MatchError: 
  TypeRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,module class scopttest)),module class SpecUtil$)),class RichString)
 (of class dotty.tools.dotc.core.Types$CachedTypeRef) while compiling

 /__w/dotty/dotty/community-build/community-projects/scopt/jvm/src/test/scala/scopt/ImmutableParserSpecJVM.scala, 
 /__w/dotty/dotty/community-build/community-projects/scopt/jvm/src/test/scala/scopt/MonadicParserSpecJVM.scala, 
 /__w/dotty/dotty/community-build/community-projects/scopt/jvm/src/test/scala/scopt/SpecUtilPlatform.scala,
 /__w/dotty /dotty/community-build/community-projects/scopt/jvm_js/src/test/scala/scopttest/UriSpec.scala,
 /__w/dotty/dotty/community-build/community-projects/scopt/shared/src/test/scala/scopttest/DiffUtil.scala,
 /__w/dotty/dotty/community-build/community-projects/scopt/shared/src/test/scala/scopttest/ImmutableParserSpec.scala, 
/__w/dotty/dotty/community-build/community-projects/scopt/shared/src/test/scala/scopttest/Issue239.scala,
 /__w/dotty/dotty/community-build/community-projects/scopt/shared/src/test/scala/scopttest/MonadicParserSpec.scala, 
/__w/dotty/dotty/community-build/community-projects/scopt/shared/src/test/scala/scopttest/MutableParserSpec.scala, 
/__w/dotty/dotty/community-build/community-projects/scopt/shared/src/test/scala/scopttest/NotToStringInverse.scala, 
/__w/dotty/dotty/community-build/community-projects/scopt/shared/src/test/scala/scopttest/SpecUtil.scala

@dotbg
Copy link
Contributor Author

dotbg commented Mar 13, 2021

It does look different now. I have attached the complete log as well

[  error ]    -- Error: /__w/dotty/dotty/community-build/community-projects/scopt/shared/src/test/scala/scopttest/MutableParserSpec.scala:185:10   
[  error ]    185 |     assert(foo ==  1 ) 
[  error ]       |     ^^^^^^^^^^^^^^^^  
[  error ]       |Exception occurred while executing macro expansion. 
[  error ]       |java.lang.RuntimeException: Expecty: Error rewriting expression. 
[  error ]       |Text:            foo == 1 
[  error ]       |AST : Apply(Select(Ident("foo"), "=="), List(Literal(IntConstant(1)))) 
[  error ]       |	at verify.asserts.RecorderMacro.recordExpressions(RecorderMacro.scala:65) 
[  error ]       |	at verify.asserts.RecorderMacro.apply$$anonfun$4(RecorderMacro.scala:35) 
[  error ]       |	at verify.asserts.RecorderMacro.apply$$anonfun$adapted$2(RecorderMacro.scala:35) 
[  error ]       |	at dotty.tools.dotc.quoted.PickledQuotes$$anon$1.transform(PickledQuotes.scala:82) 
[  error ]       |	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1367) 
[  error ]       |	at dotty.tools.dotc.quoted.PickledQuotes$$anon$1.transform(PickledQuotes.scala:107) 
[  error ]       |	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform$$anonfun$1(Trees.scala:1437) 
[  error ]       |	at scala.collection.immutable.List.mapConserve(List.scala:472) 
[  error ]       |	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1437) 
[  error ]       |	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transformStats(Trees.scala:1435) 
[  error ]       |	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1347) 
[  error ]       |	at dotty.tools.dotc.quoted.PickledQuotes$$anon$1.transform(PickledQuotes.scala:107) 
[  error ]       |	at dotty.tools.dotc.quoted.PickledQuotes$.spliceTerms(PickledQuotes.scala:122) 
[  error ]       |	at dotty.tools.dotc.quoted.PickledQuotes$.unpickleTerm(PickledQuotes.scala:61) 
[  error ]       |	at scala.quoted.runtime.impl.QuotesImpl.unpickleExpr(QuotesImpl.scala:2886) 
[  error ]       |	at verify.asserts.RecorderMacro.apply(RecorderMacro.scala:35) 
[  error ]       |	at verify.asserts.RecorderMacro$.apply(RecorderMacro.scala:172) 
[  error ]       |Caused by: java.lang.ArrayIndexOutOfBoundsException: 1900 
[  error ]       |	at dotty.tools.dotc.util.SourceFile.column(SourceFile.scala:199) 
[  error ]       |	at dotty.tools.dotc.util.SourcePosition.startColumn(SourcePosition.scala:52) 
[  error ]       |	at scala.quoted.runtime.impl.SpliceScope.toString(SpliceScope.scala:44) 
[  error ]       |	at java.lang.String.valueOf(String.java:2994) 
[  error ]       |	at java.lang.StringBuilder.append(StringBuilder.java:131) 
[  error ]       |	at scala.quoted.runtime.impl.ScopeException$.checkInCorrectScope(ScopeException.scala:27) 
[  error ]       |	at dotty.tools.dotc.quoted.PickledQuotes$.quotedExprToTree(PickledQuotes.scala:44) 
[  error ]       |	at dotty.tools.dotc.quoted.PickledQuotes$$anon$1.transform(PickledQuotes.scala:83) 
[  error ]       |	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1367) 
[  error ]       |	at dotty.tools.dotc.quoted.PickledQuotes$$anon$1.transform(PickledQuotes.scala:107) 
[  error ]       |	at dotty.tools.dotc.quoted.PickledQuotes$$anon$1.transform(PickledQuotes.scala:97) 
[  error ]       |	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1333) 
[  error ]       |	at dotty.tools.dotc.quoted.PickledQuotes$$anon$1.transform(PickledQuotes.scala:107) 
[  error ]       |	at dotty.tools.dotc.quoted.PickledQuotes$.spliceTerms(PickledQuotes.scala:122) 
[  error ]       |	at dotty.tools.dotc.quoted.PickledQuotes$.unpickleTerm(PickledQuotes.scala:61) 
[  error ]       |	at scala.quoted.runtime.impl.QuotesImpl.unpickleExpr(QuotesImpl.scala:2886) 
[  error ]       |	at verify.asserts.RecorderMacro.recordExpressions(RecorderMacro.scala:60) 
[  error ]       |	at verify.asserts.RecorderMacro.apply$$anonfun$4(RecorderMacro.scala:35) 
[  error ]       |	at verify.asserts.RecorderMacro.apply$$anonfun$adapted$2(RecorderMacro.scala:35) 
[  error ]       |	at dotty.tools.dotc.quoted.PickledQuotes$$anon$1.transform(PickledQuotes.scala:82) 

dotty-scopt-errors.txt

@dotbg
Copy link
Contributor Author

dotbg commented Mar 13, 2021

It does look like the length of the content() is different from the one we expect.

    if (idx < length && content()(idx) == '\t') (tabInc - col) % tabInc else 1

@griggt
Copy link
Contributor

griggt commented Mar 13, 2021

The new error seems to go away if I revert dotty-staging/nanotest-strawman@3af47d0

Not sure if it is a problem with the original commit (from #11576), a semantic merge conflict in #11642, or something else.

/cc @nicolasstucki

@dotbg
Copy link
Contributor Author

dotbg commented Apr 10, 2021

@griggt

I've updated the branch, the error differs a bit

[error] -- Error: /__w/dotty/dotty/community-build/community-projects/scopt/jvm/src/test/scala/scopt/MonadicParserSpecJVM.scala:33:10
[error] 33 | assert(OParser.usage(parser1) == expectedUsage)
[error] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error] |Exception occurred while executing macro expansion.
[error] |java.lang.RuntimeException: Expecty: Error rewriting expression.
[error] |Text: OParser.usage(parser1) == expectedUsage
[error] |AST : Apply(Select(Apply(TypeApply(Select(Ident("OParser"), "usage"), List(Inferred())), List(Ident("parser1"))), "=="), List(Ident("expectedUsage")))
[error] | at verify.asserts.RecorderMacro.recordExpressions(RecorderMacro.scala:65)

@anatoliykmetyuk
Copy link
Contributor

Since there hasn't been any activity on this PR for a while, we'll close it. If you would like to continue working on it, feel free to reopen it or submit a new one.

@dotbg dotbg deleted the dotty-scopt branch July 16, 2021 16:12
@dotbg
Copy link
Contributor Author

dotbg commented Jul 16, 2021

thanks. I think it is obsolete now

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.

3 participants