Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Error: Compile Error: Illegal assignment from String to Boolean

as I writing a test class, I come across this error as I am attempting to save my file.

Error: Compile Error: Illegal assignment from String to Boolean at line 15 column 13

Are there any adjustments, I need to make to my code.

Many Thanks

Vamsi Krishna Gosu's user avatar

2 Answers 2

Raman Shrivastava's user avatar

  • @MedhanieHabte - If this solves your issue please mark the question as answered so it does not keep getting bumped by the system. –  Eric Commented Jun 22, 2015 at 0:56

Line 15 should be

without quotes. It seems like it's a boolean field and you're assigning a string to it.

Moshe Karmel's user avatar

You must log in to answer this question.

Not the answer you're looking for browse other questions tagged apex unit-test class ..

  • The Overflow Blog
  • Where does Postgres fit in a world of GenAI and vector databases?
  • Featured on Meta
  • We've made changes to our Terms of Service & Privacy Policy - July 2024
  • Bringing clarity to status tag usage on meta sites

Hot Network Questions

  • What to call a test that consists of running a program with only logging?
  • Is having negative voltages on a MOSFET gate a good idea?
  • What prevents a browser from saving and tracking passwords entered to a site?
  • Input Impedance of a converter and output impedance of battery
  • Do the amplitude and frequency of gravitational waves emitted by binary stars change as the stars get closer together?
  • Why is "on " the optimal preposition in this case?
  • How would you say a couple of letters (as in mail) if they're not necessarily letters?
  • Dress code for examiner in UK PhD viva
  • Amalgamated Product Isomorphism
  • The answer is not wrong
  • What explanations can be offered for the extreme see-sawing in Montana's senate race polling?
  • Meaning of "blunk"
  • Two way ANOVA or two way repeat measurement ANOVA
  • What's the difference between '$var' and 'var' in an arithmetic expansion?
  • Why was this lighting fixture smoking? What do I do about it?
  • Are carbon fiber parts riveted, screwed or bolted?
  • Parse Minecraft's VarInt
  • Canonical ensemble, ergodicity and Liouville’s equation
  • Could someone tell me what this part of an A320 is called in English?
  • Passport Carry in Taiwan
  • Distinctive form of "לאהוב ל-" instead of "לאהוב את"
  • Historical U.S. political party "realignments"?
  • Does Vexing Bauble counter taxed 0 mana spells?
  • Has the US said why electing judges is bad in Mexico but good in the US?

illegal assignment from user to string

  • Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers
  • Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand
  • OverflowAI GenAI features for Teams
  • OverflowAPI Train & fine-tune LLMs
  • Labs The future of collective knowledge sharing
  • About the company Visit the blog

Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Get early access and see previews of new features.

Illegal assignment: Cannot assign an unpacked type to a packed type

In SystemVerilog I wrote:

But, I'm getting errors on this line:

Error: mult32x32_arith.sv(19): Illegal assignment to type 'reg[63:0]' from type 'reg $[63:0]': Cannot assign an unpacked type to a packed type.

But, I don't understand what the problem is.

  • system-verilog

toolic's user avatar

2 Answers 2

There is an easier solution: bitstream cast - see Section 6.24.1 in the language specification

typedef logic[63:0] packed_64;

and then the assignment

product <= packed_64'(product_FF);

Maybe the typedef is unnecessary, haven't tested it.

G. B.'s user avatar

You declared product as packed and product_FF as unpacked. Refer to IEEE Std 1800-2017, section 7.4 Packed and unpacked arrays :

The term packed array is used to refer to the dimensions declared before the data identifier name. The term unpacked array is used to refer to the dimensions declared after the data identifier name

You need to declare them as the same data type. For example, to make them both packed, change:

Your Answer

Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more

Sign up or log in

Post as a guest.

Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy .

  • The Overflow Blog
  • Where does Postgres fit in a world of GenAI and vector databases?
  • Featured on Meta
  • We've made changes to our Terms of Service & Privacy Policy - July 2024
  • Bringing clarity to status tag usage on meta sites
  • What does a new user need in a homepage experience on Stack Overflow?
  • Feedback requested: How do you use tag hover descriptions for curating and do...
  • Staging Ground Reviewer Motivation

Hot Network Questions

  • Is this a new result about hexagon?
  • Who was the "Dutch author", "Bumstone Bumstone"?
  • Why does a halfing's racial trait lucky specify you must use the next roll?
  • What are the French verbs that have invariable past participles?
  • (Auto)-linebreaking a long formula in align environment or with breqn package
  • What rule or standard is used to assign a SOT number to a chip housing?
  • Should I report a review I suspect to be AI-generated?
  • Deploying contracts from safe wallet
  • What is an intuitive way to rename a column in a Dataset?
  • A View over java.lang.String - improved take II
  • How can I get an Edge's Bevel Weight attribute value via Python?
  • Is there a phrase for someone who's really bad at cooking?
  • How would you say a couple of letters (as in mail) if they're not necessarily letters?
  • Why was this lighting fixture smoking? What do I do about it?
  • Passport Carry in Taiwan
  • Why an Out Parameter can be left unassigned in .NET 6 but not .NET 8 (CS0177)?
  • Could someone tell me what this part of an A320 is called in English?
  • Story where character has "boomerdisc"
  • Using a Schengen Visa for a Different Country and Future Visa Applications
  • Parody of Fables About Authenticity
  • Two way ANOVA or two way repeat measurement ANOVA
  • How long does it take to achieve buoyancy in a body of water?
  • Has the US said why electing judges is bad in Mexico but good in the US?
  • What to call a test that consists of running a program with only logging?

illegal assignment from user to string

COMMENTS

  1. apex

    Error: Compile Error: Illegal assignment from Account to String. This is the line throwing the error: ... such as explosions or gunfire, while still allowing user to hear voices? more hot questions Question feed Subscribe to RSS Question feed To subscribe to this RSS feed, copy and paste this URL into your RSS reader. ...

  2. Apex Error: Illegal assignment from List<String> to String

    Every user will have only one contact right. So why are you expecting user's region in list , i.e. usertcMap can be map of user id and region. You can convert that to single value and then add that to User's region. -

  3. trigger

    Not related to your specific question, but another important principle, is not to do DML in a loop. Put any created Accounts into a List, and insert them all at the end: trigger NewLeadCreateAcct on Lead (after insert) { List<Account> accs = new List<Account> (); for (Lead newL : Trigger.new) { Account newAcc = new Account (); newAcc.name ...

  4. Salesforce: Illegal assignment from List to String (2 Solutions!!)

    Salesforce: Illegal assignment from List to StringHelpful? Please support me on Patreon: https://www.patreon.com/roelvandepaarWith thanks & praise to God, a...

  5. Salesforce: What does "Illegal assignment from Schema ...

    Salesforce: What does "Illegal assignment from Schema.SObjectField to String" mean?Helpful? Please support me on Patreon: https://www.patreon.com/roelvandep...

  6. Salesforce: Compile Error: Illegal assignment from List <...> to String

    About Press Copyright Contact us Creators Advertise Developers Terms Privacy Policy & Safety How YouTube works Test new features NFL Sunday Ticket Press Copyright ...

  7. salesforce

    Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers; Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand; OverflowAI GenAI features for Teams; OverflowAPI Train & fine-tune LLMs; Labs The future of collective knowledge sharing; About the company Visit the blog

  8. Illegal assignment from List<SObject> to List<String>

    2. Your query returns list of accounts. You cannot assign it to a list of String. Whenever you need field value from any object you need SOQL. Try the below code. @AuraEnabled. public static string getDunsByRecordId(id currentRecordID) {. List<Account> accounts = [SELECT Id, DunsNumber. FROM Account.

  9. Salesforce: Illegal assignment from list to list ...

    Salesforce: Illegal assignment from list to list (OpportunityContactRole to String)Helpful? Please support me on Patreon: https://www.patreon.com/roelvandep...

  10. Class Help: Illegal assignment from Schema.SObjectField to String at

    2014年2月14日 5:57. You can call methods in apex classes from your trigger. I just did some refactoring on the code you provided. Please let me know if this helps you. Apex Controller. Public class Job_Description_Transfer {. public string cleanseOpportunityDescription (string oppDescription) {. String RegEx =' (</ {0,1} [^>]+>)';

  11. apex

    Your code is trying to set siteObj.Name as an Account, but you need to set the Contact AccountId field to a valid Account Id instead.. Contact cc = new Contact(); cc.AccountId = siteObj.[field for Account Id] Edit. You can try out SOQL queries easily in Workbench and it has a query builder. You can also execute anonymous APEX through the Developer Console.

  12. ERROR: "System.SObjectException, Illegal assignment from String to

    Back User Name; Feedback; View Profile; Manage Preferences; Logout; Login; Sign Up; Knowledge > Knowledge Article. ERROR: "System.SObjectException, Illegal assignment from String to Decimal" while validating the address using DAAS batch job in CC360. ... Illegal assignment from String to Decimal ...

  13. Salesforce: Illegal assignment from void to String

    Salesforce: Illegal assignment from void to StringHelpful? Please support me on Patreon: https://www.patreon.com/roelvandepaarWith thanks & praise to God, a...

  14. Illegal assignment from List<> to List<>

    2. You likely have a class or variable named "Quote", which is causing the problem, due to Name Shadowing. Use Schema.Quote instead: List<Schema.Quote> qu =[SELECT Id, Name FROM Quote]; You may want to refactor the Quote class; it's not ideal to use names that match standard objects, like Account and Quote, or standard libraries, like Test or Math.

  15. Illegal assignment from String to

    Illegal assignment from String to Decimal. Hello, I need to convert string to decimal Code //upsert the existing case to add the fields Case newC = new Case (); newC.Amount_of_Bill__c = AmountofBill1; I thought I was converting to String... //fetch all the fields from the first block Map<String,Object> BCB1 = (Map<String,Object ...

  16. Error: Compile Error: Illegal assignment from String to Boolean

    Error: Compile Error: Illegal assignment from String to Boolean at line 15 column 13. Are there any adjustments, I need to make to my code. Many Thanks. static testMethod void validateContactLookupControl() Contact c = new Contact(); c.FirstName = 'Paul'; c.LastName = 'Reid'; c.MailingStreet = '205 Hill Street'; c.MailingCity = 'Los Angeles';

  17. Salesforce: Illegal assignment from integer to string Error received

    Salesforce: Illegal assignment from integer to string Error receivedHelpful? Please support me on Patreon: https://www.patreon.com/roelvandepaarWith thanks ...

  18. verilog

    You declared product as packed and product_FF as unpacked. Refer to IEEE Std 1800-2017, section 7.4 Packed and unpacked arrays:. The term packed array is used to refer to the dimensions declared before the data identifier name. The term unpacked array is used to refer to the dimensions declared after the data identifier name. You need to declare them as the same data type.